Re: [virt-manager PATCH 4/4]RFC: addhardware: enable setting controller model

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

 



Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx> writes:

> Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
> ---
>  virtManager/addhardware.py | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> index 60e8033..531282c 100644
> --- a/virtManager/addhardware.py
> +++ b/virtManager/addhardware.py
> @@ -325,9 +325,6 @@ class vmmAddHardware(vmmGObjectUI):
>          target_model = Gtk.ListStore(str, str)
>          combo.set_model(target_model)
>          uiutil.set_combo_text_column(combo, 1)
> -        # FIXME: we should deal with controller model
> -        combo.set_visible(False)
> -        self.widget("controller-model-label").set_visible(False)
>  
>          # Available HW options
>          is_local = not self.conn.is_remote()
> @@ -1813,12 +1810,19 @@ class vmmAddHardware(vmmGObjectUI):
>          controller_type = self.get_config_controller_type()
>          model = self.get_config_controller_model()
>          self._dev = VirtualController(conn)
> -        # FIXME
> -        model = "none"
> +
> +        for ctrl in self.vm.get_controller_devices():
> +            # FIXME: some sync issue
> +            if ctrl.type == "usb":
> +                self.vm.remove_device(ctrl)

why do we remove the device here?


> +            for dev in VirtualController.get_usb2_controllers(conn):
> +                setattr(self._dev, "type", dev.type)
> +                setattr(self._dev, "model", dev.model)
> +                setattr(self._dev, "master_startport", dev.master_startport)

these could also be rewritten as object.name = value.

Thanks,
Giuseppe

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux