From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [PATCH] Specify the system UUID for VM Date: Wed, 29 Jul 2009 09:36:29 -0300 Message-ID: <6ac58f4f0907290536m1f7895f2p74d07c17837f8bb1@mail.gmail.com> References: <1247740006-27416-1-git-send-email-yzhou@redhat.com> <4A703E2B.3070703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Yolkfull Chow , kvm@vger.kernel.org, autotest@test.kernel.org To: Avi Kivity Return-path: Received: from qw-out-2122.google.com ([74.125.92.27]:13057 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754472AbZG2Mga convert rfc822-to-8bit (ORCPT ); Wed, 29 Jul 2009 08:36:30 -0400 Received: by qw-out-2122.google.com with SMTP id 8so389061qwh.37 for ; Wed, 29 Jul 2009 05:36:29 -0700 (PDT) In-Reply-To: <4A703E2B.3070703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 29, 2009 at 9:18 AM, Avi Kivity wrote: > On 07/16/2009 01:26 PM, Yolkfull Chow wrote: >> >> Signed-off-by: Yolkfull Chow >> --- >> =A0client/tests/kvm/kvm_vm.py | =A0 11 +++++++++++ >> =A01 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: >> =A0 =A0 =A0 =A0 =A0self.qemu_path =3D qemu_path >> =A0 =A0 =A0 =A0 =A0self.image_dir =3D image_dir >> =A0 =A0 =A0 =A0 =A0self.iso_dir =3D iso_dir >> + >> + =A0 =A0 =A0 =A0if params.get("uuid"): >> + =A0 =A0 =A0 =A0 =A0 =A0if params.get("uuid") =3D=3D "random": >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uuid =3D os.popen("cat >> /proc/sys/kernel/random/uuid").readline() >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0self.uuid =3D uuid.strip() >> > > instead of os.popen("cat ..."), you can open the file directly: > > =A0 uuid =3D file('/proc/.../uuid').readline() Oooops... I didn't notice this little issue. Will make a quick patch to change it, thanks Avi!