summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2025-03-17 10:54:01 +0100
committerSimon Rettberg2025-03-17 10:54:01 +0100
commita0693d65e3e1ded52b6027583a13c2549e3c495f (patch)
tree87ca5579dbe211c4345fa3f1cd5461d2f27b8c41
parent[libvirt] Setting os loader to null removes the XML tag (diff)
downloadmaster-sync-shared-a0693d6.tar.gz
master-sync-shared-a0693d6.tar.xz
master-sync-shared-a0693d6.zip
[libvirt] Add methods to get/set (QXL) VRAM
-rw-r--r--src/main/java/org/openslx/libvirt/domain/device/Video.java33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/device/Video.java b/src/main/java/org/openslx/libvirt/domain/device/Video.java
index 3bb607f..10d823a 100644
--- a/src/main/java/org/openslx/libvirt/domain/device/Video.java
+++ b/src/main/java/org/openslx/libvirt/domain/device/Video.java
@@ -199,35 +199,52 @@ public class Video extends Device
/**
* Get size of VGA memory in KB, or 0 if unset/invalid.
*/
- public int getVgaMem()
+ public long getVgaMem()
{
String mem = this.getXmlElementAttributeValue( "model", "vgamem" );
- return mem == null ? 0 : Util.parseInt( mem, 0 );
+ return mem == null ? 0 : Util.parseLong( mem, 0 );
}
/**
* Set size of VGA memory, in KB
*/
- public void setVgaMem( int kb )
+ public void setVgaMem( long kb )
{
- this.setXmlElementAttributeValue( "model", "vgamem", Integer.toString( kb ) );
+ this.setXmlElementAttributeValue( "model", "vgamem", Long.toString( kb ) );
}
/**
* Get total RAM of video card in KB, or 0 if unset/invalid.
*/
- public int getRam()
+ public long getRam()
{
String mem = this.getXmlElementAttributeValue( "model", "ram" );
- return mem == null ? 0 : Util.parseInt( mem, 0 );
+ return mem == null ? 0 : Util.parseLong( mem, 0 );
}
/**
* Set size of video card RAM, in KB.
*/
- public void setRam( int kb )
+ public void setRam( long kb )
{
- this.setXmlElementAttributeValue( "model", "ram", Integer.toString( kb ) );
+ this.setXmlElementAttributeValue( "model", "ram", Long.toString( kb ) );
+ }
+
+ /**
+ * Get total VRAM of video card in KB, or 0 if unset/invalid.
+ */
+ public long getVRam()
+ {
+ String mem = this.getXmlElementAttributeValue( "model", "vram" );
+ return mem == null ? 0 : Util.parseLong( mem, 0 );
+ }
+
+ /**
+ * Set size of video card VRAM, in KB.
+ */
+ public void setVRam( long kb )
+ {
+ this.setXmlElementAttributeValue( "model", "vram", Long.toString( kb ) );
}
}