From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yolkfull Chow Subject: [PATCH] Specify the system UUID for VM Date: Thu, 16 Jul 2009 18:26:46 +0800 Message-ID: <1247740006-27416-1-git-send-email-yzhou@redhat.com> Cc: autotest@test.kernel.org, Yolkfull Chow To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57992 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644AbZGPK0v (ORCPT ); Thu, 16 Jul 2009 06:26:51 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Yolkfull Chow --- client/tests/kvm/kvm_vm.py | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 503f636..895049e 100644 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -113,6 +113,13 @@ class VM: self.qemu_path = qemu_path self.image_dir = image_dir self.iso_dir = iso_dir + + 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 +381,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 -- 1.6.2.5