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

Giuseppe Scrivano gscrivan at redhat.com
Wed Apr 16 12:32:47 UTC 2014


Chen Hanxiao <chenhanxiao at cn.fujitsu.com> writes:

> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> ---
>  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




More information about the virt-tools-list mailing list