[libvirt RFCv9 00/31] multifd save restore prototype
by Claudio Fontana
This is v9 of the multifd save prototype, which splits things up
more in order to hopefully offer more upstreamable code,
and adds DIRECT I/O APIs and changes to the save/restore format
to be more block friendly, potentially removing the need of an
iohelper completely.
This is demonstrated in this case using the multifd streams supplied by
the multifd helper, but could also work with block-aware QEMU streams
if ever available in the future.
KNOWN ISSUES:
a) still applies only to save/restore (no managed save etc)
b) multifd: saves to multiple files instead of just one file
---
changes from v8:
* rebased on master
* reordered patches to add more upstreamable content at the start
* split introduction of virQEMUSaveFd, so the first part is multifd-free
* new virQEMUSaveDataRead as a mirror of virQEMUSaveDataWrite
* introduced virFileDirect API, using it in virFileDisk operations and
for virQEMUSaveRead and virQEMUSaveWrite
---
changes from v7:
* [ base params API and iohelper refactoring upstreamed ]
* extended the QEMU save image format more, to record the nr
of multifd channels on save. Made the data header struct packed.
* removed --parallel-connections from the restore command, as now
it is useless due to QEMU save image format extension.
* separate out patches to expose migration_params APIs to saveimage,
including qemuMigrationParamsSetString, SetCap, SetInt.
* fixed bugs in the ImageOpen patch (missing saveFd init), removed
some whitespace, and fixed some convoluted code paths for return
value -3.
---
changes from v6:
* improved error path handling, with error messages and especially
cancellation of qemu process on error during restore.
* split patches more and reordered them to keep general refactoring
at the beginning before the --parallel stuff is introduced.
* improved multifd compression support, including adding an enum
and extending the QEMU save image format to record the compression
used on save, and pick it up automatically on restore.
---
changes from v4:
* runIO renamed to virFileDiskCopy and rethought arguments
* renamed new APIs from ...ParametersFlags to ...Params
* introduce the new virDomainSaveParams and virDomainRestoreParams
without any additional parameters, so they can be upstreamed first.
* solved the issue in the gendispatch.pl script generating code that
was missing the conn parameter.
---
changes from v3:
* reordered series to have all helper-related change at the start
* solved all reported issues from ninja test, including documentation
* fixed most broken migration capabilities code (still imperfect likely)
* added G_GNUC_UNUSED as needed
* after multifd restore, added what I think were the missing operations:
qemuProcessRefreshState(),
qemuProcessStartCPUs() - most importantly,
virDomainObjSave()
The domain now starts running after restore without further encouragement
* removed the sleep(10) from the multifd-helper
---
changes from v2:
* added ability to restore the VM from disk using multifd
* fixed the multifd-helper to work in both directions,
assuming the need to listen for save, and connect for restore.
* fixed a large number of bugs, and probably introduced some :-)
---
Claudio Fontana (31):
virfile: introduce virFileDirect APIs
virfile: use virFileDirect API in runIOCopy
qemu: saveimage: rework save format and read/write to be O_DIRECT
friendly
virfile: virFileDiskCopy: prepare for O_DIRECT files without wrapper
qemu: saveimage: introduce virQEMUSaveFd
qemu: saveimage: convert qemuSaveImageCreate to use virQEMUSaveFd
qemu: saveimage: convert qemuSaveImageOpen to use virQEMUSaveFd
tools: prepare doSave to use parameters
tools: prepare cmdRestore to use parameters
libvirt: add new VIR_DOMAIN_SAVE_PARALLEL flag and parameter
qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in save
qemu: add stub support for VIR_DOMAIN_SAVE_PARALLEL in restore
multifd-helper: new helper for parallel save/restore
qemu: saveimage: add virQEMUSaveFd APIs for multifd
qemu: saveimage: wire up saveimage code with the multifd helper
qemu: capabilities: add multifd to the probed migration capabilities
qemu: saveimage: add multifd related fields to save format
qemu: migration_params: add APIs to set Int and Cap
qemu: migration: implement qemuMigrationSrcToFilesMultiFd for save
qemu: add parameter to qemuMigrationDstRun to skip waiting
qemu: implement qemuSaveImageLoadMultiFd for restore
tools: add parallel parameter to virsh save command
tools: add parallel parameter to virsh restore command
qemu: add migration parameter multifd-compression
libvirt: add new VIR_DOMAIN_SAVE_PARAM_PARALLEL_COMPRESSION
qemu: saveimage: add parallel compression argument to ImageCreate
qemu: saveimage: add stub support for multifd compression parameter
qemu: migration: expose qemuMigrationParamsSetString
qemu: saveimage: implement multifd-compression in parallel save
qemu: saveimage: restore compressed parallel images
tools: add parallel-compression parameter to virsh save command
docs/manpages/virsh.rst | 39 +-
include/libvirt/libvirt-domain.h | 29 +
po/POTFILES.in | 1 +
src/libvirt_private.syms | 7 +
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_driver.c | 146 ++--
src/qemu/qemu_migration.c | 160 ++--
src/qemu/qemu_migration.h | 16 +-
src/qemu/qemu_migration_params.c | 71 +-
src/qemu/qemu_migration_params.h | 15 +
src/qemu/qemu_process.c | 3 +-
src/qemu/qemu_process.h | 5 +-
src/qemu/qemu_saveimage.c | 753 +++++++++++++-----
src/qemu/qemu_saveimage.h | 73 +-
src/qemu/qemu_snapshot.c | 6 +-
src/util/meson.build | 16 +
src/util/multifd-helper.c | 247 ++++++
src/util/virfile.c | 316 +++++++-
src/util/virfile.h | 10 +
src/util/virthread.c | 5 +
src/util/virthread.h | 1 +
.../caps_4.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
.../caps_4.1.0.x86_64.xml | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 2 +
.../caps_5.0.0.riscv64.xml | 2 +
.../caps_5.0.0.x86_64.xml | 2 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 2 +
.../caps_5.1.0.x86_64.xml | 2 +
.../caps_5.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 2 +
.../caps_5.2.0.riscv64.xml | 2 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 2 +
.../caps_5.2.0.x86_64.xml | 2 +
.../caps_6.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 2 +
.../caps_6.0.0.x86_64.xml | 2 +
.../caps_6.1.0.x86_64.xml | 2 +
.../caps_6.2.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
.../caps_6.2.0.x86_64.xml | 2 +
.../caps_7.0.0.aarch64.xml | 2 +
.../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
.../caps_7.0.0.x86_64.xml | 2 +
.../caps_7.1.0.x86_64.xml | 2 +
tools/virsh-domain.c | 101 ++-
56 files changed, 1675 insertions(+), 406 deletions(-)
create mode 100644 src/util/multifd-helper.c
--
2.35.3
2 years, 6 months
[PATCH 00/29] Remove some unused includes
by Peng Liang
Recently, I update the toolchain in my dev machine from LLVM13 to LLVM14,
and I find that there are many unsed include headers in the libvirt. So
I try to remove them in this series.
Besides, I also find that:
1. some header files are not self-contained, which means if you want to
include one header, you need to include more headers to meet the
requirements of the declarations in the header you want to include;
2. some includes in the .h file are not the dependences of the .h file
(the declaration) but the dependences of the .c file (the
implementation), maybe it's better to move them to .c file.
But it will take more time to cleanup. So I only remove the unused
includs in this series. Is the community welcome to the removing and
the cleanup I mentioned above? If so, I'll move on and cleanup more.
Adam Tao (29):
access: Remove unused includes
admin: Remove unused includes
ch: Remove unused includes
conf: Remove unused includes
cpu: Remove unused includes
esx: Remove unused includes
hyperv: Remove unused includes
interface: Remove unused includes
libxl: Remove unused includes
locking: Remove unused includes
logging: Remove unused includes
network: Remove unused includes
node_device: Remove unused includes
nwfilter: Remove unused includes
openvz: Remove unused includes
qemu: Remove unused includes
remote: Remove unused includes
rpc: Remove unused includes
secret: Remove unused includes
security: Remove unused includes
storage: Remove unused includes
storage_file: Remove unused includes
util: Remove unused includes
vbox: Remove unused includes
vmware: Remove unused includes
vmx: Remove unused includes
test_driver: Remove unused includes
tools: Remove unused includes
tests: Remove unused includes
src/access/viraccessdriver.h | 1 -
src/access/viraccessdriverpolkit.c | 4 ----
src/access/viraccessdriverstack.c | 1 -
src/access/viraccessmanager.h | 1 -
src/access/viraccessperm.h | 1 -
src/admin/admin_server.c | 4 ----
src/admin/admin_server.h | 1 -
src/admin/admin_server_dispatch.c | 4 ----
src/admin/libvirt-admin.c | 2 --
src/ch/ch_conf.c | 1 -
src/ch/ch_domain.c | 1 -
src/ch/ch_driver.c | 7 -------
src/ch/ch_monitor.c | 2 --
src/ch/ch_process.c | 2 --
src/ch/ch_process.h | 1 -
src/conf/backup_conf.c | 3 ---
src/conf/capabilities.c | 1 -
src/conf/capabilities.h | 3 ---
src/conf/checkpoint_conf.c | 4 ----
src/conf/checkpoint_conf.h | 1 -
src/conf/cpu_conf.c | 2 --
src/conf/cpu_conf.h | 1 -
src/conf/device_conf.c | 2 --
src/conf/device_conf.h | 1 -
src/conf/domain_addr.c | 1 -
src/conf/domain_audit.c | 1 -
src/conf/domain_capabilities.c | 2 --
src/conf/domain_capabilities.h | 1 -
src/conf/domain_conf.c | 4 ----
src/conf/domain_conf.h | 1 -
src/conf/domain_event.c | 2 --
src/conf/domain_nwfilter.c | 2 --
src/conf/domain_validate.c | 1 -
src/conf/interface_conf.c | 4 ----
src/conf/interface_conf.h | 2 --
src/conf/moment_conf.c | 3 ---
src/conf/moment_conf.h | 1 -
src/conf/netdev_bandwidth_conf.c | 1 -
src/conf/netdev_vlan_conf.h | 1 -
src/conf/netdev_vport_profile_conf.c | 1 -
src/conf/netdev_vport_profile_conf.h | 1 -
src/conf/network_conf.c | 2 --
src/conf/network_conf.h | 3 ---
src/conf/network_event.h | 1 -
src/conf/networkcommon_conf.c | 3 ---
src/conf/networkcommon_conf.h | 2 --
src/conf/node_device_conf.c | 1 -
src/conf/node_device_conf.h | 2 --
src/conf/node_device_event.h | 1 -
src/conf/node_device_util.c | 1 -
src/conf/nwfilter_conf.c | 2 --
src/conf/nwfilter_conf.h | 3 ---
src/conf/nwfilter_ipaddrmap.c | 3 ---
src/conf/nwfilter_params.c | 2 --
src/conf/nwfilter_params.h | 1 -
src/conf/object_event.c | 4 ----
src/conf/object_event.h | 2 --
src/conf/secret_conf.c | 3 ---
src/conf/secret_event.h | 1 -
src/conf/snapshot_conf.c | 8 --------
src/conf/snapshot_conf.h | 1 -
src/conf/storage_adapter_conf.c | 1 -
src/conf/storage_capabilities.c | 1 -
src/conf/storage_capabilities.h | 2 --
src/conf/storage_conf.c | 4 ----
src/conf/storage_conf.h | 4 ----
src/conf/storage_encryption_conf.c | 3 ---
src/conf/storage_event.h | 1 -
src/conf/virchrdev.c | 1 -
src/conf/virchrdev.h | 1 -
src/conf/virdomaincheckpointobjlist.c | 1 -
src/conf/virdomaincheckpointobjlist.h | 2 --
src/conf/virdomainmomentobjlist.c | 5 -----
src/conf/virdomainobjlist.c | 2 --
src/conf/virdomainsnapshotobjlist.c | 3 ---
src/conf/virdomainsnapshotobjlist.h | 2 --
src/conf/virinterfaceobj.c | 1 -
src/conf/virinterfaceobj.h | 2 --
src/conf/virnetworkobj.h | 2 --
src/conf/virnetworkportdef.c | 2 --
src/conf/virnetworkportdef.h | 2 --
src/conf/virnodedeviceobj.c | 1 -
src/conf/virnwfilterbindingdef.c | 1 -
src/conf/virnwfilterbindingdef.h | 1 -
src/conf/virnwfilterbindingobj.c | 4 ----
src/conf/virnwfilterbindingobj.h | 1 -
src/conf/virnwfilterobj.h | 2 --
src/conf/virsavecookie.h | 1 -
src/conf/virsecretobj.h | 3 ---
src/conf/virstorageobj.c | 1 -
src/conf/virstorageobj.h | 4 ----
src/cpu/cpu.c | 3 ---
src/cpu/cpu.h | 1 -
src/cpu/cpu_arm.c | 1 -
src/cpu/cpu_map.c | 2 --
src/cpu/cpu_ppc64.c | 1 -
src/cpu/cpu_s390.c | 2 --
src/cpu/cpu_x86.c | 1 -
src/esx/esx_driver.c | 1 -
src/esx/esx_interface_driver.c | 6 ------
src/esx/esx_network_driver.c | 2 --
src/esx/esx_private.h | 3 ---
src/esx/esx_storage_backend_iscsi.c | 2 --
src/esx/esx_storage_backend_vmfs.c | 2 --
src/esx/esx_storage_driver.c | 2 --
src/esx/esx_stream.c | 1 -
src/esx/esx_stream.h | 1 -
src/esx/esx_util.c | 3 ---
src/esx/esx_vi.h | 2 --
src/esx/esx_vi_methods.c | 2 --
src/esx/esx_vi_types.c | 1 -
src/hyperv/hyperv_private.h | 3 ---
src/hyperv/hyperv_util.c | 3 ---
src/hyperv/hyperv_util.h | 1 -
src/interface/interface_backend_netcf.c | 2 --
src/interface/interface_backend_udev.c | 1 -
src/libxl/libxl_capabilities.c | 1 -
src/libxl/libxl_capabilities.h | 2 --
src/libxl/libxl_conf.c | 3 ---
src/libxl/libxl_conf.h | 3 ---
src/libxl/libxl_domain.c | 1 -
src/libxl/libxl_domain.h | 2 --
src/libxl/libxl_driver.c | 3 ---
src/libxl/libxl_logger.c | 2 --
src/libxl/libxl_migration.c | 3 ---
src/libxl/xen_common.h | 1 -
src/libxl/xen_xl.c | 1 -
src/libxl/xen_xl.h | 1 -
src/libxl/xen_xm.c | 1 -
src/libxl/xen_xm.h | 1 -
src/locking/domain_lock.c | 3 ---
src/locking/domain_lock.h | 2 --
src/locking/lock_daemon.c | 2 --
src/locking/lock_daemon_config.c | 4 ----
src/locking/lock_daemon_dispatch.c | 1 -
src/locking/lock_driver.h | 1 -
src/locking/lock_driver_lockd.c | 1 -
src/locking/lock_driver_nop.c | 2 --
src/locking/lock_manager.c | 1 -
src/locking/lock_manager.h | 1 -
src/locking/sanlock_helper.c | 2 --
src/logging/log_daemon.c | 5 -----
src/logging/log_daemon_config.c | 4 ----
src/logging/log_daemon_dispatch.c | 1 -
src/logging/log_handler.c | 1 -
src/logging/log_handler.h | 1 -
src/logging/log_manager.c | 1 -
src/network/bridge_driver.c | 5 -----
src/network/bridge_driver.h | 3 ---
src/network/bridge_driver_linux.c | 1 -
src/network/bridge_driver_platform.h | 1 -
src/network/leaseshelper.c | 4 ----
src/node_device/node_device_driver.c | 3 ---
src/node_device/node_device_driver.h | 1 -
src/node_device/node_device_udev.c | 3 ---
src/nwfilter/nwfilter_dhcpsnoop.c | 3 ---
src/nwfilter/nwfilter_driver.c | 5 -----
src/nwfilter/nwfilter_driver.h | 3 ---
src/nwfilter/nwfilter_ebiptables_driver.c | 4 ----
src/nwfilter/nwfilter_gentech_driver.c | 4 ----
src/nwfilter/nwfilter_gentech_driver.h | 1 -
src/nwfilter/nwfilter_learnipaddr.c | 5 -----
src/nwfilter/nwfilter_learnipaddr.h | 1 -
src/openvz/openvz_conf.c | 1 -
src/openvz/openvz_conf.h | 1 -
src/openvz/openvz_driver.h | 2 --
src/openvz/openvz_util.c | 1 -
src/qemu/qemu_agent.c | 2 --
src/qemu/qemu_agent.h | 1 -
src/qemu/qemu_alias.c | 1 -
src/qemu/qemu_alias.h | 2 --
src/qemu/qemu_backup.c | 5 -----
src/qemu/qemu_block.c | 1 -
src/qemu/qemu_block.h | 1 -
src/qemu/qemu_blockjob.c | 2 --
src/qemu/qemu_capabilities.c | 5 -----
src/qemu/qemu_capabilities.h | 2 --
src/qemu/qemu_cgroup.c | 7 -------
src/qemu/qemu_cgroup.h | 2 --
src/qemu/qemu_checkpoint.c | 3 ---
src/qemu/qemu_checkpoint.h | 1 -
src/qemu/qemu_command.c | 7 -------
src/qemu/qemu_command.h | 4 ----
src/qemu/qemu_conf.c | 5 -----
src/qemu/qemu_conf.h | 8 --------
src/qemu/qemu_dbus.c | 3 ---
src/qemu/qemu_domain.c | 6 ------
src/qemu/qemu_domain.h | 3 ---
src/qemu/qemu_domain_address.h | 2 --
src/qemu/qemu_driver.c | 8 --------
src/qemu/qemu_extdevice.c | 5 -----
src/qemu/qemu_firmware.c | 1 -
src/qemu/qemu_hostdev.c | 5 -----
src/qemu/qemu_hostdev.h | 1 -
src/qemu/qemu_hotplug.c | 4 ----
src/qemu/qemu_hotplug.h | 1 -
src/qemu/qemu_interface.c | 1 -
src/qemu/qemu_interface.h | 1 -
src/qemu/qemu_interop_config.c | 3 ---
src/qemu/qemu_migration.c | 5 -----
src/qemu/qemu_migration_cookie.c | 1 -
src/qemu/qemu_migration_cookie.h | 1 -
src/qemu/qemu_migration_params.c | 2 --
src/qemu/qemu_migration_params.h | 4 ----
src/qemu/qemu_monitor.c | 2 --
src/qemu/qemu_monitor.h | 2 --
src/qemu/qemu_monitor_json.c | 4 ----
src/qemu/qemu_monitor_json.h | 1 -
src/qemu/qemu_monitor_text.c | 2 --
src/qemu/qemu_monitor_text.h | 2 --
src/qemu/qemu_namespace.c | 1 -
src/qemu/qemu_namespace.h | 1 -
src/qemu/qemu_process.c | 2 --
src/qemu/qemu_process.h | 1 -
src/qemu/qemu_qapi.c | 2 --
src/qemu/qemu_saveimage.c | 2 --
src/qemu/qemu_saveimage.h | 2 --
src/qemu/qemu_security.h | 2 --
src/qemu/qemu_shim.c | 1 -
src/qemu/qemu_slirp.c | 3 ---
src/qemu/qemu_snapshot.c | 4 ----
src/qemu/qemu_snapshot.h | 1 -
src/qemu/qemu_tpm.c | 5 -----
src/qemu/qemu_validate.h | 1 -
src/qemu/qemu_vhost_user.c | 1 -
src/qemu/qemu_vhost_user.h | 2 --
src/qemu/qemu_vhost_user_gpu.c | 3 ---
src/qemu/qemu_vhost_user_gpu.h | 1 -
src/remote/remote_daemon.c | 3 ---
src/remote/remote_daemon.h | 1 -
src/remote/remote_daemon_config.c | 1 -
src/remote/remote_daemon_dispatch.c | 5 -----
src/remote/remote_daemon_dispatch.h | 1 -
src/remote/remote_daemon_stream.c | 1 -
src/remote/remote_driver.c | 3 ---
src/remote/remote_driver.h | 1 -
src/rpc/virkeepalive.c | 3 ---
src/rpc/virnetclient.c | 1 -
src/rpc/virnetclient.h | 1 -
src/rpc/virnetclientprogram.h | 1 -
src/rpc/virnetclientstream.c | 1 -
src/rpc/virnetclientstream.h | 1 -
src/rpc/virnetdaemon.c | 2 --
src/rpc/virnetdaemon.h | 3 ---
src/rpc/virnetlibsshsession.h | 1 -
src/rpc/virnetmessage.c | 1 -
src/rpc/virnetsaslcontext.c | 3 ---
src/rpc/virnetsaslcontext.h | 1 -
src/rpc/virnetserver.c | 2 --
src/rpc/virnetserver.h | 1 -
src/rpc/virnetserverclient.c | 1 -
src/rpc/virnetserverprogram.h | 1 -
src/rpc/virnetserverservice.h | 1 -
src/rpc/virnetsocket.c | 1 -
src/rpc/virnetsshsession.c | 1 -
src/rpc/virnetsshsession.h | 1 -
src/rpc/virnettlscontext.h | 1 -
src/secret/secret_driver.c | 2 --
src/security/security_dac.c | 1 -
src/security/security_manager.h | 1 -
src/security/security_nop.c | 2 --
src/security/security_selinux.c | 2 --
src/security/security_stack.c | 1 -
src/security/security_util.c | 1 -
src/storage/parthelper.c | 1 -
src/storage/storage_backend.c | 3 ---
src/storage/storage_backend.h | 1 -
src/storage/storage_backend_fs.c | 1 -
src/storage/storage_backend_gluster.c | 1 -
src/storage/storage_backend_iscsi.c | 4 ----
src/storage/storage_backend_iscsi_direct.c | 2 --
src/storage/storage_backend_mpath.c | 1 -
src/storage/storage_backend_rbd.c | 1 -
src/storage/storage_backend_scsi.c | 3 ---
src/storage/storage_backend_vstorage.c | 2 --
src/storage/storage_driver.c | 2 --
src/storage/storage_util.c | 3 ---
src/storage/storage_util.h | 1 -
src/storage_file/storage_file_backend.c | 2 --
src/storage_file/storage_file_backend_fs.c | 5 -----
src/storage_file/storage_file_backend_gluster.c | 2 --
src/storage_file/storage_source.c | 3 ---
src/test/test_driver.c | 2 --
src/test/test_driver.h | 2 --
src/util/iohelper.c | 3 ---
src/util/virarch.h | 2 --
src/util/virarptable.c | 2 --
src/util/virarptable.h | 2 --
src/util/viraudit.h | 1 -
src/util/virauth.c | 1 -
src/util/virauth.h | 1 -
src/util/virauthconfig.c | 1 -
src/util/virbpf.c | 1 -
src/util/virbuffer.c | 2 --
src/util/vircgroup.c | 3 ---
src/util/vircgroupv2devices.c | 1 -
src/util/vircgroupv2devices.h | 2 --
src/util/virconf.c | 1 -
src/util/vircrypto.c | 2 --
src/util/virdnsmasq.c | 2 --
src/util/virebtables.c | 4 ----
src/util/virendian.h | 2 --
src/util/virenum.c | 1 -
src/util/virerror.c | 1 -
src/util/virevent.h | 1 -
src/util/vireventglib.c | 1 -
src/util/vireventglib.h | 2 --
src/util/vireventthread.h | 1 -
src/util/virfcp.c | 2 --
src/util/virfdstream.c | 1 -
src/util/virfilecache.c | 2 --
src/util/virfilecache.h | 2 --
src/util/virfirewall.c | 1 -
src/util/virfirmware.c | 1 -
src/util/virgic.c | 1 -
src/util/virhook.c | 2 --
src/util/virhook.h | 2 --
src/util/virhostcpu.c | 2 --
src/util/virhostcpu.h | 1 -
src/util/virhostmem.c | 2 --
src/util/virhostuptime.c | 1 -
src/util/viridentity.c | 3 ---
src/util/virinitctl.c | 3 ---
src/util/viriptables.c | 6 ------
src/util/viriscsi.c | 2 --
src/util/virjson.c | 1 -
src/util/virkmod.c | 1 -
src/util/virlease.c | 2 --
src/util/virlockspace.c | 1 -
src/util/virlockspace.h | 1 -
src/util/virmacaddr.c | 1 -
src/util/virmacmap.c | 2 --
src/util/virmacmap.h | 1 -
src/util/virmdev.h | 1 -
src/util/virnetdevbandwidth.c | 2 --
src/util/virnetdevbridge.c | 2 --
src/util/virnetdevip.c | 1 -
src/util/virnetdevmacvlan.c | 2 --
src/util/virnetdevmacvlan.h | 2 --
src/util/virnetdevmidonet.c | 1 -
src/util/virnetdevopenvswitch.c | 1 -
src/util/virnetdevtap.c | 1 -
src/util/virnetdevveth.c | 3 ---
src/util/virnetdevvlan.c | 2 --
src/util/virnetlink.c | 1 -
src/util/virnetlink.h | 1 -
src/util/virnodesuspend.c | 4 ----
src/util/virnodesuspend.h | 2 --
src/util/virnvme.c | 1 -
src/util/virobject.c | 2 --
src/util/virpci.c | 1 -
src/util/virpcivpd.c | 1 -
src/util/virperf.c | 2 --
src/util/virpidfile.c | 1 -
src/util/virpolkit.c | 2 --
src/util/virportallocator.c | 3 ---
src/util/virprobe.h | 1 -
src/util/virprocess.h | 1 -
src/util/virqemu.c | 2 --
src/util/virqemu.h | 1 -
src/util/virrandom.c | 3 ---
src/util/virresctrl.h | 3 ---
src/util/virrotatingfile.c | 1 -
src/util/virscsi.h | 1 -
src/util/virscsivhost.c | 1 -
src/util/virscsivhost.h | 1 -
src/util/virseclabel.c | 2 --
src/util/virsecret.c | 1 -
src/util/virsocketaddr.c | 2 --
src/util/virstoragefile.c | 4 ----
src/util/virtpm.c | 1 -
src/util/virusb.h | 1 -
src/util/virutil.c | 2 --
src/util/viruuid.c | 3 ---
src/vbox/vbox_XPCOMCGlue.c | 3 ---
src/vbox/vbox_common.h | 1 -
src/vbox/vbox_driver.c | 2 --
src/vbox/vbox_driver.h | 2 --
src/vbox/vbox_get_driver.h | 2 --
src/vbox/vbox_network.c | 2 --
src/vbox/vbox_storage.c | 3 ---
src/vbox/vbox_tmpl.c | 1 -
src/vbox/vbox_uniformed_api.h | 2 --
src/vmware/vmware_conf.c | 1 -
src/vmware/vmware_conf.h | 1 -
src/vmware/vmware_driver.c | 1 -
src/vmx/vmx.c | 1 -
src/vmx/vmx.h | 2 --
tests/commandtest.c | 2 --
tests/cputest.c | 2 --
tests/domainconftest.c | 2 --
tests/esxutilstest.c | 1 -
tests/eventtest.c | 2 --
tests/fchosttest.c | 1 -
tests/fdstreamtest.c | 3 ---
tests/genericxml2xmltest.c | 2 --
tests/interfacexml2xmltest.c | 2 --
tests/libxlmock.c | 2 --
tests/libxlxml2domconfigtest.c | 6 ------
tests/lxcxml2xmltest.c | 2 --
tests/networkxml2conftest.c | 2 --
tests/networkxml2firewalltest.c | 2 --
tests/networkxml2xmltest.c | 3 ---
tests/networkxml2xmlupdatetest.c | 3 ---
tests/nodedevmdevctltest.c | 2 --
tests/nodedevxml2xmltest.c | 3 ---
tests/nssmock.c | 2 --
tests/nsstest.c | 1 -
tests/nwfilterebiptablestest.c | 1 -
tests/nwfilterxml2firewalltest.c | 1 -
tests/nwfilterxml2xmltest.c | 6 ------
tests/objecteventtest.c | 3 ---
tests/openvzutilstest.c | 2 --
tests/qemuagenttest.c | 2 --
tests/qemublocktest.c | 4 ----
tests/qemucapsprobemock.c | 1 -
tests/qemucommandutiltest.c | 1 -
tests/qemucpumock.c | 1 -
tests/qemudomaincheckpointxml2xmltest.c | 2 --
tests/qemudomainsnapshotxml2xmltest.c | 2 --
tests/qemuhotplugmock.c | 1 -
tests/qemuhotplugtest.c | 3 ---
tests/qemumemlocktest.c | 2 --
tests/qemumigparamstest.c | 1 -
tests/qemumigrationcookiexmltest.c | 1 -
tests/qemumonitorjsontest.c | 2 --
tests/qemumonitortestutils.c | 2 --
tests/qemumonitortestutils.h | 1 -
tests/qemusecuritymock.c | 2 --
tests/qemuxml2argvmock.c | 5 -----
tests/qemuxml2argvtest.c | 8 --------
tests/qemuxml2xmltest.c | 3 ---
tests/scsihosttest.c | 2 --
tests/seclabeltest.c | 1 -
tests/secretxml2xmltest.c | 2 --
tests/securityselinuxhelper.c | 1 -
tests/securityselinuxlabeltest.c | 2 --
tests/securityselinuxtest.c | 3 ---
tests/sockettest.c | 1 -
tests/storagebackendsheepdogtest.c | 1 -
tests/storagepoolxml2argvtest.c | 4 ----
tests/storagepoolxml2xmltest.c | 3 ---
tests/storagevolxml2argvtest.c | 4 ----
tests/storagevolxml2xmltest.c | 3 ---
tests/sysinfotest.c | 1 -
tests/testutils.c | 4 ----
tests/testutils.h | 1 -
tests/testutilslxc.c | 1 -
tests/testutilslxc.h | 2 --
tests/testutilsqemu.c | 1 -
tests/utiltest.c | 1 -
tests/virauthconfigtest.c | 2 --
tests/virbuftest.c | 2 --
tests/vircaps2xmltest.c | 1 -
tests/vircgroupmock.c | 2 --
tests/vircgrouptest.c | 1 -
tests/virconftest.c | 1 -
tests/virdriverconnvalidatetest.c | 2 --
tests/virdrivermoduletest.c | 2 --
tests/virfilemock.c | 2 --
tests/virfiletest.c | 1 -
tests/virfilewrapper.c | 2 --
tests/virfirewallmock.c | 1 -
tests/virfirewalltest.c | 1 -
tests/virhostcputest.c | 1 -
tests/viridentitytest.c | 4 ----
tests/virkeycodetest.c | 4 ----
tests/virkmodtest.c | 1 -
tests/virlockspacetest.c | 3 ---
tests/virmigtest.c | 1 -
tests/virmockstathelpers.c | 1 -
tests/virnetdaemonmock.c | 1 -
tests/virnetdevmock.c | 2 --
tests/virnetdevtest.c | 2 --
tests/virnetmessagetest.c | 2 --
tests/virnetserverclientmock.c | 1 -
tests/virnetsockettest.c | 1 -
tests/virnettlscontexttest.c | 5 -----
tests/virnettlshelpers.c | 1 -
tests/virnettlssessiontest.c | 4 ----
tests/virnetworkportxml2xmltest.c | 2 --
tests/virnumamock.c | 3 ---
tests/virnwfilterbindingxml2xmltest.c | 4 ----
tests/virpcimock.c | 1 -
tests/virportallocatortest.c | 3 ---
tests/virrandommock.c | 1 -
tests/virschematest.c | 2 --
tests/virshtest.c | 2 --
tests/virstoragetest.c | 3 ---
tests/virstorageutiltest.c | 3 ---
tests/virstringtest.c | 3 ---
tests/virtestmock.c | 2 --
tests/virtimetest.c | 2 --
tests/viruritest.c | 1 -
tests/virusbmock.c | 3 ---
tests/virusbtest.c | 2 --
tests/vmx2xmltest.c | 2 --
tests/vshtabletest.c | 1 -
tests/xlconfigtest.c | 1 -
tests/xmconfigtest.c | 2 --
tests/xml2vmxtest.c | 1 -
tools/virsh-checkpoint.c | 2 --
tools/virsh-completer-checkpoint.c | 2 --
tools/virsh-completer-domain.c | 1 -
tools/virsh-completer-host.c | 1 -
tools/virsh-completer-interface.c | 2 --
tools/virsh-completer-network.c | 1 -
tools/virsh-completer-nodedev.c | 2 --
tools/virsh-completer-nwfilter.c | 2 --
tools/virsh-completer-pool.c | 2 --
tools/virsh-completer-secret.c | 2 --
tools/virsh-completer-snapshot.c | 2 --
tools/virsh-completer-volume.c | 2 --
tools/virsh-completer.c | 2 --
tools/virsh-console.c | 1 -
tools/virsh-domain-event.c | 2 --
tools/virsh-domain.c | 1 -
tools/virsh-nodedev.c | 1 -
tools/virsh-pool.c | 1 -
tools/virsh-snapshot.c | 1 -
tools/virsh-util.c | 1 -
tools/virsh.c | 4 ----
tools/virsh.h | 2 --
tools/virt-admin.c | 1 -
tools/virt-admin.h | 1 -
tools/virt-host-validate-common.h | 1 -
tools/vsh.h | 1 -
527 files changed, 1064 deletions(-)
--
2.36.1
2 years, 6 months
[PATCH 00/37] qemu: Improve 'qemuFDPass' usability and refactor interface code to use it
by Peter Krempa
This series modifies qemuFDPass to be a bit more convenient to use by
e.g. remembering the maximum fd set index currently used across libvirtd
restarts so that we can avoid having to pass the FDs before actually
constructing the device properties.
Along with that this code refactors the handling of FDs used for network
interfaces. There was a substantial amount of duplicated code with
plethora of helper variables and such. By converting to qemuFDPass
stored in the private data we can simplify the functions.
Peter Krempa (37):
qemu_fd: Add return value handling for qemuFDPassTransfer* APIs
qemu_fd: Add validation before transferring file descriptors
qemu_fd: Remove error checking from qemuFDPassAddFD
qemuDomainAttachNetDevice: Use 'qemuFDPass' for the vdpa file
descriptor
qemu: monitor: Don't parse actual fd's from query-fdsets/add-fd
replies
qemuMonitorJSONQueryFdsets: Ensure that JSON arrays are valid before
using them
qemu: domain: Store and update 'fdsetindex' across libvirtd restarts
qemu_fd: Don't rely on fdset id allocation by qemu
qemuMonitorAddFileHandleToSet: Remove return of 'qemuMonitorAddFdInfo'
qemuFDPassTransferMonitor: Close local copy of the FD as soon as it's
passed to qemu
qemu: Clear 'qemuFDPass' helpers of char devices when no longer needed
qemu: domain: Add qemuFDPass helpers into network private data
qemu: command: Introduce 'qemuBuildInterfaceConnect' helper
qemuBuildInterfaceConnect: Connect to 'vdpa' netdev
qemuBuildHostNetProps: Move all 'tap' code together
qemuBuildHostNetProps: Refactor construction of tapfd/vhostfd
arguments
qemuDomainAttachNetDevice: Don't construct network device properties
under monitor lock
qemu: Prepare netdev code for use of qemuFDPass for tapfd/vhostfd
passing
qemuBuildNicDevProps: Don't pass 'vhostfdSize'
qemuInterfaceOpenVhostNet: Reformat error messages per new guidelines
qemu: Move opening of vhost file descriptors for net devices into
qemuBuildInterfaceConnect
qemuDomainAttachNetDevice: Remove 'vhostfd' machinery
qemuBuildInterfaceCommandLine: Remove 'vhostfd' machinery
qemuBuildHostNetProps: Remove 'vhostfd' machinery
qemuMonitorAddNetdev: Remove 'vhostfd' machinery
qemu: Move opening of tap file descriptors for net devices into
qemuBuildInterfaceConnect
qemuBuildInterfaceCommandLine: Remove 'tapfd' infrastructure
qemuDomainAttachNetDevice: Remove unused 'tapfd' infrastructure
qemuBuildNicDevProps: Remove unused 'tapfd' infrastructure
qemuMonitorAddNetdev: Remove unused 'tapfd' infrastructure
qemuInterfacePrepareSlirp: Directly populate the 'slirp' variable in
network private data
qemuSlirpStart: Simplify parameters
qemu: slirp: Call qemuSlirpOpen directly from qemuSlirpStart
qemu: slirp: Pass FDs to qemu via qemuFDPass in the network private
data
qemuDomainAttachNetDevice: Clean up unneeded 'slirp' helper variables
qemuMonitorAddNetdev: Remove unneeded 'slirp' variables and useless
debug
qemu: slirp: Remove unused 'qemuSlirpGetFD'
src/qemu/qemu_command.c | 393 +++++++++---------
src/qemu/qemu_command.h | 15 +-
src/qemu/qemu_domain.c | 34 +-
src/qemu/qemu_domain.h | 14 +-
src/qemu/qemu_extdevice.c | 13 +-
src/qemu/qemu_fd.c | 118 +++---
src/qemu/qemu_fd.h | 7 +-
src/qemu/qemu_hotplug.c | 172 ++------
src/qemu/qemu_interface.c | 83 ++--
src/qemu/qemu_interface.h | 9 +-
src/qemu/qemu_monitor.c | 50 +--
src/qemu/qemu_monitor.h | 14 +-
src/qemu/qemu_monitor_json.c | 78 +---
src/qemu/qemu_monitor_json.h | 3 +-
src/qemu/qemu_process.c | 47 ++-
src/qemu/qemu_slirp.c | 30 +-
src/qemu/qemu_slirp.h | 10 +-
tests/qemuhotplugtest.c | 1 +
tests/qemumonitorjsontest.c | 3 -
.../qemustatusxml2xmldata/backup-pull-in.xml | 1 +
.../blockjob-blockdev-in.xml | 1 +
.../blockjob-mirror-in.xml | 1 +
.../migration-in-params-in.xml | 1 +
.../migration-out-nbd-bitmaps-in.xml | 1 +
.../migration-out-nbd-out.xml | 1 +
.../migration-out-nbd-tls-out.xml | 1 +
.../migration-out-params-in.xml | 1 +
tests/qemustatusxml2xmldata/modern-in.xml | 1 +
tests/qemustatusxml2xmldata/upgrade-out.xml | 1 +
.../qemustatusxml2xmldata/vcpus-multi-in.xml | 1 +
.../net-eth-unmanaged-tap.args | 2 +-
tests/qemuxml2argvdata/user-aliases.args | 2 +-
tests/qemuxml2argvmock.c | 28 +-
tests/testutilsqemu.c | 6 +-
34 files changed, 502 insertions(+), 641 deletions(-)
--
2.35.1
2 years, 6 months
[PATCH v2] virt-xml-validate: Add more XML formats support
by Han Han
Add these XML formats validation in manpage or script:
cpu, domainbackup, domaincaps, domaincheckpoint, networkport,
storagepoolcaps.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
Diff from v1: Add domainbackup, domaincaps, networkport, storagepoolcaps
v1: https://listman.redhat.com/archives/libvir-list/2021-November/225070.html
---
docs/manpages/virt-xml-validate.rst | 24 ++++++++++++++++++++++++
tools/virt-xml-validate.in | 15 +++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/docs/manpages/virt-xml-validate.rst b/docs/manpages/virt-xml-validate.rst
index 940eada3a8..503ddbd35a 100644
--- a/docs/manpages/virt-xml-validate.rst
+++ b/docs/manpages/virt-xml-validate.rst
@@ -31,18 +31,42 @@ from the name of the root element in the XML document.
Valid schema names currently include
+- ``cpu``
+
+The schema for the XML format of cpu
+
- ``domainsnapshot``
The schema for the XML format used by domain snapshot configuration
+- ``domaincheckpoint``
+
+The schema for the XML format used by domain checkpoint configuration
+
+- ``domainbackup``
+
+The schema for the XML format used by domain backup configuration
+
+- ``domaincaps``
+
+The schema for the XML format of domain capabilities
+
- ``domain``
The schema for the XML format used by guest domains configuration
+- ``networkport``
+
+The schema for the XML format used by network port configuration
+
- ``network``
The schema for the XML format used by virtual network configuration
+- ``storagepoolcaps``
+
+The schema for the XML format of storage pool capabilities
+
- ``storagepool``
The schema for the XML format used by storage pool configuration
diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in
index 249bcf7eef..e444ef2fbc 100644
--- a/tools/virt-xml-validate.in
+++ b/tools/virt-xml-validate.in
@@ -74,9 +74,21 @@ if [ -z "$TYPE" ]; then
ROOT=`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 " | awk '{ print $3 }'`
fi
case "$ROOT" in
+ *cpu*)
+ TYPE="cpu"
+ ;;
*domainsnapshot*) # Must come first, since *domain* is a substring
TYPE="domainsnapshot"
;;
+ *domaincheckpoint*)
+ TYPE="domaincheckpoint"
+ ;;
+ *domainbackup*)
+ TYPE="domainbackup"
+ ;;
+ *domaincaps*)
+ TYPE="domaincaps"
+ ;;
*domain*)
TYPE="domain"
;;
@@ -86,6 +98,9 @@ if [ -z "$TYPE" ]; then
*network*)
TYPE="network"
;;
+ *storagepoolcaps*)
+ TYPE="storagepoolcaps"
+ ;;
*pool*)
TYPE="storagepool"
;;
--
2.36.0
2 years, 6 months
[libvirt PATCH 0/3] conf: Fix handling of SMM feature
by Andrea Bolognani
Andrea Bolognani (3):
tests: Update smm=on test
tests: Introduce smm=off test
conf: Fix smm=off handling
src/conf/domain_conf.c | 9 +++++---
...rgs => machine-smm-off.x86_64-latest.args} | 16 ++++++--------
tests/qemuxml2argvdata/machine-smm-off.xml | 17 +++++++++++++++
...args => machine-smm-on.x86_64-latest.args} | 16 ++++++--------
tests/qemuxml2argvdata/machine-smm-on.xml | 17 +++++++++++++++
tests/qemuxml2argvtest.c | 8 ++-----
.../machine-smm-off.x86_64-latest.xml} | 21 ++++++++++++-------
.../machine-smm-on.x86_64-latest.xml} | 19 ++++++++++-------
tests/qemuxml2xmltest.c | 2 ++
9 files changed, 81 insertions(+), 44 deletions(-)
copy tests/qemuxml2argvdata/{machine-smm-opt.args => machine-smm-off.x86_64-latest.args} (52%)
create mode 100644 tests/qemuxml2argvdata/machine-smm-off.xml
rename tests/qemuxml2argvdata/{machine-smm-opt.args => machine-smm-on.x86_64-latest.args} (52%)
create mode 100644 tests/qemuxml2argvdata/machine-smm-on.xml
copy tests/{qemuxml2argvdata/machine-smm-opt.xml => qemuxml2xmloutdata/machine-smm-off.x86_64-latest.xml} (51%)
rename tests/{qemuxml2argvdata/machine-smm-opt.xml => qemuxml2xmloutdata/machine-smm-on.x86_64-latest.xml} (53%)
--
2.35.3
2 years, 6 months
[PATCH v2 0/3] virDomain{Save,Restore}Params: More fixes
by Michal Privoznik
v2 of:
https://listman.redhat.com/archives/libvir-list/2022-May/231307.html
diff to v1:
- Reworked 3/3, instead of promoting restore path to a regular argument,
let's keep it in typed params as this is more future proof. But
require it for now.
Michal Prívozník (3):
qemu: Separate out save code from qemuDomainManagedSave()
lib: Repurpose virDomainSaveParams() with no
VIR_DOMAIN_SAVE_PARAM_FILE
virDomainRestoreFlags: Require VIR_DOMAIN_SAVE_PARAM_FILE for now
src/libvirt-domain.c | 6 ++-
src/qemu/qemu_driver.c | 117 +++++++++++++++++++++++++----------------
2 files changed, 77 insertions(+), 46 deletions(-)
--
2.35.1
2 years, 6 months
[PATCH 0/3] virDomain{Save,Restore}Params: More fixes
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (3):
qemu: Separate out save code from qemuDomainManagedSave()
lib: Repurpose virDomainSaveParams() with no
VIR_DOMAIN_SAVE_PARAM_FILE
lib: Require path in virDomainRestoreParams()
include/libvirt/libvirt-domain.h | 1 +
src/driver-hypervisor.h | 1 +
src/libvirt-domain.c | 27 +++++--
src/qemu/qemu_driver.c | 120 ++++++++++++++++++-------------
src/remote/remote_protocol.x | 1 +
src/remote_protocol-structs | 1 +
src/rpc/gendispatch.pl | 2 +-
7 files changed, 97 insertions(+), 56 deletions(-)
--
2.35.1
2 years, 6 months
[PATCH 0/4] network: firewalld: fix routed network
by Eric Garver
This series fixes routed networks when a newer firewalld (>= 1.0.0) is
present [1]. Firewalld 1.0.0 included a change that disallows implicit
forwarding between zones [2]. libvirt was relying on this behavior to
allow routed networks to function.
New firewalld policies are added. This is done to use common rules
between NAT and routed networks. Policies have been supported since
firewalld 0.9.0.
[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2055706
[2]: https://github.com/firewalld/firewalld/issues/177
Eric Garver (4):
network: firewalld: convert to policies
network: firewalld: add zone for routed networks
network: firewalld: add policies for routed networks
network: firewalld: add support for routed networks
src/network/bridge_driver_linux.c | 6 +++++-
src/network/libvirt-nat-out.policy | 12 ++++++++++++
src/network/libvirt-routed-in.policy | 11 +++++++++++
src/network/libvirt-routed-out.policy | 12 ++++++++++++
src/network/libvirt-routed.zone | 12 ++++++++++++
src/network/libvirt-to-host.policy | 21 +++++++++++++++++++++
src/network/libvirt.zone | 23 +++++------------------
src/network/meson.build | 25 +++++++++++++++++++++++++
8 files changed, 103 insertions(+), 19 deletions(-)
create mode 100644 src/network/libvirt-nat-out.policy
create mode 100644 src/network/libvirt-routed-in.policy
create mode 100644 src/network/libvirt-routed-out.policy
create mode 100644 src/network/libvirt-routed.zone
create mode 100644 src/network/libvirt-to-host.policy
--
2.33.0
2 years, 6 months
[PATCH] qemu: Don't check for qemuDomainManagedSavePath() retval
by Michal Privoznik
The qemuDomainManagedSavePath() function does no more than a
g_strdup_printf() and as such can't return NULL really.
Therefore, don't check for its return value.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 41c6836390..edba400a7b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2904,8 +2904,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
"save", false)) < 0)
goto cleanup;
- if (!(name = qemuDomainManagedSavePath(driver, vm)))
- goto cleanup;
+ name = qemuDomainManagedSavePath(driver, vm);
VIR_INFO("Saving state of domain '%s' to '%s'", vm->def->name, name);
@@ -2926,19 +2925,15 @@ qemuDomainManagedSaveLoad(virDomainObj *vm,
{
virQEMUDriver *driver = opaque;
g_autofree char *name = NULL;
- int ret = -1;
virObjectLock(vm);
- if (!(name = qemuDomainManagedSavePath(driver, vm)))
- goto cleanup;
+ name = qemuDomainManagedSavePath(driver, vm);
vm->hasManagedSave = virFileExists(name);
- ret = 0;
- cleanup:
virObjectUnlock(vm);
- return ret;
+ return 0;
}
@@ -2979,8 +2974,7 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
if (virDomainManagedSaveRemoveEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (!(name = qemuDomainManagedSavePath(driver, vm)))
- goto cleanup;
+ name = qemuDomainManagedSavePath(driver, vm);
if (unlink(name) < 0) {
virReportSystemError(errno,
@@ -6079,8 +6073,7 @@ qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, unsigned int flags)
if (virDomainManagedSaveGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0)
goto cleanup;
- if (!(path = qemuDomainManagedSavePath(driver, vm)))
- goto cleanup;
+ path = qemuDomainManagedSavePath(driver, vm);
if (!virFileExists(path)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -6117,8 +6110,7 @@ qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml,
if (virDomainManagedSaveDefineXMLEnsureACL(conn, vm->def) < 0)
goto cleanup;
- if (!(path = qemuDomainManagedSavePath(driver, vm)))
- goto cleanup;
+ path = qemuDomainManagedSavePath(driver, vm);
if (!virFileExists(path)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -6427,9 +6419,6 @@ qemuDomainObjStart(virConnectPtr conn,
*/
managed_save = qemuDomainManagedSavePath(driver, vm);
- if (!managed_save)
- return ret;
-
if (virFileExists(managed_save)) {
if (force_boot) {
if (unlink(managed_save) < 0) {
@@ -6690,8 +6679,6 @@ qemuDomainUndefineFlags(virDomainPtr dom,
}
name = qemuDomainManagedSavePath(driver, vm);
- if (name == NULL)
- goto endjob;
if (virFileExists(name)) {
if (flags & VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) {
--
2.35.1
2 years, 6 months
[libvirt PATCH] Send event on persistent config modification
by Efim Shevrin
>From 32dbfbf9857ea72b69ea175ea7f8b21210f4e5d2 Mon Sep 17 00:00:00 2001
From: Efim Shevrin <efim.shevrin(a)virtuozzo.com>
Date: Tue, 10 May 2022 17:03:11 +0300
Subject: [PATCH] Send event on persistent config modification
Libvirt is not sending events in case of a device update, thus any services
listening to events are unaware of the changes.This patch suggests to send event in
case of a persistent config modification, it should keep subscribed services in sync with VM configuration.
Signed-off-by: Efim Shevrin <efim.shevrin(a)virtuozzo.com>
---
src/qemu/qemu_driver.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e3582f62a7..6008a4c8f3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7942,6 +7942,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
virQEMUDriver *driver = dom->conn->privateData;
virDomainObj *vm = NULL;
qemuDomainObjPrivate *priv;
+ virObjectEvent *event = NULL;
g_autoview.settings().get('font_face')ptr(virDomainDef) vmdef = NULL;
g_autoptr(virDomainDeviceDef) dev = NULL;
virDomainDeviceDef *dev_copy = NULL;
@@ -8019,8 +8020,16 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
/* Finally, if no error until here, we can save config. */
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
- if (!ret)
+ if (!ret) {
virDomainObjAssignDef(vm, &vmdef, false, NULL);
+
+ /* Event sending if persistent config has changed */
+ event = virDomainEventLifecycleNewFromObj(vm,
+ VIR_DOMAIN_EVENT_DEFINED,
+ VIR_DOMAIN_EVENT_DEFINED_UPDATED);
+
+ virObjectEventStateQueue(driver->domainEventState, event);
+ }
}
endjob:
--
2.31.1
2 years, 6 months