[PATCH 0/7] Sanitize logic to get live/config device definitions for unplug/update

Peter Krempa posted 7 patches 1 year, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1669206840.git.pkrempa@redhat.com
src/conf/domain_conf.c   | 121 ---------------------------------------
src/conf/domain_conf.h   |   4 --
src/libvirt_private.syms |   1 -
src/lxc/lxc_driver.c     |  75 ++++++++++--------------
src/qemu/qemu_driver.c   |  97 +++++++++++++------------------
5 files changed, 70 insertions(+), 228 deletions(-)
[PATCH 0/7] Sanitize logic to get live/config device definitions for unplug/update
Posted by Peter Krempa 1 year, 5 months ago
Convert code *DomainUpdateDeviceFlags/*DomainDetachDeviceLiveAndConfig
to avoid use of virDomainDeviceDefCopy. We have the original XML string
from the user so it doesn't make sense to parse it and then copy it
(whcih involves formatting and parsing back), when we can simply parse
it twice, saving the extra formatting step.

Peter Krempa (7):
  qemu: driver: Fix formatting of function headers around
    qemuDomainAttachDevice
  qemuDomainUpdateDeviceFlags: Parse XML twice rather than use
    virDomainDeviceDefCopy
  qemuDomainDetachDeviceLiveAndConfig: Parse XML twice rather than use
    virDomainDeviceDefCopy
  qemuDomainDetachDeviceLiveAndConfig: Refactor cleanup
  lxcDomainAttachDeviceFlags: Parse XML twice rather than use
    virDomainDeviceDefCopy
  lxcDomainDetachDeviceFlags: Parse XML twice rather than use
    virDomainDeviceDefCopy
  conf: domain: Remove virDomainDeviceDefCopy

 src/conf/domain_conf.c   | 121 ---------------------------------------
 src/conf/domain_conf.h   |   4 --
 src/libvirt_private.syms |   1 -
 src/lxc/lxc_driver.c     |  75 ++++++++++--------------
 src/qemu/qemu_driver.c   |  97 +++++++++++++------------------
 5 files changed, 70 insertions(+), 228 deletions(-)

-- 
2.37.3
Re: [PATCH 0/7] Sanitize logic to get live/config device definitions for unplug/update
Posted by Ján Tomko 1 year, 4 months ago
On a Wednesday in 2022, Peter Krempa wrote:
>Convert code *DomainUpdateDeviceFlags/*DomainDetachDeviceLiveAndConfig
>to avoid use of virDomainDeviceDefCopy. We have the original XML string
>from the user so it doesn't make sense to parse it and then copy it
>(whcih involves formatting and parsing back), when we can simply parse
>it twice, saving the extra formatting step.
>
>Peter Krempa (7):
>  qemu: driver: Fix formatting of function headers around
>    qemuDomainAttachDevice
>  qemuDomainUpdateDeviceFlags: Parse XML twice rather than use
>    virDomainDeviceDefCopy
>  qemuDomainDetachDeviceLiveAndConfig: Parse XML twice rather than use
>    virDomainDeviceDefCopy
>  qemuDomainDetachDeviceLiveAndConfig: Refactor cleanup
>  lxcDomainAttachDeviceFlags: Parse XML twice rather than use
>    virDomainDeviceDefCopy
>  lxcDomainDetachDeviceFlags: Parse XML twice rather than use
>    virDomainDeviceDefCopy
>  conf: domain: Remove virDomainDeviceDefCopy
>
> src/conf/domain_conf.c   | 121 ---------------------------------------
> src/conf/domain_conf.h   |   4 --
> src/libvirt_private.syms |   1 -
> src/lxc/lxc_driver.c     |  75 ++++++++++--------------
> src/qemu/qemu_driver.c   |  97 +++++++++++++------------------
> 5 files changed, 70 insertions(+), 228 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano