Re: [PATCH 1/3] checking libvirt version and UPDATE_CPU flag

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

 



On 04/16/2013 07:02 AM, Guannan Ren wrote:
> ---
>  virtManager/connection.py |  7 +++++++
>  virtinst/support.py       | 12 ++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/virtManager/connection.py b/virtManager/connection.py
> index 40db90a..2d407e3 100644
> --- a/virtManager/connection.py
> +++ b/virtManager/connection.py
> @@ -591,6 +591,13 @@ class vmmConnection(vmmGObject):
>              else:
>                  logging.debug("Domain XML secure flag not supported.")
>  
> +            if virtinst.support.check_domain_support(vm,
> +                                virtinst.support.SUPPORT_DOMAIN_XML_UPDATE_CPU):
> +                inact |= libvirt.VIR_DOMAIN_XML_UPDATE_CPU
> +                act |= libvirt.VIR_DOMAIN_XML_UPDATE_CPU
> +            else:
> +                logging.debug("Domain XML update flag not supported.")
> +
>              return inact, act
>  
>          return self._get_flags_helper(vm, key, check_func)
> diff --git a/virtinst/support.py b/virtinst/support.py
> index b361ea2..453cf6c 100644
> --- a/virtinst/support.py
> +++ b/virtinst/support.py
> @@ -45,6 +45,8 @@ SUPPORT_DOMAIN_JOB_INFO = 1005
>  SUPPORT_DOMAIN_MAXVCPUS_XML = 1006
>  SUPPORT_DOMAIN_CONSOLE_STREAM = 1007
>  SUPPORT_DOMAIN_SET_METADATA = 1008
> +SUPPORT_DOMAIN_CPU_HOST_MODEL = 1009
> +SUPPORT_DOMAIN_XML_UPDATE_CPU = 1010
>  
>  # Flags for check_pool_support
>  SUPPORT_STORAGE_CREATEVOLFROM = 2000
> @@ -200,6 +202,16 @@ _support_dict = {
>          "version" : 9010,
>     },
>  
> +   SUPPORT_DOMAIN_CPU_HOST_MODEL : {
> +        "version" : 9010,
> +   },
> +
> +   SUPPORT_DOMAIN_XML_UPDATE_CPU : {
> +        "function" : "virDomain.XMLDesc",
> +        "args" : (),
> +        "flag" : "VIR_DOMAIN_XML_UPDATE_CPU",
> +   },
> +
>  
>      # Pool checks
>      # This can't ever require a pool object for back compat reasons
> 


Actually since the UPDATE_CPU flag is handled in generic libvirt code, we
don't need to test it since it should be provided by all drivers, or none at
all. I would only add the HOST_MODEL support check, but have it check the
earliest that supports both host-model _and_ UPDATE_CPU

Thanks,
Cole

_______________________________________________
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