]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't copy sexpr node value that is an empty string
authorJim Fehlig <jfehlig@suse.com>
Fri, 18 Nov 2011 21:54:38 +0000 (14:54 -0700)
committerJim Fehlig <jfehlig@suse.com>
Fri, 18 Nov 2011 23:00:31 +0000 (16:00 -0700)
commita495365d09138bf0f07504cfe9b6ea2de858e18e
tree2e4b6384eb6af601e0ad520e74cb55ca934ddc61
parent531d7dddf14145e6db1ca94b1c5747382fada402
Don't copy sexpr node value that is an empty string

Xen4.1 initializes some unspecified sexpr config items to an empty
string, unlike previous Xen versions that would leave the item unset.
E.g. the kernel item for an HVM guest (non-direct kernel boot):

Xen4.0 and earlier
  ...
  (image
    (hvm
      (kernel )
  ...

Xen4.1
  ...
  (image
    (hvm
      (kernel '')
  ...

The empty string for kernel causes some grief in subsequent parsing
where existence of specified kernel is checked, e.g.

  if (!def->os.kernel)
  ...

This patch solves the problem in sexpr_node_copy() by not copying
a node containing an empty string.
src/util/sexpr.c