diff options
Diffstat (limited to 'src/main/java/org/openslx/libvirt/domain/Domain.java')
-rw-r--r-- | src/main/java/org/openslx/libvirt/domain/Domain.java | 130 |
1 files changed, 128 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/Domain.java b/src/main/java/org/openslx/libvirt/domain/Domain.java index 50d0811..e0a90e5 100644 --- a/src/main/java/org/openslx/libvirt/domain/Domain.java +++ b/src/main/java/org/openslx/libvirt/domain/Domain.java @@ -26,11 +26,14 @@ import org.openslx.libvirt.domain.device.GraphicsSdl; import org.openslx.libvirt.domain.device.GraphicsSpice; import org.openslx.libvirt.domain.device.GraphicsVnc; import org.openslx.libvirt.domain.device.Hostdev; +import org.openslx.libvirt.domain.device.HostdevPci; +import org.openslx.libvirt.domain.device.HostdevUsb; import org.openslx.libvirt.domain.device.Interface; import org.openslx.libvirt.domain.device.InterfaceBridge; import org.openslx.libvirt.domain.device.InterfaceNetwork; import org.openslx.libvirt.domain.device.Parallel; import org.openslx.libvirt.domain.device.Serial; +import org.openslx.libvirt.domain.device.Shmem; import org.openslx.libvirt.domain.device.Sound; import org.openslx.libvirt.domain.device.Video; import org.openslx.libvirt.xml.LibvirtXmlDocument; @@ -272,6 +275,66 @@ public class Domain extends LibvirtXmlDocument } /** + * Returns the state of the Hyper-V vendor identifier feature. + * + * @return state of the Hyper-V vendor identifier feature. + */ + public boolean isFeatureHypervVendorIdStateOn() + { + return this.getRootXmlNode().getXmlElementAttributeValueAsBool( "features/hyperv/vendor_id", "state" ); + } + + /** + * Sets the state of the Hyper-V vendor identifier feature. + * + * @param on state for the Hyper-V vendor identifier feature. + */ + public void setFeatureHypervVendorIdState( boolean on ) + { + this.getRootXmlNode().setXmlElementAttributeValueOnOff( "features/hyperv/vendor_id", "state", on ); + } + + /** + * Returns the value of the Hyper-V vendor identifier feature. + * + * @return value of the Hyper-V vendor identifier feature. + */ + public String getFeatureHypervVendorIdValue() + { + return this.getRootXmlNode().getXmlElementAttributeValue( "features/hyperv/vendor_id", "value" ); + } + + /** + * Sets the value of the Hyper-V vendor identifier feature. + * + * @param value value for the Hyper-V vendor identifier feature. + */ + public void setFeatureHypervVendorIdValue( String value ) + { + this.getRootXmlNode().setXmlElementAttributeValue( "features/hyperv/vendor_id", "value", value ); + } + + /** + * Returns the state of the KVM hidden feature. + * + * @return state of the KVM hidden feature. + */ + public boolean isFeatureKvmHiddenStateOn() + { + return this.getRootXmlNode().getXmlElementAttributeValueAsBool( "features/kvm/hidden", "state" ); + } + + /** + * Sets the state of the KVM hidden feature. + * + * @param on state for the KVM hidden feature. + */ + public void setFeatureKvmHiddenState( boolean on ) + { + this.getRootXmlNode().setXmlElementAttributeValueOnOff( "features/kvm/hidden", "state", on ); + } + + /** * Returns virtual machine UUID defined in the Libvirt domain XML document. * * @return UUID of virtual machine. @@ -860,6 +923,28 @@ public class Domain extends LibvirtXmlDocument } /** + * Returns list of virtual machine PCI hostdev devices specified in the Libvirt domain XML + * document. + * + * @return list of virtual machine PCI hostdev devices. + */ + public ArrayList<HostdevPci> getHostdevPciDevices() + { + return Domain.filterDevices( HostdevPci.class, this.getDevices() ); + } + + /** + * Returns list of virtual machine USB hostdev devices specified in the Libvirt domain XML + * document. + * + * @return list of virtual machine USB hostdev devices. + */ + public ArrayList<HostdevUsb> getHostdevUsbDevices() + { + return Domain.filterDevices( HostdevUsb.class, this.getDevices() ); + } + + /** * Returns list of virtual machine network interface devices specified in the Libvirt domain XML * document. * @@ -903,6 +988,17 @@ public class Domain extends LibvirtXmlDocument } /** + * Returns list of virtual machine shared memory devices specified in the Libvirt domain XML + * document. + * + * @return list of virtual machine shared memory devices. + */ + public ArrayList<Shmem> getShmemDevices() + { + return Domain.filterDevices( Shmem.class, this.getDevices() ); + } + + /** * Returns list of virtual machine sound devices specified in the Libvirt domain XML document. * * @return list of virtual machine sound devices. @@ -1066,9 +1162,9 @@ public class Domain extends LibvirtXmlDocument } /** - * Adds a virtual machine disk device to the Libvirt domain XML document. + * Adds a virtual machine hostdev device to the Libvirt domain XML document. * - * @return reference to the added disk device if creation was successful. + * @return reference to the added hostdev device if creation was successful. */ public Hostdev addHostdevDevice() { @@ -1076,6 +1172,26 @@ public class Domain extends LibvirtXmlDocument } /** + * Adds a virtual machine PCI hostdev device to the Libvirt domain XML document. + * + * @return reference to the added PCI hostdev device if creation was successful. + */ + public HostdevPci addHostdevPciDevice() + { + return HostdevPci.class.cast( this.addDevice( new HostdevPci() ) ); + } + + /** + * Adds a virtual machine USB hostdev device to the Libvirt domain XML document. + * + * @return reference to the added USB hostdev device if creation was successful. + */ + public HostdevUsb addHostdevUsbDevice() + { + return HostdevUsb.class.cast( this.addDevice( new HostdevUsb() ) ); + } + + /** * Adds a virtual machine network device to the Libvirt domain XML document. * * @return reference to the added network device if creation was successful. @@ -1166,6 +1282,16 @@ public class Domain extends LibvirtXmlDocument } /** + * Adds a virtual machine shared memory device to the Libvirt domain XML document. + * + * @return reference to the added shared memory device if creation was successful. + */ + public Shmem addShmemDevice() + { + return Shmem.class.cast( this.addDevice( new Shmem() ) ); + } + + /** * Adds a virtual machine sound device to the Libvirt domain XML document. * * @return reference to the added sound device if creation was successful. |