[Libvirt-cim] [PATCH] libxkutil: Handle vnc password when retrieving domain XML
Chip Vincent
cvincent at linux.vnet.ibm.com
Mon Jul 18 14:41:51 UTC 2011
+1 and pushed.
BTW - Prior to this change, libvirt-cim was using the info store
(has_vnc_passwd) for persisting the fact the password was set. It
appears we can now remove that logic since the XML contains this data.
For reference:
Virt_VirtualSystemManagementService.c ~1548 sets has_vnc_passwd
Virt_RASD.c ~457 fetches has_vnc_passwd
Objections?
On 07/18/2011 10:13 AM, Eduardo Lima (Etrunko) wrote:
> # HG changeset patch
> # User Eduardo Lima (Etrunko)<eblima at br.ibm.com>
> # Date 1310998420 10800
> # Node ID 3c90a88a5199a4ed931a4a76097cff8f55deae41
> # Parent 3ac0556ffdf12015839ebafe035547cea5b715f5
> libxkutil: Handle vnc password when retrieving domain XML
>
> Whenever a call for ModifyResourceSettings was issued, the XML for the
> domain was requested, parsed, the property had its value changed and then
> XML was updated with the new value.
>
> It occurs that we need to specify the VIR_DOMAIN_XML_SECURE flag to retrieve
> full domain info, including sensitive fields, such as passwords. This patch
> fixes the problem for vnc password, which was not handled in the XML parsing
> code.
>
> Signed-off-by: Eduardo Lima (Etrunko)<eblima at br.ibm.com>
>
> diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
> --- a/libxkutil/device_parsing.c
> +++ b/libxkutil/device_parsing.c
> @@ -525,6 +525,7 @@
> gdev->port = get_attr_value(node, "port");
> gdev->host = get_attr_value(node, "listen");
> gdev->keymap = get_attr_value(node, "keymap");
> + gdev->passwd = get_attr_value(node, "passwd");
>
> if (gdev->port == NULL || gdev->host == NULL)
> goto err;
> @@ -1127,7 +1128,7 @@
> char *xml;
> int ret;
> int start;
> - xml = virDomainGetXMLDesc(dom, 0);
> + xml = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_SECURE);
>
> if (xml == NULL)
> return 0;
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Chip Vincent
Open Virtualization
IBM Linux Technology Center
cvincent at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list