From patchwork Thu Jul 16 11:58:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yolkfull Chow X-Patchwork-Id: 35863 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6GBwuUC013341 for ; Thu, 16 Jul 2009 11:58:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755436AbZGPL6o (ORCPT ); Thu, 16 Jul 2009 07:58:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755373AbZGPL6n (ORCPT ); Thu, 16 Jul 2009 07:58:43 -0400 Received: from mx2.redhat.com ([66.187.237.31]:59107 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755436AbZGPL6n (ORCPT ); Thu, 16 Jul 2009 07:58:43 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6GBwhPE023604; Thu, 16 Jul 2009 07:58:43 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6GBwfPr002326; Thu, 16 Jul 2009 07:58:42 -0400 Received: from localhost.localdomain (dhcp-66-70-57.nay.redhat.com [10.66.70.57]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6GBwcgR009174; Thu, 16 Jul 2009 07:58:39 -0400 From: Yolkfull Chow To: kvm@vger.kernel.org Cc: autotest@test.kernel.org, Yolkfull Chow Subject: [PATCH] Specify the system UUID for VM Date: Thu, 16 Jul 2009 19:58:43 +0800 Message-Id: <1247745523-32580-1-git-send-email-yzhou@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Yolkfull Chow --- client/tests/kvm/kvm_vm.py | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 503f636..5f81965 100644 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -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