]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't parse device twice in attach/detach
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 1 Mar 2012 18:47:34 +0000 (19:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Mar 2012 09:20:21 +0000 (10:20 +0100)
commit1e0534a770208be6b848c961785db20467deb2fc
treeae977e502de811f575fcacaa5901ce9aa71afd35
parentb819b3b7cf8ff935d1d2dd0240dffa08e22b1c15
qemu: Don't parse device twice in attach/detach

Some members are generated during XML parse (e.g. MAC address of
an interface); However, with current implementation, if we
are plugging a device both to persistent and live config,
we parse given XML twice: first time for live, second for config.
This is wrong then as the second time we are not guaranteed
to generate same values as we did for the first time.
To prevent that we need to create a copy of DeviceDefPtr;
This is done through format/parse process instead of writing
functions for deep copy as it is easier to maintain:
adding new field to any virDomain*DefPtr doesn't require change
of copying function.
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_driver.c