public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Assign an UUID for each VM in kvm command line
@ 2009-07-15  9:12 Yolkfull Chow
  2009-07-15 13:36 ` [Autotest] " Dor Laor
  0 siblings, 1 reply; 5+ messages in thread
From: Yolkfull Chow @ 2009-07-15  9:12 UTC (permalink / raw)
  To: kvm; +Cc: autotest, jasowang, Yolkfull Chow

Would submit this patch which is from our internal kvm-autotest patches submitted by Jason.
So that we could go on test case about parameters verification(UUID, DMI data etc).

Signed-off-by: Yolkfull Chow <yzhou@redhat.com>
---
 client/tests/kvm/kvm_vm.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 503f636..68cc235 100644
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -287,6 +287,10 @@ class VM:
         elif params.get("display") == "nographic":
             qemu_cmd += " -nographic"
 
+        uuid = os.popen("cat /proc/sys/kernel/random/uuid").readline().strip()
+        if uuid:
+            qemu_cmd += " -uuid %s" % uuid
+
         return qemu_cmd
 
 
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Autotest] [PATCH] Assign an UUID for each VM in kvm command line
  2009-07-15  9:12 [PATCH] Assign an UUID for each VM in kvm command line Yolkfull Chow
@ 2009-07-15 13:36 ` Dor Laor
  2009-07-16  2:42   ` Yolkfull Chow
  0 siblings, 1 reply; 5+ messages in thread
From: Dor Laor @ 2009-07-15 13:36 UTC (permalink / raw)
  To: Yolkfull Chow; +Cc: kvm, autotest, jasowang

On 07/15/2009 12:12 PM, Yolkfull Chow wrote:
> Would submit this patch which is from our internal kvm-autotest patches submitted by Jason.
> So that we could go on test case about parameters verification(UUID, DMI data etc).
>
> Signed-off-by: Yolkfull Chow<yzhou@redhat.com>
> ---
>   client/tests/kvm/kvm_vm.py |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 503f636..68cc235 100644
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -287,6 +287,10 @@ class VM:
>           elif params.get("display") == "nographic":
>               qemu_cmd += " -nographic"
>
> +        uuid = os.popen("cat /proc/sys/kernel/random/uuid").readline().strip()
> +        if uuid:
> +            qemu_cmd += " -uuid %s" % uuid

If you'll change the uuid on every run, the guest will notice that. Some 
guest (M$) might not love it.
Why not use a static uuid or even just test uuid in a specific test 
without having it in all tests?

btw: why you're at it, please add uuid to the block devices too.
+ the -smbios option.

Thanks,
dor

> +
>           return qemu_cmd
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Autotest] [PATCH] Assign an UUID for each VM in kvm command line
  2009-07-15 13:36 ` [Autotest] " Dor Laor
@ 2009-07-16  2:42   ` Yolkfull Chow
  2009-07-16  4:11     ` sudhir kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Yolkfull Chow @ 2009-07-16  2:42 UTC (permalink / raw)
  To: dlaor; +Cc: kvm, autotest, jasowang

On 07/15/2009 09:36 PM, Dor Laor wrote:
> On 07/15/2009 12:12 PM, Yolkfull Chow wrote:
>> Would submit this patch which is from our internal kvm-autotest 
>> patches submitted by Jason.
>> So that we could go on test case about parameters verification(UUID, 
>> DMI data etc).
>>
>> Signed-off-by: Yolkfull Chow<yzhou@redhat.com>
>> ---
>>   client/tests/kvm/kvm_vm.py |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
>> index 503f636..68cc235 100644
>> --- a/client/tests/kvm/kvm_vm.py
>> +++ b/client/tests/kvm/kvm_vm.py
>> @@ -287,6 +287,10 @@ class VM:
>>           elif params.get("display") == "nographic":
>>               qemu_cmd += " -nographic"
>>
>> +        uuid = os.popen("cat 
>> /proc/sys/kernel/random/uuid").readline().strip()
>> +        if uuid:
>> +            qemu_cmd += " -uuid %s" % uuid
>
> If you'll change the uuid on every run, the guest will notice that. 
> Some guest (M$) might not love it.
> Why not use a static uuid or even just test uuid in a specific test 
> without having it in all tests?
Hi Dor, since we cannot use a static uuid for running stress_boot test, 
but just assign UUID in a specific test is a good idea. We could use an 
option like assign_uuid = yes for that specific test?
>
> btw: why you're at it, please add uuid to the block devices too.
> + the -smbios option.
Do you mean assign serial number for block devices?

Thanks for suggestions. :)
>
> Thanks,
> dor
>
>> +
>>           return qemu_cmd
>>
>>
>


