[virt-tools-list] [virt-manager PATCH] Prohibit adding PCI host devices to container

Cole Robinson crobinso at redhat.com
Thu Dec 24 16:39:24 UTC 2015


On 12/23/2015 07:01 AM, Pavel Fedin wrote:
> libvirt does not allow this and attempt to do so causes error during domain
> startup. Prevent this in the beginning instead with correct explanation.
> 
> Signed-off-by: Pavel Fedin <p.fedin at samsung.com>
> ---
>  virtManager/addhardware.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> index 8de710d..6d812e3 100644
> --- a/virtManager/addhardware.py
> +++ b/virtManager/addhardware.py
> @@ -376,9 +376,14 @@ class vmmAddHardware(vmmGObjectUI):
>                        self.conn.is_nodedev_capable(),
>                        _("Connection does not support host device enumeration"),
>                        "usb")
> +        if self.vm.is_container():
> +            enabled = False
> +            errstr = _("Not supported for this guest type")
> +        else:
> +            enabled = self.conn.is_nodedev_capable()
> +            errstr = _("Connection does not support host device enumeration")
>          add_hw_option("PCI Host Device", "system-run", PAGE_HOSTDEV,
> -                      self.conn.is_nodedev_capable(),
> -                      _("Connection does not support host device enumeration"),
> +                      enabled, errstr,
>                        "pci")
>          add_hw_option("Video", "video-display", PAGE_VIDEO, True,
>                        _("Libvirt version does not support video devices."))
> 

Thanks, pushed with some minor tweaks

- Cole




More information about the virt-tools-list mailing list