[libvirt] [PATCH] conf: fix forget restore ctxt->node when parse memory device success

Peter Krempa pkrempa at redhat.com
Thu May 21 07:46:14 UTC 2015


On Thu, May 21, 2015 at 13:08:12 +0800, Luyao Huang wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1223631
> 
> When set a memory device in the xml, <sysinfo> in xml will be lost.
> Because we forgot restore ctxt->node to the oldnode after parse memory
> device, this will make the parse function after virDomainMemoryDefParseXML
> cannot find a node they need when parse a full xml(virDomainDefParseXML).

The commit message is really hard to read.

> 
> Signed-off-by: Luyao Huang <lhuang at redhat.com>
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index bfdc94e..7ddc1ea 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -11828,6 +11828,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode,
>      if (virDomainDeviceInfoParseXML(memdevNode, NULL, &def->info, flags) < 0)
>          goto error;
>  
> +    ctxt->node = save;
>      return def;

A test case is missing. The bugzilla link contains one so I'll add it.

ACK to the code. I'll rewrite the commit message and add a test case.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150521/76436167/attachment-0001.sig>


More information about the libvir-list mailing list