[Kimchi-devel] [PATCH] bug fix: from persistent xml get user and group

Sheldon shaohef at linux.vnet.ibm.com
Mon Apr 21 12:20:09 UTC 2014


On 04/21/2014 02:22 PM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> define domain just edit the persistent xml.
> So we should get user and group from persistent xml instead of live xml
> when domain is living.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> ---
>   src/kimchi/model/vms.py | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
> index 90e9537..2b9bf56 100644
> --- a/src/kimchi/model/vms.py
> +++ b/src/kimchi/model/vms.py
> @@ -258,9 +258,11 @@ class VMModel(object):
>
>           old_xml = new_xml = dom.XMLDesc(0)

     meta_xml = (dom.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE) if 
dom.isUpdated else old_xml)?
> +        meta_xml = (dom.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)
> +                    if dom.isPersistent() else old_xml)
>           metadata_xpath = "/domain/metadata/kimchi/access/%s"
> -        users = xpath_get_text(old_xml, metadata_xpath % "user")
> -        groups = xpath_get_text(old_xml, metadata_xpath % "group")
> +        users = xpath_get_text(meta_xml, metadata_xpath % "user")
> +        groups = xpath_get_text(meta_xml, metadata_xpath % "group")
>
>           for key, val in params.items():
>               if key == 'users':


-- 
Thanks and best regards!

Sheldon Feng(冯少合)<shaohef at linux.vnet.ibm.com>
IBM Linux Technology Center




More information about the Kimchi-devel mailing list