[PATCH V2 00/20] qemu: support mapped-ram+directio+mulitfd
by Jim Fehlig
I'm claiming this to be V2 of a series to support QEMU's mapped-ram stream
format [1] and migration capability, even though the approach to control
the feature is different than V1. To control mapped-ram in V1, I bumped
the save format version and added a 'features' field to the save image
header. In V2, I use the save_image_format setting in qemu.conf, extending
it with a 'sparse' option to enable mapped-ram. IMO, the latter is nicer
approach that fits better with existing save options.
V2 leaves the "raw" save image format as default. save_image_format must
be set to "sparse" to enable use of mapped-ram. Like V1, this version of
the series also includes patches that leverage mapped-ram to add support
for parallel save/restore.
In one of the previous threads on this topic we discussed per-VM control of
save image format by adding a 'format' parameter to virDomainSaveParams.
I can do that as a followup series if folks agree its useful.
Changes in V2
* Use save_image_format setting to control mapped-ram instead of
introducing a new field to the header and bumping the save image version
* Rename save parameter parallel-connections to parallel-channels
* Address other minor comments from V1
[1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/M...
Claudio Fontana (3):
include: Define constants for parallel save/restore
tools: add parallel parameter to virsh save command
tools: add parallel parameter to virsh restore command
Jim Fehlig (17):
lib: virDomain{Save,Restore}Params: Ensure absolute path
qemu_fd: Add function to retrieve fdset ID
qemu: Add function to check capability in migration params
qemu: Add function to get bool value from migration params
qemu: Add mapped-ram migration capability
qemu: Add function to get migration params for save
qemu_saveimage: add "sparse" to supported save image formats
qemu: Add helper function for creating save image fd
qemu: Move declaration of virQEMUSaveFormat to header file
qemu: Add support for mapped-ram on save
qemu: Decompose qemuSaveImageOpen
qemu: Move creation of qemuProcessIncomingDef struct
qemu: Apply migration parameters in qemuMigrationDstRun
qemu: Add support for mapped-ram on restore
qemu: Support O_DIRECT with mapped-ram on save
qemu: Support O_DIRECT with mapped-ram on restore
qemu: Add support for parallel save and restore
docs/manpages/virsh.rst | 21 ++-
include/libvirt/libvirt-domain.h | 11 ++
src/libvirt-domain.c | 95 +++++++++++---
src/qemu/qemu.conf.in | 9 +-
src/qemu/qemu_driver.c | 108 +++++++++++-----
src/qemu/qemu_fd.c | 18 +++
src/qemu/qemu_fd.h | 3 +
src/qemu/qemu_migration.c | 194 +++++++++++++++++++---------
src/qemu/qemu_migration.h | 10 +-
src/qemu/qemu_migration_params.c | 92 ++++++++++++++
src/qemu/qemu_migration_params.h | 17 +++
src/qemu/qemu_monitor.c | 40 ++++++
src/qemu/qemu_monitor.h | 5 +
src/qemu/qemu_process.c | 117 ++++++++++++-----
src/qemu/qemu_process.h | 19 ++-
src/qemu/qemu_saveimage.c | 211 ++++++++++++++++++-------------
src/qemu/qemu_saveimage.h | 39 +++++-
src/qemu/qemu_snapshot.c | 29 +++--
tools/virsh-domain.c | 79 ++++++++++--
19 files changed, 856 insertions(+), 261 deletions(-)
--
2.43.0
1 day, 8 hours
[PATCH 0/2] qemu: Improve opening and verifying save images
by Jim Fehlig
qemuSaveImageOpen does a lot of stuff. When bypass-cache is specified,
it creates a virFileWrapperFd, which is not cleaned up in the subsequent
failure paths. This results in errors from the iohelper, which can
overwrite the actual error. E.g. consider libvirt attempting to restore
an image saved in an unknown format
# virsh restore --bypass-cache /data/test.sav.sparse
error: Failed to restore domain from /data/test.sav.sparse
error: internal error: Child process (LIBVIRT_LOG_OUTPUTS=1:stderr /usr/lib64/libvirt/libvirt_iohelper /data/test.sav.sparse 0) unexpected fatal signal 13
When not using the iohelper, and not creating a virFileWrapperFd, we see
the real error:
# virsh restore /data/test.sav.sparse
error: Failed to restore domain from /data/test.sav.sparse
error: operation failed: Invalid compressed save format 6
Although that error highlights a spot I missed when removing the
"compression" implications around the 'foo_image_format' settings in
qemu.conf with commit bd6d7ebf622 :-). IMO, the error message would be
best fixed by checking for valid values when reading the save image
metadata.
Patch 1 decomposes qemuSaveImageOpen to allow for better error handling
and more flexibility. Patch 2 checks for a valid format when checking the
other header fields.
Jim Fehlig (2):
qemu: Decompose qemuSaveImageOpen
qemu: Check for valid save image format when verifying image header
src/qemu/qemu_driver.c | 37 +++++++--------
src/qemu/qemu_saveimage.c | 95 +++++++++++++++++++++++++--------------
src/qemu/qemu_saveimage.h | 16 ++++---
src/qemu/qemu_snapshot.c | 9 ++--
4 files changed, 95 insertions(+), 62 deletions(-)
--
2.43.0
1 day, 8 hours
[PATCH v5 0/5] ch: handle events from cloud-hypervisor
by Purna Pavan Chandra Aekkaladevi
changes from v4->v5:
* Incase of invalid events, exit VirCHEventHandler
* Open eventmonitor fifo (Reader end) in virCHMonitorNew itself.
This way, we can clean exit incase open fails for some reason.
changes from v3->v4:
* Don't abort; instead kill the VM and exit
* use g_clear_pointer along with g_free
* Fix possible memory leak
changes from v2->v3:
* Remove patch 'utils: Implement virFileIsNamedPipe' as it is no more needed.
* Remove the eventmonitorpath only if it exists
* Added domain name as a prefix to logs from ch_events.c. This will make
debugging easier.
* Simplified event parsing logic by reserving a byte for null char.
changes from v1->v2:
* Rebase on latest master
* Use /* */ for comments
* Remove fifo file if already exists
* Address other comments from Praveen Paladugu
cloud-hypervisor raises various events, including VM lifecylce operations
such as boot, shutdown, pause, resume, etc. Libvirt will now read these
events and take the necessary actions, such as correctly updating the
domain state. A FIFO file is passed to `--event-monitor` option of
cloud-hypervisor. Libvirt creates a new thread that acts as the reader
of the fifo file and continuously monitors for new events. Currently,
shutdown events are handled by updating the domain state appropriately.
Purna Pavan Chandra Aekkaladevi (5):
ch: pass --event-monitor option to cloud-hypervisor
ch: start a new thread for handling ch events
ch: events: Read and parse cloud-hypervisor events
ch: events: facilitate lifecycle events handling
NEWS: Mention event handling support in ch driver
NEWS.rst | 7 +
po/POTFILES | 1 +
src/ch/ch_events.c | 312 ++++++++++++++++++++++++++++++++++++++++++++
src/ch/ch_events.h | 54 ++++++++
src/ch/ch_monitor.c | 76 ++++++++++-
src/ch/ch_monitor.h | 12 ++
src/ch/meson.build | 2 +
7 files changed, 458 insertions(+), 6 deletions(-)
create mode 100644 src/ch/ch_events.c
create mode 100644 src/ch/ch_events.h
--
2.34.1
1 day, 16 hours
[PATCH] qemu: Allow virDomainBlockJobSetSpeed during migration
by Jiri Denemark
When a migration with non-shared storage is started with
VIR_MIGRATE_PARAM_BANDWIDTH set, it will be applied to both memory
migration and each block job started for storage migration. Once the
migration is running virDomainMigrateSetMaxSpeed may be used to change
the bandwidth used by memory migration, but there was no way of changing
storage migration speed. Let's allow virDomainBlockJobSetSpeed during
migration to enable the missing functionality.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/virdomainjob.h | 11 +++++++----
src/qemu/qemu_driver.c | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/conf/virdomainjob.h b/src/conf/virdomainjob.h
index 8b2dccd298..d8685cf236 100644
--- a/src/conf/virdomainjob.h
+++ b/src/conf/virdomainjob.h
@@ -37,10 +37,13 @@ typedef enum {
VIR_JOB_MODIFY, /* May change state */
VIR_JOB_ABORT, /* Abort current async job */
VIR_JOB_MIGRATION_OP, /* Operation influencing outgoing migration */
- VIR_JOB_MODIFY_MIGRATION_SAFE, /* Internal only job for event handlers which
- need to be processed even during migration.
- The code may only change state in a way
- that does not affect migration. */
+ VIR_JOB_MODIFY_MIGRATION_SAFE, /* Modify job that is safe to be run during
+ migration. The code may only change state
+ in a way that does not affect migration.
+ Used in event handlers which need to be
+ processed even during migration or for
+ setting block job speed when migrating
+ with non-shared storage. */
/* The following two items must always be the last items before JOB_LAST */
VIR_JOB_ASYNC, /* Asynchronous job */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d2eddbd9ae..a1fc61bae2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13982,7 +13982,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
if (virDomainBlockJobSetSpeedEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
+ if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY_MIGRATION_SAFE) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
--
2.48.1
1 day, 16 hours
[PATCH 0/5] qemu: IO error reporting fixes and improvements (part 1?)
by Peter Krempa
This series:
- fixed bug in lookup of devices for the IO error which made them
useless (2/5)
- adds framework to return error messages (3/5)
- implements the passthrough of errors (4/5)
- logs the I/O errors in the VM log (5/5)
Peter Krempa (5):
qemuProcessHandleIOError: Refactor to extract 'priv' instead of
'driver'
qemuProcessHandleIOError: Fix logic for lookup of disk
API: Document more possibilities for @reason field of
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON event
qemu: monitor: Plumb in disk IO error message passthrough to
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
qemuProcessHandleIOError: Log IO errors in the VM log file
include/libvirt/libvirt-domain.h | 8 +++--
src/qemu/qemu_monitor_json.c | 19 ++++++++++--
src/qemu/qemu_process.c | 51 ++++++++++++++++++--------------
3 files changed, 51 insertions(+), 27 deletions(-)
--
2.48.1
1 day, 16 hours
[PATCH] ch: implement domainInterfaceAddresses
by Praveen K Paladugu
From: Anirudh Rayabharam <anrayabh(a)linux.microsoft.com>
Implement domainInterfaceAddresses for the Cloud Hypervisor driver.
Support VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE and
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP sources. Implementation is
similar to other drivers.
Signed-off-by: Anirudh Rayabharam <anrayabh(a)linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu(a)gmail.com>
---
src/ch/ch_driver.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
index 6a8da5f356..d284524337 100644
--- a/src/ch/ch_driver.c
+++ b/src/ch/ch_driver.c
@@ -2298,6 +2298,47 @@ chConnectDomainEventDeregisterAny(virConnectPtr conn,
return 0;
}
+static int
+chDomainInterfaceAddresses(virDomain *dom,
+ virDomainInterfacePtr **ifaces,
+ unsigned int source,
+ unsigned int flags)
+{
+ virDomainObj *vm = NULL;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ if (!(vm = virCHDomainObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def, source) < 0)
+ goto cleanup;
+
+ if (virDomainObjCheckActive(vm) < 0)
+ goto cleanup;
+
+ switch (source) {
+ case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE:
+ ret = virDomainNetDHCPInterfaces(vm->def, ifaces);
+ break;
+
+ case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP:
+ ret = virDomainNetARPInterfaces(vm->def, ifaces);
+ break;
+
+ default:
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+ _("Unsupported IP address data source %1$d"),
+ source);
+ break;
+ }
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
/* Function Tables */
static virHypervisorDriver chHypervisorDriver = {
@@ -2316,6 +2357,7 @@ static virHypervisorDriver chHypervisorDriver = {
.domainCreateXML = chDomainCreateXML, /* 7.5.0 */
.domainCreate = chDomainCreate, /* 7.5.0 */
.domainCreateWithFlags = chDomainCreateWithFlags, /* 7.5.0 */
+ .domainInterfaceAddresses = chDomainInterfaceAddresses, /* 10.10.1 */
.domainShutdown = chDomainShutdown, /* 7.5.0 */
.domainShutdownFlags = chDomainShutdownFlags, /* 7.5.0 */
.domainReboot = chDomainReboot, /* 7.5.0 */
--
2.47.0
1 day, 16 hours
[PATCH v2 0/3] qemu: Add support for avail-switchover-bandwidth migration parameter
by Jiri Denemark
See documentation in 1/3 for details.
Jiri Denemark (3):
Add a migration parameter for available bandwidth in switchover
virsh migrate: Add --available-switchover-bandwidth option
qemu: Add support for avail-switchover-bandwidth migration parameter
docs/manpages/virsh.rst | 12 ++++++++++++
include/libvirt/libvirt-domain.h | 18 ++++++++++++++++++
src/qemu/qemu_migration.h | 1 +
src/qemu/qemu_migration_params.c | 9 +++++++++
src/qemu/qemu_migration_params.h | 1 +
tools/virsh-domain.c | 13 +++++++++++++
6 files changed, 54 insertions(+)
--
2.48.1
1 day, 17 hours
[PATCH 0/3] Unify handling of directories used for loadable modules
by Andrea Bolognani
This solves the same problem as 7a8c2319acf2 but in a different, more
generic fashion.
Andrea Bolognani (3):
meson: Unify handling of directories used for loadable modules
rpm: Add missing Requires
rpm: Unify handling of directories used for loadable modules
libvirt.spec.in | 7 ++++---
meson.build | 5 +++++
src/locking/meson.build | 6 ++----
src/meson.build | 13 +++++++++++--
src/storage/meson.build | 2 --
src/storage_file/meson.build | 2 --
6 files changed, 22 insertions(+), 13 deletions(-)
--
2.48.1
1 day, 17 hours
[PATCH 0/8] Enable virtio-mem-ccw
by Michal Privoznik
To test these you'll need:
QEMU: v9.2.0-492-gaa910c20ec
Kernel: v6.13-rc1~206^2~46^2~3
or newer.
Michal Prívozník (8):
qemu: Do NOT autoadd NUMA node for s390
qemu_command: Use qemuBuildVirtioDevProps() to build cmd line for
virtio-mem and virtio-pmem
qemuxmlconftest: Introduce memory-hotplug-virtio-mem-s390x.xml
qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW
qemu: Validate virtio-mem-ccw
qemu: Allow virtio-mem on CCW
qemuxmlconftest: Update memory-hotplug-virtio-mem-s390x.xml
NEWS: Document virtio-mem-ccw
NEWS.rst | 5 ++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 28 +++++++--
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_postparse.c | 1 +
src/qemu/qemu_validate.c | 35 ++++++++++-
.../caps_10.0.0_s390x.xml | 1 +
...hotplug-virtio-mem-s390x.s390x-latest.args | 39 ++++++++++++
...-hotplug-virtio-mem-s390x.s390x-latest.xml | 60 +++++++++++++++++++
.../memory-hotplug-virtio-mem-s390x.xml | 57 ++++++++++++++++++
tests/qemuxmlconftest.c | 1 +
12 files changed, 227 insertions(+), 9 deletions(-)
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-s390x.s390x-latest.args
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-s390x.s390x-latest.xml
create mode 100644 tests/qemuxmlconfdata/memory-hotplug-virtio-mem-s390x.xml
--
2.45.2
1 day, 20 hours
[PATCH v5 00/18] *** qemu: block: Support block disk along with throttle filters ***
by Harikumar R
*** BLURB HERE ***
Chun Feng Wu (17):
schema: Add new domain elements to support multiple throttle groups
schema: Add new domain elements to support multiple throttle filters
config: Introduce ThrottleGroup and corresponding XML parsing
config: Introduce ThrottleFilter and corresponding XML parsing
qemu: monitor: Add support for ThrottleGroup operations
tests: Test qemuMonitorJSONGetThrottleGroup and
qemuMonitorJSONUpdateThrottleGroup
remote: New APIs for ThrottleGroup lifecycle management
qemu: Refactor qemuDomainSetBlockIoTune to extract common methods
qemu: Implement qemu driver for throttle API
qemu: helper: throttle filter nodename and preparation processing
qemu: block: Support block disk along with throttle filters
config: validate: Verify iotune, throttle group and filter
qemuxmlconftest: Add 'throttlefilter' tests
test_driver: Test throttle group lifecycle APIs
virsh: Refactor iotune options for re-use
virsh: Add support for throttle group operations
virsh: Add option "throttle-groups" to "attach_disk"
Harikumar Rajkumar (1):
tests: Test qemuxmlactivetestThrottleGroup
docs/formatdomain.rst | 47 ++
docs/manpages/virsh.rst | 135 +++-
include/libvirt/libvirt-domain.h | 21 +
src/conf/domain_conf.c | 398 ++++++++++
src/conf/domain_conf.h | 45 ++
src/conf/domain_validate.c | 119 ++-
src/conf/schemas/domaincommon.rng | 293 ++++----
src/conf/virconftypes.h | 4 +
src/driver-hypervisor.h | 22 +
src/libvirt-domain.c | 174 +++++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 7 +
src/qemu/qemu_block.c | 136 ++++
src/qemu/qemu_block.h | 49 ++
src/qemu/qemu_command.c | 180 +++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 73 +-
src/qemu/qemu_driver.c | 619 +++++++++++++---
src/qemu/qemu_hotplug.c | 33 +
src/qemu/qemu_monitor.c | 34 +
src/qemu/qemu_monitor.h | 14 +
src/qemu/qemu_monitor_json.c | 134 ++++
src/qemu/qemu_monitor_json.h | 14 +
src/remote/remote_daemon_dispatch.c | 44 ++
src/remote/remote_driver.c | 40 ++
src/remote/remote_protocol.x | 48 +-
src/remote_protocol-structs | 28 +
src/test/test_driver.c | 452 ++++++++----
tests/qemumonitorjsontest.c | 86 +++
.../throttlefilter-in.xml | 392 ++++++++++
.../throttlefilter-out.xml | 393 ++++++++++
tests/qemuxmlactivetest.c | 1 +
.../throttlefilter-invalid.x86_64-latest.err | 1 +
.../throttlefilter-invalid.xml | 89 +++
.../throttlefilter.x86_64-latest.args | 55 ++
.../throttlefilter.x86_64-latest.xml | 105 +++
tests/qemuxmlconfdata/throttlefilter.xml | 95 +++
tests/qemuxmlconftest.c | 2 +
tools/virsh-completer-domain.c | 82 +++
tools/virsh-completer-domain.h | 16 +
tools/virsh-domain.c | 680 ++++++++++++++----
41 files changed, 4649 insertions(+), 525 deletions(-)
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-in.xml
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-out.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml
--
2.39.5 (Apple Git-154)
1 day, 20 hours