-- 
Yolkfull
Regards,


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Autotest] [PATCH] Assign an UUID for each VM in kvm command line
  2009-07-16  2:42   ` Yolkfull Chow
@ 2009-07-16  4:11     ` sudhir kumar
  2009-07-16  8:27       ` Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: sudhir kumar @ 2009-07-16  4:11 UTC (permalink / raw)
  To: Yolkfull Chow; +Cc: dlaor, autotest, jasowang, kvm

On Thu, Jul 16, 2009 at 8:12 AM, Yolkfull Chow<yzhou@redhat.com> wrote:
> On 07/15/2009 09:36 PM, Dor Laor wrote:
>> On 07/15/2009 12:12 PM, Yolkfull Chow wrote:
>>> Would submit this patch which is from our internal kvm-autotest
>>> patches submitted by Jason.
>>> So that we could go on test case about parameters verification(UUID,
>>> DMI data etc).
>>>
>>> Signed-off-by: Yolkfull Chow<yzhou@redhat.com>
>>> ---
>>>   client/tests/kvm/kvm_vm.py |    4 ++++
>>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
>>> index 503f636..68cc235 100644
>>> --- a/client/tests/kvm/kvm_vm.py
>>> +++ b/client/tests/kvm/kvm_vm.py
>>> @@ -287,6 +287,10 @@ class VM:
>>>           elif params.get("display") == "nographic":
>>>               qemu_cmd += " -nographic"
>>>
>>> +        uuid = os.popen("cat
>>> /proc/sys/kernel/random/uuid").readline().strip()
>>> +        if uuid:
>>> +            qemu_cmd += " -uuid %s" % uuid
>>
>> If you'll change the uuid on every run, the guest will notice that.
>> Some guest (M$) might not love it.
>> Why not use a static uuid or even just test uuid in a specific test
>> without having it in all tests?
> Hi Dor, since we cannot use a static uuid for running stress_boot test,
> but just assign UUID in a specific test is a good idea. We could use an
> option like assign_uuid = yes for that specific test?

This will be far better and more flexible.
>>
>> btw: why you're at it, please add uuid to the block devices too.
>> + the -smbios option.
> Do you mean assign serial number for block devices?
>
> Thanks for suggestions. :)
>>
>> Thanks,
>> dor
>>
>>> +
>>>           return qemu_cmd
>>>
>>>
>>
>
>
> --
> Yolkfull
> Regards,
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Sudhir Kumar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Autotest] [PATCH] Assign an UUID for each VM in kvm command line
  2009-07-16  4:11     ` sudhir kumar
@ 2009-07-16  8:27       ` Michael Goldish
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Goldish @ 2009-07-16  8:27 UTC (permalink / raw)
  To: sudhir kumar; +Cc: dlaor, autotest, jasowang, kvm, Yolkfull Chow


----- "sudhir kumar" <smalikphy@gmail.com> wrote:

> On Thu, Jul 16, 2009 at 8:12 AM, Yolkfull Chow<yzhou@redhat.com>
> wrote:
> > On 07/15/2009 09:36 PM, Dor Laor wrote:
> >> On 07/15/2009 12:12 PM, Yolkfull Chow wrote:
> >>> Would submit this patch which is from our internal kvm-autotest
> >>> patches submitted by Jason.
> >>> So that we could go on test case about parameters
> verification(UUID,
> >>> DMI data etc).
> >>>
> >>> Signed-off-by: Yolkfull Chow<yzhou@redhat.com>
> >>> ---
> >>>   client/tests/kvm/kvm_vm.py |    4 ++++
> >>>   1 files changed, 4 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/client/tests/kvm/kvm_vm.py
> b/client/tests/kvm/kvm_vm.py
> >>> index 503f636..68cc235 100644
> >>> --- a/client/tests/kvm/kvm_vm.py
> >>> +++ b/client/tests/kvm/kvm_vm.py
> >>> @@ -287,6 +287,10 @@ class VM:
> >>>           elif params.get("display") == "nographic":
> >>>               qemu_cmd += " -nographic"
> >>>
> >>> +        uuid = os.popen("cat
> >>> /proc/sys/kernel/random/uuid").readline().strip()
> >>> +        if uuid:
> >>> +            qemu_cmd += " -uuid %s" % uuid
> >>
> >> If you'll change the uuid on every run, the guest will notice
> that.
> >> Some guest (M$) might not love it.
> >> Why not use a static uuid or even just test uuid in a specific
> test
> >> without having it in all tests?
> > Hi Dor, since we cannot use a static uuid for running stress_boot
> test,
> > but just assign UUID in a specific test is a good idea. We could use
> an
> > option like assign_uuid = yes for that specific test?
> 
> This will be far better and more flexible.

Why not allow both static:

uuid = 7032808e-7d90-4921-b95d-fa0e11c9659c

and random:

uuid = random

If uuid == random, VM.create() will generate a random one. Otherwise
it will use the one given.

BTW, the code that generates a random uuid should be in VM.create(),
not in VM.make_qemu_command(). VM.make_qemu_command() should be
deterministic. VM.create() should store the uuid in an attribute
(e.g. self.uuid = ...) and then VM.make_qemu_command() should use this
attribute. This is important because we use VM.make_qemu_command() to
see if the VM needs to be restarted, and if the uuid changes every time
VM.make_qemu_command() is called, the VM will always be restarted,
even if no parameters change.
(When running a test, we normally use the existing VM without killing
and restarting it; we restart only if the qemu command of the new test
is different, or if the user explicitly requested a restart via the
config file.)

> >> btw: why you're at it, please add uuid to the block devices too.
> >> + the -smbios option.
> > Do you mean assign serial number for block devices?
> >
> > Thanks for suggestions. :)
> >>
> >> Thanks,
> >> dor
> >>
> >>> +
> >>>           return qemu_cmd
> >>>
> >>>
> >>
> >
> >
> > --
> > Yolkfull
> > Regards,
> >
> > _______________________________________________
> > Autotest mailing list
> > Autotest@test.kernel.org
> > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
> >
> 
> 
> 
> -- 
> Sudhir Kumar
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-16  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15  9:12 [PATCH] Assign an UUID for each VM in kvm command line Yolkfull Chow
2009-07-15 13:36 ` [Autotest] " Dor Laor
2009-07-16  2:42   ` Yolkfull Chow
2009-07-16  4:11     ` sudhir kumar
2009-07-16  8:27       ` Michael Goldish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox