Skip to contentSkip to conversation

Specify the system UUID for VM

PATCH New Yolkfull Chow 1 participant 1 message Jul 16, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Specify the system UUID for VM

---
 client/tests/kvm/kvm_vm.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
client/tests/kvm/kvm_vm.py +12 -0
index 503f636..5f81965 100644
@@ -113,6 +113,14 @@ class VM:
         self.qemu_path = qemu_path
         self.image_dir = image_dir
         self.iso_dir = iso_dir
+        
+        self.uuid = None
+        if params.get("uuid"):
+            if params.get("uuid") == "random":
+                uuid = os.popen("cat /proc/sys/kernel/random/uuid").readline()
+                self.uuid = uuid.strip()
+            else:
+                self.uuid = params.get("uuid")
 
 
         # Find available monitor filename
@@ -374,6 +382,10 @@ class VM:
             # Make qemu command
             qemu_command = self.make_qemu_command()
 
+            # Specify the system UUID
+            if self.uuid:
+                qemu_command += " -uuid %s" % self.uuid
+
             # Is this VM supposed to accept incoming migrations?
             if for_migration:
                 # Find available migration port
Signature · 1 line
1.6.2.5