Re: [PATCH 5/5] KVM test: Make it possible to run VMs without NICs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/25/2010 02:33 AM, Lucas Meneghel Rodrigues wrote:
> For unittesting, for example, is interesting that we
> run the VM with the bare mininum number of parameters.
> This fix allows that.
> 
> Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
> ---
>  client/tests/kvm/kvm_vm.py |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index 7b1fc05..3c01fa0 100755
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -118,8 +118,9 @@ class VM:
>          self.root_dir = root_dir
>          self.address_cache = address_cache
>          self.netdev_id = []
> -        for nic in params.get("nics").split():
> -            self.netdev_id.append(kvm_utils.generate_random_id())
> +        if params.get("nics"):
> +            for nic in params.get("nics").split():

That's exactly what kvm_utils.get_sub_dict_names() does.  It may be a
long name for something so simple but it's used everywhere in kvm-autotest.

> +                self.netdev_id.append(kvm_utils.generate_random_id())

I think the 3 lines above belong in VM.create(), not VM.__init__(),
because VM params are routinely changed in calls to VM.create().  If the
code stays in __init__() the changed params will not affect
self.netdev_id.  A good place for it would be near the code that handles
-redir.

>  
>          # Find a unique identifier for this VM
>          while True:
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux