From c1c5344a14e146ed23c9d39bd82b7c2c4490e6e5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 06:09:38 +0000 Subject: import libvirt-3.9.0-14.el7 --- diff --git a/.gitignore b/.gitignore index 1d9289f..b62ce7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libvirt-3.2.0.tar.xz +SOURCES/libvirt-3.9.0.tar.xz diff --git a/.libvirt.metadata b/.libvirt.metadata index e2e8aba..0db550c 100644 --- a/.libvirt.metadata +++ b/.libvirt.metadata @@ -1 +1 @@ -47d4b443fdf1e268589529018c436bbc4b413a7c SOURCES/libvirt-3.2.0.tar.xz +7aae5bfdbc859234833464a7faaa2a1cc0c2775e SOURCES/libvirt-3.9.0.tar.xz diff --git a/SOURCES/libvirt-Add-VIR_DOMAIN_JOB_OPERATION-typed-parameter.patch b/SOURCES/libvirt-Add-VIR_DOMAIN_JOB_OPERATION-typed-parameter.patch deleted file mode 100644 index adafe29..0000000 --- a/SOURCES/libvirt-Add-VIR_DOMAIN_JOB_OPERATION-typed-parameter.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 16dad808f19120275bc57e952968840417e0d091 Mon Sep 17 00:00:00 2001 -Message-Id: <16dad808f19120275bc57e952968840417e0d091@dist-git> -From: Jiri Denemark -Date: Wed, 26 Apr 2017 11:59:59 +0200 -Subject: [PATCH] Add VIR_DOMAIN_JOB_OPERATION typed parameter - -The parameter is reported by virDomainGetJobStats API and -VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event and it can be used to identify -the operation (migration, snapshot, ...) to which the reported -statistics belong. - -https://bugzilla.redhat.com/show_bug.cgi?id=1441563 - -Signed-off-by: Jiri Denemark -(cherry picked from commit b1c79d785f9385eb4ebd5e71d1d44e67f744f4d9) -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt-domain.h | 25 +++++++++++++++++++++++++ - tools/virsh-domain.c | 29 +++++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+) - -diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h -index 501996bc8..c9e96a6c9 100644 ---- a/include/libvirt/libvirt-domain.h -+++ b/include/libvirt/libvirt-domain.h -@@ -3117,6 +3117,31 @@ int virDomainGetJobStats(virDomainPtr domain, - unsigned int flags); - int virDomainAbortJob(virDomainPtr dom); - -+typedef enum { -+ VIR_DOMAIN_JOB_OPERATION_UNKNOWN = 0, -+ VIR_DOMAIN_JOB_OPERATION_START = 1, -+ VIR_DOMAIN_JOB_OPERATION_SAVE = 2, -+ VIR_DOMAIN_JOB_OPERATION_RESTORE = 3, -+ VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN = 4, -+ VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT = 5, -+ VIR_DOMAIN_JOB_OPERATION_SNAPSHOT = 6, -+ VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT = 7, -+ VIR_DOMAIN_JOB_OPERATION_DUMP = 8, -+ -+# ifdef VIR_ENUM_SENTINELS -+ VIR_DOMAIN_JOB_OPERATION_LAST -+# endif -+} virDomainJobOperation; -+ -+/** -+ * VIR_DOMAIN_JOB_OPERATION: -+ * -+ * virDomainGetJobStats field: the operation which started the job as -+ * VIR_TYPED_PARAM_INT. The values correspond to the items in -+ * virDomainJobOperation enum. -+ */ -+# define VIR_DOMAIN_JOB_OPERATION "operation" -+ - /** - * VIR_DOMAIN_JOB_TIME_ELAPSED: - * -diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c -index 4b6c13ce4..bc0ded686 100644 ---- a/tools/virsh-domain.c -+++ b/tools/virsh-domain.c -@@ -5754,6 +5754,26 @@ virshDomainJobToString(int type) - return str ? _(str) : _("unknown"); - } - -+VIR_ENUM_DECL(virshDomainJobOperation); -+VIR_ENUM_IMPL(virshDomainJobOperation, -+ VIR_DOMAIN_JOB_OPERATION_LAST, -+ N_("Unknown"), -+ N_("Start"), -+ N_("Save"), -+ N_("Restore"), -+ N_("Incoming migration"), -+ N_("Outgoing migration"), -+ N_("Snapshot"), -+ N_("Snapshot revert"), -+ N_("Dump")) -+ -+static const char * -+virshDomainJobOperationToString(int op) -+{ -+ const char *str = virshDomainJobOperationTypeToString(op); -+ return str ? _(str) : _("unknown"); -+} -+ - static bool - cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - { -@@ -5767,6 +5787,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - unsigned long long value; - unsigned int flags = 0; - int ivalue; -+ int op; - int rc; - - if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) -@@ -5836,6 +5857,14 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd) - goto cleanup; - } - -+ op = VIR_DOMAIN_JOB_OPERATION_UNKNOWN; -+ if ((rc = virTypedParamsGetInt(params, nparams, -+ VIR_DOMAIN_JOB_OPERATION, &op)) < 0) -+ goto save_error; -+ -+ vshPrint(ctl, "%-17s %-12s\n", _("Operation:"), -+ virshDomainJobOperationToString(op)); -+ - vshPrint(ctl, "%-17s %-12llu ms\n", _("Time elapsed:"), info.timeElapsed); - if ((rc = virTypedParamsGetULLong(params, nparams, - VIR_DOMAIN_JOB_TIME_ELAPSED_NET, --- -2.12.2 - diff --git a/SOURCES/libvirt-Add-capabilities-for-qemu-2.9.0-ppc64.patch b/SOURCES/libvirt-Add-capabilities-for-qemu-2.9.0-ppc64.patch deleted file mode 100644 index 41ce69d..0000000 --- a/SOURCES/libvirt-Add-capabilities-for-qemu-2.9.0-ppc64.patch +++ /dev/null @@ -1,20299 +0,0 @@ -From 7aaf4f3e62156b4b86388de24c426056bfa8499a Mon Sep 17 00:00:00 2001 -Message-Id: <7aaf4f3e62156b4b86388de24c426056bfa8499a@dist-git> -From: Shivaprasad G Bhat -Date: Thu, 3 Aug 2017 10:11:46 +0200 -Subject: [PATCH] Add capabilities for qemu-2.9.0 ppc64 - -Signed-off-by: Shivaprasad G Bhat -Reviewed-by: Andrea Bolognani -(cherry picked from commit eb56cc6f8865960687fe73b29beb8314479176a6) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1474327 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - .../caps_2.9.0.ppc64le.replies | 19188 +++++++++++++++++++ - tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml | 1062 + - tests/qemucapabilitiestest.c | 1 + - 3 files changed, 20251 insertions(+) - create mode 100644 tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies - create mode 100644 tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml - -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies -new file mode 100644 -index 0000000000..0c85f9ed45 ---- /dev/null -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies -@@ -0,0 +1,19188 @@ -+{ -+ "QMP": { -+ "version": { -+ "qemu": { -+ "micro": 0, -+ "minor": 9, -+ "major": 2 -+ }, -+ "package": " (v2.9.0)" -+ }, -+ "capabilities": [ -+ ] -+ } -+} -+ -+{ -+ "return": { -+ }, -+ "id": "libvirt-1" -+} -+ -+{ -+ "return": { -+ "qemu": { -+ "micro": 0, -+ "minor": 9, -+ "major": 2 -+ }, -+ "package": " (v2.9.0)" -+ }, -+ "id": "libvirt-2" -+} -+ -+{ -+ "return": { -+ "arch": "ppc64" -+ }, -+ "id": "libvirt-3" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "netdev_add" -+ }, -+ { -+ "name": "device_add" -+ }, -+ { -+ "name": "query-qmp-schema" -+ }, -+ { -+ "name": "xen-set-replication" -+ }, -+ { -+ "name": "xen-set-global-dirty-log" -+ }, -+ { -+ "name": "xen-save-devices-state" -+ }, -+ { -+ "name": "xen-load-devices-state" -+ }, -+ { -+ "name": "xen-colo-do-checkpoint" -+ }, -+ { -+ "name": "x-colo-lost-heartbeat" -+ }, -+ { -+ "name": "x-blockdev-remove-medium" -+ }, -+ { -+ "name": "x-blockdev-insert-medium" -+ }, -+ { -+ "name": "x-blockdev-change" -+ }, -+ { -+ "name": "transaction" -+ }, -+ { -+ "name": "trace-event-set-state" -+ }, -+ { -+ "name": "trace-event-get-state" -+ }, -+ { -+ "name": "system_wakeup" -+ }, -+ { -+ "name": "system_reset" -+ }, -+ { -+ "name": "system_powerdown" -+ }, -+ { -+ "name": "stop" -+ }, -+ { -+ "name": "set_password" -+ }, -+ { -+ "name": "set_link" -+ }, -+ { -+ "name": "send-key" -+ }, -+ { -+ "name": "screendump" -+ }, -+ { -+ "name": "ringbuf-write" -+ }, -+ { -+ "name": "ringbuf-read" -+ }, -+ { -+ "name": "remove-fd" -+ }, -+ { -+ "name": "quit" -+ }, -+ { -+ "name": "query-xen-replication-status" -+ }, -+ { -+ "name": "query-vnc-servers" -+ }, -+ { -+ "name": "query-vnc" -+ }, -+ { -+ "name": "query-vm-generation-id" -+ }, -+ { -+ "name": "query-version" -+ }, -+ { -+ "name": "query-uuid" -+ }, -+ { -+ "name": "query-tpm-types" -+ }, -+ { -+ "name": "query-tpm-models" -+ }, -+ { -+ "name": "query-tpm" -+ }, -+ { -+ "name": "query-target" -+ }, -+ { -+ "name": "query-status" -+ }, -+ { -+ "name": "query-rx-filter" -+ }, -+ { -+ "name": "query-rocker-ports" -+ }, -+ { -+ "name": "query-rocker-of-dpa-groups" -+ }, -+ { -+ "name": "query-rocker-of-dpa-flows" -+ }, -+ { -+ "name": "query-rocker" -+ }, -+ { -+ "name": "query-pci" -+ }, -+ { -+ "name": "query-named-block-nodes" -+ }, -+ { -+ "name": "query-name" -+ }, -+ { -+ "name": "query-migrate-parameters" -+ }, -+ { -+ "name": "query-migrate-capabilities" -+ }, -+ { -+ "name": "query-migrate-cache-size" -+ }, -+ { -+ "name": "query-migrate" -+ }, -+ { -+ "name": "query-mice" -+ }, -+ { -+ "name": "query-memory-devices" -+ }, -+ { -+ "name": "query-memdev" -+ }, -+ { -+ "name": "query-machines" -+ }, -+ { -+ "name": "query-kvm" -+ }, -+ { -+ "name": "query-iothreads" -+ }, -+ { -+ "name": "query-hotpluggable-cpus" -+ }, -+ { -+ "name": "query-fdsets" -+ }, -+ { -+ "name": "query-events" -+ }, -+ { -+ "name": "query-dump-guest-memory-capability" -+ }, -+ { -+ "name": "query-dump" -+ }, -+ { -+ "name": "query-cpus" -+ }, -+ { -+ "name": "query-cpu-definitions" -+ }, -+ { -+ "name": "query-commands" -+ }, -+ { -+ "name": "query-command-line-options" -+ }, -+ { -+ "name": "query-chardev-backends" -+ }, -+ { -+ "name": "query-chardev" -+ }, -+ { -+ "name": "query-blockstats" -+ }, -+ { -+ "name": "query-block-jobs" -+ }, -+ { -+ "name": "query-block" -+ }, -+ { -+ "name": "query-balloon" -+ }, -+ { -+ "name": "query-acpi-ospm-status" -+ }, -+ { -+ "name": "qom-set" -+ }, -+ { -+ "name": "qom-list-types" -+ }, -+ { -+ "name": "qom-list" -+ }, -+ { -+ "name": "qom-get" -+ }, -+ { -+ "name": "qmp_capabilities" -+ }, -+ { -+ "name": "pmemsave" -+ }, -+ { -+ "name": "object-del" -+ }, -+ { -+ "name": "object-add" -+ }, -+ { -+ "name": "netdev_del" -+ }, -+ { -+ "name": "nbd-server-stop" -+ }, -+ { -+ "name": "nbd-server-start" -+ }, -+ { -+ "name": "nbd-server-add" -+ }, -+ { -+ "name": "migrate_set_speed" -+ }, -+ { -+ "name": "migrate_set_downtime" -+ }, -+ { -+ "name": "migrate_cancel" -+ }, -+ { -+ "name": "migrate-start-postcopy" -+ }, -+ { -+ "name": "migrate-set-parameters" -+ }, -+ { -+ "name": "migrate-set-capabilities" -+ }, -+ { -+ "name": "migrate-set-cache-size" -+ }, -+ { -+ "name": "migrate-incoming" -+ }, -+ { -+ "name": "migrate" -+ }, -+ { -+ "name": "memsave" -+ }, -+ { -+ "name": "input-send-event" -+ }, -+ { -+ "name": "inject-nmi" -+ }, -+ { -+ "name": "human-monitor-command" -+ }, -+ { -+ "name": "getfd" -+ }, -+ { -+ "name": "expire_password" -+ }, -+ { -+ "name": "eject" -+ }, -+ { -+ "name": "dump-guest-memory" -+ }, -+ { -+ "name": "drive-mirror" -+ }, -+ { -+ "name": "drive-backup" -+ }, -+ { -+ "name": "device_del" -+ }, -+ { -+ "name": "device-list-properties" -+ }, -+ { -+ "name": "cpu-add" -+ }, -+ { -+ "name": "cpu" -+ }, -+ { -+ "name": "cont" -+ }, -+ { -+ "name": "closefd" -+ }, -+ { -+ "name": "client_migrate_info" -+ }, -+ { -+ "name": "chardev-remove" -+ }, -+ { -+ "name": "chardev-add" -+ }, -+ { -+ "name": "change-vnc-password" -+ }, -+ { -+ "name": "change-backing-file" -+ }, -+ { -+ "name": "change" -+ }, -+ { -+ "name": "blockdev-snapshot-sync" -+ }, -+ { -+ "name": "blockdev-snapshot-internal-sync" -+ }, -+ { -+ "name": "blockdev-snapshot-delete-internal-sync" -+ }, -+ { -+ "name": "blockdev-snapshot" -+ }, -+ { -+ "name": "blockdev-open-tray" -+ }, -+ { -+ "name": "blockdev-mirror" -+ }, -+ { -+ "name": "blockdev-del" -+ }, -+ { -+ "name": "blockdev-close-tray" -+ }, -+ { -+ "name": "blockdev-change-medium" -+ }, -+ { -+ "name": "blockdev-backup" -+ }, -+ { -+ "name": "blockdev-add" -+ }, -+ { -+ "name": "block_set_io_throttle" -+ }, -+ { -+ "name": "block_resize" -+ }, -+ { -+ "name": "block_passwd" -+ }, -+ { -+ "name": "block-stream" -+ }, -+ { -+ "name": "block-set-write-threshold" -+ }, -+ { -+ "name": "block-job-set-speed" -+ }, -+ { -+ "name": "block-job-resume" -+ }, -+ { -+ "name": "block-job-pause" -+ }, -+ { -+ "name": "block-job-complete" -+ }, -+ { -+ "name": "block-job-cancel" -+ }, -+ { -+ "name": "block-dirty-bitmap-remove" -+ }, -+ { -+ "name": "block-dirty-bitmap-clear" -+ }, -+ { -+ "name": "block-dirty-bitmap-add" -+ }, -+ { -+ "name": "block-commit" -+ }, -+ { -+ "name": "balloon" -+ }, -+ { -+ "name": "add_client" -+ }, -+ { -+ "name": "add-fd" -+ } -+ ], -+ "id": "libvirt-4" -+} -+ -+{ -+ "return": { -+ "fd": 17, -+ "fdset-id": 0 -+ }, -+ "id": "libvirt-5" -+} -+ -+{ -+ "id": "libvirt-6", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'bogus' not found" -+ } -+} -+ -+{ -+ "return": { -+ "enabled": true, -+ "present": true -+ }, -+ "id": "libvirt-7" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "WATCHDOG" -+ }, -+ { -+ "name": "WAKEUP" -+ }, -+ { -+ "name": "VSERPORT_CHANGE" -+ }, -+ { -+ "name": "VNC_INITIALIZED" -+ }, -+ { -+ "name": "VNC_DISCONNECTED" -+ }, -+ { -+ "name": "VNC_CONNECTED" -+ }, -+ { -+ "name": "SUSPEND_DISK" -+ }, -+ { -+ "name": "SUSPEND" -+ }, -+ { -+ "name": "STOP" -+ }, -+ { -+ "name": "SPICE_MIGRATE_COMPLETED" -+ }, -+ { -+ "name": "SPICE_INITIALIZED" -+ }, -+ { -+ "name": "SPICE_DISCONNECTED" -+ }, -+ { -+ "name": "SPICE_CONNECTED" -+ }, -+ { -+ "name": "SHUTDOWN" -+ }, -+ { -+ "name": "RTC_CHANGE" -+ }, -+ { -+ "name": "RESUME" -+ }, -+ { -+ "name": "RESET" -+ }, -+ { -+ "name": "QUORUM_REPORT_BAD" -+ }, -+ { -+ "name": "QUORUM_FAILURE" -+ }, -+ { -+ "name": "POWERDOWN" -+ }, -+ { -+ "name": "NIC_RX_FILTER_CHANGED" -+ }, -+ { -+ "name": "MIGRATION_PASS" -+ }, -+ { -+ "name": "MIGRATION" -+ }, -+ { -+ "name": "MEM_UNPLUG_ERROR" -+ }, -+ { -+ "name": "GUEST_PANICKED" -+ }, -+ { -+ "name": "DUMP_COMPLETED" -+ }, -+ { -+ "name": "DEVICE_TRAY_MOVED" -+ }, -+ { -+ "name": "DEVICE_DELETED" -+ }, -+ { -+ "name": "BLOCK_WRITE_THRESHOLD" -+ }, -+ { -+ "name": "BLOCK_JOB_READY" -+ }, -+ { -+ "name": "BLOCK_JOB_ERROR" -+ }, -+ { -+ "name": "BLOCK_JOB_COMPLETED" -+ }, -+ { -+ "name": "BLOCK_JOB_CANCELLED" -+ }, -+ { -+ "name": "BLOCK_IO_ERROR" -+ }, -+ { -+ "name": "BLOCK_IMAGE_CORRUPTED" -+ }, -+ { -+ "name": "BALLOON_CHANGE" -+ }, -+ { -+ "name": "ACPI_DEVICE_OST" -+ } -+ ], -+ "id": "libvirt-8" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "vhost-vsock-pci" -+ }, -+ { -+ "name": "scsi-generic" -+ }, -+ { -+ "name": "qio-channel-tls" -+ }, -+ { -+ "name": "virtio-mmio" -+ }, -+ { -+ "name": "scsi-hd" -+ }, -+ { -+ "name": "MPC8541E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "isa-m48t59" -+ }, -+ { -+ "name": "405GPb-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8544E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-bot" -+ }, -+ { -+ "name": "chardev-null" -+ }, -+ { -+ "name": "750_v3.1-powerpc64-cpu" -+ }, -+ { -+ "name": "dec-21154" -+ }, -+ { -+ "name": "chardev-parallel" -+ }, -+ { -+ "name": "qemu-xhci" -+ }, -+ { -+ "name": "spapr-pci-vfio-host-bridge" -+ }, -+ { -+ "name": "e300c2-powerpc64-cpu" -+ }, -+ { -+ "name": "lsi53c895a" -+ }, -+ { -+ "name": "MPC8568-powerpc64-cpu" -+ }, -+ { -+ "name": "401-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8379-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-keyboard-pci" -+ }, -+ { -+ "name": "40p-machine" -+ }, -+ { -+ "name": "750cxe_v3.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8349EA-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxr-powerpc64-cpu" -+ }, -+ { -+ "name": "750cl_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "G2HiP4-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "STB04-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-audio" -+ }, -+ { -+ "name": "ide-hd" -+ }, -+ { -+ "name": "virtio-net-device" -+ }, -+ { -+ "name": "601_v0-powerpc64-cpu" -+ }, -+ { -+ "name": "powernv-chip-POWER9" -+ }, -+ { -+ "name": "powernv-chip-POWER8" -+ }, -+ { -+ "name": "chardev-pty" -+ }, -+ { -+ "name": "ppc4xx-pcihost" -+ }, -+ { -+ "name": "spapr-vio-bus" -+ }, -+ { -+ "name": "ppc4xx-host-bridge" -+ }, -+ { -+ "name": "750fx_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "macio-newworld" -+ }, -+ { -+ "name": "MPC8377E-powerpc64-cpu" -+ }, -+ { -+ "name": "970fx_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "440EPa-powerpc64-cpu" -+ }, -+ { -+ "name": "SUNW,fdtwo" -+ }, -+ { -+ "name": "isa-pcspk" -+ }, -+ { -+ "name": "dec-21154-p2p-bridge" -+ }, -+ { -+ "name": "603e_v4.1-powerpc64-cpu" -+ }, -+ { -+ "name": "7445_v3.3-powerpc64-cpu" -+ }, -+ { -+ "name": "970MP_v1.1-spapr-cpu-core" -+ }, -+ { -+ "name": "G2leGP3-powerpc64-cpu" -+ }, -+ { -+ "name": "spapr-vscsi" -+ }, -+ { -+ "name": "loader" -+ }, -+ { -+ "name": "xlnx.xps-ethernetlite" -+ }, -+ { -+ "name": "7410_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "filter-rewriter" -+ }, -+ { -+ "name": "platform-bus-device" -+ }, -+ { -+ "name": "403GA-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-serial-pci" -+ }, -+ { -+ "name": "MPC5200_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxe_v2.4b-powerpc64-cpu" -+ }, -+ { -+ "name": "ics" -+ }, -+ { -+ "name": "MPC8610-powerpc64-cpu" -+ }, -+ { -+ "name": "icp" -+ }, -+ { -+ "name": "virtio-crypto-device" -+ }, -+ { -+ "name": "MPC8548E_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.5-powerpc64-cpu" -+ }, -+ { -+ "name": "7447_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "970fx_v3.1-powerpc64-cpu" -+ }, -+ { -+ "name": "7457_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-bt-dongle" -+ }, -+ { -+ "name": "virtio-input-host-pci" -+ }, -+ { -+ "name": "xlnx.xps-intc" -+ }, -+ { -+ "name": "MPC8343EA-powerpc64-cpu" -+ }, -+ { -+ "name": "e1000" -+ }, -+ { -+ "name": "mpc8xxx_gpio" -+ }, -+ { -+ "name": "401F2-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-mux" -+ }, -+ { -+ "name": "pseries-2.1-machine" -+ }, -+ { -+ "name": "ich9-usb-uhci6" -+ }, -+ { -+ "name": "ich9-usb-uhci5" -+ }, -+ { -+ "name": "usb-mtp" -+ }, -+ { -+ "name": "ich9-usb-uhci3" -+ }, -+ { -+ "name": "cmd646-ide" -+ }, -+ { -+ "name": "ich9-usb-uhci4" -+ }, -+ { -+ "name": "sysbus-ahci" -+ }, -+ { -+ "name": "e500v2_v22-powerpc64-cpu" -+ }, -+ { -+ "name": "ich9-usb-uhci2" -+ }, -+ { -+ "name": "ich9-usb-uhci1" -+ }, -+ { -+ "name": "MPC8533E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "7447A_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "tpci200" -+ }, -+ { -+ "name": "memory-backend-file" -+ }, -+ { -+ "name": "604r-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-socket" -+ }, -+ { -+ "name": "sysbus-m48t59" -+ }, -+ { -+ "name": "603e7v2-powerpc64-cpu" -+ }, -+ { -+ "name": "970mp_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "uni-north-internal-pci-pcihost" -+ }, -+ { -+ "name": "rtl8139" -+ }, -+ { -+ "name": "pci-bridge" -+ }, -+ { -+ "name": "chardev-hci" -+ }, -+ { -+ "name": "MPC8347EAT-powerpc64-cpu" -+ }, -+ { -+ "name": "megasas" -+ }, -+ { -+ "name": "405GPc-powerpc64-cpu" -+ }, -+ { -+ "name": "7455_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "7400_v2.8-powerpc64-cpu" -+ }, -+ { -+ "name": "u3-agp" -+ }, -+ { -+ "name": "container" -+ }, -+ { -+ "name": "7450_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "scsi-block" -+ }, -+ { -+ "name": "7451_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "unimplemented-device" -+ }, -+ { -+ "name": "603e_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "eTSEC" -+ }, -+ { -+ "name": "scsi-cd" -+ }, -+ { -+ "name": "uni-north-agp" -+ }, -+ { -+ "name": "440EPX-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER8_v2.0-spapr-cpu-core" -+ }, -+ { -+ "name": "MPC5200B_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-uas" -+ }, -+ { -+ "name": "accel" -+ }, -+ { -+ "name": "740p-powerpc64-cpu" -+ }, -+ { -+ "name": "floppy-bus" -+ }, -+ { -+ "name": "virtio-vga" -+ }, -+ { -+ "name": "440-Xilinx-powerpc64-cpu" -+ }, -+ { -+ "name": "vhost-scsi-pci" -+ }, -+ { -+ "name": "spapr-rng" -+ }, -+ { -+ "name": "xlnx.xps-timer" -+ }, -+ { -+ "name": "isa-serial" -+ }, -+ { -+ "name": "virtio-serial-device" -+ }, -+ { -+ "name": "970_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "tls-creds-anon" -+ }, -+ { -+ "name": "sdhci-pci" -+ }, -+ { -+ "name": "POWER7_v2.3-spapr-cpu-core" -+ }, -+ { -+ "name": "chardev-gdb" -+ }, -+ { -+ "name": "pc-testdev" -+ }, -+ { -+ "name": "icskvm" -+ }, -+ { -+ "name": "escc" -+ }, -+ { -+ "name": "fw_cfg_mem" -+ }, -+ { -+ "name": "603e_v3-powerpc64-cpu" -+ }, -+ { -+ "name": "pseries-2.3-machine" -+ }, -+ { -+ "name": "MPC8347T-powerpc64-cpu" -+ }, -+ { -+ "name": "7445_v3.4-powerpc64-cpu" -+ }, -+ { -+ "name": "taihu-machine" -+ }, -+ { -+ "name": "icp-kvm" -+ }, -+ { -+ "name": "MPC8555_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "G2-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-balloon-pci" -+ }, -+ { -+ "name": "ide-cd" -+ }, -+ { -+ "name": "usb-ccid" -+ }, -+ { -+ "name": "750p-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "pseries-2.2-machine" -+ }, -+ { -+ "name": "powernv-cpu-core-POWER8NVL" -+ }, -+ { -+ "name": "403GCX-powerpc64-cpu" -+ }, -+ { -+ "name": "sb16" -+ }, -+ { -+ "name": "iothread" -+ }, -+ { -+ "name": "750gl-powerpc64-cpu" -+ }, -+ { -+ "name": "filter-redirector" -+ }, -+ { -+ "name": "7410_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8347EP-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC5200_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "7450_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "750_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER7_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "vhost-vsock-device" -+ }, -+ { -+ "name": "MPC8545E_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "cs4231a" -+ }, -+ { -+ "name": "virtio-input-host-device" -+ }, -+ { -+ "name": "970MP_v1.0-spapr-cpu-core" -+ }, -+ { -+ "name": "403GB-powerpc64-cpu" -+ }, -+ { -+ "name": "G2le-powerpc64-cpu" -+ }, -+ { -+ "name": "i82559er" -+ }, -+ { -+ "name": "MPC8548E_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.6-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.8-powerpc64-cpu" -+ }, -+ { -+ "name": "604e_v2.4-powerpc64-cpu" -+ }, -+ { -+ "name": "ivshmem-doorbell" -+ }, -+ { -+ "name": "750cxe_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "750cx_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-udp" -+ }, -+ { -+ "name": "MPC8343-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-rng-device" -+ }, -+ { -+ "name": "G2leLS-powerpc64-cpu" -+ }, -+ { -+ "name": "isa-parallel" -+ }, -+ { -+ "name": "MPC8548E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "adlib" -+ }, -+ { -+ "name": "602-powerpc64-cpu" -+ }, -+ { -+ "name": "pci-bridge-seat" -+ }, -+ { -+ "name": "hda-micro" -+ }, -+ { -+ "name": "fw_cfg_io" -+ }, -+ { -+ "name": "dc390" -+ }, -+ { -+ "name": "POWER5+_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "740_v3.0-powerpc64-cpu" -+ }, -+ { -+ "name": "7441_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "qemu,register" -+ }, -+ { -+ "name": "IDE" -+ }, -+ { -+ "name": "MPC8533_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "e300c3-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8641D-powerpc64-cpu" -+ }, -+ { -+ "name": "401E2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8347EAP-powerpc64-cpu" -+ }, -+ { -+ "name": "spapr-pci-host-bridge" -+ }, -+ { -+ "name": "memory-backend-ram" -+ }, -+ { -+ "name": "am53c974" -+ }, -+ { -+ "name": "pseries-2.5-machine" -+ }, -+ { -+ "name": "750cx_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER7+_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-blk-device" -+ }, -+ { -+ "name": "qio-channel-file" -+ }, -+ { -+ "name": "745_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "601_v1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8544_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "740_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "qio-channel-websock" -+ }, -+ { -+ "name": "pseries-2.4-machine" -+ }, -+ { -+ "name": "mc146818rtc" -+ }, -+ { -+ "name": "spapr-nvram" -+ }, -+ { -+ "name": "POWER9_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-msmouse" -+ }, -+ { -+ "name": "uni-north-pci" -+ }, -+ { -+ "name": "chardev-pipe" -+ }, -+ { -+ "name": "cryptodev-backend-builtin" -+ }, -+ { -+ "name": "750fx_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "hda-output" -+ }, -+ { -+ "name": "603e_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC603-powerpc64-cpu" -+ }, -+ { -+ "name": "sysbus-m48t08" -+ }, -+ { -+ "name": "raven" -+ }, -+ { -+ "name": "440EPb-powerpc64-cpu" -+ }, -+ { -+ "name": "VGA" -+ }, -+ { -+ "name": "i8257" -+ }, -+ { -+ "name": "sysbus-m48t02" -+ }, -+ { -+ "name": "pc87312" -+ }, -+ { -+ "name": "mptsas1068" -+ }, -+ { -+ "name": "edu" -+ }, -+ { -+ "name": "MPC8347P-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-mouse-pci" -+ }, -+ { -+ "name": "740_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "7455_v3.2-powerpc64-cpu" -+ }, -+ { -+ "name": "vfio-pci-igd-lpc-bridge" -+ }, -+ { -+ "name": "spapr-vlan" -+ }, -+ { -+ "name": "603e_v4-powerpc64-cpu" -+ }, -+ { -+ "name": "HDA" -+ }, -+ { -+ "name": "7447_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "603e_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "pseries-2.8-machine" -+ }, -+ { -+ "name": "MPC8543E_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "floppy" -+ }, -+ { -+ "name": "macio-oldworld" -+ }, -+ { -+ "name": "qemu:memory-region" -+ }, -+ { -+ "name": "adb-keyboard" -+ }, -+ { -+ "name": "G2LS-powerpc64-cpu" -+ }, -+ { -+ "name": "sysbus-ohci" -+ }, -+ { -+ "name": "7445_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "pseries-2.7-machine" -+ }, -+ { -+ "name": "755_v2.4-powerpc64-cpu" -+ }, -+ { -+ "name": "7450_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "e600-powerpc64-cpu" -+ }, -+ { -+ "name": "qio-channel-command" -+ }, -+ { -+ "name": "chardev-ringbuf" -+ }, -+ { -+ "name": "usb-serial" -+ }, -+ { -+ "name": "x2vp20-powerpc64-cpu" -+ }, -+ { -+ "name": "qtest-accel" -+ }, -+ { -+ "name": "pseries-2.6-machine" -+ }, -+ { -+ "name": "750l_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "750fl-powerpc64-cpu" -+ }, -+ { -+ "name": "vt82c686b-usb-uhci" -+ }, -+ { -+ "name": "405D2-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-blk-pci" -+ }, -+ { -+ "name": "virtio-gpu-device" -+ }, -+ { -+ "name": "MPC8560_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "750gx_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "System" -+ }, -+ { -+ "name": "lsi53c810" -+ }, -+ { -+ "name": "uni-north-agp-pcihost" -+ }, -+ { -+ "name": "IOP480-powerpc64-cpu" -+ }, -+ { -+ "name": "603e7t-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8548E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "405GPd-powerpc64-cpu" -+ }, -+ { -+ "name": "603-powerpc64-cpu" -+ }, -+ { -+ "name": "G2GP-powerpc64-cpu" -+ }, -+ { -+ "name": "7400_v2.9-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxe_v3.1b-powerpc64-cpu" -+ }, -+ { -+ "name": "G2leGP-powerpc64-cpu" -+ }, -+ { -+ "name": "7450_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-file" -+ }, -+ { -+ "name": "7448_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "mac99-machine" -+ }, -+ { -+ "name": "e300c4-powerpc64-cpu" -+ }, -+ { -+ "name": "750l_v3.0-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC5200B_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "PCIE" -+ }, -+ { -+ "name": "qio-dns-resolver" -+ }, -+ { -+ "name": "750cx_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "cuda" -+ }, -+ { -+ "name": "604e_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8572E-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-serial-bus" -+ }, -+ { -+ "name": "vhost-scsi" -+ }, -+ { -+ "name": "secondary-vga" -+ }, -+ { -+ "name": "401D2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8544_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "e500-ccsr" -+ }, -+ { -+ "name": "601_v2-powerpc64-cpu" -+ }, -+ { -+ "name": "405EP-powerpc64-cpu" -+ }, -+ { -+ "name": "ccid-bus" -+ }, -+ { -+ "name": "pci-ohci" -+ }, -+ { -+ "name": "cfi.pflash02" -+ }, -+ { -+ "name": "cfi.pflash01" -+ }, -+ { -+ "name": "pseries-2.9-machine" -+ }, -+ { -+ "name": "usb-hub" -+ }, -+ { -+ "name": "750fx_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "405LP-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8541_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8555_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "input-linux" -+ }, -+ { -+ "name": "x2vp4-powerpc64-cpu" -+ }, -+ { -+ "name": "7410_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "7400_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "740_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC5200_v12-powerpc64-cpu" -+ }, -+ { -+ "name": "7448_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "xlnx.xps-uartlite" -+ }, -+ { -+ "name": "e5500-powerpc64-cpu" -+ }, -+ { -+ "name": "pci-serial" -+ }, -+ { -+ "name": "403GC-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.7-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8543_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "i8042" -+ }, -+ { -+ "name": "750cxe_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8543E_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "i82559c" -+ }, -+ { -+ "name": "i82559b" -+ }, -+ { -+ "name": "i82559a" -+ }, -+ { -+ "name": "SCSI" -+ }, -+ { -+ "name": "MPC8543E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "rocker" -+ }, -+ { -+ "name": "pcnet" -+ }, -+ { -+ "name": "rng-egd" -+ }, -+ { -+ "name": "405CRa-powerpc64-cpu" -+ }, -+ { -+ "name": "spapr-tce-table" -+ }, -+ { -+ "name": "7400_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-testdev" -+ }, -+ { -+ "name": "MPC8349-powerpc64-cpu" -+ }, -+ { -+ "name": "e200z5-powerpc64-cpu" -+ }, -+ { -+ "name": "740_v3.1-powerpc64-cpu" -+ }, -+ { -+ "name": "filter-dump" -+ }, -+ { -+ "name": "MPC8533_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "i82558b" -+ }, -+ { -+ "name": "G2H4-powerpc64-cpu" -+ }, -+ { -+ "name": "i82558a" -+ }, -+ { -+ "name": "MPC8560_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "smbus-eeprom" -+ }, -+ { -+ "name": "host-powerpc64-cpu" -+ }, -+ { -+ "name": "i82801" -+ }, -+ { -+ "name": "tls-creds-x509" -+ }, -+ { -+ "name": "virtio-net-pci" -+ }, -+ { -+ "name": "virtio-keyboard-device" -+ }, -+ { -+ "name": "i82562" -+ }, -+ { -+ "name": "usb-net" -+ }, -+ { -+ "name": "MPC8560_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER7+_v2.1-spapr-cpu-core" -+ }, -+ { -+ "name": "603e_v1.3-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8568E-powerpc64-cpu" -+ }, -+ { -+ "name": "i82557c" -+ }, -+ { -+ "name": "i82557b" -+ }, -+ { -+ "name": "i82557a" -+ }, -+ { -+ "name": "chardev-memory" -+ }, -+ { -+ "name": "isa-i8259" -+ }, -+ { -+ "name": "virtio-gpu-pci" -+ }, -+ { -+ "name": "nec-usb-xhci" -+ }, -+ { -+ "name": "pc-dimm" -+ }, -+ { -+ "name": "host-spapr-cpu-core" -+ }, -+ { -+ "name": "usb-mouse" -+ }, -+ { -+ "name": "sdhci-bus" -+ }, -+ { -+ "name": "i82551" -+ }, -+ { -+ "name": "i82550" -+ }, -+ { -+ "name": "405EZ-powerpc64-cpu" -+ }, -+ { -+ "name": "7455_v3.3-powerpc64-cpu" -+ }, -+ { -+ "name": "sd-bus" -+ }, -+ { -+ "name": "apple-desktop-bus" -+ }, -+ { -+ "name": "e500v2_v30-powerpc64-cpu" -+ }, -+ { -+ "name": "macio-ide" -+ }, -+ { -+ "name": "401C2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8541_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-crypto-pci" -+ }, -+ { -+ "name": "755_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "filter-mirror" -+ }, -+ { -+ "name": "ich9-usb-ehci1" -+ }, -+ { -+ "name": "ich9-usb-ehci2" -+ }, -+ { -+ "name": "isa-ide" -+ }, -+ { -+ "name": "vfio-pci" -+ }, -+ { -+ "name": "prep-machine" -+ }, -+ { -+ "name": "irq" -+ }, -+ { -+ "name": "405GPR-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER8E_v2.1-spapr-cpu-core" -+ }, -+ { -+ "name": "750l_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "7410_v1.3-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.5-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8572-powerpc64-cpu" -+ }, -+ { -+ "name": "7450_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "7457_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "qio-channel-socket" -+ }, -+ { -+ "name": "ich9-ahci" -+ }, -+ { -+ "name": "7457A_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER8NVL_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8347AT-powerpc64-cpu" -+ }, -+ { -+ "name": "chardev-stdio" -+ }, -+ { -+ "name": "piix3-usb-uhci" -+ }, -+ { -+ "name": "virtserialport" -+ }, -+ { -+ "name": "MPC8543E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "pvscsi" -+ }, -+ { -+ "name": "MPC8548_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxe_v2.4-powerpc64-cpu" -+ }, -+ { -+ "name": "i82378" -+ }, -+ { -+ "name": "7447A_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "powernv-chip-POWER8NVL" -+ }, -+ { -+ "name": "750gx_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "gus" -+ }, -+ { -+ "name": "e500_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "i82374" -+ }, -+ { -+ "name": "pnv-lpc" -+ }, -+ { -+ "name": "7445_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8543_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8540_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "604-powerpc64-cpu" -+ }, -+ { -+ "name": "405CRb-powerpc64-cpu" -+ }, -+ { -+ "name": "g3beige-machine" -+ }, -+ { -+ "name": "7400_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "IndustryPack" -+ }, -+ { -+ "name": "powernv-chip-POWER8E" -+ }, -+ { -+ "name": "7441_v2.3-powerpc64-cpu" -+ }, -+ { -+ "name": "7448_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8377-powerpc64-cpu" -+ }, -+ { -+ "name": "401A1-powerpc64-cpu" -+ }, -+ { -+ "name": "603e7-powerpc64-cpu" -+ }, -+ { -+ "name": "cryptodev-backend" -+ }, -+ { -+ "name": "adb-mouse" -+ }, -+ { -+ "name": "Npe405L-powerpc64-cpu" -+ }, -+ { -+ "name": "or-irq" -+ }, -+ { -+ "name": "750cx_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8343E-powerpc64-cpu" -+ }, -+ { -+ "name": "powernv-cpu-core-POWER9" -+ }, -+ { -+ "name": "powernv-cpu-core-POWER8" -+ }, -+ { -+ "name": "7451_v2.10-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-rng-pci" -+ }, -+ { -+ "name": "chardev-vc" -+ }, -+ { -+ "name": "usb-ehci" -+ }, -+ { -+ "name": "bamboo-machine" -+ }, -+ { -+ "name": "filter-replay" -+ }, -+ { -+ "name": "G2leGP1-powerpc64-cpu" -+ }, -+ { -+ "name": "603e_v1.4-powerpc64-cpu" -+ }, -+ { -+ "name": "970mp_v1.1-spapr-cpu-core" -+ }, -+ { -+ "name": "dec-21154-sysbus" -+ }, -+ { -+ "name": "virtio-9p-pci" -+ }, -+ { -+ "name": "spapr-vty" -+ }, -+ { -+ "name": "e1000-82545em" -+ }, -+ { -+ "name": "chardev-wctablet" -+ }, -+ { -+ "name": "7441_v2.10-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8567E-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER5+_v2.1-spapr-cpu-core" -+ }, -+ { -+ "name": "7400_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "e1000-82544gc" -+ }, -+ { -+ "name": "740_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "7448_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "7455_v3.4-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER8NVL_v1.0-spapr-cpu-core" -+ }, -+ { -+ "name": "prep-systemio" -+ }, -+ { -+ "name": "MPC8547E_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.8-powerpc64-cpu" -+ }, -+ { -+ "name": "e500-spin" -+ }, -+ { -+ "name": "MPC8543_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8349E-powerpc64-cpu" -+ }, -+ { -+ "name": "filter-buffer" -+ }, -+ { -+ "name": "mpc8544ds-machine" -+ }, -+ { -+ "name": "pci-serial-4x" -+ }, -+ { -+ "name": "401B2-powerpc64-cpu" -+ }, -+ { -+ "name": "ich9-intel-hda" -+ }, -+ { -+ "name": "virtio-9p-device" -+ }, -+ { -+ "name": "MPC8347AP-powerpc64-cpu" -+ }, -+ { -+ "name": "ivshmem" -+ }, -+ { -+ "name": "e500v2_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8379E-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-scsi-pci" -+ }, -+ { -+ "name": "e200z6-powerpc64-cpu" -+ }, -+ { -+ "name": "7457A_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8555E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "qemu-console" -+ }, -+ { -+ "name": "ppce500-machine" -+ }, -+ { -+ "name": "virtio-pci-bus" -+ }, -+ { -+ "name": "750l_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "ISA" -+ }, -+ { -+ "name": "MPC8541E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "ipoctal232" -+ }, -+ { -+ "name": "mpc8544-guts" -+ }, -+ { -+ "name": "uni-north-pci-pcihost" -+ }, -+ { -+ "name": "MPC8548_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "pci-testdev" -+ }, -+ { -+ "name": "405GPa-powerpc64-cpu" -+ }, -+ { -+ "name": "piix4-usb-uhci" -+ }, -+ { -+ "name": "7400_v2.6-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-tablet-device" -+ }, -+ { -+ "name": "Npe405H2-powerpc64-cpu" -+ }, -+ { -+ "name": "750_v3.0-powerpc64-cpu" -+ }, -+ { -+ "name": "powernv-machine" -+ }, -+ { -+ "name": "ES1370" -+ }, -+ { -+ "name": "603e7v-powerpc64-cpu" -+ }, -+ { -+ "name": "openpic" -+ }, -+ { -+ "name": "Npe405H-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8548_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8545_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8567-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "e500_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxe_v3.0-powerpc64-cpu" -+ }, -+ { -+ "name": "G2HiP3-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8378-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8343A-powerpc64-cpu" -+ }, -+ { -+ "name": "STB03-powerpc64-cpu" -+ }, -+ { -+ "name": "tcg-accel" -+ }, -+ { -+ "name": "750_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "virtconsole" -+ }, -+ { -+ "name": "MPC8540_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "750l_v3.2-powerpc64-cpu" -+ }, -+ { -+ "name": "pci-serial-2x" -+ }, -+ { -+ "name": "ne2k_isa" -+ }, -+ { -+ "name": "isa-fdc" -+ }, -+ { -+ "name": "chardev-serial" -+ }, -+ { -+ "name": "colo-compare" -+ }, -+ { -+ "name": "745_v2.4-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-mmio-bus" -+ }, -+ { -+ "name": "virtio-tablet-pci" -+ }, -+ { -+ "name": "e1000e" -+ }, -+ { -+ "name": "usb-bus" -+ }, -+ { -+ "name": "7445_v3.2-powerpc64-cpu" -+ }, -+ { -+ "name": "rs6000-mc" -+ }, -+ { -+ "name": "usb-storage" -+ }, -+ { -+ "name": "PCI" -+ }, -+ { -+ "name": "kvm-openpic" -+ }, -+ { -+ "name": "esp" -+ }, -+ { -+ "name": "scsi-disk" -+ }, -+ { -+ "name": "virtex-ml507-machine" -+ }, -+ { -+ "name": "usb-kbd" -+ }, -+ { -+ "name": "750_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "e500-host-bridge" -+ }, -+ { -+ "name": "7410_v1.4-powerpc64-cpu" -+ }, -+ { -+ "name": "Npe4GS3-powerpc64-cpu" -+ }, -+ { -+ "name": "ne2k_pci" -+ }, -+ { -+ "name": "isabus-bridge" -+ }, -+ { -+ "name": "970mp_v1.0-spapr-cpu-core" -+ }, -+ { -+ "name": "ivshmem-plain" -+ }, -+ { -+ "name": "755_v2.6-powerpc64-cpu" -+ }, -+ { -+ "name": "604e_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "qio-channel-buffer" -+ }, -+ { -+ "name": "970fx_v3.0-powerpc64-cpu" -+ }, -+ { -+ "name": "7457_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "u3-agp-pcihost" -+ }, -+ { -+ "name": "spapr-vio-bridge" -+ }, -+ { -+ "name": "secret" -+ }, -+ { -+ "name": "hda-duplex" -+ }, -+ { -+ "name": "raven-pcihost" -+ }, -+ { -+ "name": "spapr-dr-connector" -+ }, -+ { -+ "name": "allwinner-ahci" -+ }, -+ { -+ "name": "nvme" -+ }, -+ { -+ "name": "sysbus-fdc" -+ }, -+ { -+ "name": "405D4-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8544E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-balloon-device" -+ }, -+ { -+ "name": "MPC8641-powerpc64-cpu" -+ }, -+ { -+ "name": "none-machine" -+ }, -+ { -+ "name": "750fx_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "750gx_v1.2-powerpc64-cpu" -+ }, -+ { -+ "name": "megasas-gen2" -+ }, -+ { -+ "name": "AC97" -+ }, -+ { -+ "name": "usb-tablet" -+ }, -+ { -+ "name": "970fx_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "e300c1-powerpc64-cpu" -+ }, -+ { -+ "name": "e500v2_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8540_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "7400_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8543_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8533E_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "7447A_v1.1-powerpc64-cpu" -+ }, -+ { -+ "name": "405CRc-powerpc64-cpu" -+ }, -+ { -+ "name": "740e-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-braille" -+ }, -+ { -+ "name": "440-Xilinx-w-dfpu-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8555E_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "970mp_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "603e7v1-powerpc64-cpu" -+ }, -+ { -+ "name": "e500mc-powerpc64-cpu" -+ }, -+ { -+ "name": "e500v2_v10-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8378E-powerpc64-cpu" -+ }, -+ { -+ "name": "intel-hda" -+ }, -+ { -+ "name": "kvm-accel" -+ }, -+ { -+ "name": "7400_v2.7-powerpc64-cpu" -+ }, -+ { -+ "name": "virtio-scsi-device" -+ }, -+ { -+ "name": "603p-powerpc64-cpu" -+ }, -+ { -+ "name": "grackle" -+ }, -+ { -+ "name": "970_v2.2-spapr-cpu-core" -+ }, -+ { -+ "name": "Cobra-powerpc64-cpu" -+ }, -+ { -+ "name": "POWER8E_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "750fx_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "usb-wacom-tablet" -+ }, -+ { -+ "name": "970fx_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8548_v11-powerpc64-cpu" -+ }, -+ { -+ "name": "MPC8545_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "i2c-bus" -+ }, -+ { -+ "name": "virtio-mouse-device" -+ }, -+ { -+ "name": "750e-powerpc64-cpu" -+ }, -+ { -+ "name": "isa-pit" -+ }, -+ { -+ "name": "macio-nvram" -+ }, -+ { -+ "name": "POWER9_v1.0-spapr-cpu-core" -+ }, -+ { -+ "name": "powernv-cpu-core-POWER8E" -+ }, -+ { -+ "name": "grackle-pcihost" -+ }, -+ { -+ "name": "ide-drive" -+ }, -+ { -+ "name": "ref405ep-machine" -+ }, -+ { -+ "name": "MPC8349A-powerpc64-cpu" -+ }, -+ { -+ "name": "401G2-powerpc64-cpu" -+ }, -+ { -+ "name": "generic-sdhci" -+ }, -+ { -+ "name": "POWER8_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "i6300esb" -+ }, -+ { -+ "name": "STB25-powerpc64-cpu" -+ }, -+ { -+ "name": "sd-card" -+ }, -+ { -+ "name": "MPC8547E_v21-powerpc64-cpu" -+ }, -+ { -+ "name": "7455_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "745_v2.0-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.2-powerpc64-cpu" -+ }, -+ { -+ "name": "vmxnet3" -+ }, -+ { -+ "name": "750_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "e500-pcihost" -+ }, -+ { -+ "name": "MPC8545E_v20-powerpc64-cpu" -+ }, -+ { -+ "name": "uni-north-internal-pci" -+ }, -+ { -+ "name": "spapr-rtc" -+ }, -+ { -+ "name": "MPC8347ET-powerpc64-cpu" -+ }, -+ { -+ "name": "755_v2.7-powerpc64-cpu" -+ }, -+ { -+ "name": "750cxe_v2.1-powerpc64-cpu" -+ }, -+ { -+ "name": "rng-random" -+ }, -+ { -+ "name": "750cl_v1.0-powerpc64-cpu" -+ }, -+ { -+ "name": "7457A_v1.2-powerpc64-cpu" -+ } -+ ], -+ "id": "libvirt-9" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "secs", -+ "type": "uint32" -+ }, -+ { -+ "name": "request-merging", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "min_io_size", -+ "type": "uint16" -+ }, -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "serial", -+ "type": "str" -+ }, -+ { -+ "name": "heads", -+ "type": "uint32" -+ }, -+ { -+ "name": "ioeventfd", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "scsi", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "cyls", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-disable-pcie", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "logical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iothread", -+ "type": "link" -+ }, -+ { -+ "name": "disable-modern", -+ "type": "bool" -+ }, -+ { -+ "name": "drive", -+ "description": "Node name or ID of a block device to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "disable-legacy", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnkctl-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "werror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "discard_granularity", -+ "type": "uint32" -+ }, -+ { -+ "name": "rerror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "page-per-vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-deverr-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-pm-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "share-rw", -+ "type": "bool" -+ }, -+ { -+ "name": "physical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "config-wce", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "class", -+ "type": "uint32" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "migrate-extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "modern-pio-notify", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "vectors", -+ "type": "uint32" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-backend", -+ "type": "child" -+ }, -+ { -+ "name": "x-ignore-backend-features", -+ "type": "bool" -+ }, -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "write-cache", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "num-queues", -+ "type": "uint16" -+ }, -+ { -+ "name": "opt_io_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "ats", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-pci-bus-master-bug-migration", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ } -+ ], -+ "id": "libvirt-10" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "ctrl_mac_addr", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "status", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-pm-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest_csum", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ctrl_rx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ctrl_vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "disable-modern", -+ "type": "bool" -+ }, -+ { -+ "name": "mrg_rxbuf", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "host_tso6", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-txtimer", -+ "type": "uint32" -+ }, -+ { -+ "name": "host_tso4", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "ctrl_rx_extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "gso", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "page-per-vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-disable-pcie", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-ignore-backend-features", -+ "type": "bool" -+ }, -+ { -+ "name": "vlan", -+ "description": "Integer VLAN id to connect to", -+ "type": "int32" -+ }, -+ { -+ "name": "x-txburst", -+ "type": "int32" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnkctl-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "host_mtu", -+ "type": "uint16" -+ }, -+ { -+ "name": "ctrl_vlan", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-backend", -+ "type": "child" -+ }, -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "vectors", -+ "type": "uint32" -+ }, -+ { -+ "name": "guest_announce", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "host_ecn", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "ats", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "host_ufo", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest_tso4", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest_tso6", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ctrl_guest_offloads", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "csum", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "modern-pio-notify", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ioeventfd", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "mq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest_ecn", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest_ufo", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-pci-bus-master-bug-migration", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "mac", -+ "description": "Ethernet 6-byte MAC Address, example: 52:54:00:12:34:56", -+ "type": "str" -+ }, -+ { -+ "name": "disable-legacy", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "tx", -+ "type": "str" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-deverr-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "netdev", -+ "description": "ID of a netdev to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "migrate-extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rx_queue_size", -+ "type": "uint16" -+ } -+ ], -+ "id": "libvirt-11" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ioeventfd", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-disable-pcie", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "cmd_per_lun", -+ "type": "uint32" -+ }, -+ { -+ "name": "disable-modern", -+ "type": "bool" -+ }, -+ { -+ "name": "num_queues", -+ "type": "uint32" -+ }, -+ { -+ "name": "disable-legacy", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnkctl-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "hotplug", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "page-per-vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-deverr-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-pm-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "max_sectors", -+ "type": "uint32" -+ }, -+ { -+ "name": "param_change", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iothread", -+ "type": "link" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "migrate-extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "modern-pio-notify", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "vectors", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-backend", -+ "type": "child" -+ }, -+ { -+ "name": "x-ignore-backend-features", -+ "type": "bool" -+ }, -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ats", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-pci-bus-master-bug-migration", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ } -+ ], -+ "id": "libvirt-12" -+} -+ -+{ -+ "id": "libvirt-13", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-blk-ccw' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-14", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-net-ccw' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-15", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-scsi-ccw' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-16", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-blk-s390' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-17", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-net-s390' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-18", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'pci-assign' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-19", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'kvm-pci-assign' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "x-pci-sub-device-id", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-no-kvm-msi", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-igd-opregion", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-vga", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pci-vendor-id", -+ "type": "uint32" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "x-req", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-igd-gms", -+ "type": "uint32" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ }, -+ { -+ "name": "x-no-kvm-intx", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pci-device-id", -+ "type": "uint32" -+ }, -+ { -+ "name": "host", -+ "description": "Address (bus/device/function) of the host device, example: 04:10.0", -+ "type": "str" -+ }, -+ { -+ "name": "x-no-kvm-msix", -+ "type": "bool" -+ }, -+ { -+ "name": "x-intx-mmap-timeout-ms", -+ "type": "uint32" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "x-pci-sub-vendor-id", -+ "type": "uint32" -+ }, -+ { -+ "name": "sysfsdev", -+ "type": "str" -+ }, -+ { -+ "name": "x-no-mmap", -+ "type": "bool" -+ } -+ ], -+ "id": "libvirt-20" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "serial", -+ "type": "str" -+ }, -+ { -+ "name": "port_index", -+ "type": "uint16" -+ }, -+ { -+ "name": "dpofua", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "logical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "discard_granularity", -+ "type": "uint32" -+ }, -+ { -+ "name": "lun", -+ "type": "uint32" -+ }, -+ { -+ "name": "max_unmap_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "drive", -+ "description": "Node name or ID of a block device to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "port_wwn", -+ "type": "uint64" -+ }, -+ { -+ "name": "write-cache", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "share-rw", -+ "type": "bool" -+ }, -+ { -+ "name": "opt_io_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "min_io_size", -+ "type": "uint16" -+ }, -+ { -+ "name": "product", -+ "type": "str" -+ }, -+ { -+ "name": "scsi-id", -+ "type": "uint32" -+ }, -+ { -+ "name": "channel", -+ "type": "uint32" -+ }, -+ { -+ "name": "vendor", -+ "type": "str" -+ }, -+ { -+ "name": "wwn", -+ "type": "uint64" -+ }, -+ { -+ "name": "werror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "removable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rerror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "ver", -+ "type": "str" -+ }, -+ { -+ "name": "physical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "max_io_size", -+ "type": "uint64" -+ } -+ ], -+ "id": "libvirt-21" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "serial", -+ "type": "str" -+ }, -+ { -+ "name": "logical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "discard_granularity", -+ "type": "uint32" -+ }, -+ { -+ "name": "drive", -+ "description": "Node name or ID of a block device to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "write-cache", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "share-rw", -+ "type": "bool" -+ }, -+ { -+ "name": "opt_io_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "min_io_size", -+ "type": "uint16" -+ }, -+ { -+ "name": "unit", -+ "type": "uint32" -+ }, -+ { -+ "name": "wwn", -+ "type": "uint64" -+ }, -+ { -+ "name": "werror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "model", -+ "type": "str" -+ }, -+ { -+ "name": "rerror", -+ "description": "Error handling policy, report/ignore/enospc/stop/auto", -+ "type": "BlockdevOnError" -+ }, -+ { -+ "name": "ver", -+ "type": "str" -+ }, -+ { -+ "name": "physical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ } -+ ], -+ "id": "libvirt-22" -+} -+ -+{ -+ "id": "libvirt-23", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'PIIX4_PM' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-24", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'usb-redir' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-25", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'usb-host' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "drive", -+ "description": "Node name or ID of a block device to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "lun", -+ "type": "uint32" -+ }, -+ { -+ "name": "channel", -+ "type": "uint32" -+ }, -+ { -+ "name": "scsi-id", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-26" -+} -+ -+{ -+ "id": "libvirt-27", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'i440FX-pcihost' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-28", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'q35-pcihost' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "serial", -+ "type": "str" -+ }, -+ { -+ "name": "msos-desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "logical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ }, -+ { -+ "name": "discard_granularity", -+ "type": "uint32" -+ }, -+ { -+ "name": "drive", -+ "description": "Node name or ID of a block device to use as a backend", -+ "type": "str" -+ }, -+ { -+ "name": "bootindex", -+ "type": "int32" -+ }, -+ { -+ "name": "write-cache", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "share-rw", -+ "type": "bool" -+ }, -+ { -+ "name": "opt_io_size", -+ "type": "uint32" -+ }, -+ { -+ "name": "min_io_size", -+ "type": "uint16" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ }, -+ { -+ "name": "attached", -+ "type": "bool" -+ }, -+ { -+ "name": "full-path", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "removable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "physical_block_size", -+ "description": "A power of two between 512 and 32768", -+ "type": "uint16" -+ } -+ ], -+ "id": "libvirt-29" -+} -+ -+{ -+ "id": "libvirt-30", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'kvm-pit' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "mmio", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "qemu-extended-regs", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "big-endian-framebuffer", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ }, -+ { -+ "name": "vgamem_mb", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ } -+ ], -+ "id": "libvirt-31" -+} -+ -+{ -+ "id": "libvirt-32", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'vmware-svga' not found" -+ } -+} -+ -+{ -+ "id": "libvirt-33", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'qxl' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ioeventfd", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-disable-pcie", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "disable-modern", -+ "type": "bool" -+ }, -+ { -+ "name": "disable-legacy", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnkctl-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "page-per-vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-deverr-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-pm-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "max_outputs", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "migrate-extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "modern-pio-notify", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "vectors", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-backend", -+ "type": "child" -+ }, -+ { -+ "name": "max_hostmem", -+ "type": "size" -+ }, -+ { -+ "name": "x-ignore-backend-features", -+ "type": "bool" -+ }, -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ats", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-pci-bus-master-bug-migration", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ } -+ ], -+ "id": "libvirt-34" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "max_outputs", -+ "type": "uint32" -+ }, -+ { -+ "name": "max_hostmem", -+ "type": "size" -+ } -+ ], -+ "id": "libvirt-35" -+} -+ -+{ -+ "id": "libvirt-36", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'ICH9-LPC' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "guest-stats-polling-interval", -+ "type": "int" -+ }, -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-disable-pcie", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "disable-modern", -+ "type": "bool" -+ }, -+ { -+ "name": "disable-legacy", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnkctl-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest-stats", -+ "type": "guest statistics" -+ }, -+ { -+ "name": "deflate-on-oom", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "page-per-vq", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-deverr-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-pm-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "class", -+ "type": "uint32" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "migrate-extra", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "modern-pio-notify", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-backend", -+ "type": "child" -+ }, -+ { -+ "name": "x-ignore-backend-features", -+ "type": "bool" -+ }, -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "ats", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "virtio-pci-bus-master-bug-migration", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ } -+ ], -+ "id": "libvirt-37" -+} -+ -+{ -+ "id": "libvirt-38", -+ "error": { -+ "class": "DeviceNotFound", -+ "desc": "Device 'virtio-balloon-ccw' not found" -+ } -+} -+ -+{ -+ "return": [ -+ { -+ "name": "notify_on_empty", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "any_layout", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "indirect_desc", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "guest-stats", -+ "type": "guest statistics" -+ }, -+ { -+ "name": "guest-stats-polling-interval", -+ "type": "int" -+ }, -+ { -+ "name": "event_idx", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "iommu_platform", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "deflate-on-oom", -+ "description": "on/off", -+ "type": "bool" -+ } -+ ], -+ "id": "libvirt-39" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "rombar", -+ "type": "uint32" -+ }, -+ { -+ "name": "intrs", -+ "type": "uint32" -+ }, -+ { -+ "name": "x-pcie-lnksta-dllla", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "msix", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "multifunction", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "msi", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "superspeed-ports-first", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "streams", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "romfile", -+ "type": "str" -+ }, -+ { -+ "name": "force-pcie-endcap", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "command_serr_enable", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "x-pcie-extcap-init", -+ "description": "on/off", -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "description": "Slot and optional function number, example: 06.0 or 06", -+ "type": "int32" -+ }, -+ { -+ "name": "p3", -+ "type": "uint32" -+ }, -+ { -+ "name": "p2", -+ "type": "uint32" -+ }, -+ { -+ "name": "slots", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-40" -+} -+ -+{ -+ "return": [ -+ { -+ "hotpluggable-cpus": false, -+ "name": "ref405ep", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "none", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "virtex-ml507", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "powernv", -+ "cpu-max": 2048 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "ppce500", -+ "cpu-max": 32 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "mpc8544ds", -+ "cpu-max": 15 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "bamboo", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "g3beige", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "prep", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": true, -+ "name": "pseries-2.9", -+ "is-default": true, -+ "cpu-max": 1024, -+ "alias": "pseries" -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "mac99", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.6", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": true, -+ "name": "pseries-2.7", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": true, -+ "name": "pseries-2.8", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.4", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.5", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.2", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "taihu", -+ "cpu-max": 1 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.3", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "pseries-2.1", -+ "cpu-max": 1024 -+ }, -+ { -+ "hotpluggable-cpus": false, -+ "name": "40p", -+ "cpu-max": 1 -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "default", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc32", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc64", -+ "typename": "970fx_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970mp", -+ "typename": "970mp_v1.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970fx", -+ "typename": "970fx_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970", -+ "typename": "970_v2.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER9", -+ "typename": "POWER9_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8NVL", -+ "typename": "POWER8NVL_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8", -+ "typename": "POWER8E_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8E", -+ "typename": "POWER8E_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER7+", -+ "typename": "POWER7+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER7", -+ "typename": "POWER7_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER5gs", -+ "typename": "POWER5+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER5+", -+ "typename": "POWER5+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo7PM", -+ "typename": "7457A_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457A", -+ "typename": "7457A_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7447A", -+ "typename": "7447A_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo7", -+ "typename": "7457_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457", -+ "typename": "7457_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7447", -+ "typename": "7447_v1.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo6", -+ "typename": "7455_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7455", -+ "typename": "7455_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7445", -+ "typename": "7445_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7451", -+ "typename": "7451_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7441", -+ "typename": "7441_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vger", -+ "typename": "7450_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7450", -+ "typename": "7450_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7448", -+ "typename": "7448_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Nitro", -+ "typename": "7410_v1.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7410", -+ "typename": "7410_v1.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "G4", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Max", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7400", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Goldfinger", -+ "typename": "755_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "755", -+ "typename": "755_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "745", -+ "typename": "745_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "LoneStar", -+ "typename": "750l_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750l", -+ "typename": "750l_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750gx", -+ "typename": "750gx_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750fx", -+ "typename": "750fx_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cxe", -+ "typename": "750cxe_v3.1b-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cx", -+ "typename": "750cx_v2.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cl", -+ "typename": "750cl_v2.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Conan/Doyle", -+ "typename": "750p-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "G3", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Typhoon", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Arthur", -+ "typename": "740_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "740", -+ "typename": "740_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Mach5", -+ "typename": "604r-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Sirocco", -+ "typename": "604e_v2.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "604e", -+ "typename": "604e_v2.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Goldeneye", -+ "typename": "603e7t-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "603r", -+ "typename": "603e7t-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vaillant", -+ "typename": "603e7v-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Stretch", -+ "typename": "603e_v4.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "603e", -+ "typename": "603e_v4.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vanilla", -+ "typename": "603-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "601v", -+ "typename": "601_v2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "601", -+ "typename": "601_v2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8560", -+ "typename": "MPC8560_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E", -+ "typename": "MPC8555E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8555", -+ "typename": "MPC8555_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E", -+ "typename": "MPC8548E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8548", -+ "typename": "MPC8548_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E", -+ "typename": "MPC8547E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E", -+ "typename": "MPC8545E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8545", -+ "typename": "MPC8545_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E", -+ "typename": "MPC8544E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8544", -+ "typename": "MPC8544_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E", -+ "typename": "MPC8543E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8543", -+ "typename": "MPC8543_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E", -+ "typename": "MPC8541E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8541", -+ "typename": "MPC8541_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8540", -+ "typename": "MPC8540_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E", -+ "typename": "MPC8533E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8533", -+ "typename": "MPC8533_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500v2", -+ "typename": "e500v2_v22-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500v1", -+ "typename": "e500_v20-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500", -+ "typename": "e500v2_v22-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EA", -+ "typename": "MPC8347EAT-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347E", -+ "typename": "MPC8347ET-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347A", -+ "typename": "MPC8347AT-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347", -+ "typename": "MPC8347T-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e300", -+ "typename": "e300c3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e200", -+ "typename": "e200z6-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8280", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8275", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8272", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8271", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8270", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8248", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8247", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8245", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8241", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "PowerQUICC-II", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC82xx", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B", -+ "typename": "MPC5200B_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC5200", -+ "typename": "MPC5200_v12-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC52xx", -+ "typename": "MPC5200_v12-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8240", -+ "typename": "603-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "440EP", -+ "typename": "440EPb-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "x2vp50", -+ "typename": "x2vp20-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "x2vp7", -+ "typename": "x2vp4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405GPe", -+ "typename": "405CRc-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405GP", -+ "typename": "405GPd-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405CR", -+ "typename": "405CRc-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405", -+ "typename": "405D4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "403", -+ "typename": "403GC-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cl_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347ET", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB25", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401G2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349A", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750e", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8E_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Cobra", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8378E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500mc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970mp_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440-Xilinx-w-dfpu", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740e", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8641", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405D4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe4GS3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB03", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343A", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8378", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2HiP3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8567", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405H", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405H2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e200z6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8379E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347AP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401B2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8567E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7451_v2.10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405L", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401A1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8377", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347AT", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8NVL_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8572", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPR", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401C2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v30", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405EZ", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8568E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "host", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2H4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e200z5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GC", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e5500", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v12", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "x2vp4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405LP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405EP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401D2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8572E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.1b", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.9", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2GP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPd", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7t", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "IOP480", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405D2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fl", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "x2vp20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e600", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2LS", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347P", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC603", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER9_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER7+_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EAP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401E2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8641D", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER5+_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "602", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leLS", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2le", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GB", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER7_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gl", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GCX", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347T", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440-Xilinx", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPX", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7451_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EAT", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970mp_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604r", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v22", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401F2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343EA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8610", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.4b", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v4.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8377E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB04", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2HiP4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cl_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxr", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349EA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8379", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8568", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E_v11", -+ "typename": "", -+ "static": false -+ } -+ ], -+ "id": "libvirt-42" -+} -+ -+{ -+ "return": [ -+ ], -+ "id": "libvirt-43" -+} -+ -+{ -+ "return": [ -+ ], -+ "id": "libvirt-44" -+} -+ -+{ -+ "return": [ -+ { -+ "parameters": [ -+ { -+ "name": "timeout", -+ "help": "Request timeout in seconds (default 0 = no timeout)", -+ "type": "number" -+ }, -+ { -+ "name": "initiator-name", -+ "help": "Initiator iqn name to use when connecting", -+ "type": "string" -+ }, -+ { -+ "name": "header-digest", -+ "help": "HeaderDigest setting. {CRC32C|CRC32C-NONE|NONE-CRC32C|NONE}", -+ "type": "string" -+ }, -+ { -+ "name": "password-secret", -+ "help": "ID of the secret providing password for CHAP authentication to target", -+ "type": "string" -+ }, -+ { -+ "name": "password", -+ "help": "password for CHAP authentication to target", -+ "type": "string" -+ }, -+ { -+ "name": "user", -+ "help": "username for CHAP authentication to target", -+ "type": "string" -+ } -+ ], -+ "option": "iscsi" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "non-adaptive", -+ "type": "boolean" -+ }, -+ { -+ "name": "lossy", -+ "type": "boolean" -+ }, -+ { -+ "name": "acl", -+ "type": "boolean" -+ }, -+ { -+ "name": "x509verify", -+ "type": "string" -+ }, -+ { -+ "name": "tls", -+ "type": "boolean" -+ }, -+ { -+ "name": "sasl", -+ "type": "boolean" -+ }, -+ { -+ "name": "key-delay-ms", -+ "type": "number" -+ }, -+ { -+ "name": "lock-key-sync", -+ "type": "boolean" -+ }, -+ { -+ "name": "reverse", -+ "type": "boolean" -+ }, -+ { -+ "name": "password", -+ "type": "boolean" -+ }, -+ { -+ "name": "ipv6", -+ "type": "boolean" -+ }, -+ { -+ "name": "ipv4", -+ "type": "boolean" -+ }, -+ { -+ "name": "to", -+ "type": "number" -+ }, -+ { -+ "name": "connections", -+ "type": "number" -+ }, -+ { -+ "name": "head", -+ "type": "number" -+ }, -+ { -+ "name": "display", -+ "type": "string" -+ }, -+ { -+ "name": "share", -+ "type": "string" -+ }, -+ { -+ "name": "x509", -+ "type": "string" -+ }, -+ { -+ "name": "tls-creds", -+ "type": "string" -+ }, -+ { -+ "name": "websocket", -+ "type": "string" -+ }, -+ { -+ "name": "vnc", -+ "type": "string" -+ } -+ ], -+ "option": "vnc" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "sock_fd", -+ "type": "number" -+ }, -+ { -+ "name": "socket", -+ "type": "string" -+ }, -+ { -+ "name": "readonly", -+ "type": "boolean" -+ }, -+ { -+ "name": "writeout", -+ "type": "string" -+ }, -+ { -+ "name": "security_model", -+ "type": "string" -+ }, -+ { -+ "name": "mount_tag", -+ "type": "string" -+ }, -+ { -+ "name": "path", -+ "type": "string" -+ }, -+ { -+ "name": "fsdriver", -+ "type": "string" -+ } -+ ], -+ "option": "virtfs" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "throttling.iops-size", -+ "help": "when limiting by iops max size of an I/O in bytes", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write-max-length", -+ "help": "length of the bps-write-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read-max-length", -+ "help": "length of the bps-read-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total-max-length", -+ "help": "length of the bps-total-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write-max-length", -+ "help": "length of the iops-write-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read-max-length", -+ "help": "length of the iops-read-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total-max-length", -+ "help": "length of the iops-total-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write-max", -+ "help": "total bytes write burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read-max", -+ "help": "total bytes read burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total-max", -+ "help": "total bytes burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write-max", -+ "help": "I/O operations write burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read-max", -+ "help": "I/O operations read burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total-max", -+ "help": "I/O operations burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write", -+ "help": "limit write bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read", -+ "help": "limit read bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total", -+ "help": "limit total bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write", -+ "help": "limit write operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read", -+ "help": "limit read operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total", -+ "help": "limit total I/O operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "sock_fd", -+ "type": "number" -+ }, -+ { -+ "name": "socket", -+ "type": "string" -+ }, -+ { -+ "name": "readonly", -+ "type": "boolean" -+ }, -+ { -+ "name": "writeout", -+ "type": "string" -+ }, -+ { -+ "name": "security_model", -+ "type": "string" -+ }, -+ { -+ "name": "path", -+ "type": "string" -+ }, -+ { -+ "name": "fsdriver", -+ "type": "string" -+ } -+ ], -+ "option": "fsdev" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "string", -+ "help": "Sets content of the blob to be inserted from a string", -+ "type": "string" -+ }, -+ { -+ "name": "file", -+ "help": "Sets the name of the file from which\nthe fw_cfg blob will be loaded", -+ "type": "string" -+ }, -+ { -+ "name": "name", -+ "help": "Sets the fw_cfg name of the blob to be inserted", -+ "type": "string" -+ } -+ ], -+ "option": "fw_cfg" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "arg", -+ "type": "string" -+ }, -+ { -+ "name": "target", -+ "type": "string" -+ }, -+ { -+ "name": "enable", -+ "type": "boolean" -+ } -+ ], -+ "option": "semihosting-config" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "rrsnapshot", -+ "type": "string" -+ }, -+ { -+ "name": "rrfile", -+ "type": "string" -+ }, -+ { -+ "name": "rr", -+ "type": "string" -+ }, -+ { -+ "name": "sleep", -+ "type": "boolean" -+ }, -+ { -+ "name": "align", -+ "type": "boolean" -+ }, -+ { -+ "name": "shift", -+ "type": "string" -+ } -+ ], -+ "option": "icount" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "numa" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "debug-threads", -+ "help": "When enabled, name the individual threads; defaults off.\nNOTE: The thread names are for debugging and not a\nstable API.", -+ "type": "boolean" -+ }, -+ { -+ "name": "process", -+ "help": "Sets the name of the QEMU process, as shown in top etc", -+ "type": "string" -+ }, -+ { -+ "name": "guest", -+ "help": "Sets the name of the guest.\nThis name will be displayed in the SDL window caption.\nThe name will also be used for the VNC server", -+ "type": "string" -+ } -+ ], -+ "option": "name" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "timestamp", -+ "type": "boolean" -+ } -+ ], -+ "option": "msg" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "mlock", -+ "type": "boolean" -+ } -+ ], -+ "option": "realtime" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "tpmdev" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "object" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "opaque", -+ "help": "free-form string used to describe fd", -+ "type": "string" -+ }, -+ { -+ "name": "set", -+ "help": "ID of the fd set to add fd to", -+ "type": "number" -+ }, -+ { -+ "name": "fd", -+ "help": "file descriptor of which a duplicate is added to fd set", -+ "type": "number" -+ } -+ ], -+ "option": "add-fd" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "enable", -+ "type": "boolean" -+ } -+ ], -+ "option": "sandbox" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "strict", -+ "type": "boolean" -+ }, -+ { -+ "name": "reboot-timeout", -+ "type": "string" -+ }, -+ { -+ "name": "splash-time", -+ "type": "string" -+ }, -+ { -+ "name": "splash", -+ "type": "string" -+ }, -+ { -+ "name": "menu", -+ "type": "boolean" -+ }, -+ { -+ "name": "once", -+ "type": "string" -+ }, -+ { -+ "name": "order", -+ "type": "string" -+ } -+ ], -+ "option": "boot-opts" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "maxcpus", -+ "type": "number" -+ }, -+ { -+ "name": "threads", -+ "type": "number" -+ }, -+ { -+ "name": "cores", -+ "type": "number" -+ }, -+ { -+ "name": "sockets", -+ "type": "number" -+ }, -+ { -+ "name": "cpus", -+ "type": "number" -+ } -+ ], -+ "option": "smp-opts" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "maxmem", -+ "type": "size" -+ }, -+ { -+ "name": "slots", -+ "type": "number" -+ }, -+ { -+ "name": "size", -+ "type": "size" -+ } -+ ], -+ "option": "memory" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "thread", -+ "help": "Enable/disable multi-threaded TCG", -+ "type": "string" -+ }, -+ { -+ "name": "accel", -+ "help": "Select the type of accelerator", -+ "type": "string" -+ } -+ ], -+ "option": "accel" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "dea-key-wrap", -+ "help": "enable/disable DEA key wrapping using the CPACF wrapping key", -+ "type": "boolean" -+ }, -+ { -+ "name": "aes-key-wrap", -+ "help": "enable/disable AES key wrapping using the CPACF wrapping key", -+ "type": "boolean" -+ }, -+ { -+ "name": "suppress-vmdesc", -+ "help": "Set on to disable self-describing migration", -+ "type": "boolean" -+ }, -+ { -+ "name": "iommu", -+ "help": "Set on/off to enable/disable Intel IOMMU (VT-d)", -+ "type": "boolean" -+ }, -+ { -+ "name": "firmware", -+ "help": "firmware image", -+ "type": "string" -+ }, -+ { -+ "name": "usb", -+ "help": "Set on/off to enable/disable usb", -+ "type": "boolean" -+ }, -+ { -+ "name": "mem-merge", -+ "help": "enable/disable memory merge support", -+ "type": "boolean" -+ }, -+ { -+ "name": "dump-guest-core", -+ "help": "Include guest memory in a core dump", -+ "type": "boolean" -+ }, -+ { -+ "name": "dt_compatible", -+ "help": "Overrides the \"compatible\" property of the dt root node", -+ "type": "string" -+ }, -+ { -+ "name": "phandle_start", -+ "help": "The first phandle ID we may generate dynamically", -+ "type": "number" -+ }, -+ { -+ "name": "dumpdtb", -+ "help": "Dump current dtb to a file and quit", -+ "type": "string" -+ }, -+ { -+ "name": "dtb", -+ "help": "Linux kernel device tree file", -+ "type": "string" -+ }, -+ { -+ "name": "append", -+ "help": "Linux kernel command line", -+ "type": "string" -+ }, -+ { -+ "name": "initrd", -+ "help": "Linux initial ramdisk file", -+ "type": "string" -+ }, -+ { -+ "name": "kernel", -+ "help": "Linux kernel image file", -+ "type": "string" -+ }, -+ { -+ "name": "kvm_shadow_mem", -+ "help": "KVM shadow MMU size", -+ "type": "size" -+ }, -+ { -+ "name": "kernel_irqchip", -+ "help": "use KVM in-kernel irqchip", -+ "type": "boolean" -+ }, -+ { -+ "name": "accel", -+ "help": "accelerator list", -+ "type": "string" -+ }, -+ { -+ "name": "type", -+ "help": "emulated machine", -+ "type": "string" -+ } -+ ], -+ "option": "machine" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "romfile", -+ "type": "string" -+ }, -+ { -+ "name": "bootindex", -+ "type": "number" -+ } -+ ], -+ "option": "option-rom" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "file", -+ "type": "string" -+ }, -+ { -+ "name": "events", -+ "type": "string" -+ }, -+ { -+ "name": "enable", -+ "type": "string" -+ } -+ ], -+ "option": "trace" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "pretty", -+ "type": "boolean" -+ }, -+ { -+ "name": "default", -+ "type": "boolean" -+ }, -+ { -+ "name": "chardev", -+ "type": "string" -+ }, -+ { -+ "name": "mode", -+ "type": "string" -+ } -+ ], -+ "option": "mon" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "value", -+ "type": "string" -+ }, -+ { -+ "name": "property", -+ "type": "string" -+ }, -+ { -+ "name": "driver", -+ "type": "string" -+ } -+ ], -+ "option": "global" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "driftfix", -+ "type": "string" -+ }, -+ { -+ "name": "clock", -+ "type": "string" -+ }, -+ { -+ "name": "base", -+ "type": "string" -+ } -+ ], -+ "option": "rtc" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "net" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "netdev" -+ }, -+ { -+ "parameters": [ -+ ], -+ "option": "device" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "logappend", -+ "type": "boolean" -+ }, -+ { -+ "name": "logfile", -+ "type": "string" -+ }, -+ { -+ "name": "append", -+ "type": "boolean" -+ }, -+ { -+ "name": "chardev", -+ "type": "string" -+ }, -+ { -+ "name": "size", -+ "type": "size" -+ }, -+ { -+ "name": "debug", -+ "type": "number" -+ }, -+ { -+ "name": "name", -+ "type": "string" -+ }, -+ { -+ "name": "signal", -+ "type": "boolean" -+ }, -+ { -+ "name": "mux", -+ "type": "boolean" -+ }, -+ { -+ "name": "rows", -+ "type": "number" -+ }, -+ { -+ "name": "cols", -+ "type": "number" -+ }, -+ { -+ "name": "height", -+ "type": "number" -+ }, -+ { -+ "name": "width", -+ "type": "number" -+ }, -+ { -+ "name": "tls-creds", -+ "type": "string" -+ }, -+ { -+ "name": "telnet", -+ "type": "boolean" -+ }, -+ { -+ "name": "reconnect", -+ "type": "number" -+ }, -+ { -+ "name": "delay", -+ "type": "boolean" -+ }, -+ { -+ "name": "server", -+ "type": "boolean" -+ }, -+ { -+ "name": "wait", -+ "type": "boolean" -+ }, -+ { -+ "name": "ipv6", -+ "type": "boolean" -+ }, -+ { -+ "name": "ipv4", -+ "type": "boolean" -+ }, -+ { -+ "name": "to", -+ "type": "number" -+ }, -+ { -+ "name": "localport", -+ "type": "string" -+ }, -+ { -+ "name": "localaddr", -+ "type": "string" -+ }, -+ { -+ "name": "port", -+ "type": "string" -+ }, -+ { -+ "name": "host", -+ "type": "string" -+ }, -+ { -+ "name": "path", -+ "type": "string" -+ }, -+ { -+ "name": "backend", -+ "type": "string" -+ } -+ ], -+ "option": "chardev" -+ }, -+ { -+ "parameters": [ -+ { -+ "name": "copy-on-read", -+ "help": "copy read data from backing file into image file", -+ "type": "boolean" -+ }, -+ { -+ "name": "werror", -+ "help": "write error action", -+ "type": "string" -+ }, -+ { -+ "name": "rerror", -+ "help": "read error action", -+ "type": "string" -+ }, -+ { -+ "name": "read-only", -+ "help": "open drive file as read-only", -+ "type": "boolean" -+ }, -+ { -+ "name": "file", -+ "help": "file name", -+ "type": "string" -+ }, -+ { -+ "name": "serial", -+ "help": "disk serial number", -+ "type": "string" -+ }, -+ { -+ "name": "addr", -+ "help": "pci address (virtio only)", -+ "type": "string" -+ }, -+ { -+ "name": "boot", -+ "help": "(deprecated, ignored)", -+ "type": "boolean" -+ }, -+ { -+ "name": "trans", -+ "help": "chs translation (auto, lba, none)", -+ "type": "string" -+ }, -+ { -+ "name": "secs", -+ "help": "number of sectors (ide disk geometry)", -+ "type": "number" -+ }, -+ { -+ "name": "heads", -+ "help": "number of heads (ide disk geometry)", -+ "type": "number" -+ }, -+ { -+ "name": "cyls", -+ "help": "number of cylinders (ide disk geometry)", -+ "type": "number" -+ }, -+ { -+ "name": "if", -+ "help": "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", -+ "type": "string" -+ }, -+ { -+ "name": "media", -+ "help": "media type (disk, cdrom)", -+ "type": "string" -+ }, -+ { -+ "name": "index", -+ "help": "index number", -+ "type": "number" -+ }, -+ { -+ "name": "unit", -+ "help": "unit number (i.e. lun for scsi)", -+ "type": "number" -+ }, -+ { -+ "name": "bus", -+ "help": "bus number", -+ "type": "number" -+ }, -+ { -+ "name": "stats-account-failed", -+ "help": "whether to account for failed I/O operations in the statistics", -+ "type": "boolean" -+ }, -+ { -+ "name": "stats-account-invalid", -+ "help": "whether to account for invalid I/O operations in the statistics", -+ "type": "boolean" -+ }, -+ { -+ "name": "detect-zeroes", -+ "help": "try to optimize zero writes (off, on, unmap)", -+ "type": "string" -+ }, -+ { -+ "name": "throttling.group", -+ "help": "name of the block throttling group", -+ "type": "string" -+ }, -+ { -+ "name": "throttling.iops-size", -+ "help": "when limiting by iops max size of an I/O in bytes", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write-max-length", -+ "help": "length of the bps-write-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read-max-length", -+ "help": "length of the bps-read-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total-max-length", -+ "help": "length of the bps-total-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write-max-length", -+ "help": "length of the iops-write-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read-max-length", -+ "help": "length of the iops-read-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total-max-length", -+ "help": "length of the iops-total-max burst period, in seconds", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write-max", -+ "help": "total bytes write burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read-max", -+ "help": "total bytes read burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total-max", -+ "help": "total bytes burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write-max", -+ "help": "I/O operations write burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read-max", -+ "help": "I/O operations read burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total-max", -+ "help": "I/O operations burst", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-write", -+ "help": "limit write bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-read", -+ "help": "limit read bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.bps-total", -+ "help": "limit total bytes per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-write", -+ "help": "limit write operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-read", -+ "help": "limit read operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "throttling.iops-total", -+ "help": "limit total I/O operations per second", -+ "type": "number" -+ }, -+ { -+ "name": "werror", -+ "help": "write error action", -+ "type": "string" -+ }, -+ { -+ "name": "format", -+ "help": "disk format (raw, qcow2, ...)", -+ "type": "string" -+ }, -+ { -+ "name": "cache.writeback", -+ "help": "Enable writeback mode", -+ "type": "boolean" -+ }, -+ { -+ "name": "aio", -+ "help": "host AIO implementation (threads, native)", -+ "type": "string" -+ }, -+ { -+ "name": "snapshot", -+ "help": "enable/disable snapshot mode", -+ "type": "boolean" -+ }, -+ { -+ "name": "discard", -+ "help": "discard operation (ignore/off, unmap/on)", -+ "type": "string" -+ }, -+ { -+ "name": "read-only", -+ "help": "Node is opened in read-only mode", -+ "type": "boolean" -+ }, -+ { -+ "name": "cache.no-flush", -+ "help": "Ignore flush requests", -+ "type": "boolean" -+ }, -+ { -+ "name": "cache.direct", -+ "help": "Bypass software writeback cache on the host", -+ "type": "boolean" -+ }, -+ { -+ "name": "driver", -+ "help": "Block driver to use for the node", -+ "type": "string" -+ }, -+ { -+ "name": "node-name", -+ "help": "Node name of the block device node", -+ "type": "string" -+ } -+ ], -+ "option": "drive" -+ } -+ ], -+ "id": "libvirt-45" -+} -+ -+{ -+ "return": [ -+ { -+ "state": false, -+ "capability": "xbzrle" -+ }, -+ { -+ "state": false, -+ "capability": "rdma-pin-all" -+ }, -+ { -+ "state": false, -+ "capability": "auto-converge" -+ }, -+ { -+ "state": false, -+ "capability": "zero-blocks" -+ }, -+ { -+ "state": false, -+ "capability": "compress" -+ }, -+ { -+ "state": false, -+ "capability": "events" -+ }, -+ { -+ "state": false, -+ "capability": "postcopy-ram" -+ }, -+ { -+ "state": false, -+ "capability": "x-colo" -+ }, -+ { -+ "state": false, -+ "capability": "release-ram" -+ } -+ ], -+ "id": "libvirt-46" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "ACPI_DEVICE_OST", -+ "meta-type": "event", -+ "arg-type": "0" -+ }, -+ { -+ "name": "BALLOON_CHANGE", -+ "meta-type": "event", -+ "arg-type": "1" -+ }, -+ { -+ "name": "BLOCK_IMAGE_CORRUPTED", -+ "meta-type": "event", -+ "arg-type": "2" -+ }, -+ { -+ "name": "BLOCK_IO_ERROR", -+ "meta-type": "event", -+ "arg-type": "3" -+ }, -+ { -+ "name": "BLOCK_JOB_CANCELLED", -+ "meta-type": "event", -+ "arg-type": "4" -+ }, -+ { -+ "name": "BLOCK_JOB_COMPLETED", -+ "meta-type": "event", -+ "arg-type": "5" -+ }, -+ { -+ "name": "BLOCK_JOB_ERROR", -+ "meta-type": "event", -+ "arg-type": "6" -+ }, -+ { -+ "name": "BLOCK_JOB_READY", -+ "meta-type": "event", -+ "arg-type": "7" -+ }, -+ { -+ "name": "BLOCK_WRITE_THRESHOLD", -+ "meta-type": "event", -+ "arg-type": "8" -+ }, -+ { -+ "name": "DEVICE_DELETED", -+ "meta-type": "event", -+ "arg-type": "9" -+ }, -+ { -+ "name": "DEVICE_TRAY_MOVED", -+ "meta-type": "event", -+ "arg-type": "10" -+ }, -+ { -+ "name": "DUMP_COMPLETED", -+ "meta-type": "event", -+ "arg-type": "11" -+ }, -+ { -+ "name": "GUEST_PANICKED", -+ "meta-type": "event", -+ "arg-type": "12" -+ }, -+ { -+ "name": "MEM_UNPLUG_ERROR", -+ "meta-type": "event", -+ "arg-type": "13" -+ }, -+ { -+ "name": "MIGRATION", -+ "meta-type": "event", -+ "arg-type": "14" -+ }, -+ { -+ "name": "MIGRATION_PASS", -+ "meta-type": "event", -+ "arg-type": "15" -+ }, -+ { -+ "name": "NIC_RX_FILTER_CHANGED", -+ "meta-type": "event", -+ "arg-type": "16" -+ }, -+ { -+ "name": "POWERDOWN", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "QUORUM_FAILURE", -+ "meta-type": "event", -+ "arg-type": "18" -+ }, -+ { -+ "name": "QUORUM_REPORT_BAD", -+ "meta-type": "event", -+ "arg-type": "19" -+ }, -+ { -+ "name": "RESET", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "RESUME", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "RTC_CHANGE", -+ "meta-type": "event", -+ "arg-type": "20" -+ }, -+ { -+ "name": "SHUTDOWN", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "SPICE_CONNECTED", -+ "meta-type": "event", -+ "arg-type": "21" -+ }, -+ { -+ "name": "SPICE_DISCONNECTED", -+ "meta-type": "event", -+ "arg-type": "22" -+ }, -+ { -+ "name": "SPICE_INITIALIZED", -+ "meta-type": "event", -+ "arg-type": "23" -+ }, -+ { -+ "name": "SPICE_MIGRATE_COMPLETED", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "STOP", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "SUSPEND", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "SUSPEND_DISK", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "VNC_CONNECTED", -+ "meta-type": "event", -+ "arg-type": "24" -+ }, -+ { -+ "name": "VNC_DISCONNECTED", -+ "meta-type": "event", -+ "arg-type": "25" -+ }, -+ { -+ "name": "VNC_INITIALIZED", -+ "meta-type": "event", -+ "arg-type": "26" -+ }, -+ { -+ "name": "VSERPORT_CHANGE", -+ "meta-type": "event", -+ "arg-type": "27" -+ }, -+ { -+ "name": "WAKEUP", -+ "meta-type": "event", -+ "arg-type": "17" -+ }, -+ { -+ "name": "WATCHDOG", -+ "meta-type": "event", -+ "arg-type": "28" -+ }, -+ { -+ "name": "add-fd", -+ "ret-type": "30", -+ "meta-type": "command", -+ "arg-type": "29" -+ }, -+ { -+ "name": "add_client", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "31" -+ }, -+ { -+ "name": "balloon", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "32" -+ }, -+ { -+ "name": "block-commit", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "33" -+ }, -+ { -+ "name": "block-dirty-bitmap-add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "34" -+ }, -+ { -+ "name": "block-dirty-bitmap-clear", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "35" -+ }, -+ { -+ "name": "block-dirty-bitmap-remove", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "35" -+ }, -+ { -+ "name": "block-job-cancel", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "36" -+ }, -+ { -+ "name": "block-job-complete", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "37" -+ }, -+ { -+ "name": "block-job-pause", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "38" -+ }, -+ { -+ "name": "block-job-resume", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "39" -+ }, -+ { -+ "name": "block-job-set-speed", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "40" -+ }, -+ { -+ "name": "block-set-write-threshold", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "41" -+ }, -+ { -+ "name": "block-stream", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "42" -+ }, -+ { -+ "name": "block_passwd", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "43" -+ }, -+ { -+ "name": "block_resize", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "44" -+ }, -+ { -+ "name": "block_set_io_throttle", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "45" -+ }, -+ { -+ "name": "blockdev-add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "46" -+ }, -+ { -+ "name": "blockdev-backup", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "47" -+ }, -+ { -+ "name": "blockdev-change-medium", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "48" -+ }, -+ { -+ "name": "blockdev-close-tray", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "49" -+ }, -+ { -+ "name": "blockdev-del", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "50" -+ }, -+ { -+ "name": "blockdev-mirror", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "51" -+ }, -+ { -+ "name": "blockdev-open-tray", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "52" -+ }, -+ { -+ "name": "blockdev-snapshot", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "53" -+ }, -+ { -+ "name": "blockdev-snapshot-delete-internal-sync", -+ "ret-type": "55", -+ "meta-type": "command", -+ "arg-type": "54" -+ }, -+ { -+ "name": "blockdev-snapshot-internal-sync", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "56" -+ }, -+ { -+ "name": "blockdev-snapshot-sync", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "57" -+ }, -+ { -+ "name": "change", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "58" -+ }, -+ { -+ "name": "change-backing-file", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "59" -+ }, -+ { -+ "name": "change-vnc-password", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "60" -+ }, -+ { -+ "name": "chardev-add", -+ "ret-type": "62", -+ "meta-type": "command", -+ "arg-type": "61" -+ }, -+ { -+ "name": "chardev-remove", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "63" -+ }, -+ { -+ "name": "client_migrate_info", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "64" -+ }, -+ { -+ "name": "closefd", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "65" -+ }, -+ { -+ "name": "cont", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "cpu", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "66" -+ }, -+ { -+ "name": "cpu-add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "67" -+ }, -+ { -+ "name": "device-list-properties", -+ "ret-type": "[69]", -+ "meta-type": "command", -+ "arg-type": "68" -+ }, -+ { -+ "name": "device_add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "70" -+ }, -+ { -+ "name": "device_del", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "71" -+ }, -+ { -+ "name": "drive-backup", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "72" -+ }, -+ { -+ "name": "drive-mirror", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "73" -+ }, -+ { -+ "name": "dump-guest-memory", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "74" -+ }, -+ { -+ "name": "dump-skeys", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "75" -+ }, -+ { -+ "name": "eject", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "76" -+ }, -+ { -+ "name": "expire_password", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "77" -+ }, -+ { -+ "name": "getfd", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "78" -+ }, -+ { -+ "name": "human-monitor-command", -+ "ret-type": "str", -+ "meta-type": "command", -+ "arg-type": "79" -+ }, -+ { -+ "name": "inject-nmi", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "input-send-event", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "80" -+ }, -+ { -+ "name": "memsave", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "81" -+ }, -+ { -+ "name": "migrate", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "82" -+ }, -+ { -+ "name": "migrate-incoming", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "83" -+ }, -+ { -+ "name": "migrate-set-cache-size", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "84" -+ }, -+ { -+ "name": "migrate-set-capabilities", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "85" -+ }, -+ { -+ "name": "migrate-set-parameters", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "86" -+ }, -+ { -+ "name": "migrate-start-postcopy", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "migrate_cancel", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "migrate_set_downtime", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "87" -+ }, -+ { -+ "name": "migrate_set_speed", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "88" -+ }, -+ { -+ "name": "nbd-server-add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "89" -+ }, -+ { -+ "name": "nbd-server-start", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "90" -+ }, -+ { -+ "name": "nbd-server-stop", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "netdev_add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "91" -+ }, -+ { -+ "name": "netdev_del", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "92" -+ }, -+ { -+ "name": "object-add", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "93" -+ }, -+ { -+ "name": "object-del", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "94" -+ }, -+ { -+ "name": "pmemsave", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "95" -+ }, -+ { -+ "name": "qmp_capabilities", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "qom-get", -+ "ret-type": "any", -+ "meta-type": "command", -+ "arg-type": "96" -+ }, -+ { -+ "name": "qom-list", -+ "ret-type": "[98]", -+ "meta-type": "command", -+ "arg-type": "97" -+ }, -+ { -+ "name": "qom-list-types", -+ "ret-type": "[100]", -+ "meta-type": "command", -+ "arg-type": "99" -+ }, -+ { -+ "name": "qom-set", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "101" -+ }, -+ { -+ "name": "query-acpi-ospm-status", -+ "ret-type": "[102]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-balloon", -+ "ret-type": "103", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-block", -+ "ret-type": "[104]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-block-jobs", -+ "ret-type": "[105]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-blockstats", -+ "ret-type": "[107]", -+ "meta-type": "command", -+ "arg-type": "106" -+ }, -+ { -+ "name": "query-chardev", -+ "ret-type": "[108]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-chardev-backends", -+ "ret-type": "[109]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-command-line-options", -+ "ret-type": "[111]", -+ "meta-type": "command", -+ "arg-type": "110" -+ }, -+ { -+ "name": "query-commands", -+ "ret-type": "[112]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-cpu-definitions", -+ "ret-type": "[113]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-cpu-model-baseline", -+ "ret-type": "115", -+ "meta-type": "command", -+ "arg-type": "114" -+ }, -+ { -+ "name": "query-cpu-model-comparison", -+ "ret-type": "117", -+ "meta-type": "command", -+ "arg-type": "116" -+ }, -+ { -+ "name": "query-cpu-model-expansion", -+ "ret-type": "119", -+ "meta-type": "command", -+ "arg-type": "118" -+ }, -+ { -+ "name": "query-cpus", -+ "ret-type": "[120]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-dump", -+ "ret-type": "121", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-dump-guest-memory-capability", -+ "ret-type": "122", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-events", -+ "ret-type": "[123]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-fdsets", -+ "ret-type": "[124]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-gic-capabilities", -+ "ret-type": "[125]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-hotpluggable-cpus", -+ "ret-type": "[126]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-iothreads", -+ "ret-type": "[127]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-kvm", -+ "ret-type": "128", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-machines", -+ "ret-type": "[129]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-memdev", -+ "ret-type": "[130]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-memory-devices", -+ "ret-type": "[131]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-mice", -+ "ret-type": "[132]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-migrate", -+ "ret-type": "133", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-migrate-cache-size", -+ "ret-type": "int", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-migrate-capabilities", -+ "ret-type": "[134]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-migrate-parameters", -+ "ret-type": "86", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-name", -+ "ret-type": "135", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-named-block-nodes", -+ "ret-type": "[136]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-pci", -+ "ret-type": "[137]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-qmp-schema", -+ "ret-type": "[138]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-rocker", -+ "ret-type": "140", -+ "meta-type": "command", -+ "arg-type": "139" -+ }, -+ { -+ "name": "query-rocker-of-dpa-flows", -+ "ret-type": "[142]", -+ "meta-type": "command", -+ "arg-type": "141" -+ }, -+ { -+ "name": "query-rocker-of-dpa-groups", -+ "ret-type": "[144]", -+ "meta-type": "command", -+ "arg-type": "143" -+ }, -+ { -+ "name": "query-rocker-ports", -+ "ret-type": "[146]", -+ "meta-type": "command", -+ "arg-type": "145" -+ }, -+ { -+ "name": "query-rx-filter", -+ "ret-type": "[148]", -+ "meta-type": "command", -+ "arg-type": "147" -+ }, -+ { -+ "name": "query-spice", -+ "ret-type": "149", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-status", -+ "ret-type": "150", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-target", -+ "ret-type": "151", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-tpm", -+ "ret-type": "[152]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-tpm-models", -+ "ret-type": "[153]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-tpm-types", -+ "ret-type": "[154]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-uuid", -+ "ret-type": "155", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-version", -+ "ret-type": "156", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-vm-generation-id", -+ "ret-type": "157", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-vnc", -+ "ret-type": "158", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-vnc-servers", -+ "ret-type": "[159]", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "query-xen-replication-status", -+ "ret-type": "160", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "quit", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "remove-fd", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "161" -+ }, -+ { -+ "name": "ringbuf-read", -+ "ret-type": "str", -+ "meta-type": "command", -+ "arg-type": "162" -+ }, -+ { -+ "name": "ringbuf-write", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "163" -+ }, -+ { -+ "name": "rtc-reset-reinjection", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "screendump", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "164" -+ }, -+ { -+ "name": "send-key", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "165" -+ }, -+ { -+ "name": "set_link", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "166" -+ }, -+ { -+ "name": "set_password", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "167" -+ }, -+ { -+ "name": "stop", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "system_powerdown", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "system_reset", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "system_wakeup", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "trace-event-get-state", -+ "ret-type": "[169]", -+ "meta-type": "command", -+ "arg-type": "168" -+ }, -+ { -+ "name": "trace-event-set-state", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "170" -+ }, -+ { -+ "name": "transaction", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "171" -+ }, -+ { -+ "name": "x-blockdev-change", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "172" -+ }, -+ { -+ "name": "x-blockdev-insert-medium", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "173" -+ }, -+ { -+ "name": "x-blockdev-remove-medium", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "174" -+ }, -+ { -+ "name": "x-colo-lost-heartbeat", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "xen-colo-do-checkpoint", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "17" -+ }, -+ { -+ "name": "xen-load-devices-state", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "175" -+ }, -+ { -+ "name": "xen-save-devices-state", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "176" -+ }, -+ { -+ "name": "xen-set-global-dirty-log", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "177" -+ }, -+ { -+ "name": "xen-set-replication", -+ "ret-type": "17", -+ "meta-type": "command", -+ "arg-type": "178" -+ }, -+ { -+ "name": "0", -+ "members": [ -+ { -+ "name": "info", -+ "type": "102" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "1", -+ "members": [ -+ { -+ "name": "actual", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "2", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "msg", -+ "type": "str" -+ }, -+ { -+ "name": "offset", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "fatal", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "3", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "type": "str" -+ }, -+ { -+ "name": "operation", -+ "type": "179" -+ }, -+ { -+ "name": "action", -+ "type": "180" -+ }, -+ { -+ "name": "nospace", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "reason", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "4", -+ "members": [ -+ { -+ "name": "type", -+ "type": "181" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "len", -+ "type": "int" -+ }, -+ { -+ "name": "offset", -+ "type": "int" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "5", -+ "members": [ -+ { -+ "name": "type", -+ "type": "181" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "len", -+ "type": "int" -+ }, -+ { -+ "name": "offset", -+ "type": "int" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ }, -+ { -+ "name": "error", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "6", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "operation", -+ "type": "179" -+ }, -+ { -+ "name": "action", -+ "type": "180" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "7", -+ "members": [ -+ { -+ "name": "type", -+ "type": "181" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "len", -+ "type": "int" -+ }, -+ { -+ "name": "offset", -+ "type": "int" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "8", -+ "members": [ -+ { -+ "name": "node-name", -+ "type": "str" -+ }, -+ { -+ "name": "amount-exceeded", -+ "type": "int" -+ }, -+ { -+ "name": "write-threshold", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "9", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "path", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "10", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "tray-open", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "11", -+ "members": [ -+ { -+ "name": "result", -+ "type": "121" -+ }, -+ { -+ "name": "error", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "12", -+ "members": [ -+ { -+ "name": "action", -+ "type": "182" -+ }, -+ { -+ "name": "info", -+ "default": null, -+ "type": "183" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "13", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "msg", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "14", -+ "members": [ -+ { -+ "name": "status", -+ "type": "184" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "15", -+ "members": [ -+ { -+ "name": "pass", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "16", -+ "members": [ -+ { -+ "name": "name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "path", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "17", -+ "members": [ -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "18", -+ "members": [ -+ { -+ "name": "reference", -+ "type": "str" -+ }, -+ { -+ "name": "sector-num", -+ "type": "int" -+ }, -+ { -+ "name": "sectors-count", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "19", -+ "members": [ -+ { -+ "name": "type", -+ "type": "185" -+ }, -+ { -+ "name": "error", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "type": "str" -+ }, -+ { -+ "name": "sector-num", -+ "type": "int" -+ }, -+ { -+ "name": "sectors-count", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "20", -+ "members": [ -+ { -+ "name": "offset", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "21", -+ "members": [ -+ { -+ "name": "server", -+ "type": "186" -+ }, -+ { -+ "name": "client", -+ "type": "186" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "22", -+ "members": [ -+ { -+ "name": "server", -+ "type": "186" -+ }, -+ { -+ "name": "client", -+ "type": "186" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "23", -+ "members": [ -+ { -+ "name": "server", -+ "type": "187" -+ }, -+ { -+ "name": "client", -+ "type": "188" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "24", -+ "members": [ -+ { -+ "name": "server", -+ "type": "189" -+ }, -+ { -+ "name": "client", -+ "type": "190" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "25", -+ "members": [ -+ { -+ "name": "server", -+ "type": "189" -+ }, -+ { -+ "name": "client", -+ "type": "191" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "26", -+ "members": [ -+ { -+ "name": "server", -+ "type": "189" -+ }, -+ { -+ "name": "client", -+ "type": "191" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "27", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "open", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "28", -+ "members": [ -+ { -+ "name": "action", -+ "type": "192" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "29", -+ "members": [ -+ { -+ "name": "fdset-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "opaque", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "30", -+ "members": [ -+ { -+ "name": "fdset-id", -+ "type": "int" -+ }, -+ { -+ "name": "fd", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "31", -+ "members": [ -+ { -+ "name": "protocol", -+ "type": "str" -+ }, -+ { -+ "name": "fdname", -+ "type": "str" -+ }, -+ { -+ "name": "skipauth", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "tls", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "32", -+ "members": [ -+ { -+ "name": "value", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "33", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "base", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "top", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "backing-file", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "filter-node-name", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "34", -+ "members": [ -+ { -+ "name": "node", -+ "type": "str" -+ }, -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "granularity", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "35", -+ "members": [ -+ { -+ "name": "node", -+ "type": "str" -+ }, -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "36", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "force", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "37", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "38", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "39", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "40", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "41", -+ "members": [ -+ { -+ "name": "node-name", -+ "type": "str" -+ }, -+ { -+ "name": "write-threshold", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "42", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "base", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "base-node", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "backing-file", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "on-error", -+ "default": null, -+ "type": "193" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "43", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "44", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "45", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "bps", -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd", -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr", -+ "type": "int" -+ }, -+ { -+ "name": "iops", -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd", -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr", -+ "type": "int" -+ }, -+ { -+ "name": "bps_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "46", -+ "tag": "driver", -+ "variants": [ -+ { -+ "case": "blkdebug", -+ "type": "198" -+ }, -+ { -+ "case": "blkverify", -+ "type": "199" -+ }, -+ { -+ "case": "bochs", -+ "type": "200" -+ }, -+ { -+ "case": "cloop", -+ "type": "200" -+ }, -+ { -+ "case": "dmg", -+ "type": "200" -+ }, -+ { -+ "case": "file", -+ "type": "201" -+ }, -+ { -+ "case": "ftp", -+ "type": "202" -+ }, -+ { -+ "case": "ftps", -+ "type": "203" -+ }, -+ { -+ "case": "gluster", -+ "type": "204" -+ }, -+ { -+ "case": "host_cdrom", -+ "type": "201" -+ }, -+ { -+ "case": "host_device", -+ "type": "201" -+ }, -+ { -+ "case": "http", -+ "type": "205" -+ }, -+ { -+ "case": "https", -+ "type": "206" -+ }, -+ { -+ "case": "iscsi", -+ "type": "207" -+ }, -+ { -+ "case": "luks", -+ "type": "208" -+ }, -+ { -+ "case": "nbd", -+ "type": "209" -+ }, -+ { -+ "case": "nfs", -+ "type": "210" -+ }, -+ { -+ "case": "null-aio", -+ "type": "211" -+ }, -+ { -+ "case": "null-co", -+ "type": "211" -+ }, -+ { -+ "case": "parallels", -+ "type": "200" -+ }, -+ { -+ "case": "qcow2", -+ "type": "212" -+ }, -+ { -+ "case": "qcow", -+ "type": "213" -+ }, -+ { -+ "case": "qed", -+ "type": "213" -+ }, -+ { -+ "case": "quorum", -+ "type": "214" -+ }, -+ { -+ "case": "raw", -+ "type": "215" -+ }, -+ { -+ "case": "rbd", -+ "type": "216" -+ }, -+ { -+ "case": "replication", -+ "type": "217" -+ }, -+ { -+ "case": "sheepdog", -+ "type": "218" -+ }, -+ { -+ "case": "ssh", -+ "type": "219" -+ }, -+ { -+ "case": "vdi", -+ "type": "200" -+ }, -+ { -+ "case": "vhdx", -+ "type": "200" -+ }, -+ { -+ "case": "vmdk", -+ "type": "213" -+ }, -+ { -+ "case": "vpc", -+ "type": "200" -+ }, -+ { -+ "case": "vvfat", -+ "type": "220" -+ } -+ ], -+ "members": [ -+ { -+ "name": "driver", -+ "type": "194" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "discard", -+ "default": null, -+ "type": "195" -+ }, -+ { -+ "name": "cache", -+ "default": null, -+ "type": "196" -+ }, -+ { -+ "name": "read-only", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "detect-zeroes", -+ "default": null, -+ "type": "197" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "47", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "sync", -+ "type": "221" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "compress", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "on-source-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "on-target-error", -+ "default": null, -+ "type": "193" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "48", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "filename", -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "read-only-mode", -+ "default": null, -+ "type": "222" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "49", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "50", -+ "members": [ -+ { -+ "name": "node-name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "51", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "replaces", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sync", -+ "type": "221" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "granularity", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "buf-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "on-source-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "on-target-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "filter-node-name", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "52", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "force", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "53", -+ "members": [ -+ { -+ "name": "node", -+ "type": "str" -+ }, -+ { -+ "name": "overlay", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "54", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "name", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "55", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "vm-state-size", -+ "type": "int" -+ }, -+ { -+ "name": "date-sec", -+ "type": "int" -+ }, -+ { -+ "name": "date-nsec", -+ "type": "int" -+ }, -+ { -+ "name": "vm-clock-sec", -+ "type": "int" -+ }, -+ { -+ "name": "vm-clock-nsec", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "56", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "57", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "snapshot-file", -+ "type": "str" -+ }, -+ { -+ "name": "snapshot-node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "mode", -+ "default": null, -+ "type": "223" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "58", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "arg", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "59", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "image-node-name", -+ "type": "str" -+ }, -+ { -+ "name": "backing-file", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "60", -+ "members": [ -+ { -+ "name": "password", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "61", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "backend", -+ "type": "224" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "62", -+ "members": [ -+ { -+ "name": "pty", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "63", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "64", -+ "members": [ -+ { -+ "name": "protocol", -+ "type": "str" -+ }, -+ { -+ "name": "hostname", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tls-port", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cert-subject", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "65", -+ "members": [ -+ { -+ "name": "fdname", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "66", -+ "members": [ -+ { -+ "name": "index", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "67", -+ "members": [ -+ { -+ "name": "id", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "68", -+ "members": [ -+ { -+ "name": "typename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[69]", -+ "element-type": "69", -+ "meta-type": "array" -+ }, -+ { -+ "name": "69", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "description", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "70", -+ "members": [ -+ { -+ "name": "driver", -+ "type": "str" -+ }, -+ { -+ "name": "bus", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "71", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "72", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sync", -+ "type": "221" -+ }, -+ { -+ "name": "mode", -+ "default": null, -+ "type": "223" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bitmap", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "compress", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "on-source-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "on-target-error", -+ "default": null, -+ "type": "193" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "73", -+ "members": [ -+ { -+ "name": "job-id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "replaces", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sync", -+ "type": "221" -+ }, -+ { -+ "name": "mode", -+ "default": null, -+ "type": "223" -+ }, -+ { -+ "name": "speed", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "granularity", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "buf-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "on-source-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "on-target-error", -+ "default": null, -+ "type": "193" -+ }, -+ { -+ "name": "unmap", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "74", -+ "members": [ -+ { -+ "name": "paging", -+ "type": "bool" -+ }, -+ { -+ "name": "protocol", -+ "type": "str" -+ }, -+ { -+ "name": "detach", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "begin", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "225" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "75", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "76", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "force", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "77", -+ "members": [ -+ { -+ "name": "protocol", -+ "type": "str" -+ }, -+ { -+ "name": "time", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "78", -+ "members": [ -+ { -+ "name": "fdname", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "79", -+ "members": [ -+ { -+ "name": "command-line", -+ "type": "str" -+ }, -+ { -+ "name": "cpu-index", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "str", -+ "json-type": "string", -+ "meta-type": "builtin" -+ }, -+ { -+ "name": "80", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "head", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "events", -+ "type": "[226]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "81", -+ "members": [ -+ { -+ "name": "val", -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "filename", -+ "type": "str" -+ }, -+ { -+ "name": "cpu-index", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "82", -+ "members": [ -+ { -+ "name": "uri", -+ "type": "str" -+ }, -+ { -+ "name": "blk", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "inc", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "detach", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "83", -+ "members": [ -+ { -+ "name": "uri", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "84", -+ "members": [ -+ { -+ "name": "value", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "85", -+ "members": [ -+ { -+ "name": "capabilities", -+ "type": "[134]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "86", -+ "members": [ -+ { -+ "name": "compress-level", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "compress-threads", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "decompress-threads", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cpu-throttle-initial", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cpu-throttle-increment", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tls-creds", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "tls-hostname", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "max-bandwidth", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "downtime-limit", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "x-checkpoint-delay", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "87", -+ "members": [ -+ { -+ "name": "value", -+ "type": "number" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "88", -+ "members": [ -+ { -+ "name": "value", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "89", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "writable", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "90", -+ "members": [ -+ { -+ "name": "addr", -+ "type": "227" -+ }, -+ { -+ "name": "tls-creds", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "91", -+ "members": [ -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "92", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "93", -+ "members": [ -+ { -+ "name": "qom-type", -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "props", -+ "default": null, -+ "type": "any" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "94", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "95", -+ "members": [ -+ { -+ "name": "val", -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "filename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "96", -+ "members": [ -+ { -+ "name": "path", -+ "type": "str" -+ }, -+ { -+ "name": "property", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "any", -+ "json-type": "value", -+ "meta-type": "builtin" -+ }, -+ { -+ "name": "97", -+ "members": [ -+ { -+ "name": "path", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[98]", -+ "element-type": "98", -+ "meta-type": "array" -+ }, -+ { -+ "name": "98", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "99", -+ "members": [ -+ { -+ "name": "implements", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "abstract", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[100]", -+ "element-type": "100", -+ "meta-type": "array" -+ }, -+ { -+ "name": "100", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "101", -+ "members": [ -+ { -+ "name": "path", -+ "type": "str" -+ }, -+ { -+ "name": "property", -+ "type": "str" -+ }, -+ { -+ "name": "value", -+ "type": "any" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[102]", -+ "element-type": "102", -+ "meta-type": "array" -+ }, -+ { -+ "name": "102", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "slot", -+ "type": "str" -+ }, -+ { -+ "name": "slot-type", -+ "type": "228" -+ }, -+ { -+ "name": "source", -+ "type": "int" -+ }, -+ { -+ "name": "status", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "103", -+ "members": [ -+ { -+ "name": "actual", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[104]", -+ "element-type": "104", -+ "meta-type": "array" -+ }, -+ { -+ "name": "104", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "removable", -+ "type": "bool" -+ }, -+ { -+ "name": "locked", -+ "type": "bool" -+ }, -+ { -+ "name": "inserted", -+ "default": null, -+ "type": "136" -+ }, -+ { -+ "name": "tray_open", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "io-status", -+ "default": null, -+ "type": "229" -+ }, -+ { -+ "name": "dirty-bitmaps", -+ "default": null, -+ "type": "[230]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[105]", -+ "element-type": "105", -+ "meta-type": "array" -+ }, -+ { -+ "name": "105", -+ "members": [ -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "len", -+ "type": "int" -+ }, -+ { -+ "name": "offset", -+ "type": "int" -+ }, -+ { -+ "name": "busy", -+ "type": "bool" -+ }, -+ { -+ "name": "paused", -+ "type": "bool" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ }, -+ { -+ "name": "io-status", -+ "type": "229" -+ }, -+ { -+ "name": "ready", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "106", -+ "members": [ -+ { -+ "name": "query-nodes", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[107]", -+ "element-type": "107", -+ "meta-type": "array" -+ }, -+ { -+ "name": "107", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "stats", -+ "type": "231" -+ }, -+ { -+ "name": "parent", -+ "default": null, -+ "type": "107" -+ }, -+ { -+ "name": "backing", -+ "default": null, -+ "type": "107" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[108]", -+ "element-type": "108", -+ "meta-type": "array" -+ }, -+ { -+ "name": "108", -+ "members": [ -+ { -+ "name": "label", -+ "type": "str" -+ }, -+ { -+ "name": "filename", -+ "type": "str" -+ }, -+ { -+ "name": "frontend-open", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[109]", -+ "element-type": "109", -+ "meta-type": "array" -+ }, -+ { -+ "name": "109", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "110", -+ "members": [ -+ { -+ "name": "option", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[111]", -+ "element-type": "111", -+ "meta-type": "array" -+ }, -+ { -+ "name": "111", -+ "members": [ -+ { -+ "name": "option", -+ "type": "str" -+ }, -+ { -+ "name": "parameters", -+ "type": "[232]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[112]", -+ "element-type": "112", -+ "meta-type": "array" -+ }, -+ { -+ "name": "112", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[113]", -+ "element-type": "113", -+ "meta-type": "array" -+ }, -+ { -+ "name": "113", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "migration-safe", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "static", -+ "type": "bool" -+ }, -+ { -+ "name": "unavailable-features", -+ "default": null, -+ "type": "[str]" -+ }, -+ { -+ "name": "typename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "114", -+ "members": [ -+ { -+ "name": "modela", -+ "type": "233" -+ }, -+ { -+ "name": "modelb", -+ "type": "233" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "115", -+ "members": [ -+ { -+ "name": "model", -+ "type": "233" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "116", -+ "members": [ -+ { -+ "name": "modela", -+ "type": "233" -+ }, -+ { -+ "name": "modelb", -+ "type": "233" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "117", -+ "members": [ -+ { -+ "name": "result", -+ "type": "234" -+ }, -+ { -+ "name": "responsible-properties", -+ "type": "[str]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "118", -+ "members": [ -+ { -+ "name": "type", -+ "type": "235" -+ }, -+ { -+ "name": "model", -+ "type": "233" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "119", -+ "members": [ -+ { -+ "name": "model", -+ "type": "233" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[120]", -+ "element-type": "120", -+ "meta-type": "array" -+ }, -+ { -+ "name": "120", -+ "tag": "arch", -+ "variants": [ -+ { -+ "case": "x86", -+ "type": "237" -+ }, -+ { -+ "case": "sparc", -+ "type": "238" -+ }, -+ { -+ "case": "ppc", -+ "type": "239" -+ }, -+ { -+ "case": "mips", -+ "type": "240" -+ }, -+ { -+ "case": "tricore", -+ "type": "241" -+ }, -+ { -+ "case": "other", -+ "type": "242" -+ } -+ ], -+ "members": [ -+ { -+ "name": "CPU", -+ "type": "int" -+ }, -+ { -+ "name": "current", -+ "type": "bool" -+ }, -+ { -+ "name": "halted", -+ "type": "bool" -+ }, -+ { -+ "name": "qom_path", -+ "type": "str" -+ }, -+ { -+ "name": "thread_id", -+ "type": "int" -+ }, -+ { -+ "name": "arch", -+ "type": "236" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "121", -+ "members": [ -+ { -+ "name": "status", -+ "type": "243" -+ }, -+ { -+ "name": "completed", -+ "type": "int" -+ }, -+ { -+ "name": "total", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "122", -+ "members": [ -+ { -+ "name": "formats", -+ "type": "[225]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[123]", -+ "element-type": "123", -+ "meta-type": "array" -+ }, -+ { -+ "name": "123", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[124]", -+ "element-type": "124", -+ "meta-type": "array" -+ }, -+ { -+ "name": "124", -+ "members": [ -+ { -+ "name": "fdset-id", -+ "type": "int" -+ }, -+ { -+ "name": "fds", -+ "type": "[244]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[125]", -+ "element-type": "125", -+ "meta-type": "array" -+ }, -+ { -+ "name": "125", -+ "members": [ -+ { -+ "name": "version", -+ "type": "int" -+ }, -+ { -+ "name": "emulated", -+ "type": "bool" -+ }, -+ { -+ "name": "kernel", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[126]", -+ "element-type": "126", -+ "meta-type": "array" -+ }, -+ { -+ "name": "126", -+ "members": [ -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "vcpus-count", -+ "type": "int" -+ }, -+ { -+ "name": "props", -+ "type": "245" -+ }, -+ { -+ "name": "qom-path", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[127]", -+ "element-type": "127", -+ "meta-type": "array" -+ }, -+ { -+ "name": "127", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "thread-id", -+ "type": "int" -+ }, -+ { -+ "name": "poll-max-ns", -+ "type": "int" -+ }, -+ { -+ "name": "poll-grow", -+ "type": "int" -+ }, -+ { -+ "name": "poll-shrink", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "128", -+ "members": [ -+ { -+ "name": "enabled", -+ "type": "bool" -+ }, -+ { -+ "name": "present", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[129]", -+ "element-type": "129", -+ "meta-type": "array" -+ }, -+ { -+ "name": "129", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "alias", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "is-default", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "cpu-max", -+ "type": "int" -+ }, -+ { -+ "name": "hotpluggable-cpus", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[130]", -+ "element-type": "130", -+ "meta-type": "array" -+ }, -+ { -+ "name": "130", -+ "members": [ -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "merge", -+ "type": "bool" -+ }, -+ { -+ "name": "dump", -+ "type": "bool" -+ }, -+ { -+ "name": "prealloc", -+ "type": "bool" -+ }, -+ { -+ "name": "host-nodes", -+ "type": "[int]" -+ }, -+ { -+ "name": "policy", -+ "type": "246" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[131]", -+ "element-type": "131", -+ "meta-type": "array" -+ }, -+ { -+ "name": "131", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "dimm", -+ "type": "248" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "247" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[132]", -+ "element-type": "132", -+ "meta-type": "array" -+ }, -+ { -+ "name": "132", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "index", -+ "type": "int" -+ }, -+ { -+ "name": "current", -+ "type": "bool" -+ }, -+ { -+ "name": "absolute", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "133", -+ "members": [ -+ { -+ "name": "status", -+ "default": null, -+ "type": "184" -+ }, -+ { -+ "name": "ram", -+ "default": null, -+ "type": "249" -+ }, -+ { -+ "name": "disk", -+ "default": null, -+ "type": "249" -+ }, -+ { -+ "name": "xbzrle-cache", -+ "default": null, -+ "type": "250" -+ }, -+ { -+ "name": "total-time", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "expected-downtime", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "downtime", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "setup-time", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cpu-throttle-percentage", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "error-desc", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "int", -+ "json-type": "int", -+ "meta-type": "builtin" -+ }, -+ { -+ "name": "[134]", -+ "element-type": "134", -+ "meta-type": "array" -+ }, -+ { -+ "name": "134", -+ "members": [ -+ { -+ "name": "capability", -+ "type": "251" -+ }, -+ { -+ "name": "state", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "135", -+ "members": [ -+ { -+ "name": "name", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[136]", -+ "element-type": "136", -+ "meta-type": "array" -+ }, -+ { -+ "name": "136", -+ "members": [ -+ { -+ "name": "file", -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "ro", -+ "type": "bool" -+ }, -+ { -+ "name": "drv", -+ "type": "str" -+ }, -+ { -+ "name": "backing_file", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "backing_file_depth", -+ "type": "int" -+ }, -+ { -+ "name": "encrypted", -+ "type": "bool" -+ }, -+ { -+ "name": "encryption_key_missing", -+ "type": "bool" -+ }, -+ { -+ "name": "detect_zeroes", -+ "type": "197" -+ }, -+ { -+ "name": "bps", -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd", -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr", -+ "type": "int" -+ }, -+ { -+ "name": "iops", -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd", -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr", -+ "type": "int" -+ }, -+ { -+ "name": "image", -+ "type": "252" -+ }, -+ { -+ "name": "bps_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr_max", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_rd_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "bps_wr_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_rd_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_wr_max_length", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "iops_size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "cache", -+ "type": "253" -+ }, -+ { -+ "name": "write_threshold", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[137]", -+ "element-type": "137", -+ "meta-type": "array" -+ }, -+ { -+ "name": "137", -+ "members": [ -+ { -+ "name": "bus", -+ "type": "int" -+ }, -+ { -+ "name": "devices", -+ "type": "[254]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[138]", -+ "element-type": "138", -+ "meta-type": "array" -+ }, -+ { -+ "name": "138", -+ "tag": "meta-type", -+ "variants": [ -+ { -+ "case": "builtin", -+ "type": "256" -+ }, -+ { -+ "case": "enum", -+ "type": "257" -+ }, -+ { -+ "case": "array", -+ "type": "258" -+ }, -+ { -+ "case": "object", -+ "type": "259" -+ }, -+ { -+ "case": "alternate", -+ "type": "260" -+ }, -+ { -+ "case": "command", -+ "type": "261" -+ }, -+ { -+ "case": "event", -+ "type": "262" -+ } -+ ], -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "meta-type", -+ "type": "255" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "139", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "140", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "type": "int" -+ }, -+ { -+ "name": "ports", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "141", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "tbl-id", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[142]", -+ "element-type": "142", -+ "meta-type": "array" -+ }, -+ { -+ "name": "142", -+ "members": [ -+ { -+ "name": "cookie", -+ "type": "int" -+ }, -+ { -+ "name": "hits", -+ "type": "int" -+ }, -+ { -+ "name": "key", -+ "type": "263" -+ }, -+ { -+ "name": "mask", -+ "type": "264" -+ }, -+ { -+ "name": "action", -+ "type": "265" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "143", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[144]", -+ "element-type": "144", -+ "meta-type": "array" -+ }, -+ { -+ "name": "144", -+ "members": [ -+ { -+ "name": "id", -+ "type": "int" -+ }, -+ { -+ "name": "type", -+ "type": "int" -+ }, -+ { -+ "name": "vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "pport", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "index", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "out-pport", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "set-vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "pop-vlan", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group-ids", -+ "default": null, -+ "type": "[int]" -+ }, -+ { -+ "name": "set-eth-src", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "set-eth-dst", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "ttl-check", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "145", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[146]", -+ "element-type": "146", -+ "meta-type": "array" -+ }, -+ { -+ "name": "146", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "enabled", -+ "type": "bool" -+ }, -+ { -+ "name": "link-up", -+ "type": "bool" -+ }, -+ { -+ "name": "speed", -+ "type": "int" -+ }, -+ { -+ "name": "duplex", -+ "type": "266" -+ }, -+ { -+ "name": "autoneg", -+ "type": "267" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "147", -+ "members": [ -+ { -+ "name": "name", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[148]", -+ "element-type": "148", -+ "meta-type": "array" -+ }, -+ { -+ "name": "148", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "promiscuous", -+ "type": "bool" -+ }, -+ { -+ "name": "multicast", -+ "type": "268" -+ }, -+ { -+ "name": "unicast", -+ "type": "268" -+ }, -+ { -+ "name": "vlan", -+ "type": "268" -+ }, -+ { -+ "name": "broadcast-allowed", -+ "type": "bool" -+ }, -+ { -+ "name": "multicast-overflow", -+ "type": "bool" -+ }, -+ { -+ "name": "unicast-overflow", -+ "type": "bool" -+ }, -+ { -+ "name": "main-mac", -+ "type": "str" -+ }, -+ { -+ "name": "vlan-table", -+ "type": "[int]" -+ }, -+ { -+ "name": "unicast-table", -+ "type": "[str]" -+ }, -+ { -+ "name": "multicast-table", -+ "type": "[str]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "149", -+ "members": [ -+ { -+ "name": "enabled", -+ "type": "bool" -+ }, -+ { -+ "name": "migrated", -+ "type": "bool" -+ }, -+ { -+ "name": "host", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tls-port", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "auth", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "compiled-version", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "mouse-mode", -+ "type": "269" -+ }, -+ { -+ "name": "channels", -+ "default": null, -+ "type": "[188]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "150", -+ "members": [ -+ { -+ "name": "running", -+ "type": "bool" -+ }, -+ { -+ "name": "singlestep", -+ "type": "bool" -+ }, -+ { -+ "name": "status", -+ "type": "270" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "151", -+ "members": [ -+ { -+ "name": "arch", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[152]", -+ "element-type": "152", -+ "meta-type": "array" -+ }, -+ { -+ "name": "152", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "model", -+ "type": "153" -+ }, -+ { -+ "name": "options", -+ "type": "271" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[153]", -+ "element-type": "153", -+ "meta-type": "array" -+ }, -+ { -+ "name": "153", -+ "meta-type": "enum", -+ "values": [ -+ "tpm-tis" -+ ] -+ }, -+ { -+ "name": "[154]", -+ "element-type": "154", -+ "meta-type": "array" -+ }, -+ { -+ "name": "154", -+ "meta-type": "enum", -+ "values": [ -+ "passthrough" -+ ] -+ }, -+ { -+ "name": "155", -+ "members": [ -+ { -+ "name": "UUID", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "156", -+ "members": [ -+ { -+ "name": "qemu", -+ "type": "272" -+ }, -+ { -+ "name": "package", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "157", -+ "members": [ -+ { -+ "name": "guid", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "158", -+ "members": [ -+ { -+ "name": "enabled", -+ "type": "bool" -+ }, -+ { -+ "name": "host", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "default": null, -+ "type": "273" -+ }, -+ { -+ "name": "service", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "auth", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "clients", -+ "default": null, -+ "type": "[191]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[159]", -+ "element-type": "159", -+ "meta-type": "array" -+ }, -+ { -+ "name": "159", -+ "members": [ -+ { -+ "name": "id", -+ "type": "str" -+ }, -+ { -+ "name": "server", -+ "type": "[274]" -+ }, -+ { -+ "name": "clients", -+ "type": "[191]" -+ }, -+ { -+ "name": "auth", -+ "type": "275" -+ }, -+ { -+ "name": "vencrypt", -+ "default": null, -+ "type": "276" -+ }, -+ { -+ "name": "display", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "160", -+ "members": [ -+ { -+ "name": "error", -+ "type": "bool" -+ }, -+ { -+ "name": "desc", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "161", -+ "members": [ -+ { -+ "name": "fdset-id", -+ "type": "int" -+ }, -+ { -+ "name": "fd", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "162", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "277" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "163", -+ "members": [ -+ { -+ "name": "device", -+ "type": "str" -+ }, -+ { -+ "name": "data", -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "default": null, -+ "type": "277" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "164", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "165", -+ "members": [ -+ { -+ "name": "keys", -+ "type": "[278]" -+ }, -+ { -+ "name": "hold-time", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "166", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "up", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "167", -+ "members": [ -+ { -+ "name": "protocol", -+ "type": "str" -+ }, -+ { -+ "name": "password", -+ "type": "str" -+ }, -+ { -+ "name": "connected", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "168", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "vcpu", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[169]", -+ "element-type": "169", -+ "meta-type": "array" -+ }, -+ { -+ "name": "169", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "state", -+ "type": "279" -+ }, -+ { -+ "name": "vcpu", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "170", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "enable", -+ "type": "bool" -+ }, -+ { -+ "name": "ignore-unavailable", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "vcpu", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "171", -+ "members": [ -+ { -+ "name": "actions", -+ "type": "[280]" -+ }, -+ { -+ "name": "properties", -+ "default": null, -+ "type": "281" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "172", -+ "members": [ -+ { -+ "name": "parent", -+ "type": "str" -+ }, -+ { -+ "name": "child", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "173", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "node-name", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "174", -+ "members": [ -+ { -+ "name": "device", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "175", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "176", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "177", -+ "members": [ -+ { -+ "name": "enable", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "178", -+ "members": [ -+ { -+ "name": "enable", -+ "type": "bool" -+ }, -+ { -+ "name": "primary", -+ "type": "bool" -+ }, -+ { -+ "name": "failover", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "bool", -+ "json-type": "boolean", -+ "meta-type": "builtin" -+ }, -+ { -+ "name": "179", -+ "meta-type": "enum", -+ "values": [ -+ "read", -+ "write" -+ ] -+ }, -+ { -+ "name": "180", -+ "meta-type": "enum", -+ "values": [ -+ "ignore", -+ "report", -+ "stop" -+ ] -+ }, -+ { -+ "name": "181", -+ "meta-type": "enum", -+ "values": [ -+ "commit", -+ "stream", -+ "mirror", -+ "backup" -+ ] -+ }, -+ { -+ "name": "182", -+ "meta-type": "enum", -+ "values": [ -+ "pause", -+ "poweroff" -+ ] -+ }, -+ { -+ "name": "183", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "hyper-v", -+ "type": "283" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "282" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "184", -+ "meta-type": "enum", -+ "values": [ -+ "none", -+ "setup", -+ "cancelling", -+ "cancelled", -+ "active", -+ "postcopy-active", -+ "completed", -+ "failed", -+ "colo" -+ ] -+ }, -+ { -+ "name": "185", -+ "meta-type": "enum", -+ "values": [ -+ "read", -+ "write", -+ "flush" -+ ] -+ }, -+ { -+ "name": "186", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "187", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "auth", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "188", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "connection-id", -+ "type": "int" -+ }, -+ { -+ "name": "channel-type", -+ "type": "int" -+ }, -+ { -+ "name": "channel-id", -+ "type": "int" -+ }, -+ { -+ "name": "tls", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "189", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "service", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "websocket", -+ "type": "bool" -+ }, -+ { -+ "name": "auth", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "190", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "service", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "websocket", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "191", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "service", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "websocket", -+ "type": "bool" -+ }, -+ { -+ "name": "x509_dname", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sasl_username", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "192", -+ "meta-type": "enum", -+ "values": [ -+ "reset", -+ "shutdown", -+ "poweroff", -+ "pause", -+ "debug", -+ "none", -+ "inject-nmi" -+ ] -+ }, -+ { -+ "name": "193", -+ "meta-type": "enum", -+ "values": [ -+ "report", -+ "ignore", -+ "enospc", -+ "stop", -+ "auto" -+ ] -+ }, -+ { -+ "name": "194", -+ "meta-type": "enum", -+ "values": [ -+ "blkdebug", -+ "blkverify", -+ "bochs", -+ "cloop", -+ "dmg", -+ "file", -+ "ftp", -+ "ftps", -+ "gluster", -+ "host_cdrom", -+ "host_device", -+ "http", -+ "https", -+ "iscsi", -+ "luks", -+ "nbd", -+ "nfs", -+ "null-aio", -+ "null-co", -+ "parallels", -+ "qcow", -+ "qcow2", -+ "qed", -+ "quorum", -+ "raw", -+ "rbd", -+ "replication", -+ "sheepdog", -+ "ssh", -+ "vdi", -+ "vhdx", -+ "vmdk", -+ "vpc", -+ "vvfat" -+ ] -+ }, -+ { -+ "name": "195", -+ "meta-type": "enum", -+ "values": [ -+ "ignore", -+ "unmap" -+ ] -+ }, -+ { -+ "name": "196", -+ "members": [ -+ { -+ "name": "direct", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "no-flush", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "197", -+ "meta-type": "enum", -+ "values": [ -+ "off", -+ "on", -+ "unmap" -+ ] -+ }, -+ { -+ "name": "198", -+ "members": [ -+ { -+ "name": "image", -+ "type": "284" -+ }, -+ { -+ "name": "config", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "align", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "inject-error", -+ "default": null, -+ "type": "[285]" -+ }, -+ { -+ "name": "set-state", -+ "default": null, -+ "type": "[286]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "199", -+ "members": [ -+ { -+ "name": "test", -+ "type": "284" -+ }, -+ { -+ "name": "raw", -+ "type": "284" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "200", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "201", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ }, -+ { -+ "name": "aio", -+ "default": null, -+ "type": "287" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "202", -+ "members": [ -+ { -+ "name": "url", -+ "type": "str" -+ }, -+ { -+ "name": "readahead", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "timeout", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-password-secret", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "203", -+ "members": [ -+ { -+ "name": "url", -+ "type": "str" -+ }, -+ { -+ "name": "readahead", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "timeout", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sslverify", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "204", -+ "members": [ -+ { -+ "name": "volume", -+ "type": "str" -+ }, -+ { -+ "name": "path", -+ "type": "str" -+ }, -+ { -+ "name": "server", -+ "type": "[288]" -+ }, -+ { -+ "name": "debug", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "205", -+ "members": [ -+ { -+ "name": "url", -+ "type": "str" -+ }, -+ { -+ "name": "readahead", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "timeout", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "cookie", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "206", -+ "members": [ -+ { -+ "name": "url", -+ "type": "str" -+ }, -+ { -+ "name": "readahead", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "timeout", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-username", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "proxy-password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "cookie", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "sslverify", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "207", -+ "members": [ -+ { -+ "name": "transport", -+ "type": "289" -+ }, -+ { -+ "name": "portal", -+ "type": "str" -+ }, -+ { -+ "name": "target", -+ "type": "str" -+ }, -+ { -+ "name": "lun", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "user", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "password-secret", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "initiator-name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "header-digest", -+ "default": null, -+ "type": "290" -+ }, -+ { -+ "name": "timeout", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "208", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ }, -+ { -+ "name": "key-secret", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "209", -+ "members": [ -+ { -+ "name": "server", -+ "type": "288" -+ }, -+ { -+ "name": "export", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "tls-creds", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "210", -+ "members": [ -+ { -+ "name": "server", -+ "type": "291" -+ }, -+ { -+ "name": "path", -+ "type": "str" -+ }, -+ { -+ "name": "user", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tcp-syn-count", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "readahead-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "page-cache-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "debug", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "211", -+ "members": [ -+ { -+ "name": "size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "latency-ns", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "212", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ }, -+ { -+ "name": "backing", -+ "default": null, -+ "type": "284" -+ }, -+ { -+ "name": "lazy-refcounts", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "pass-discard-request", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "pass-discard-snapshot", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "pass-discard-other", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "overlap-check", -+ "default": null, -+ "type": "292" -+ }, -+ { -+ "name": "cache-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "l2-cache-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "refcount-cache-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cache-clean-interval", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "213", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ }, -+ { -+ "name": "backing", -+ "default": null, -+ "type": "284" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "214", -+ "members": [ -+ { -+ "name": "blkverify", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "children", -+ "type": "[284]" -+ }, -+ { -+ "name": "vote-threshold", -+ "type": "int" -+ }, -+ { -+ "name": "rewrite-corrupted", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "read-pattern", -+ "default": null, -+ "type": "293" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "215", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ }, -+ { -+ "name": "offset", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "216", -+ "members": [ -+ { -+ "name": "pool", -+ "type": "str" -+ }, -+ { -+ "name": "image", -+ "type": "str" -+ }, -+ { -+ "name": "conf", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "snapshot", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "user", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "server", -+ "default": null, -+ "type": "[294]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "217", -+ "members": [ -+ { -+ "name": "file", -+ "type": "284" -+ }, -+ { -+ "name": "mode", -+ "type": "295" -+ }, -+ { -+ "name": "top-id", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "218", -+ "members": [ -+ { -+ "name": "server", -+ "type": "288" -+ }, -+ { -+ "name": "vdi", -+ "type": "str" -+ }, -+ { -+ "name": "snap-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tag", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "219", -+ "members": [ -+ { -+ "name": "server", -+ "type": "296" -+ }, -+ { -+ "name": "path", -+ "type": "str" -+ }, -+ { -+ "name": "user", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "220", -+ "members": [ -+ { -+ "name": "dir", -+ "type": "str" -+ }, -+ { -+ "name": "fat-type", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "floppy", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "label", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "rw", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "221", -+ "meta-type": "enum", -+ "values": [ -+ "top", -+ "full", -+ "none", -+ "incremental" -+ ] -+ }, -+ { -+ "name": "222", -+ "meta-type": "enum", -+ "values": [ -+ "retain", -+ "read-only", -+ "read-write" -+ ] -+ }, -+ { -+ "name": "223", -+ "meta-type": "enum", -+ "values": [ -+ "existing", -+ "absolute-paths" -+ ] -+ }, -+ { -+ "name": "224", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "file", -+ "type": "298" -+ }, -+ { -+ "case": "serial", -+ "type": "299" -+ }, -+ { -+ "case": "parallel", -+ "type": "299" -+ }, -+ { -+ "case": "pipe", -+ "type": "299" -+ }, -+ { -+ "case": "socket", -+ "type": "300" -+ }, -+ { -+ "case": "udp", -+ "type": "301" -+ }, -+ { -+ "case": "pty", -+ "type": "302" -+ }, -+ { -+ "case": "null", -+ "type": "302" -+ }, -+ { -+ "case": "mux", -+ "type": "303" -+ }, -+ { -+ "case": "msmouse", -+ "type": "302" -+ }, -+ { -+ "case": "wctablet", -+ "type": "302" -+ }, -+ { -+ "case": "braille", -+ "type": "302" -+ }, -+ { -+ "case": "testdev", -+ "type": "302" -+ }, -+ { -+ "case": "stdio", -+ "type": "304" -+ }, -+ { -+ "case": "console", -+ "type": "302" -+ }, -+ { -+ "case": "spicevmc", -+ "type": "305" -+ }, -+ { -+ "case": "spiceport", -+ "type": "306" -+ }, -+ { -+ "case": "vc", -+ "type": "307" -+ }, -+ { -+ "case": "ringbuf", -+ "type": "308" -+ }, -+ { -+ "case": "memory", -+ "type": "308" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "297" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "225", -+ "meta-type": "enum", -+ "values": [ -+ "elf", -+ "kdump-zlib", -+ "kdump-lzo", -+ "kdump-snappy" -+ ] -+ }, -+ { -+ "name": "[226]", -+ "element-type": "226", -+ "meta-type": "array" -+ }, -+ { -+ "name": "226", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "key", -+ "type": "310" -+ }, -+ { -+ "case": "btn", -+ "type": "311" -+ }, -+ { -+ "case": "rel", -+ "type": "312" -+ }, -+ { -+ "case": "abs", -+ "type": "312" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "309" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "number", -+ "json-type": "number", -+ "meta-type": "builtin" -+ }, -+ { -+ "name": "227", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "inet", -+ "type": "314" -+ }, -+ { -+ "case": "unix", -+ "type": "315" -+ }, -+ { -+ "case": "vsock", -+ "type": "316" -+ }, -+ { -+ "case": "fd", -+ "type": "317" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "313" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "228", -+ "meta-type": "enum", -+ "values": [ -+ "DIMM", -+ "CPU" -+ ] -+ }, -+ { -+ "name": "229", -+ "meta-type": "enum", -+ "values": [ -+ "ok", -+ "failed", -+ "nospace" -+ ] -+ }, -+ { -+ "name": "[230]", -+ "element-type": "230", -+ "meta-type": "array" -+ }, -+ { -+ "name": "230", -+ "members": [ -+ { -+ "name": "name", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "count", -+ "type": "int" -+ }, -+ { -+ "name": "granularity", -+ "type": "int" -+ }, -+ { -+ "name": "status", -+ "type": "318" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "231", -+ "members": [ -+ { -+ "name": "rd_bytes", -+ "type": "int" -+ }, -+ { -+ "name": "wr_bytes", -+ "type": "int" -+ }, -+ { -+ "name": "rd_operations", -+ "type": "int" -+ }, -+ { -+ "name": "wr_operations", -+ "type": "int" -+ }, -+ { -+ "name": "flush_operations", -+ "type": "int" -+ }, -+ { -+ "name": "flush_total_time_ns", -+ "type": "int" -+ }, -+ { -+ "name": "wr_total_time_ns", -+ "type": "int" -+ }, -+ { -+ "name": "rd_total_time_ns", -+ "type": "int" -+ }, -+ { -+ "name": "wr_highest_offset", -+ "type": "int" -+ }, -+ { -+ "name": "rd_merged", -+ "type": "int" -+ }, -+ { -+ "name": "wr_merged", -+ "type": "int" -+ }, -+ { -+ "name": "idle_time_ns", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "failed_rd_operations", -+ "type": "int" -+ }, -+ { -+ "name": "failed_wr_operations", -+ "type": "int" -+ }, -+ { -+ "name": "failed_flush_operations", -+ "type": "int" -+ }, -+ { -+ "name": "invalid_rd_operations", -+ "type": "int" -+ }, -+ { -+ "name": "invalid_wr_operations", -+ "type": "int" -+ }, -+ { -+ "name": "invalid_flush_operations", -+ "type": "int" -+ }, -+ { -+ "name": "account_invalid", -+ "type": "bool" -+ }, -+ { -+ "name": "account_failed", -+ "type": "bool" -+ }, -+ { -+ "name": "timed_stats", -+ "type": "[319]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[232]", -+ "element-type": "232", -+ "meta-type": "array" -+ }, -+ { -+ "name": "232", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "320" -+ }, -+ { -+ "name": "help", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "default", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[str]", -+ "element-type": "str", -+ "meta-type": "array" -+ }, -+ { -+ "name": "233", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "props", -+ "default": null, -+ "type": "any" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "234", -+ "meta-type": "enum", -+ "values": [ -+ "incompatible", -+ "identical", -+ "superset", -+ "subset" -+ ] -+ }, -+ { -+ "name": "235", -+ "meta-type": "enum", -+ "values": [ -+ "static", -+ "full" -+ ] -+ }, -+ { -+ "name": "236", -+ "meta-type": "enum", -+ "values": [ -+ "x86", -+ "sparc", -+ "ppc", -+ "mips", -+ "tricore", -+ "other" -+ ] -+ }, -+ { -+ "name": "237", -+ "members": [ -+ { -+ "name": "pc", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "238", -+ "members": [ -+ { -+ "name": "pc", -+ "type": "int" -+ }, -+ { -+ "name": "npc", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "239", -+ "members": [ -+ { -+ "name": "nip", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "240", -+ "members": [ -+ { -+ "name": "PC", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "241", -+ "members": [ -+ { -+ "name": "PC", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "242", -+ "members": [ -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "243", -+ "meta-type": "enum", -+ "values": [ -+ "none", -+ "active", -+ "completed", -+ "failed" -+ ] -+ }, -+ { -+ "name": "[225]", -+ "element-type": "225", -+ "meta-type": "array" -+ }, -+ { -+ "name": "[244]", -+ "element-type": "244", -+ "meta-type": "array" -+ }, -+ { -+ "name": "244", -+ "members": [ -+ { -+ "name": "fd", -+ "type": "int" -+ }, -+ { -+ "name": "opaque", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "245", -+ "members": [ -+ { -+ "name": "node-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "socket-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "core-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "thread-id", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[int]", -+ "element-type": "int", -+ "meta-type": "array" -+ }, -+ { -+ "name": "246", -+ "meta-type": "enum", -+ "values": [ -+ "default", -+ "preferred", -+ "bind", -+ "interleave" -+ ] -+ }, -+ { -+ "name": "247", -+ "meta-type": "enum", -+ "values": [ -+ "dimm" -+ ] -+ }, -+ { -+ "name": "248", -+ "members": [ -+ { -+ "name": "data", -+ "type": "321" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "249", -+ "members": [ -+ { -+ "name": "transferred", -+ "type": "int" -+ }, -+ { -+ "name": "remaining", -+ "type": "int" -+ }, -+ { -+ "name": "total", -+ "type": "int" -+ }, -+ { -+ "name": "duplicate", -+ "type": "int" -+ }, -+ { -+ "name": "skipped", -+ "type": "int" -+ }, -+ { -+ "name": "normal", -+ "type": "int" -+ }, -+ { -+ "name": "normal-bytes", -+ "type": "int" -+ }, -+ { -+ "name": "dirty-pages-rate", -+ "type": "int" -+ }, -+ { -+ "name": "mbps", -+ "type": "number" -+ }, -+ { -+ "name": "dirty-sync-count", -+ "type": "int" -+ }, -+ { -+ "name": "postcopy-requests", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "250", -+ "members": [ -+ { -+ "name": "cache-size", -+ "type": "int" -+ }, -+ { -+ "name": "bytes", -+ "type": "int" -+ }, -+ { -+ "name": "pages", -+ "type": "int" -+ }, -+ { -+ "name": "cache-miss", -+ "type": "int" -+ }, -+ { -+ "name": "cache-miss-rate", -+ "type": "number" -+ }, -+ { -+ "name": "overflow", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "251", -+ "meta-type": "enum", -+ "values": [ -+ "xbzrle", -+ "rdma-pin-all", -+ "auto-converge", -+ "zero-blocks", -+ "compress", -+ "events", -+ "postcopy-ram", -+ "x-colo", -+ "release-ram" -+ ] -+ }, -+ { -+ "name": "252", -+ "members": [ -+ { -+ "name": "filename", -+ "type": "str" -+ }, -+ { -+ "name": "format", -+ "type": "str" -+ }, -+ { -+ "name": "dirty-flag", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "actual-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "virtual-size", -+ "type": "int" -+ }, -+ { -+ "name": "cluster-size", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "encrypted", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "compressed", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "backing-filename", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "full-backing-filename", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "backing-filename-format", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "snapshots", -+ "default": null, -+ "type": "[55]" -+ }, -+ { -+ "name": "backing-image", -+ "default": null, -+ "type": "252" -+ }, -+ { -+ "name": "format-specific", -+ "default": null, -+ "type": "322" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "253", -+ "members": [ -+ { -+ "name": "writeback", -+ "type": "bool" -+ }, -+ { -+ "name": "direct", -+ "type": "bool" -+ }, -+ { -+ "name": "no-flush", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[254]", -+ "element-type": "254", -+ "meta-type": "array" -+ }, -+ { -+ "name": "254", -+ "members": [ -+ { -+ "name": "bus", -+ "type": "int" -+ }, -+ { -+ "name": "slot", -+ "type": "int" -+ }, -+ { -+ "name": "function", -+ "type": "int" -+ }, -+ { -+ "name": "class_info", -+ "type": "323" -+ }, -+ { -+ "name": "id", -+ "type": "324" -+ }, -+ { -+ "name": "irq", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "qdev_id", -+ "type": "str" -+ }, -+ { -+ "name": "pci_bridge", -+ "default": null, -+ "type": "325" -+ }, -+ { -+ "name": "regions", -+ "type": "[326]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "255", -+ "meta-type": "enum", -+ "values": [ -+ "builtin", -+ "enum", -+ "array", -+ "object", -+ "alternate", -+ "command", -+ "event" -+ ] -+ }, -+ { -+ "name": "256", -+ "members": [ -+ { -+ "name": "json-type", -+ "type": "327" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "257", -+ "members": [ -+ { -+ "name": "values", -+ "type": "[str]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "258", -+ "members": [ -+ { -+ "name": "element-type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "259", -+ "members": [ -+ { -+ "name": "members", -+ "type": "[328]" -+ }, -+ { -+ "name": "tag", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "variants", -+ "default": null, -+ "type": "[329]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "260", -+ "members": [ -+ { -+ "name": "members", -+ "type": "[330]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "261", -+ "members": [ -+ { -+ "name": "arg-type", -+ "type": "str" -+ }, -+ { -+ "name": "ret-type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "262", -+ "members": [ -+ { -+ "name": "arg-type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "263", -+ "members": [ -+ { -+ "name": "priority", -+ "type": "int" -+ }, -+ { -+ "name": "tbl-id", -+ "type": "int" -+ }, -+ { -+ "name": "in-pport", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tunnel-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "eth-type", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "eth-src", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "eth-dst", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "ip-proto", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "ip-tos", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "ip-dst", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "264", -+ "members": [ -+ { -+ "name": "in-pport", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tunnel-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "eth-src", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "eth-dst", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "ip-proto", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "ip-tos", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "265", -+ "members": [ -+ { -+ "name": "goto-tbl", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "group-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "tunnel-lport", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "new-vlan-id", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "out-pport", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "266", -+ "meta-type": "enum", -+ "values": [ -+ "half", -+ "full" -+ ] -+ }, -+ { -+ "name": "267", -+ "meta-type": "enum", -+ "values": [ -+ "off", -+ "on" -+ ] -+ }, -+ { -+ "name": "268", -+ "meta-type": "enum", -+ "values": [ -+ "normal", -+ "none", -+ "all" -+ ] -+ }, -+ { -+ "name": "269", -+ "meta-type": "enum", -+ "values": [ -+ "client", -+ "server", -+ "unknown" -+ ] -+ }, -+ { -+ "name": "[188]", -+ "element-type": "188", -+ "meta-type": "array" -+ }, -+ { -+ "name": "270", -+ "meta-type": "enum", -+ "values": [ -+ "debug", -+ "inmigrate", -+ "internal-error", -+ "io-error", -+ "paused", -+ "postmigrate", -+ "prelaunch", -+ "finish-migrate", -+ "restore-vm", -+ "running", -+ "save-vm", -+ "shutdown", -+ "suspended", -+ "watchdog", -+ "guest-panicked", -+ "colo" -+ ] -+ }, -+ { -+ "name": "271", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "passthrough", -+ "type": "332" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "331" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "272", -+ "members": [ -+ { -+ "name": "major", -+ "type": "int" -+ }, -+ { -+ "name": "minor", -+ "type": "int" -+ }, -+ { -+ "name": "micro", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "273", -+ "meta-type": "enum", -+ "values": [ -+ "ipv4", -+ "ipv6", -+ "unix", -+ "vsock", -+ "unknown" -+ ] -+ }, -+ { -+ "name": "[191]", -+ "element-type": "191", -+ "meta-type": "array" -+ }, -+ { -+ "name": "[274]", -+ "element-type": "274", -+ "meta-type": "array" -+ }, -+ { -+ "name": "274", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "service", -+ "type": "str" -+ }, -+ { -+ "name": "family", -+ "type": "273" -+ }, -+ { -+ "name": "websocket", -+ "type": "bool" -+ }, -+ { -+ "name": "auth", -+ "type": "275" -+ }, -+ { -+ "name": "vencrypt", -+ "default": null, -+ "type": "276" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "275", -+ "meta-type": "enum", -+ "values": [ -+ "none", -+ "vnc", -+ "ra2", -+ "ra2ne", -+ "tight", -+ "ultra", -+ "tls", -+ "vencrypt", -+ "sasl" -+ ] -+ }, -+ { -+ "name": "276", -+ "meta-type": "enum", -+ "values": [ -+ "plain", -+ "tls-none", -+ "x509-none", -+ "tls-vnc", -+ "x509-vnc", -+ "tls-plain", -+ "x509-plain", -+ "tls-sasl", -+ "x509-sasl" -+ ] -+ }, -+ { -+ "name": "277", -+ "meta-type": "enum", -+ "values": [ -+ "utf8", -+ "base64" -+ ] -+ }, -+ { -+ "name": "[278]", -+ "element-type": "278", -+ "meta-type": "array" -+ }, -+ { -+ "name": "278", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "number", -+ "type": "334" -+ }, -+ { -+ "case": "qcode", -+ "type": "335" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "333" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "279", -+ "meta-type": "enum", -+ "values": [ -+ "unavailable", -+ "disabled", -+ "enabled" -+ ] -+ }, -+ { -+ "name": "[280]", -+ "element-type": "280", -+ "meta-type": "array" -+ }, -+ { -+ "name": "280", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "abort", -+ "type": "337" -+ }, -+ { -+ "case": "block-dirty-bitmap-add", -+ "type": "338" -+ }, -+ { -+ "case": "block-dirty-bitmap-clear", -+ "type": "339" -+ }, -+ { -+ "case": "blockdev-backup", -+ "type": "340" -+ }, -+ { -+ "case": "blockdev-snapshot", -+ "type": "341" -+ }, -+ { -+ "case": "blockdev-snapshot-internal-sync", -+ "type": "342" -+ }, -+ { -+ "case": "blockdev-snapshot-sync", -+ "type": "343" -+ }, -+ { -+ "case": "drive-backup", -+ "type": "344" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "336" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "281", -+ "members": [ -+ { -+ "name": "completion-mode", -+ "default": null, -+ "type": "345" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "282", -+ "meta-type": "enum", -+ "values": [ -+ "hyper-v" -+ ] -+ }, -+ { -+ "name": "283", -+ "members": [ -+ { -+ "name": "arg1", -+ "type": "int" -+ }, -+ { -+ "name": "arg2", -+ "type": "int" -+ }, -+ { -+ "name": "arg3", -+ "type": "int" -+ }, -+ { -+ "name": "arg4", -+ "type": "int" -+ }, -+ { -+ "name": "arg5", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "284", -+ "members": [ -+ { -+ "type": "46" -+ }, -+ { -+ "type": "str" -+ } -+ ], -+ "meta-type": "alternate" -+ }, -+ { -+ "name": "[285]", -+ "element-type": "285", -+ "meta-type": "array" -+ }, -+ { -+ "name": "285", -+ "members": [ -+ { -+ "name": "event", -+ "type": "346" -+ }, -+ { -+ "name": "state", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "errno", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "sector", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "once", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "immediately", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[286]", -+ "element-type": "286", -+ "meta-type": "array" -+ }, -+ { -+ "name": "286", -+ "members": [ -+ { -+ "name": "event", -+ "type": "346" -+ }, -+ { -+ "name": "state", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "new_state", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "287", -+ "meta-type": "enum", -+ "values": [ -+ "threads", -+ "native" -+ ] -+ }, -+ { -+ "name": "[288]", -+ "element-type": "288", -+ "meta-type": "array" -+ }, -+ { -+ "name": "288", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "inet", -+ "type": "296" -+ }, -+ { -+ "case": "unix", -+ "type": "348" -+ }, -+ { -+ "case": "vsock", -+ "type": "349" -+ }, -+ { -+ "case": "fd", -+ "type": "350" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "347" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "289", -+ "meta-type": "enum", -+ "values": [ -+ "tcp", -+ "iser" -+ ] -+ }, -+ { -+ "name": "290", -+ "meta-type": "enum", -+ "values": [ -+ "crc32c", -+ "none", -+ "crc32c-none", -+ "none-crc32c" -+ ] -+ }, -+ { -+ "name": "291", -+ "members": [ -+ { -+ "name": "type", -+ "type": "351" -+ }, -+ { -+ "name": "host", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "292", -+ "members": [ -+ { -+ "type": "352" -+ }, -+ { -+ "type": "353" -+ } -+ ], -+ "meta-type": "alternate" -+ }, -+ { -+ "name": "[284]", -+ "element-type": "284", -+ "meta-type": "array" -+ }, -+ { -+ "name": "293", -+ "meta-type": "enum", -+ "values": [ -+ "quorum", -+ "fifo" -+ ] -+ }, -+ { -+ "name": "[294]", -+ "element-type": "294", -+ "meta-type": "array" -+ }, -+ { -+ "name": "294", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "295", -+ "meta-type": "enum", -+ "values": [ -+ "primary", -+ "secondary" -+ ] -+ }, -+ { -+ "name": "296", -+ "members": [ -+ { -+ "name": "host", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ }, -+ { -+ "name": "numeric", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "to", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "ipv4", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "ipv6", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "297", -+ "meta-type": "enum", -+ "values": [ -+ "file", -+ "serial", -+ "parallel", -+ "pipe", -+ "socket", -+ "udp", -+ "pty", -+ "null", -+ "mux", -+ "msmouse", -+ "wctablet", -+ "braille", -+ "testdev", -+ "stdio", -+ "console", -+ "spicevmc", -+ "spiceport", -+ "vc", -+ "ringbuf", -+ "memory" -+ ] -+ }, -+ { -+ "name": "298", -+ "members": [ -+ { -+ "name": "data", -+ "type": "354" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "299", -+ "members": [ -+ { -+ "name": "data", -+ "type": "355" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "300", -+ "members": [ -+ { -+ "name": "data", -+ "type": "356" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "301", -+ "members": [ -+ { -+ "name": "data", -+ "type": "357" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "302", -+ "members": [ -+ { -+ "name": "data", -+ "type": "358" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "303", -+ "members": [ -+ { -+ "name": "data", -+ "type": "359" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "304", -+ "members": [ -+ { -+ "name": "data", -+ "type": "360" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "305", -+ "members": [ -+ { -+ "name": "data", -+ "type": "361" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "306", -+ "members": [ -+ { -+ "name": "data", -+ "type": "362" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "307", -+ "members": [ -+ { -+ "name": "data", -+ "type": "363" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "308", -+ "members": [ -+ { -+ "name": "data", -+ "type": "364" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "309", -+ "meta-type": "enum", -+ "values": [ -+ "key", -+ "btn", -+ "rel", -+ "abs" -+ ] -+ }, -+ { -+ "name": "310", -+ "members": [ -+ { -+ "name": "data", -+ "type": "365" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "311", -+ "members": [ -+ { -+ "name": "data", -+ "type": "366" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "312", -+ "members": [ -+ { -+ "name": "data", -+ "type": "367" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "313", -+ "meta-type": "enum", -+ "values": [ -+ "inet", -+ "unix", -+ "vsock", -+ "fd" -+ ] -+ }, -+ { -+ "name": "314", -+ "members": [ -+ { -+ "name": "data", -+ "type": "296" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "315", -+ "members": [ -+ { -+ "name": "data", -+ "type": "348" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "316", -+ "members": [ -+ { -+ "name": "data", -+ "type": "349" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "317", -+ "members": [ -+ { -+ "name": "data", -+ "type": "350" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "318", -+ "meta-type": "enum", -+ "values": [ -+ "active", -+ "disabled", -+ "frozen" -+ ] -+ }, -+ { -+ "name": "[319]", -+ "element-type": "319", -+ "meta-type": "array" -+ }, -+ { -+ "name": "319", -+ "members": [ -+ { -+ "name": "interval_length", -+ "type": "int" -+ }, -+ { -+ "name": "min_rd_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "max_rd_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "avg_rd_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "min_wr_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "max_wr_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "avg_wr_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "min_flush_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "max_flush_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "avg_flush_latency_ns", -+ "type": "int" -+ }, -+ { -+ "name": "avg_rd_queue_depth", -+ "type": "number" -+ }, -+ { -+ "name": "avg_wr_queue_depth", -+ "type": "number" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "320", -+ "meta-type": "enum", -+ "values": [ -+ "string", -+ "boolean", -+ "number", -+ "size" -+ ] -+ }, -+ { -+ "name": "321", -+ "members": [ -+ { -+ "name": "id", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "addr", -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "slot", -+ "type": "int" -+ }, -+ { -+ "name": "node", -+ "type": "int" -+ }, -+ { -+ "name": "memdev", -+ "type": "str" -+ }, -+ { -+ "name": "hotplugged", -+ "type": "bool" -+ }, -+ { -+ "name": "hotpluggable", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[55]", -+ "element-type": "55", -+ "meta-type": "array" -+ }, -+ { -+ "name": "322", -+ "tag": "type", -+ "variants": [ -+ { -+ "case": "qcow2", -+ "type": "369" -+ }, -+ { -+ "case": "vmdk", -+ "type": "370" -+ }, -+ { -+ "case": "luks", -+ "type": "371" -+ } -+ ], -+ "members": [ -+ { -+ "name": "type", -+ "type": "368" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "323", -+ "members": [ -+ { -+ "name": "desc", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "class", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "324", -+ "members": [ -+ { -+ "name": "device", -+ "type": "int" -+ }, -+ { -+ "name": "vendor", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "325", -+ "members": [ -+ { -+ "name": "bus", -+ "type": "372" -+ }, -+ { -+ "name": "devices", -+ "default": null, -+ "type": "[254]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[326]", -+ "element-type": "326", -+ "meta-type": "array" -+ }, -+ { -+ "name": "326", -+ "members": [ -+ { -+ "name": "bar", -+ "type": "int" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "address", -+ "type": "int" -+ }, -+ { -+ "name": "size", -+ "type": "int" -+ }, -+ { -+ "name": "prefetch", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "mem_type_64", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "327", -+ "meta-type": "enum", -+ "values": [ -+ "string", -+ "number", -+ "int", -+ "boolean", -+ "null", -+ "object", -+ "array", -+ "value" -+ ] -+ }, -+ { -+ "name": "[328]", -+ "element-type": "328", -+ "meta-type": "array" -+ }, -+ { -+ "name": "328", -+ "members": [ -+ { -+ "name": "name", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ }, -+ { -+ "name": "default", -+ "default": null, -+ "type": "any" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[329]", -+ "element-type": "329", -+ "meta-type": "array" -+ }, -+ { -+ "name": "329", -+ "members": [ -+ { -+ "name": "case", -+ "type": "str" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[330]", -+ "element-type": "330", -+ "meta-type": "array" -+ }, -+ { -+ "name": "330", -+ "members": [ -+ { -+ "name": "type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "331", -+ "meta-type": "enum", -+ "values": [ -+ "passthrough" -+ ] -+ }, -+ { -+ "name": "332", -+ "members": [ -+ { -+ "name": "data", -+ "type": "373" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "333", -+ "meta-type": "enum", -+ "values": [ -+ "number", -+ "qcode" -+ ] -+ }, -+ { -+ "name": "334", -+ "members": [ -+ { -+ "name": "data", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "335", -+ "members": [ -+ { -+ "name": "data", -+ "type": "374" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "336", -+ "meta-type": "enum", -+ "values": [ -+ "abort", -+ "block-dirty-bitmap-add", -+ "block-dirty-bitmap-clear", -+ "blockdev-backup", -+ "blockdev-snapshot", -+ "blockdev-snapshot-internal-sync", -+ "blockdev-snapshot-sync", -+ "drive-backup" -+ ] -+ }, -+ { -+ "name": "337", -+ "members": [ -+ { -+ "name": "data", -+ "type": "375" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "338", -+ "members": [ -+ { -+ "name": "data", -+ "type": "34" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "339", -+ "members": [ -+ { -+ "name": "data", -+ "type": "35" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "340", -+ "members": [ -+ { -+ "name": "data", -+ "type": "47" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "341", -+ "members": [ -+ { -+ "name": "data", -+ "type": "53" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "342", -+ "members": [ -+ { -+ "name": "data", -+ "type": "56" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "343", -+ "members": [ -+ { -+ "name": "data", -+ "type": "57" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "344", -+ "members": [ -+ { -+ "name": "data", -+ "type": "72" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "345", -+ "meta-type": "enum", -+ "values": [ -+ "individual", -+ "grouped" -+ ] -+ }, -+ { -+ "name": "346", -+ "meta-type": "enum", -+ "values": [ -+ "l1_update", -+ "l1_grow_alloc_table", -+ "l1_grow_write_table", -+ "l1_grow_activate_table", -+ "l2_load", -+ "l2_update", -+ "l2_update_compressed", -+ "l2_alloc_cow_read", -+ "l2_alloc_write", -+ "read_aio", -+ "read_backing_aio", -+ "read_compressed", -+ "write_aio", -+ "write_compressed", -+ "vmstate_load", -+ "vmstate_save", -+ "cow_read", -+ "cow_write", -+ "reftable_load", -+ "reftable_grow", -+ "reftable_update", -+ "refblock_load", -+ "refblock_update", -+ "refblock_update_part", -+ "refblock_alloc", -+ "refblock_alloc_hookup", -+ "refblock_alloc_write", -+ "refblock_alloc_write_blocks", -+ "refblock_alloc_write_table", -+ "refblock_alloc_switch_table", -+ "cluster_alloc", -+ "cluster_alloc_bytes", -+ "cluster_free", -+ "flush_to_os", -+ "flush_to_disk", -+ "pwritev_rmw_head", -+ "pwritev_rmw_after_head", -+ "pwritev_rmw_tail", -+ "pwritev_rmw_after_tail", -+ "pwritev", -+ "pwritev_zero", -+ "pwritev_done", -+ "empty_image_prepare" -+ ] -+ }, -+ { -+ "name": "347", -+ "meta-type": "enum", -+ "values": [ -+ "inet", -+ "unix", -+ "vsock", -+ "fd" -+ ] -+ }, -+ { -+ "name": "348", -+ "members": [ -+ { -+ "name": "path", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "349", -+ "members": [ -+ { -+ "name": "cid", -+ "type": "str" -+ }, -+ { -+ "name": "port", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "350", -+ "members": [ -+ { -+ "name": "str", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "351", -+ "meta-type": "enum", -+ "values": [ -+ "inet" -+ ] -+ }, -+ { -+ "name": "352", -+ "members": [ -+ { -+ "name": "template", -+ "default": null, -+ "type": "353" -+ }, -+ { -+ "name": "main-header", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "active-l1", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "active-l2", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "refcount-table", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "refcount-block", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "snapshot-table", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "inactive-l1", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "inactive-l2", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "353", -+ "meta-type": "enum", -+ "values": [ -+ "none", -+ "constant", -+ "cached", -+ "all" -+ ] -+ }, -+ { -+ "name": "354", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "in", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "out", -+ "type": "str" -+ }, -+ { -+ "name": "append", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "355", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "device", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "356", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "addr", -+ "type": "227" -+ }, -+ { -+ "name": "tls-creds", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "server", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "wait", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "nodelay", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "telnet", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "reconnect", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "357", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "remote", -+ "type": "227" -+ }, -+ { -+ "name": "local", -+ "default": null, -+ "type": "227" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "358", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "359", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "chardev", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "360", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "signal", -+ "default": null, -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "361", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "type", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "362", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "fqdn", -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "363", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "width", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "height", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "cols", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "rows", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "364", -+ "members": [ -+ { -+ "name": "logfile", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "logappend", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "size", -+ "default": null, -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "365", -+ "members": [ -+ { -+ "name": "key", -+ "type": "278" -+ }, -+ { -+ "name": "down", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "366", -+ "members": [ -+ { -+ "name": "button", -+ "type": "376" -+ }, -+ { -+ "name": "down", -+ "type": "bool" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "367", -+ "members": [ -+ { -+ "name": "axis", -+ "type": "377" -+ }, -+ { -+ "name": "value", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "368", -+ "meta-type": "enum", -+ "values": [ -+ "qcow2", -+ "vmdk", -+ "luks" -+ ] -+ }, -+ { -+ "name": "369", -+ "members": [ -+ { -+ "name": "data", -+ "type": "378" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "370", -+ "members": [ -+ { -+ "name": "data", -+ "type": "379" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "371", -+ "members": [ -+ { -+ "name": "data", -+ "type": "380" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "372", -+ "members": [ -+ { -+ "name": "number", -+ "type": "int" -+ }, -+ { -+ "name": "secondary", -+ "type": "int" -+ }, -+ { -+ "name": "subordinate", -+ "type": "int" -+ }, -+ { -+ "name": "io_range", -+ "type": "381" -+ }, -+ { -+ "name": "memory_range", -+ "type": "381" -+ }, -+ { -+ "name": "prefetchable_range", -+ "type": "381" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "373", -+ "members": [ -+ { -+ "name": "path", -+ "default": null, -+ "type": "str" -+ }, -+ { -+ "name": "cancel-path", -+ "default": null, -+ "type": "str" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "374", -+ "meta-type": "enum", -+ "values": [ -+ "unmapped", -+ "shift", -+ "shift_r", -+ "alt", -+ "alt_r", -+ "altgr", -+ "altgr_r", -+ "ctrl", -+ "ctrl_r", -+ "menu", -+ "esc", -+ "1", -+ "2", -+ "3", -+ "4", -+ "5", -+ "6", -+ "7", -+ "8", -+ "9", -+ "0", -+ "minus", -+ "equal", -+ "backspace", -+ "tab", -+ "q", -+ "w", -+ "e", -+ "r", -+ "t", -+ "y", -+ "u", -+ "i", -+ "o", -+ "p", -+ "bracket_left", -+ "bracket_right", -+ "ret", -+ "a", -+ "s", -+ "d", -+ "f", -+ "g", -+ "h", -+ "j", -+ "k", -+ "l", -+ "semicolon", -+ "apostrophe", -+ "grave_accent", -+ "backslash", -+ "z", -+ "x", -+ "c", -+ "v", -+ "b", -+ "n", -+ "m", -+ "comma", -+ "dot", -+ "slash", -+ "asterisk", -+ "spc", -+ "caps_lock", -+ "f1", -+ "f2", -+ "f3", -+ "f4", -+ "f5", -+ "f6", -+ "f7", -+ "f8", -+ "f9", -+ "f10", -+ "num_lock", -+ "scroll_lock", -+ "kp_divide", -+ "kp_multiply", -+ "kp_subtract", -+ "kp_add", -+ "kp_enter", -+ "kp_decimal", -+ "sysrq", -+ "kp_0", -+ "kp_1", -+ "kp_2", -+ "kp_3", -+ "kp_4", -+ "kp_5", -+ "kp_6", -+ "kp_7", -+ "kp_8", -+ "kp_9", -+ "less", -+ "f11", -+ "f12", -+ "print", -+ "home", -+ "pgup", -+ "pgdn", -+ "end", -+ "left", -+ "up", -+ "down", -+ "right", -+ "insert", -+ "delete", -+ "stop", -+ "again", -+ "props", -+ "undo", -+ "front", -+ "copy", -+ "open", -+ "paste", -+ "find", -+ "cut", -+ "lf", -+ "help", -+ "meta_l", -+ "meta_r", -+ "compose", -+ "pause", -+ "ro", -+ "hiragana", -+ "henkan", -+ "yen", -+ "kp_comma", -+ "kp_equals", -+ "power" -+ ] -+ }, -+ { -+ "name": "375", -+ "members": [ -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "376", -+ "meta-type": "enum", -+ "values": [ -+ "left", -+ "middle", -+ "right", -+ "wheel-up", -+ "wheel-down", -+ "side", -+ "extra" -+ ] -+ }, -+ { -+ "name": "377", -+ "meta-type": "enum", -+ "values": [ -+ "x", -+ "y" -+ ] -+ }, -+ { -+ "name": "378", -+ "members": [ -+ { -+ "name": "compat", -+ "type": "str" -+ }, -+ { -+ "name": "lazy-refcounts", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "corrupt", -+ "default": null, -+ "type": "bool" -+ }, -+ { -+ "name": "refcount-bits", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "379", -+ "members": [ -+ { -+ "name": "create-type", -+ "type": "str" -+ }, -+ { -+ "name": "cid", -+ "type": "int" -+ }, -+ { -+ "name": "parent-cid", -+ "type": "int" -+ }, -+ { -+ "name": "extents", -+ "type": "[252]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "380", -+ "members": [ -+ { -+ "name": "cipher-alg", -+ "type": "382" -+ }, -+ { -+ "name": "cipher-mode", -+ "type": "383" -+ }, -+ { -+ "name": "ivgen-alg", -+ "type": "384" -+ }, -+ { -+ "name": "ivgen-hash-alg", -+ "default": null, -+ "type": "385" -+ }, -+ { -+ "name": "hash-alg", -+ "type": "385" -+ }, -+ { -+ "name": "payload-offset", -+ "type": "int" -+ }, -+ { -+ "name": "master-key-iters", -+ "type": "int" -+ }, -+ { -+ "name": "uuid", -+ "type": "str" -+ }, -+ { -+ "name": "slots", -+ "type": "[386]" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "381", -+ "members": [ -+ { -+ "name": "base", -+ "type": "int" -+ }, -+ { -+ "name": "limit", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ }, -+ { -+ "name": "[252]", -+ "element-type": "252", -+ "meta-type": "array" -+ }, -+ { -+ "name": "382", -+ "meta-type": "enum", -+ "values": [ -+ "aes-128", -+ "aes-192", -+ "aes-256", -+ "des-rfb", -+ "3des", -+ "cast5-128", -+ "serpent-128", -+ "serpent-192", -+ "serpent-256", -+ "twofish-128", -+ "twofish-192", -+ "twofish-256" -+ ] -+ }, -+ { -+ "name": "383", -+ "meta-type": "enum", -+ "values": [ -+ "ecb", -+ "cbc", -+ "xts", -+ "ctr" -+ ] -+ }, -+ { -+ "name": "384", -+ "meta-type": "enum", -+ "values": [ -+ "plain", -+ "plain64", -+ "essiv" -+ ] -+ }, -+ { -+ "name": "385", -+ "meta-type": "enum", -+ "values": [ -+ "md5", -+ "sha1", -+ "sha224", -+ "sha256", -+ "sha384", -+ "sha512", -+ "ripemd160" -+ ] -+ }, -+ { -+ "name": "[386]", -+ "element-type": "386", -+ "meta-type": "array" -+ }, -+ { -+ "name": "386", -+ "members": [ -+ { -+ "name": "active", -+ "type": "bool" -+ }, -+ { -+ "name": "iters", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "stripes", -+ "default": null, -+ "type": "int" -+ }, -+ { -+ "name": "key-offset", -+ "type": "int" -+ } -+ ], -+ "meta-type": "object" -+ } -+ ], -+ "id": "libvirt-47" -+} -+ -+{ -+ "return": { -+ }, -+ "id": "libvirt-1" -+} -+ -+{ -+ "return": [ -+ { -+ "name": "default", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc32", -+ "typename": "604-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "ppc64", -+ "typename": "970fx_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970mp", -+ "typename": "970mp_v1.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970fx", -+ "typename": "970fx_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "970", -+ "typename": "970_v2.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER9", -+ "typename": "POWER9_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8NVL", -+ "typename": "POWER8NVL_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8", -+ "typename": "POWER8_v2.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER8E", -+ "typename": "POWER8E_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER7+", -+ "typename": "POWER7+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER7", -+ "typename": "POWER7_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER5gs", -+ "typename": "POWER5+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "POWER5+", -+ "typename": "POWER5+_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo7PM", -+ "typename": "7457A_v1.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457A", -+ "typename": "7457A_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7447A", -+ "typename": "7447A_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo7", -+ "typename": "7457_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457", -+ "typename": "7457_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7447", -+ "typename": "7447_v1.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Apollo6", -+ "typename": "7455_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7455", -+ "typename": "7455_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7445", -+ "typename": "7445_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7451", -+ "typename": "7451_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7441", -+ "typename": "7441_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vger", -+ "typename": "7450_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7450", -+ "typename": "7450_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7448", -+ "typename": "7448_v2.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Nitro", -+ "typename": "7410_v1.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7410", -+ "typename": "7410_v1.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "G4", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Max", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7400", -+ "typename": "7400_v2.9-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Goldfinger", -+ "typename": "755_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "755", -+ "typename": "755_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "745", -+ "typename": "745_v2.8-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "LoneStar", -+ "typename": "750l_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750l", -+ "typename": "750l_v3.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750gx", -+ "typename": "750gx_v1.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750fx", -+ "typename": "750fx_v2.3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cxe", -+ "typename": "750cxe_v3.1b-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cx", -+ "typename": "750cx_v2.2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750cl", -+ "typename": "750cl_v2.0-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Conan/Doyle", -+ "typename": "750p-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "G3", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Typhoon", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "750", -+ "typename": "750_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Arthur", -+ "typename": "740_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "740", -+ "typename": "740_v3.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Mach5", -+ "typename": "604r-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Sirocco", -+ "typename": "604e_v2.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "604e", -+ "typename": "604e_v2.4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Goldeneye", -+ "typename": "603e7t-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "603r", -+ "typename": "603e7t-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vaillant", -+ "typename": "603e7v-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Stretch", -+ "typename": "603e_v4.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "603e", -+ "typename": "603e_v4.1-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "Vanilla", -+ "typename": "603-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "601v", -+ "typename": "601_v2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "601", -+ "typename": "601_v2-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8560", -+ "typename": "MPC8560_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E", -+ "typename": "MPC8555E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8555", -+ "typename": "MPC8555_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E", -+ "typename": "MPC8548E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8548", -+ "typename": "MPC8548_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E", -+ "typename": "MPC8547E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E", -+ "typename": "MPC8545E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8545", -+ "typename": "MPC8545_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E", -+ "typename": "MPC8544E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8544", -+ "typename": "MPC8544_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E", -+ "typename": "MPC8543E_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8543", -+ "typename": "MPC8543_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E", -+ "typename": "MPC8541E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8541", -+ "typename": "MPC8541_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8540", -+ "typename": "MPC8540_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E", -+ "typename": "MPC8533E_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8533", -+ "typename": "MPC8533_v11-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500v2", -+ "typename": "e500v2_v22-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500v1", -+ "typename": "e500_v20-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e500", -+ "typename": "e500v2_v22-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EA", -+ "typename": "MPC8347EAT-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347E", -+ "typename": "MPC8347ET-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347A", -+ "typename": "MPC8347AT-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8347", -+ "typename": "MPC8347T-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e300", -+ "typename": "e300c3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "e200", -+ "typename": "e200z6-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8280", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8275", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8272", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8271", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8270", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8266", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8265", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8264", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8260", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8255", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250_HiP4", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250_HiP3", -+ "typename": "G2HiP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8250", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8248", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8247", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8245", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8241", -+ "typename": "G2HiP4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "PowerQUICC-II", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC82xx", -+ "typename": "G2leGP3-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B", -+ "typename": "MPC5200B_v21-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC5200", -+ "typename": "MPC5200_v12-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC52xx", -+ "typename": "MPC5200_v12-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "MPC8240", -+ "typename": "603-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "440EP", -+ "typename": "440EPb-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "x2vp50", -+ "typename": "x2vp20-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "x2vp7", -+ "typename": "x2vp4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405GPe", -+ "typename": "405CRc-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405GP", -+ "typename": "405GPd-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405CR", -+ "typename": "405CRc-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "405", -+ "typename": "405D4-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "403", -+ "typename": "403GC-powerpc64-cpu", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cl_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347ET", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB25", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401G2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349A", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750e", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8E_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Cobra", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8378E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500mc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970mp_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440-Xilinx-w-dfpu", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740e", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8641", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405D4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe4GS3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB03", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343A", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8378", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2HiP3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8567", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405H", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405H2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e200z6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8379E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347AP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401B2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8547E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8567E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7451_v2.10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "Npe405L", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401A1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8377", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8540_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347AT", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER8NVL_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457A_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8572", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPR", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401C2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v30", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405EZ", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8568E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2H4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e200z5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405CRa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.7", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GC", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e5500", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v12", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "x2vp4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405LP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405EP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401D2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8572E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7448_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.1b", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.9", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2GP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPd", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7t", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "IOP480", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8560_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405D2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fl", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750l_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "x2vp20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e600", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2LS", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8543E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v3.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347P", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC603", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER9_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER7+_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EAP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401E2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8641D", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7441_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740_v3.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER5+_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "602", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leLS", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cx_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604e_v2.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.6", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2le", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GB", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8545E_v21", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "POWER7_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "755_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EP", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750gl", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GCX", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8555_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347T", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970_v2.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440-Xilinx", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "740p", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200B_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPX", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7451_v2.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7450_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7400_v2.8", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7455_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPc", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8347EAT", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970mp_v1.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e7v2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "604r", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447A_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8533E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e500v2_v22", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401F2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8343EA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7457_v1.2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7447_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v2.5", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8548E_v20", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8610", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v2.4b", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC5200_v10", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "403GA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7410_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2leGP3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "7445_v3.3", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "603e_v4.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "440EPa", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "970fx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8377E", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750fx_v2.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "601_v0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "STB04", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "745_v1.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "G2HiP4", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cl_v2.0", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxr", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8349EA", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750cxe_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8379", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "401", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8568", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "e300c2", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "750_v3.1", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8544E_v11", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "405GPb", -+ "typename": "", -+ "static": false -+ }, -+ { -+ "name": "MPC8541E_v11", -+ "typename": "", -+ "static": false -+ } -+ ], -+ "id": "libvirt-2" -+} -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml -new file mode 100644 -index 0000000000..29721b04f0 ---- /dev/null -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml -@@ -0,0 +1,1062 @@ -+ -+ 0 -+ 0 -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ 2009000 -+ 0 -+ (v2.9.0) -+ ppc64 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c -index 2918ff4695..5937fbbe57 100644 ---- a/tests/qemucapabilitiestest.c -+++ b/tests/qemucapabilitiestest.c -@@ -173,6 +173,7 @@ mymain(void) - DO_TEST("aarch64", "caps_2.6.0-gicv2"); - DO_TEST("aarch64", "caps_2.6.0-gicv3"); - DO_TEST("ppc64le", "caps_2.6.0"); -+ DO_TEST("ppc64le", "caps_2.9.0"); - DO_TEST("s390x", "caps_2.7.0"); - DO_TEST("s390x", "caps_2.8.0"); - --- -2.13.3 - diff --git a/SOURCES/libvirt-Add-support-for-CPU-cache-specification.patch b/SOURCES/libvirt-Add-support-for-CPU-cache-specification.patch deleted file mode 100644 index 2906ff9..0000000 --- a/SOURCES/libvirt-Add-support-for-CPU-cache-specification.patch +++ /dev/null @@ -1,389 +0,0 @@ -From a5cb43154905e2708bf90988bd2aa5f2fca6b935 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Mon, 24 Apr 2017 15:40:07 +0200 -Subject: [PATCH] Add support for CPU cache specification - -This patch introduces - - - - - -sub element of /domain/cpu. Currently only a single element is -allowed. - -Signed-off-by: Jiri Denemark -(cherry picked from commit a646a6016a7c62688988f7cfaa22e1340c2ce761) - -https://bugzilla.redhat.com/show_bug.cgi?id=1428952 - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 35 ++++++++++++ - docs/schemas/cputypes.rng | 21 ++++++++ - docs/schemas/domaincommon.rng | 3 ++ - src/conf/cpu_conf.c | 62 ++++++++++++++++++++++ - src/conf/cpu_conf.h | 19 +++++++ - src/libvirt_private.syms | 2 + - .../generic-cpu-cache-disable.xml | 20 +++++++ - .../generic-cpu-cache-emulate.xml | 20 +++++++ - .../generic-cpu-cache-passthrough.xml | 20 +++++++ - tests/genericxml2xmltest.c | 4 ++ - 10 files changed, 206 insertions(+) - create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-disable.xml - create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-emulate.xml - create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-passthrough.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index aae5e9c07..aee1e1442 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -1198,6 +1198,7 @@ - <model fallback='allow'>core2duo</model> - <vendor>Intel</vendor> - <topology sockets='1' cores='2' threads='1'/> -+ <cache level='3' mode='emulate'/> - <feature policy='disable' name='lahf_lm'/> - </cpu> - ... -@@ -1211,6 +1212,7 @@ - -
- <cpu mode='host-passthrough'>
-+  <cache mode='passthrough'/>
-   <feature policy='disable' name='lahf_lm'/>
- ...
- -@@ -1431,6 +1433,39 @@ - Since 0.8.5 the policy - attribute can be omitted and will default to require. - -+ -+
cache
-+
Since 3.3.0 the cache -+ element describes the virtual CPU cache. If the element is missing, -+ the hypervisor will use a sensible default. -+ -+
-+
level
-+
This optional attribute specifies which cache level is described -+ by the element. Missing attribute means the element describes all -+ CPU cache levels at once. Mixing cache elements with -+ the level attribute set and those without the -+ attribute is forbidden.
-+ -+
mode
-+
-+ The following values are supported: -+
-+
emulate
-+
The hypervisor will provide a fake CPU cache data.
-+ -+
passthrough
-+
The real CPU cache data reported by the host CPU will be -+ passed through to the virtual CPU.
-+ -+
disable
-+
The virtual CPU will report no CPU cache of the specified -+ level (or no cache at all if the level attribute -+ is missing).
-+
-+
-+
-+
- - -

-diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng -index 8189114e3..3eef16abc 100644 ---- a/docs/schemas/cputypes.rng -+++ b/docs/schemas/cputypes.rng -@@ -142,4 +142,25 @@ - - - -+ -+ -+ -+ -+ -+ 1 -+ 2 -+ 3 -+ -+ -+ -+ -+ -+ emulate -+ passthrough -+ disable -+ -+ -+ -+ -+ - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index edc225fe5..d5c28ee3c 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -4545,6 +4545,9 @@ - - - -+ -+ -+ - - - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index 623b1699f..1b098c476 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -62,6 +62,12 @@ VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST, - "disable", - "forbid") - -+VIR_ENUM_IMPL(virCPUCacheMode, VIR_CPU_CACHE_MODE_LAST, -+ "emulate", -+ "passthrough", -+ "disable") -+ -+ - void - virCPUDefFreeFeatures(virCPUDefPtr def) - { -@@ -92,6 +98,7 @@ virCPUDefFree(virCPUDefPtr def) - return; - - virCPUDefFreeModel(def); -+ VIR_FREE(def->cache); - VIR_FREE(def); - } - -@@ -204,7 +211,18 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu) - copy->threads = cpu->threads; - copy->arch = cpu->arch; - -+ if (cpu->cache) { -+ if (VIR_ALLOC(copy->cache) < 0) -+ goto error; -+ -+ *copy->cache = *cpu->cache; -+ } -+ - return copy; -+ -+ error: -+ virCPUDefFree(copy); -+ return NULL; - } - - -@@ -489,6 +507,41 @@ virCPUDefParseXML(xmlNodePtr node, - def->features[i].policy = policy; - } - -+ if (virXPathInt("count(./cache)", ctxt, &n) < 0) { -+ goto cleanup; -+ } else if (n > 1) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("at most one CPU cache element may be specified")); -+ goto cleanup; -+ } else if (n == 1) { -+ int level = -1; -+ char *strmode; -+ int mode; -+ -+ if (virXPathBoolean("boolean(./cache[1]/@level)", ctxt) == 1 && -+ (virXPathInt("string(./cache[1]/@level)", ctxt, &level) < 0 || -+ level < 1 || level > 3)) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("invalid CPU cache level, must be in range [1,3]")); -+ goto cleanup; -+ } -+ -+ if (!(strmode = virXPathString("string(./cache[1]/@mode)", ctxt)) || -+ (mode = virCPUCacheModeTypeFromString(strmode)) < 0) { -+ VIR_FREE(strmode); -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("missing or invalid CPU cache mode")); -+ goto cleanup; -+ } -+ VIR_FREE(strmode); -+ -+ if (VIR_ALLOC(def->cache) < 0) -+ goto cleanup; -+ -+ def->cache->level = level; -+ def->cache->mode = mode; -+ } -+ - cleanup: - ctxt->node = oldnode; - VIR_FREE(fallback); -@@ -662,6 +715,15 @@ virCPUDefFormatBuf(virBufferPtr buf, - virBufferAddLit(buf, "/>\n"); - } - -+ if (def->cache) { -+ virBufferAddLit(buf, "cache->level != -1) -+ virBufferAsprintf(buf, "level='%d' ", def->cache->level); -+ virBufferAsprintf(buf, "mode='%s'", -+ virCPUCacheModeTypeToString(def->cache->mode)); -+ virBufferAddLit(buf, "/>\n"); -+ } -+ - for (i = 0; i < def->nfeatures; i++) { - virCPUFeatureDefPtr feature = def->features + i; - -diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h -index 3e02deed4..09438b68b 100644 ---- a/src/conf/cpu_conf.h -+++ b/src/conf/cpu_conf.h -@@ -103,6 +103,24 @@ struct _virCPUFeatureDef { - }; - - -+typedef enum { -+ VIR_CPU_CACHE_MODE_EMULATE, -+ VIR_CPU_CACHE_MODE_PASSTHROUGH, -+ VIR_CPU_CACHE_MODE_DISABLE, -+ -+ VIR_CPU_CACHE_MODE_LAST -+} virCPUCacheMode; -+ -+VIR_ENUM_DECL(virCPUCacheMode); -+ -+typedef struct _virCPUCacheDef virCPUCacheDef; -+typedef virCPUCacheDef *virCPUCacheDefPtr; -+struct _virCPUCacheDef { -+ int level; /* -1 for unspecified */ -+ virCPUCacheMode mode; -+}; -+ -+ - typedef struct _virCPUDef virCPUDef; - typedef virCPUDef *virCPUDefPtr; - struct _virCPUDef { -@@ -121,6 +139,7 @@ struct _virCPUDef { - size_t nfeatures; - size_t nfeatures_max; - virCPUFeatureDefPtr features; -+ virCPUCacheDefPtr cache; - }; - - -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index b551cb86a..9a334311d 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -67,6 +67,8 @@ virCapabilitiesSetNetPrefix; - - - # conf/cpu_conf.h -+virCPUCacheModeTypeFromString; -+virCPUCacheModeTypeToString; - virCPUDefAddFeature; - virCPUDefCopy; - virCPUDefCopyModel; -diff --git a/tests/genericxml2xmlindata/generic-cpu-cache-disable.xml b/tests/genericxml2xmlindata/generic-cpu-cache-disable.xml -new file mode 100644 -index 000000000..25f65cc6e ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cpu-cache-disable.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cpu-cache-emulate.xml b/tests/genericxml2xmlindata/generic-cpu-cache-emulate.xml -new file mode 100644 -index 000000000..6ea57cbf6 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cpu-cache-emulate.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/genericxml2xmlindata/generic-cpu-cache-passthrough.xml b/tests/genericxml2xmlindata/generic-cpu-cache-passthrough.xml -new file mode 100644 -index 000000000..8d4c186c9 ---- /dev/null -+++ b/tests/genericxml2xmlindata/generic-cpu-cache-passthrough.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c -index 488190270..ab1ebce9f 100644 ---- a/tests/genericxml2xmltest.c -+++ b/tests/genericxml2xmltest.c -@@ -100,6 +100,10 @@ mymain(void) - - DO_TEST("vcpus-individual"); - -+ DO_TEST("cpu-cache-emulate"); -+ DO_TEST("cpu-cache-passthrough"); -+ DO_TEST("cpu-cache-disable"); -+ - virObjectUnref(caps); - virObjectUnref(xmlopt); - --- -2.12.2 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-controllers.patch b/SOURCES/libvirt-Add-virtio-related-options-to-controllers.patch deleted file mode 100644 index f494336..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-controllers.patch +++ /dev/null @@ -1,126 +0,0 @@ -From e0bb36c4d7c60336d2aba94013c2946e1594959b Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:03 +0200 -Subject: [PATCH] Add virtio-related options to controllers -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit c85217cf8a81879d065b9d13e876eec141f63f6f) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 6 ++++++ - docs/schemas/domaincommon.rng | 1 + - src/conf/domain_conf.c | 10 ++++++++++ - src/conf/domain_conf.h | 1 + - tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml | 2 ++ - 5 files changed, 20 insertions(+) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index bb7a85a1a1..2b26f090cd 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3597,6 +3597,12 @@ - iothread value. The iothread value - must be within the range 1 to the domain iothreads value. - -+

virtio options
-+
-+ For virtio controllers, -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
- -

- USB companion controllers have an optional -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index f838dc55fd..2108d23df7 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2019,6 +2019,7 @@ - - - -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index a4b4f70855..2e5eeb1172 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1873,6 +1873,7 @@ void virDomainControllerDefFree(virDomainControllerDefPtr def) - return; - - virDomainDeviceInfoClear(&def->info); -+ VIR_FREE(def->virtio); - - VIR_FREE(def); - } -@@ -9037,6 +9038,9 @@ virDomainControllerDefParseXML(xmlNodePtr node, - cur = cur->next; - } - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - /* node is parsed differently from target attributes because - * someone thought it should be a subelement instead... - */ -@@ -19214,6 +19218,10 @@ virDomainControllerDefCheckABIStability(virDomainControllerDefPtr src, - } - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -21504,6 +21512,8 @@ virDomainControllerDriverFormat(virBufferPtr buf, - if (def->iothread) - virBufferAsprintf(&driverBuf, " iothread='%u'", def->iothread); - -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ - if (virBufferUse(&driverBuf)) { - virBufferAddLit(buf, " - - -+ -

- - - -+ -
- - --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-disks.patch b/SOURCES/libvirt-Add-virtio-related-options-to-disks.patch deleted file mode 100644 index abd2ba2..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-disks.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 51a842ccdf1c02ec00ba96217658b0db31a6addb Mon Sep 17 00:00:00 2001 -Message-Id: <51a842ccdf1c02ec00ba96217658b0db31a6addb@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:02 +0200 -Subject: [PATCH] Add virtio-related options to disks -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit 1bc2cb3b3205dca7174147ac970e2b82c8af69da) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 5 +++++ - docs/schemas/domaincommon.rng | 1 + - src/conf/domain_conf.c | 15 +++++++++++++++ - src/conf/domain_conf.h | 1 + - tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml | 2 +- - 5 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 2556f383fc..bb7a85a1a1 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3008,6 +3008,11 @@ - bus and "pci" or "ccw" address types. - Since 1.2.8 (QEMU 2.1) - -+
  • -+ For virtio disks, -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
  • - - -
    backenddomain
    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index f571af6706..f838dc55fd 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -1716,6 +1716,7 @@ - - - -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 4768d02029..a4b4f70855 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1745,6 +1745,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def) - VIR_FREE(def->product); - VIR_FREE(def->domain_name); - VIR_FREE(def->blkdeviotune.group_name); -+ VIR_FREE(def->virtio); - virDomainDeviceInfoClear(&def->info); - virObjectUnref(def->privateData); - -@@ -4440,6 +4441,10 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, - } - } - -+ if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO && -+ virDomainCheckVirtioOptions(disk->virtio) < 0) -+ return -1; -+ - if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && - virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) - return -1; -@@ -8420,6 +8425,9 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, - } - } - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - /* Disk volume types will have authentication information handled in - * virStorageTranslateDiskSourcePool - */ -@@ -19146,6 +19154,10 @@ virDomainDiskDefCheckABIStability(virDomainDiskDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -21307,6 +21319,9 @@ virDomainDiskDefFormat(virBufferPtr buf, - virBufferAsprintf(&driverBuf, " iothread='%u'", def->iothread); - if (def->detect_zeroes) - virBufferAsprintf(&driverBuf, " detect_zeroes='%s'", detect_zeroes); -+ -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ - if (virBufferUse(&driverBuf)) { - virBufferAddLit(buf, " 0 specific thread # */ - int detect_zeroes; /* enum virDomainDiskDetectZeroes */ - char *domain_name; /* backend domain name */ -+ virDomainVirtioOptionsPtr virtio; - }; - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -index b16a9847fe..6dd82de648 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -15,7 +15,7 @@ - - /usr/bin/qemu-system-x86_64 - -- -+ - - -
    --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-filesystems.patch b/SOURCES/libvirt-Add-virtio-related-options-to-filesystems.patch deleted file mode 100644 index 2576cd7..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-filesystems.patch +++ /dev/null @@ -1,127 +0,0 @@ -From c828a666c154dece5bce0530c6a53d72d91ca3a1 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:04 +0200 -Subject: [PATCH] Add virtio-related options to filesystems -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit b10c22d9fa11e2a67eca04592688bd701700f77f) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 5 +++++ - docs/schemas/domaincommon.rng | 1 + - src/conf/domain_conf.c | 10 ++++++++++ - src/conf/domain_conf.h | 1 + - tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml | 3 ++- - 5 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 2b26f090cd..8d3f916a19 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3293,6 +3293,11 @@ - or "handle", but no formats. Virtuozzo driver supports - a type of "ploop" with a format of "ploop". - -+
  • -+ For virtio-backed devices, -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
  • - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 2108d23df7..5e526b6100 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2202,6 +2202,7 @@ - immediate - - -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 2e5eeb1172..5c7ffc0419 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1905,6 +1905,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def) - virStorageSourceFree(def->src); - VIR_FREE(def->dst); - virDomainDeviceInfoClear(&def->info); -+ VIR_FREE(def->virtio); - - VIR_FREE(def); - } -@@ -9451,6 +9452,9 @@ virDomainFSDefParseXML(xmlNodePtr node, - goto error; - } - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - def->src->path = source; - source = NULL; - def->dst = target; -@@ -19246,6 +19250,10 @@ virDomainFsDefCheckABIStability(virDomainFSDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -21713,6 +21721,8 @@ virDomainFSDefFormat(virBufferPtr buf, - - } - -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ - if (virBufferUse(&driverBuf)) { - virBufferAddLit(buf, " - - -+ - - -
    - - -- -+ - - -
    --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-input-devices.patch b/SOURCES/libvirt-Add-virtio-related-options-to-input-devices.patch deleted file mode 100644 index 6e235e0..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-input-devices.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 00aaab7312b72b5ef1785793f97849a69f425b83 Mon Sep 17 00:00:00 2001 -Message-Id: <00aaab7312b72b5ef1785793f97849a69f425b83@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:07 +0200 -Subject: [PATCH] Add virtio-related options to input devices -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit cc0933d3501229cdc8cf183a52a14c9b1c8de666) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 7 +++++++ - docs/schemas/domaincommon.rng | 5 +++++ - src/conf/domain_conf.c | 18 ++++++++++++++++++ - src/conf/domain_conf.h | 1 + - tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml | 4 ++++ - 5 files changed, 35 insertions(+) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 6be015f866..dc8e7d2dc7 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5712,6 +5712,13 @@ qemu-kvm -net nic,model=? /dev/null - event device passed through to guests. (KVM only) -

    - -+

    -+ The subelement driver can be used to tune the virtio -+ options of the device: -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+

    -+ -

    Hub devices

    - -

    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index ee49d6eb58..78023ff4af 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3936,6 +3936,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index a0de639e51..d8ca25da38 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1400,6 +1400,7 @@ void virDomainInputDefFree(virDomainInputDefPtr def) - - virDomainDeviceInfoClear(&def->info); - VIR_FREE(def->source.evdev); -+ VIR_FREE(def->virtio); - VIR_FREE(def); - } - -@@ -11587,6 +11588,9 @@ virDomainInputDefParseXML(const virDomainDef *dom, - goto error; - } - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - cleanup: - VIR_FREE(evdev); - VIR_FREE(type); -@@ -19328,6 +19332,10 @@ virDomainInputDefCheckABIStability(virDomainInputDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -23404,6 +23412,7 @@ virDomainInputDefFormat(virBufferPtr buf, - const char *type = virDomainInputTypeToString(def->type); - const char *bus = virDomainInputBusTypeToString(def->bus); - virBuffer childbuf = VIR_BUFFER_INITIALIZER; -+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER; - - /* don't format keyboard into migratable XML for backward compatibility */ - if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE && -@@ -23427,6 +23436,15 @@ virDomainInputDefFormat(virBufferPtr buf, - type, bus); - - virBufferAdjustIndent(&childbuf, virBufferGetIndent(buf, false) + 2); -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ if (virBufferCheckError(&driverBuf) < 0) -+ return -1; -+ -+ if (virBufferUse(&driverBuf)) { -+ virBufferAddLit(&childbuf, "\n"); -+ } - virBufferEscapeString(&childbuf, "\n", def->source.evdev); - if (virDomainDeviceInfoFormat(&childbuf, &def->info, flags) < 0) - return -1; -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index b79fb50c79..4c33b0d15e 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1282,6 +1282,7 @@ struct _virDomainInputDef { - char *evdev; - } source; - virDomainDeviceInfo info; -+ virDomainVirtioOptionsPtr virtio; - }; - - typedef enum { -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -index 85d1145263..773038a320 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -54,15 +54,19 @@ -

    - - -+ -
    - - -+ -
    - - -+ -
    - - -+ - -
    - --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-interfaces.patch b/SOURCES/libvirt-Add-virtio-related-options-to-interfaces.patch deleted file mode 100644 index fcede1c..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-interfaces.patch +++ /dev/null @@ -1,334 +0,0 @@ -From 7667b332ec942112270da554ded58658a78860b9 Mon Sep 17 00:00:00 2001 -Message-Id: <7667b332ec942112270da554ded58658a78860b9@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:00 +0200 -Subject: [PATCH] Add virtio-related options to interfaces -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - - - - - - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit fd518643402d8233ceffe4ef28279bcce53284f6) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 19 ++++ - docs/schemas/domaincommon.rng | 12 ++ - src/conf/domain_conf.c | 121 +++++++++++++++++++++ - src/conf/domain_conf.h | 10 ++ - .../qemuxml2argv-virtio-options.xml | 1 + - 5 files changed, 163 insertions(+) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index e8a3367bac..23546daae9 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3448,6 +3448,19 @@ - - - -+

    Virtio-related options

    -+ -+

    -+ QEMU's virtio devices have some attributes related to the virtio transport under -+ the driver element: -+ The iommu attribute enables the use of emulated IOMMU -+ by the device. The attribute ats controls the Address -+ Translation Service support for PCIe devices. This is needed to make use -+ of IOTLB support (see IOMMU device). -+ Possible values are on or off. -+ Since 3.5.0 -+

    -+ -

    Controllers

    - -

    -@@ -5139,6 +5152,12 @@ qemu-kvm -net nic,model=? /dev/null - In general you should leave this option alone, unless you - are very certain you know what you are doing. - -+

    virtio options
    -+
    -+ For virtio interfaces, -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
    - -

    - Offloading options for the host and guest can be configured using -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 1b66362f17..9e68bbc52d 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -2632,6 +2632,7 @@ - - - -+ - - - -@@ -4952,6 +4953,17 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 4652e1c72b..bba50cf3fd 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1112,6 +1112,46 @@ virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) - return &xmlopt->ns; - } - -+static int -+virDomainVirtioOptionsParseXML(xmlXPathContextPtr ctxt, -+ virDomainVirtioOptionsPtr *virtio) -+{ -+ char *str = NULL; -+ int ret = -1; -+ int val; -+ virDomainVirtioOptionsPtr res; -+ -+ if (VIR_ALLOC(*virtio) < 0) -+ return -1; -+ -+ res = *virtio; -+ -+ if ((str = virXPathString("string(./driver/@iommu)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("invalid iommu value")); -+ goto cleanup; -+ } -+ res->iommu = val; -+ } -+ VIR_FREE(str); -+ -+ if ((str = virXPathString("string(./driver/@ats)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(str)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("invalid ats value")); -+ goto cleanup; -+ } -+ res->ats = val; -+ } -+ -+ ret = 0; -+ -+ cleanup: -+ VIR_FREE(str); -+ return ret; -+} -+ - - virSaveCookieCallbacksPtr - virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt) -@@ -1953,6 +1993,7 @@ virDomainNetDefClear(virDomainNetDefPtr def) - VIR_FREE(def->ifname); - VIR_FREE(def->ifname_guest); - VIR_FREE(def->ifname_guest_actual); -+ VIR_FREE(def->virtio); - - virNetDevIPInfoClear(&def->guestIP); - virNetDevIPInfoClear(&def->hostIP); -@@ -4313,6 +4354,28 @@ virDomainHostdevDefPostParse(virDomainHostdevDefPtr dev, - - - static int -+virDomainCheckVirtioOptions(virDomainVirtioOptionsPtr virtio) -+{ -+ if (!virtio) -+ return 0; -+ -+ if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("iommu driver option is only supported " -+ "for virtio devices")); -+ return -1; -+ } -+ if (virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("ats driver option is only supported " -+ "for virtio devices")); -+ return -1; -+ } -+ return 0; -+} -+ -+ -+static int - virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, - const virDomainDef *def, - virCapsPtr caps ATTRIBUTE_UNUSED, -@@ -4410,6 +4473,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, - } - } - -+ if (dev->type == VIR_DOMAIN_DEVICE_NET) { -+ virDomainNetDefPtr net = dev->data.net; -+ if (STRNEQ_NULLABLE(net->model, "virtio") && -+ virDomainCheckVirtioOptions(net->virtio) < 0) -+ return -1; -+ } -+ - return 0; - } - -@@ -5208,6 +5278,24 @@ virDomainDefValidate(virDomainDefPtr def, - } - - -+static void -+virDomainVirtioOptionsFormat(virBufferPtr buf, -+ virDomainVirtioOptionsPtr virtio) -+{ -+ if (!virtio) -+ return; -+ -+ if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(buf, " iommu='%s'", -+ virTristateSwitchTypeToString(virtio->iommu)); -+ } -+ if (virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(buf, " ats='%s'", -+ virTristateSwitchTypeToString(virtio->ats)); -+ } -+} -+ -+ - /* Generate a string representation of a device address - * @info address Device address to stringify - */ -@@ -10354,6 +10442,9 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, - goto error; - } - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - cleanup: - ctxt->node = oldnode; - VIR_FREE(macaddr); -@@ -18979,6 +19070,30 @@ virDomainDeviceInfoCheckABIStability(virDomainDeviceInfoPtr src, - - - static bool -+virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptionsPtr src, -+ virDomainVirtioOptionsPtr dst) -+{ -+ if (src->iommu != dst->iommu) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target device iommu option '%s' does not " -+ "match source '%s'"), -+ virTristateSwitchTypeToString(dst->iommu), -+ virTristateSwitchTypeToString(src->iommu)); -+ return false; -+ } -+ if (src->ats != dst->ats) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target device ats option '%s' does not " -+ "match source '%s'"), -+ virTristateSwitchTypeToString(dst->ats), -+ virTristateSwitchTypeToString(src->ats)); -+ return false; -+ } -+ return true; -+} -+ -+ -+static bool - virDomainDiskDefCheckABIStability(virDomainDiskDefPtr src, - virDomainDiskDefPtr dst) - { -@@ -19137,6 +19252,10 @@ virDomainNetDefCheckABIStability(virDomainNetDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -22074,6 +22193,8 @@ virDomainVirtioNetDriverFormat(char **outstr, - virBufferAsprintf(&buf, " rx_queue_size='%u'", - def->driver.virtio.rx_queue_size); - -+ virDomainVirtioOptionsFormat(&buf, def->virtio); -+ - if (virBufferCheckError(&buf) < 0) - return -1; - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index e6c20a9e1e..603d35bd50 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -156,6 +156,9 @@ typedef virDomainTPMDef *virDomainTPMDefPtr; - typedef struct _virDomainIOMMUDef virDomainIOMMUDef; - typedef virDomainIOMMUDef *virDomainIOMMUDefPtr; - -+typedef struct _virDomainVirtioOptions virDomainVirtioOptions; -+typedef virDomainVirtioOptions *virDomainVirtioOptionsPtr; -+ - /* Flags for the 'type' field in virDomainDeviceDef */ - typedef enum { - VIR_DOMAIN_DEVICE_NONE = 0, -@@ -1040,6 +1043,7 @@ struct _virDomainNetDef { - int linkstate; - unsigned int mtu; - virNetDevCoalescePtr coalesce; -+ virDomainVirtioOptionsPtr virtio; - }; - - typedef enum { -@@ -2215,6 +2219,12 @@ struct _virDomainIOMMUDef { - virTristateSwitch eim; - virTristateSwitch iotlb; - }; -+ -+struct _virDomainVirtioOptions { -+ virTristateSwitch iommu; -+ virTristateSwitch ats; -+}; -+ - /* - * Guest VM main configuration - * -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -index c88cf649b1..3357bc6d1b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -47,6 +47,7 @@ - - - -+ -

    - - --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-rng-devices.patch b/SOURCES/libvirt-Add-virtio-related-options-to-rng-devices.patch deleted file mode 100644 index a2777a9..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-rng-devices.patch +++ /dev/null @@ -1,146 +0,0 @@ -From b452148f1570656d9b42efbdbff396cf5cafa9c7 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:05 +0200 -Subject: [PATCH] Add virtio-related options to rng devices -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit f65db1be1200b656094180ecfdb63f8bd0158cab) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 11 +++++++++++ - docs/schemas/domaincommon.rng | 5 +++++ - src/conf/domain_conf.c | 19 +++++++++++++++++++ - src/conf/domain_conf.h | 1 + - .../qemuxml2argvdata/qemuxml2argv-virtio-options.xml | 1 + - 5 files changed, 37 insertions(+) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 8d3f916a19..2e5c669c4a 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -7061,6 +7061,17 @@ qemu-kvm -net nic,model=? /dev/null - - - -+
    driver
    -+
    -+ The subelement driver can be used to tune the device: -+
    -+
    virtio options
    -+
    -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
    -+
    -+
    - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 5e526b6100..7e80275029 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -4912,6 +4912,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 5c7ffc0419..059c006b69 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -12922,6 +12922,9 @@ virDomainRNGDefParseXML(virDomainXMLOptionPtr xmlopt, - if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) - goto error; - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - cleanup: - VIR_FREE(model); - VIR_FREE(backend); -@@ -19637,6 +19640,10 @@ virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -23132,6 +23139,7 @@ virDomainRNGDefFormat(virBufferPtr buf, - { - const char *model = virDomainRNGModelTypeToString(def->model); - const char *backend = virDomainRNGBackendTypeToString(def->backend); -+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER; - - virBufferAsprintf(buf, "\n", model); - virBufferAdjustIndent(buf, 2); -@@ -23160,6 +23168,16 @@ virDomainRNGDefFormat(virBufferPtr buf, - break; - } - -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ if (virBufferCheckError(&driverBuf) < 0) -+ return -1; -+ -+ if (virBufferUse(&driverBuf)) { -+ virBufferAddLit(buf, "\n"); -+ } -+ - if (virDomainDeviceInfoNeedsFormat(&def->info, flags)) { - if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0) - return -1; -@@ -23188,6 +23206,7 @@ virDomainRNGDefFree(virDomainRNGDefPtr def) - } - - virDomainDeviceInfoClear(&def->info); -+ VIR_FREE(def->virtio); - VIR_FREE(def); - } - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index fdd852c29d..8cb9d5d0b1 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2020,6 +2020,7 @@ struct _virDomainRNGDef { - } source; - - virDomainDeviceInfo info; -+ virDomainVirtioOptionsPtr virtio; - }; - - typedef enum { -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -index 33da214611..b7b95014cd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -80,6 +80,7 @@ - - - /dev/random -+ -
    - - --- -2.13.1 - diff --git a/SOURCES/libvirt-Add-virtio-related-options-to-video.patch b/SOURCES/libvirt-Add-virtio-related-options-to-video.patch deleted file mode 100644 index 1f0f3e4..0000000 --- a/SOURCES/libvirt-Add-virtio-related-options-to-video.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 6abf3f12df5173dc12af69827fbee98811f83959 Mon Sep 17 00:00:00 2001 -Message-Id: <6abf3f12df5173dc12af69827fbee98811f83959@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:06 +0200 -Subject: [PATCH] Add virtio-related options to video -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit f5384fb4029a59624e728a2e0d37e6a62efbdc52) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 12 ++++++++++ - docs/schemas/domaincommon.rng | 5 ++++ - src/conf/domain_conf.c | 27 ++++++++++++++++++++-- - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-virtio-options.xml | 1 + - 5 files changed, 44 insertions(+), 2 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 2e5c669c4a..6be015f866 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -6133,6 +6133,18 @@ qemu-kvm -net nic,model=? /dev/null - The optional address sub-element can be used to - tie the video device to a particular PCI slot. - -+ -+
    driver
    -+
    -+ The subelement driver can be used to tune the device: -+
    -+
    virtio options
    -+
    -+ Virtio-specific options can also be -+ set. (Since 3.5.0) -+
    -+
    -+
    - - -

    Consoles, serial, parallel & channel devices

    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 7e80275029..ee49d6eb58 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3165,6 +3165,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 059c006b69..a0de639e51 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2339,6 +2339,7 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def) - virDomainDeviceInfoClear(&def->info); - - VIR_FREE(def->accel); -+ VIR_FREE(def->virtio); - VIR_FREE(def); - } - -@@ -13499,11 +13500,13 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) - - static virDomainVideoDefPtr - virDomainVideoDefParseXML(xmlNodePtr node, -+ xmlXPathContextPtr ctxt, - const virDomainDef *dom, - unsigned int flags) - { - virDomainVideoDefPtr def; - xmlNodePtr cur; -+ xmlNodePtr saved = ctxt->node; - char *type = NULL; - char *heads = NULL; - char *vram = NULL; -@@ -13512,6 +13515,8 @@ virDomainVideoDefParseXML(xmlNodePtr node, - char *vgamem = NULL; - char *primary = NULL; - -+ ctxt->node = node; -+ - if (VIR_ALLOC(def) < 0) - return NULL; - -@@ -13613,7 +13618,12 @@ virDomainVideoDefParseXML(xmlNodePtr node, - if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) - goto error; - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - cleanup: -+ ctxt->node = saved; -+ - VIR_FREE(type); - VIR_FREE(ram); - VIR_FREE(vram); -@@ -14412,7 +14422,7 @@ virDomainDeviceDefParse(const char *xmlStr, - goto error; - break; - case VIR_DOMAIN_DEVICE_VIDEO: -- if (!(dev->data.video = virDomainVideoDefParseXML(node, def, flags))) -+ if (!(dev->data.video = virDomainVideoDefParseXML(node, ctxt, def, flags))) - goto error; - break; - case VIR_DOMAIN_DEVICE_HOSTDEV: -@@ -18347,7 +18357,7 @@ virDomainDefParseXML(xmlDocPtr xml, - virDomainVideoDefPtr video; - ssize_t insertAt = -1; - -- if (!(video = virDomainVideoDefParseXML(nodes[i], def, flags))) -+ if (!(video = virDomainVideoDefParseXML(nodes[i], ctxt, def, flags))) - goto error; - - if (video->primary) { -@@ -19414,6 +19424,10 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, - } - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -23332,6 +23346,7 @@ virDomainVideoDefFormat(virBufferPtr buf, - unsigned int flags) - { - const char *model = virDomainVideoTypeToString(def->type); -+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER; - - if (!model) { - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -23341,6 +23356,14 @@ virDomainVideoDefFormat(virBufferPtr buf, - - virBufferAddLit(buf, " - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index bba50cf3fd..4768d02029 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2292,6 +2292,7 @@ void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def) - return; - - virDomainDeviceInfoClear(&def->info); -+ VIR_FREE(def->virtio); - - VIR_FREE(def); - } -@@ -12970,6 +12971,9 @@ virDomainMemballoonDefParseXML(xmlNodePtr node, - else if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0) - goto error; - -+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0) -+ goto error; -+ - cleanup: - VIR_FREE(model); - VIR_FREE(deflate); -@@ -19582,6 +19586,10 @@ virDomainMemballoonDefCheckABIStability(virDomainMemballoonDefPtr src, - return false; - } - -+ if (src->virtio && dst->virtio && -+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) -+ return false; -+ - if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) - return false; - -@@ -22934,6 +22942,22 @@ virDomainMemballoonDefFormat(virBufferPtr buf, - return -1; - } - -+ if (def->virtio) { -+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER; -+ -+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio); -+ -+ if (virBufferCheckError(&driverBuf) < 0) { -+ virBufferFreeAndReset(&childrenBuf); -+ return -1; -+ } -+ if (virBufferUse(&driverBuf)) { -+ virBufferAddLit(&childrenBuf, "\n"); -+ } -+ } -+ - if (!virBufferUse(&childrenBuf)) { - virBufferAddLit(buf, "/>\n"); - } else { -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 603d35bd50..f1f9208b91 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1609,6 +1609,7 @@ struct _virDomainMemballoonDef { - virDomainDeviceInfo info; - int period; /* seconds between collections */ - int autodeflate; /* enum virTristateSwitch */ -+ virDomainVirtioOptionsPtr virtio; - }; - - struct _virDomainNVRAMDef { -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -index 3357bc6d1b..b16a9847fe 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -73,6 +73,7 @@ - - -
    -+ - - - /dev/random --- -2.13.1 - diff --git a/SOURCES/libvirt-audit-Fix-the-output-message-for-shmem.patch b/SOURCES/libvirt-audit-Fix-the-output-message-for-shmem.patch deleted file mode 100644 index c3e819a..0000000 --- a/SOURCES/libvirt-audit-Fix-the-output-message-for-shmem.patch +++ /dev/null @@ -1,70 +0,0 @@ -From c71f920357ffb17cd13aaf9a12e8d77d1b29b08c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Mon, 5 Jun 2017 17:02:03 +0200 -Subject: [PATCH] audit: Fix the output message for shmem - -After some discussion on and off the linux-audit mailing list, we -should use different fields for the audit messages. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1218603 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 6d12a1cb2fb0e0152a19518423dceafa7cf088fb) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/conf/domain_audit.c | 24 +++++++++++++----------- - 1 file changed, 13 insertions(+), 11 deletions(-) - -diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c -index 2d9ff5e3ff..1e667af73c 100644 ---- a/src/conf/domain_audit.c -+++ b/src/conf/domain_audit.c -@@ -983,15 +983,13 @@ virDomainAuditShmem(virDomainObjPtr vm, - char uuidstr[VIR_UUID_STRING_BUFLEN]; - char *vmname = virAuditEncode("vm", vm->def->name); - const char *srcpath = virDomainAuditChardevPath(&def->server.chr); -- char *src = virAuditEncode("server", VIR_AUDIT_STR(srcpath)); -- char *shmem = virAuditEncode("shmem", VIR_AUDIT_STR(def->name)); - const char *virt = virDomainVirtTypeToString(vm->def->virtType); -- char *size = NULL; -+ char *shmpath = NULL; - - virUUIDFormat(vm->def->uuid, uuidstr); - -- if (!vmname || !src || !shmem || -- virAsprintfQuiet(&size, "%llu", def->size) < 0) { -+ if (!vmname || -+ virAsprintfQuiet(&shmpath, "/dev/shm/%s", def->name) < 0) { - VIR_WARN("OOM while encoding audit message"); - goto cleanup; - } -@@ -1002,14 +1000,18 @@ virDomainAuditShmem(virDomainObjPtr vm, - virt = "?"; - } - -- VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success, -- "virt=%s resrc=shmem reason=%s %s uuid=%s size=%s %s %s", -- virt, reason, vmname, uuidstr, size, shmem, src); -+ if (def->server.enabled) { -+ VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success, -+ "virt=%s resrc=ivshmem-socket reason=%s %s uuid=%s path=%s", -+ virt, reason, vmname, uuidstr, VIR_AUDIT_STR(srcpath)); -+ } else { -+ VIR_AUDIT(VIR_AUDIT_RECORD_RESOURCE, success, -+ "virt=%s resrc=shmem reason=%s %s uuid=%s size=%llu path=%s", -+ virt, reason, vmname, uuidstr, def->size, VIR_AUDIT_STR(shmpath)); -+ } - - cleanup: - VIR_FREE(vmname); -- VIR_FREE(src); -- VIR_FREE(size); -- VIR_FREE(shmem); -+ VIR_FREE(shmpath); - return; - } --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Add-check-for-non-scsi_host-parent-during-vport-delete.patch b/SOURCES/libvirt-conf-Add-check-for-non-scsi_host-parent-during-vport-delete.patch deleted file mode 100644 index 66afa80..0000000 --- a/SOURCES/libvirt-conf-Add-check-for-non-scsi_host-parent-during-vport-delete.patch +++ /dev/null @@ -1,46 +0,0 @@ -From aa337656da6b3e44ccaae85ec64538dee80000cf Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Thu, 13 Apr 2017 10:38:35 -0400 -Subject: [PATCH] conf: Add check for non scsi_host parent during vport delete - -https://bugzilla.redhat.com/show_bug.cgi?id=1420740 - -If the parent is not a scsi_host, then we can just happily return since -we won't be removing a vport. - -Fixes a bug with the following output: - -$ virsh pool-destroy host4_hba_pool -error: Failed to destroy pool host4_hba_pool -error: internal error: Invalid adapter name 'pci_0000_10_00_1' for SCSI pool - -$ - -(cherry picked from commit 84f178bdc7ab38011cc1f76759b0a41335285a4f) -Signed-off-by: John Ferlan ---- - src/conf/node_device_conf.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index 7d0baa9d1..cc3fad8b9 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -2074,6 +2074,13 @@ virNodeDeviceDeleteVport(virConnectPtr conn, - if (!(vhba_parent = virNodeDeviceGetParentName(conn, scsi_host_name))) - goto cleanup; - -+ /* If the parent is not a scsi_host, then this is a pool backed -+ * directly to an HBA and there's no vHBA to remove - so we're done */ -+ if (!STRPREFIX(vhba_parent, "scsi_host")) { -+ ret = 0; -+ goto cleanup; -+ } -+ - if (virSCSIHostGetNumber(vhba_parent, &parent_host) < 0) - goto cleanup; - } --- -2.12.2 - diff --git a/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch b/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch new file mode 100644 index 0000000..2015326 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-infrastructure-for-disk-source-private-data-XML.patch @@ -0,0 +1,510 @@ +From 996dfd6322782e72583384381ffebf91ef1d3e27 Mon Sep 17 00:00:00 2001 +Message-Id: <996dfd6322782e72583384381ffebf91ef1d3e27@dist-git> +From: Peter Krempa +Date: Thu, 14 Dec 2017 14:31:51 +0100 +Subject: [PATCH] conf: Add infrastructure for disk source private data XML + +VM drivers may need to store additional private data to the status XML +so that it can be restored after libvirtd restart. Since not everything +is needed add a callback infrastructure, where VM drivers can add only +stuff they need. + +Note that the private data is formatted as a sub-element +of the or sub-element. This is done since +storing it out of band (in the VM private data) would require a complex +matching process to allow to put the data into correct place. + +(cherry picked from commit aed3d038a6565f3b0e916bdb004ca90b302b200d) + + Conflicts: + tests/qemublocktest.c: This file does not exist downstream yet. + +https://bugzilla.redhat.com/show_bug.cgi?id=1523261 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 136 ++++++++++++++++++++++++++++++++++---------- + src/conf/domain_conf.h | 17 +++++- + src/conf/snapshot_conf.c | 18 +++--- + src/network/bridge_driver.c | 2 +- + src/qemu/qemu_domain.c | 2 +- + tests/virstoragetest.c | 2 +- + 6 files changed, 134 insertions(+), 43 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 2d54037b71..ad9c16a1e0 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -8550,11 +8550,43 @@ virDomainDiskSourceEncryptionParse(xmlNodePtr node, + } + + ++static int ++virDomainDiskSourcePrivateDataParse(xmlXPathContextPtr ctxt, ++ virStorageSourcePtr src, ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) ++{ ++ xmlNodePtr saveNode = ctxt->node; ++ xmlNodePtr node; ++ int ret = -1; ++ ++ if (!(flags & VIR_DOMAIN_DEF_PARSE_STATUS) || ++ !xmlopt || !xmlopt->privateData.storageParse) ++ return 0; ++ ++ if (!(node = virXPathNode("./privateData", ctxt))) ++ return 0; ++ ++ ctxt->node = node; ++ ++ if (xmlopt->privateData.storageParse(ctxt, src) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ ++ cleanup: ++ ctxt->node = saveNode; ++ ++ return ret; ++} ++ ++ + int + virDomainDiskSourceParse(xmlNodePtr node, + xmlXPathContextPtr ctxt, + virStorageSourcePtr src, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { + int ret = -1; + xmlNodePtr saveNode = ctxt->node; +@@ -8593,6 +8625,9 @@ virDomainDiskSourceParse(xmlNodePtr node, + if (virDomainDiskSourceEncryptionParse(node, &src->encryption) < 0) + goto cleanup; + ++ if (virDomainDiskSourcePrivateDataParse(ctxt, src, flags, xmlopt) < 0) ++ goto cleanup; ++ + /* People sometimes pass a bogus '' source path when they mean to omit the + * source element completely (e.g. CDROM without media). This is just a + * little compatibility check to help those broken apps */ +@@ -8610,7 +8645,8 @@ virDomainDiskSourceParse(xmlNodePtr node, + static int + virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, + virStorageSourcePtr src, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { + virStorageSourcePtr backingStore = NULL; + xmlNodePtr save_ctxt = ctxt->node; +@@ -8668,8 +8704,8 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, + goto cleanup; + } + +- if (virDomainDiskSourceParse(source, ctxt, backingStore, flags) < 0 || +- virDomainDiskBackingStoreParse(ctxt, backingStore, flags) < 0) ++ if (virDomainDiskSourceParse(source, ctxt, backingStore, flags, xmlopt) < 0 || ++ virDomainDiskBackingStoreParse(ctxt, backingStore, flags, xmlopt) < 0) + goto cleanup; + + VIR_STEAL_PTR(src->backingStore, backingStore); +@@ -8771,7 +8807,8 @@ static int + virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, + xmlNodePtr cur, + xmlXPathContextPtr ctxt, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { + xmlNodePtr mirrorNode; + char *mirrorFormat = NULL; +@@ -8809,7 +8846,8 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, + goto cleanup; + } + +- if (virDomainDiskSourceParse(mirrorNode, ctxt, def->mirror, flags) < 0) ++ if (virDomainDiskSourceParse(mirrorNode, ctxt, def->mirror, ++ flags, xmlopt) < 0) + goto cleanup; + } else { + /* For back-compat reasons, we handle a file name +@@ -9235,7 +9273,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, + if (!source && virXMLNodeNameEqual(cur, "source")) { + sourceNode = cur; + +- if (virDomainDiskSourceParse(cur, ctxt, def->src, flags) < 0) ++ if (virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0) + goto error; + + /* If we've already found an as a child of and +@@ -9316,7 +9354,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, + } else if (!def->mirror && + virXMLNodeNameEqual(cur, "mirror") && + !(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) { +- if (virDomainDiskDefMirrorParse(def, cur, ctxt, flags) < 0) ++ if (virDomainDiskDefMirrorParse(def, cur, ctxt, flags, xmlopt) < 0) + goto error; + } else if (!authdef && + virXMLNodeNameEqual(cur, "auth")) { +@@ -9587,7 +9625,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, + product = NULL; + + if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) { +- if (virDomainDiskBackingStoreParse(ctxt, def->src, flags) < 0) ++ if (virDomainDiskBackingStoreParse(ctxt, def->src, flags, xmlopt) < 0) + goto error; + } + +@@ -22349,12 +22387,43 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf, + } + + ++static int ++virDomainDiskSourceFormatPrivateData(virBufferPtr buf, ++ virStorageSourcePtr src, ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) ++{ ++ virBuffer childBuf = VIR_BUFFER_INITIALIZER; ++ int ret = -1; ++ ++ if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) || ++ !xmlopt || !xmlopt->privateData.storageFormat) ++ return 0; ++ ++ virBufferSetChildIndent(&childBuf, buf); ++ ++ if (xmlopt->privateData.storageFormat(src, &childBuf) < 0) ++ goto cleanup; ++ ++ if (virXMLFormatElement(buf, "privateData", NULL, &childBuf) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ ++ cleanup: ++ virBufferFreeAndReset(&childBuf); ++ ++ return ret; ++} ++ ++ + static int + virDomainDiskSourceFormatInternal(virBufferPtr buf, + virStorageSourcePtr src, + int policy, + unsigned int flags, +- bool skipSeclabels) ++ bool skipSeclabels, ++ virDomainXMLOptionPtr xmlopt) + { + const char *startupPolicy = NULL; + virBuffer attrBuf = VIR_BUFFER_INITIALIZER; +@@ -22436,6 +22505,9 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf, + virStorageEncryptionFormat(&childBuf, src->encryption) < 0) + return -1; + ++ if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt) < 0) ++ return -1; ++ + if (virXMLFormatElement(buf, "source", &attrBuf, &childBuf) < 0) + goto error; + } +@@ -22453,15 +22525,18 @@ int + virDomainDiskSourceFormat(virBufferPtr buf, + virStorageSourcePtr src, + int policy, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { +- return virDomainDiskSourceFormatInternal(buf, src, policy, flags, false); ++ return virDomainDiskSourceFormatInternal(buf, src, policy, flags, false, xmlopt); + } + + + static int + virDomainDiskBackingStoreFormat(virBufferPtr buf, +- virStorageSourcePtr backingStore) ++ virStorageSourcePtr backingStore, ++ virDomainXMLOptionPtr xmlopt, ++ unsigned int flags) + { + const char *format; + +@@ -22490,9 +22565,9 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, + + virBufferAsprintf(buf, "\n", format); + /* We currently don't output seclabels for backing chain element */ +- if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, 0, true) < 0 || +- virDomainDiskBackingStoreFormat(buf, +- backingStore->backingStore) < 0) ++ if (virDomainDiskSourceFormatInternal(buf, backingStore, 0, flags, true, xmlopt) < 0 || ++ virDomainDiskBackingStoreFormat(buf, backingStore->backingStore, ++ xmlopt, flags) < 0) + return -1; + + virBufferAdjustIndent(buf, -2); +@@ -22510,7 +22585,8 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, + static int + virDomainDiskDefFormat(virBufferPtr buf, + virDomainDiskDefPtr def, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { + const char *type = virStorageTypeToString(def->src->type); + const char *device = virDomainDiskDeviceTypeToString(def->device); +@@ -22623,13 +22699,14 @@ virDomainDiskDefFormat(virBufferPtr buf, + } + + if (virDomainDiskSourceFormat(buf, def->src, def->startupPolicy, +- flags) < 0) ++ flags, xmlopt) < 0) + return -1; + + /* Don't format backingStore to inactive XMLs until the code for + * persistent storage of backing chains is ready. */ + if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && +- virDomainDiskBackingStoreFormat(buf, def->src->backingStore) < 0) ++ virDomainDiskBackingStoreFormat(buf, def->src->backingStore, ++ xmlopt, flags) < 0) + return -1; + + virBufferEscapeString(buf, "\n", def->domain_name); +@@ -22666,7 +22743,7 @@ virDomainDiskDefFormat(virBufferPtr buf, + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + virBufferEscapeString(buf, "\n", formatStr); +- if (virDomainDiskSourceFormat(buf, def->mirror, 0, 0) < 0) ++ if (virDomainDiskSourceFormat(buf, def->mirror, 0, 0, xmlopt) < 0) + return -1; + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); +@@ -25897,7 +25974,8 @@ int + virDomainDefFormatInternal(virDomainDefPtr def, + virCapsPtr caps, + unsigned int flags, +- virBufferPtr buf) ++ virBufferPtr buf, ++ virDomainXMLOptionPtr xmlopt) + { + unsigned char *uuid; + char uuidstr[VIR_UUID_STRING_BUFLEN]; +@@ -25952,10 +26030,10 @@ virDomainDefFormatInternal(virDomainDefPtr def, + * but no leading indentation before the starting element. + * Thankfully, libxml maps what looks like globals into + * thread-local uses, so we are thread-safe. */ +- xmlIndentTreeOutput = 1; +- xmlbuf = xmlBufferCreate(); +- if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata, +- virBufferGetIndent(buf, false) / 2, 1) < 0) { ++ xmlIndentTreeOutput = 1; ++ xmlbuf = xmlBufferCreate(); ++ if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata, ++ virBufferGetIndent(buf, false) / 2, 1) < 0) { + xmlBufferFree(xmlbuf); + xmlIndentTreeOutput = oldIndentTreeOutput; + goto error; +@@ -26528,7 +26606,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, + def->emulator); + + for (n = 0; n < def->ndisks; n++) +- if (virDomainDiskDefFormat(buf, def->disks[n], flags) < 0) ++ if (virDomainDiskDefFormat(buf, def->disks[n], flags, xmlopt) < 0) + goto error; + + for (n = 0; n < def->ncontrollers; n++) +@@ -26715,7 +26793,7 @@ virDomainDefFormat(virDomainDefPtr def, virCapsPtr caps, unsigned int flags) + virBuffer buf = VIR_BUFFER_INITIALIZER; + + virCheckFlags(VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS, NULL); +- if (virDomainDefFormatInternal(def, caps, flags, &buf) < 0) ++ if (virDomainDefFormatInternal(def, caps, flags, &buf, NULL) < 0) + return NULL; + + return virBufferContentAndReset(&buf); +@@ -26750,7 +26828,7 @@ virDomainObjFormat(virDomainXMLOptionPtr xmlopt, + xmlopt->privateData.format(&buf, obj) < 0) + goto error; + +- if (virDomainDefFormatInternal(obj->def, caps, flags, &buf) < 0) ++ if (virDomainDefFormatInternal(obj->def, caps, flags, &buf, xmlopt) < 0) + goto error; + + virBufferAdjustIndent(&buf, -2); +@@ -27704,7 +27782,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, + + switch ((virDomainDeviceType) src->type) { + case VIR_DOMAIN_DEVICE_DISK: +- rc = virDomainDiskDefFormat(&buf, src->data.disk, flags); ++ rc = virDomainDiskDefFormat(&buf, src->data.disk, flags, xmlopt); + break; + case VIR_DOMAIN_DEVICE_LEASE: + rc = virDomainLeaseDefFormat(&buf, src->data.lease); +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 698d3280fe..5e67c9a9c1 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2626,6 +2626,12 @@ typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, + virDomainObjPtr, + virDomainDefParserConfigPtr); + ++typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathContextPtr ctxt, ++ virStorageSourcePtr src); ++typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSourcePtr src, ++ virBufferPtr buf); ++ ++ + typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks; + typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; + struct _virDomainXMLPrivateDataCallbacks { +@@ -2639,6 +2645,8 @@ struct _virDomainXMLPrivateDataCallbacks { + virDomainXMLPrivateDataNewFunc chrSourceNew; + virDomainXMLPrivateDataFormatFunc format; + virDomainXMLPrivateDataParseFunc parse; ++ virDomainXMLPrivateDataStorageSourceParseFunc storageParse; ++ virDomainXMLPrivateDataStorageSourceFormatFunc storageFormat; + }; + + typedef bool (*virDomainABIStabilityDomain)(const virDomainDef *src, +@@ -2963,12 +2971,14 @@ char *virDomainObjFormat(virDomainXMLOptionPtr xmlopt, + int virDomainDefFormatInternal(virDomainDefPtr def, + virCapsPtr caps, + unsigned int flags, +- virBufferPtr buf); ++ virBufferPtr buf, ++ virDomainXMLOptionPtr xmlopt); + + int virDomainDiskSourceFormat(virBufferPtr buf, + virStorageSourcePtr src, + int policy, +- unsigned int flags); ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt); + + int virDomainNetDefFormat(virBufferPtr buf, + virDomainNetDefPtr def, +@@ -3017,7 +3027,8 @@ virDomainDiskRemoveByName(virDomainDefPtr def, const char *name); + int virDomainDiskSourceParse(xmlNodePtr node, + xmlXPathContextPtr ctxt, + virStorageSourcePtr src, +- unsigned int flags); ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt); + + int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net); + virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device); +diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c +index f0e852c92b..d7b086242b 100644 +--- a/src/conf/snapshot_conf.c ++++ b/src/conf/snapshot_conf.c +@@ -110,7 +110,8 @@ static int + virDomainSnapshotDiskDefParseXML(xmlNodePtr node, + xmlXPathContextPtr ctxt, + virDomainSnapshotDiskDefPtr def, +- unsigned int flags) ++ unsigned int flags, ++ virDomainXMLOptionPtr xmlopt) + { + int ret = -1; + char *snapshot = NULL; +@@ -155,7 +156,7 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, + } + + if ((cur = virXPathNode("./source", ctxt)) && +- virDomainDiskSourceParse(cur, ctxt, def->src, flags) < 0) ++ virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0) + goto cleanup; + + if ((driver = virXPathString("string(./driver/@type)", ctxt))) { +@@ -348,8 +349,8 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, + goto cleanup; + def->ndisks = n; + for (i = 0; i < def->ndisks; i++) { +- if (virDomainSnapshotDiskDefParseXML(nodes[i], ctxt, +- &def->disks[i], flags) < 0) ++ if (virDomainSnapshotDiskDefParseXML(nodes[i], ctxt, &def->disks[i], ++ flags, xmlopt) < 0) + goto cleanup; + } + VIR_FREE(nodes); +@@ -663,7 +664,8 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def, + + static void + virDomainSnapshotDiskDefFormat(virBufferPtr buf, +- virDomainSnapshotDiskDefPtr disk) ++ virDomainSnapshotDiskDefPtr disk, ++ virDomainXMLOptionPtr xmlopt) + { + int type = disk->src->type; + +@@ -686,7 +688,7 @@ virDomainSnapshotDiskDefFormat(virBufferPtr buf, + if (disk->src->format > 0) + virBufferEscapeString(buf, "\n", + virStorageFileFormatTypeToString(disk->src->format)); +- virDomainDiskSourceFormat(buf, disk->src, 0, 0); ++ virDomainDiskSourceFormat(buf, disk->src, 0, 0, xmlopt); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); +@@ -740,13 +742,13 @@ virDomainSnapshotDefFormat(const char *domain_uuid, + virBufferAddLit(&buf, "\n"); + virBufferAdjustIndent(&buf, 2); + for (i = 0; i < def->ndisks; i++) +- virDomainSnapshotDiskDefFormat(&buf, &def->disks[i]); ++ virDomainSnapshotDiskDefFormat(&buf, &def->disks[i], xmlopt); + virBufferAdjustIndent(&buf, -2); + virBufferAddLit(&buf, "\n"); + } + + if (def->dom) { +- if (virDomainDefFormatInternal(def->dom, caps, flags, &buf) < 0) ++ if (virDomainDefFormatInternal(def->dom, caps, flags, &buf, xmlopt) < 0) + goto error; + } else if (domain_uuid) { + virBufferAddLit(&buf, "\n"); +diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c +index fcaa66df91..334da7a85d 100644 +--- a/src/network/bridge_driver.c ++++ b/src/network/bridge_driver.c +@@ -233,7 +233,7 @@ networkRunHook(virNetworkObjPtr obj, + goto cleanup; + if (virNetworkDefFormatBuf(&buf, def, 0) < 0) + goto cleanup; +- if (dom && virDomainDefFormatInternal(dom, NULL, 0, &buf) < 0) ++ if (dom && virDomainDefFormatInternal(dom, NULL, 0, &buf, NULL) < 0) + goto cleanup; + + virBufferAdjustIndent(&buf, -2); +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 9dd9db049b..625bcb20d5 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -5245,7 +5245,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, + format: + ret = virDomainDefFormatInternal(def, caps, + virDomainDefFormatConvertXMLFlags(flags), +- buf); ++ buf, driver->xmlopt); + + cleanup: + virDomainDefFree(copy); +diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c +index e1d8751728..bdd0829c21 100644 +--- a/tests/virstoragetest.c ++++ b/tests/virstoragetest.c +@@ -693,7 +693,7 @@ testBackingParse(const void *args) + goto cleanup; + } + +- if (virDomainDiskSourceFormat(&buf, src, 0, 0) < 0 || ++ if (virDomainDiskSourceFormat(&buf, src, 0, 0, NULL) < 0 || + !(xml = virBufferContentAndReset(&buf))) { + fprintf(stderr, "failed to format disk source xml\n"); + goto cleanup; +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Add-save-cookie-callbacks-to-xmlopt.patch b/SOURCES/libvirt-conf-Add-save-cookie-callbacks-to-xmlopt.patch deleted file mode 100644 index d7101a8..0000000 --- a/SOURCES/libvirt-conf-Add-save-cookie-callbacks-to-xmlopt.patch +++ /dev/null @@ -1,427 +0,0 @@ -From 7cf2eee78e7e0e08eb1203f7fdb5705aba6b0e42 Mon Sep 17 00:00:00 2001 -Message-Id: <7cf2eee78e7e0e08eb1203f7fdb5705aba6b0e42@dist-git> -From: Jiri Denemark -Date: Fri, 2 Jun 2017 00:44:46 +0200 -Subject: [PATCH] conf: Add save cookie callbacks to xmlopt - -virDomainXMLOption gains driver specific callbacks for parsing and -formatting save cookies. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 25af7e950a9e35a6cffeed32bbcdd95dd7e01035) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/bhyve/bhyve_domain.c | 2 +- - src/conf/domain_conf.c | 16 +++++++++++++++- - src/conf/domain_conf.h | 7 ++++++- - src/conf/snapshot_conf.c | 11 ++++++++++- - src/conf/snapshot_conf.h | 2 ++ - src/libvirt_private.syms | 1 + - src/libxl/libxl_conf.c | 2 +- - src/lxc/lxc_conf.c | 2 +- - src/openvz/openvz_driver.c | 2 +- - src/phyp/phyp_driver.c | 2 +- - src/qemu/qemu_capabilities.c | 2 +- - src/qemu/qemu_conf.c | 3 ++- - src/security/virt-aa-helper.c | 2 +- - src/test/test_driver.c | 2 +- - src/uml/uml_driver.c | 2 +- - src/vbox/vbox_common.c | 2 +- - src/vmware/vmware_driver.c | 3 ++- - src/vmx/vmx.c | 2 +- - src/vz/vz_driver.c | 2 +- - src/xen/xen_driver.c | 2 +- - src/xenapi/xenapi_driver.c | 2 +- - tests/bhyveargv2xmltest.c | 2 +- - tests/testutils.c | 2 +- - 23 files changed, 54 insertions(+), 21 deletions(-) - -diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c -index 0a99550afa..20c82937b5 100644 ---- a/src/bhyve/bhyve_domain.c -+++ b/src/bhyve/bhyve_domain.c -@@ -144,7 +144,7 @@ virBhyveDriverCreateXMLConf(bhyveConnPtr driver) - virBhyveDriverDomainDefParserConfig.priv = driver; - return virDomainXMLOptionNew(&virBhyveDriverDomainDefParserConfig, - &virBhyveDriverPrivateDataCallbacks, -- NULL, NULL); -+ NULL, NULL, NULL); - } - - virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = { -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 395dcc0531..b473ce6b1e 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -79,6 +79,9 @@ struct _virDomainXMLOption { - - /* ABI stability callbacks */ - virDomainABIStability abi; -+ -+ /* Private data for save image stored in snapshot XML */ -+ virSaveCookieCallbacks saveCookie; - }; - - #define VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS \ -@@ -1054,7 +1057,8 @@ virDomainXMLOptionPtr - virDomainXMLOptionNew(virDomainDefParserConfigPtr config, - virDomainXMLPrivateDataCallbacksPtr priv, - virDomainXMLNamespacePtr xmlns, -- virDomainABIStabilityPtr abi) -+ virDomainABIStabilityPtr abi, -+ virSaveCookieCallbacksPtr saveCookie) - { - virDomainXMLOptionPtr xmlopt; - -@@ -1076,6 +1080,9 @@ virDomainXMLOptionNew(virDomainDefParserConfigPtr config, - if (abi) - xmlopt->abi = *abi; - -+ if (saveCookie) -+ xmlopt->saveCookie = *saveCookie; -+ - /* Technically this forbids to use one of Xerox's MAC address prefixes in - * our hypervisor drivers. This shouldn't ever be a problem. - * -@@ -1106,6 +1113,13 @@ virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) - } - - -+virSaveCookieCallbacksPtr -+virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt) -+{ -+ return &xmlopt->saveCookie; -+} -+ -+ - void - virBlkioDeviceArrayClear(virBlkioDevicePtr devices, - int ndevices) -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index d64ef1b6e9..706d106ad9 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -55,6 +55,7 @@ - # include "virgic.h" - # include "virperf.h" - # include "virtypedparam.h" -+# include "virsavecookie.h" - - /* forward declarations of all device types, required by - * virDomainDeviceDef -@@ -2549,7 +2550,11 @@ struct _virDomainABIStability { - virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config, - virDomainXMLPrivateDataCallbacksPtr priv, - virDomainXMLNamespacePtr xmlns, -- virDomainABIStabilityPtr abi); -+ virDomainABIStabilityPtr abi, -+ virSaveCookieCallbacksPtr saveCookie); -+ -+virSaveCookieCallbacksPtr -+virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt); - - void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr mac); - -diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c -index e3bba985d7..6330f7d1f9 100644 ---- a/src/conf/snapshot_conf.c -+++ b/src/conf/snapshot_conf.c -@@ -102,6 +102,7 @@ void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def) - virDomainSnapshotDiskDefClear(&def->disks[i]); - VIR_FREE(def->disks); - virDomainDefFree(def->dom); -+ virObjectUnref(def->cookie); - VIR_FREE(def); - } - -@@ -214,6 +215,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, - char *memorySnapshot = NULL; - char *memoryFile = NULL; - bool offline = !!(flags & VIR_DOMAIN_SNAPSHOT_PARSE_OFFLINE); -+ virSaveCookieCallbacksPtr saveCookie = virDomainXMLOptionGetSaveCookie(xmlopt); - - if (VIR_ALLOC(def) < 0) - goto cleanup; -@@ -365,6 +367,9 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, - def->current = active != 0; - } - -+ if (!offline && virSaveCookieParse(ctxt, &def->cookie, saveCookie) < 0) -+ goto cleanup; -+ - ret = def; - - cleanup: -@@ -691,7 +696,7 @@ char * - virDomainSnapshotDefFormat(const char *domain_uuid, - virDomainSnapshotDefPtr def, - virCapsPtr caps, -- virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED, -+ virDomainXMLOptionPtr xmlopt, - unsigned int flags, - int internal) - { -@@ -751,6 +756,10 @@ virDomainSnapshotDefFormat(const char *domain_uuid, - virBufferAddLit(&buf, "\n"); - } - -+ if (virSaveCookieFormatBuf(&buf, def->cookie, -+ virDomainXMLOptionGetSaveCookie(xmlopt)) < 0) -+ goto error; -+ - if (internal) - virBufferAsprintf(&buf, "%d\n", def->current); - -diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h -index 2ce526fa6b..1d663c77bc 100644 ---- a/src/conf/snapshot_conf.h -+++ b/src/conf/snapshot_conf.h -@@ -76,6 +76,8 @@ struct _virDomainSnapshotDef { - - virDomainDefPtr dom; - -+ virObjectPtr cookie; -+ - /* Internal use. */ - bool current; /* At most one snapshot in the list should have this set */ - }; -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index b4769080e8..88e3f4b8ac 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -533,6 +533,7 @@ virDomainWatchdogActionTypeToString; - virDomainWatchdogModelTypeFromString; - virDomainWatchdogModelTypeToString; - virDomainXMLOptionGetNamespace; -+virDomainXMLOptionGetSaveCookie; - virDomainXMLOptionNew; - - -diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c -index dd345c22cf..28d31db158 100644 ---- a/src/libxl/libxl_conf.c -+++ b/src/libxl/libxl_conf.c -@@ -2147,5 +2147,5 @@ libxlCreateXMLConf(void) - { - return virDomainXMLOptionNew(&libxlDomainDefParserConfig, - &libxlDomainXMLPrivateDataCallbacks, -- NULL, NULL); -+ NULL, NULL, NULL); - } -diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c -index b46fbc58ff..8adc408c32 100644 ---- a/src/lxc/lxc_conf.c -+++ b/src/lxc/lxc_conf.c -@@ -213,7 +213,7 @@ lxcDomainXMLConfInit(void) - return virDomainXMLOptionNew(&virLXCDriverDomainDefParserConfig, - &virLXCDriverPrivateDataCallbacks, - &virLXCDriverDomainXMLNamespace, -- NULL); -+ NULL, NULL); - } - - -diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c -index 44a6631a99..4392aa64c0 100644 ---- a/src/openvz/openvz_driver.c -+++ b/src/openvz/openvz_driver.c -@@ -1493,7 +1493,7 @@ static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn, - goto cleanup; - - if (!(driver->xmlopt = virDomainXMLOptionNew(&openvzDomainDefParserConfig, -- NULL, NULL, NULL))) -+ NULL, NULL, NULL, NULL))) - goto cleanup; - - if (openvzLoadDomains(driver) < 0) -diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c -index e85f66ffab..32cb681c75 100644 ---- a/src/phyp/phyp_driver.c -+++ b/src/phyp/phyp_driver.c -@@ -1199,7 +1199,7 @@ phypConnectOpen(virConnectPtr conn, - goto failure; - - if (!(phyp_driver->xmlopt = virDomainXMLOptionNew(&virPhypDriverDomainDefParserConfig, -- NULL, NULL, NULL))) -+ NULL, NULL, NULL, NULL))) - goto failure; - - conn->privateData = phyp_driver; -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 72d3f25763..29bb9949af 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -5027,7 +5027,7 @@ virQEMUCapsInitQMPCommandRun(virQEMUCapsInitQMPCommandPtr cmd, - goto ignore; - } - -- if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL)) || -+ if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL)) || - !(cmd->vm = virDomainObjNew(xmlopt))) - goto cleanup; - -diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index 76eed25277..96956b7779 100644 ---- a/src/qemu/qemu_conf.c -+++ b/src/qemu/qemu_conf.c -@@ -908,7 +908,8 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver) - return virDomainXMLOptionNew(&virQEMUDriverDomainDefParserConfig, - &virQEMUDriverPrivateDataCallbacks, - &virQEMUDriverDomainXMLNamespace, -- &virQEMUDriverDomainABIStability); -+ &virQEMUDriverDomainABIStability, -+ NULL); - } - - -diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c -index 48201d5b8c..97436e5dc7 100644 ---- a/src/security/virt-aa-helper.c -+++ b/src/security/virt-aa-helper.c -@@ -667,7 +667,7 @@ get_definition(vahControl * ctl, const char *xmlStr) - goto exit; - } - -- if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL))) { -+ if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL))) { - vah_error(ctl, 0, _("Failed to create XML config object")); - goto exit; - } -diff --git a/src/test/test_driver.c b/src/test/test_driver.c -index c8085dd797..4fd14ddee6 100644 ---- a/src/test/test_driver.c -+++ b/src/test/test_driver.c -@@ -414,7 +414,7 @@ testDriverNew(void) - goto error; - } - -- if (!(ret->xmlopt = virDomainXMLOptionNew(NULL, NULL, &ns, NULL)) || -+ if (!(ret->xmlopt = virDomainXMLOptionNew(NULL, NULL, &ns, NULL, NULL)) || - !(ret->eventState = virObjectEventStateNew()) || - !(ret->domains = virDomainObjListNew()) || - !(ret->networks = virNetworkObjListNew())) -diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c -index ae75daa596..f91ee2961e 100644 ---- a/src/uml/uml_driver.c -+++ b/src/uml/uml_driver.c -@@ -533,7 +533,7 @@ umlStateInitialize(bool privileged, - goto out_of_memory; - - if (!(uml_driver->xmlopt = virDomainXMLOptionNew(¨DriverDomainDefParserConfig, -- &privcb, NULL, NULL))) -+ &privcb, NULL, NULL, NULL))) - goto error; - - if ((uml_driver->inotifyFD = inotify_init()) < 0) { -diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c -index c739031660..4a79c43a1a 100644 ---- a/src/vbox/vbox_common.c -+++ b/src/vbox/vbox_common.c -@@ -139,7 +139,7 @@ vboxDriverObjNew(void) - - if (!(driver->caps = vboxCapsInit()) || - !(driver->xmlopt = virDomainXMLOptionNew(&vboxDomainDefParserConfig, -- NULL, NULL, NULL))) -+ NULL, NULL, NULL, NULL))) - goto cleanup; - - return driver; -diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c -index 24e97a4969..525c85edc8 100644 ---- a/src/vmware/vmware_driver.c -+++ b/src/vmware/vmware_driver.c -@@ -114,7 +114,8 @@ vmwareDomainXMLConfigInit(void) - virDomainXMLPrivateDataCallbacks priv = { .alloc = vmwareDataAllocFunc, - .free = vmwareDataFreeFunc }; - -- return virDomainXMLOptionNew(&vmwareDomainDefParserConfig, &priv, NULL, NULL); -+ return virDomainXMLOptionNew(&vmwareDomainDefParserConfig, &priv, -+ NULL, NULL, NULL); - } - - static virDrvOpenStatus -diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c -index 3289a20026..96507f10f3 100644 ---- a/src/vmx/vmx.c -+++ b/src/vmx/vmx.c -@@ -591,7 +591,7 @@ virDomainXMLOptionPtr - virVMXDomainXMLConfInit(void) - { - return virDomainXMLOptionNew(&virVMXDomainDefParserConfig, NULL, -- &virVMXDomainXMLNamespace, NULL); -+ &virVMXDomainXMLNamespace, NULL, NULL); - } - - char * -diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c -index f0b6722a6e..532a6841f3 100644 ---- a/src/vz/vz_driver.c -+++ b/src/vz/vz_driver.c -@@ -326,7 +326,7 @@ vzDriverObjNew(void) - if (!(driver->caps = vzBuildCapabilities()) || - !(driver->xmlopt = virDomainXMLOptionNew(&vzDomainDefParserConfig, - &vzDomainXMLPrivateDataCallbacksPtr, -- NULL, NULL)) || -+ NULL, NULL, NULL)) || - !(driver->domains = virDomainObjListNew()) || - !(driver->domainEventState = virObjectEventStateNew()) || - (vzInitVersion(driver) < 0) || -diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c -index 0c160f8370..ab74ba9928 100644 ---- a/src/xen/xen_driver.c -+++ b/src/xen/xen_driver.c -@@ -401,7 +401,7 @@ virDomainXMLOptionPtr - xenDomainXMLConfInit(void) - { - return virDomainXMLOptionNew(&xenDomainDefParserConfig, -- NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL); - } - - -diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c -index 5623ddb507..c94fd422f9 100644 ---- a/src/xenapi/xenapi_driver.c -+++ b/src/xenapi/xenapi_driver.c -@@ -200,7 +200,7 @@ xenapiConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - } - - if (!(privP->xmlopt = virDomainXMLOptionNew(&xenapiDomainDefParserConfig, -- NULL, NULL, NULL))) { -+ NULL, NULL, NULL, NULL))) { - xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, - _("Failed to create XML conf object")); - goto error; -diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c -index 5d7261a45b..43ef76a594 100644 ---- a/tests/bhyveargv2xmltest.c -+++ b/tests/bhyveargv2xmltest.c -@@ -131,7 +131,7 @@ mymain(void) - return EXIT_FAILURE; - - if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, -- NULL, NULL)) == NULL) -+ NULL, NULL, NULL)) == NULL) - return EXIT_FAILURE; - - # define DO_TEST_FULL(name, flags) \ -diff --git a/tests/testutils.c b/tests/testutils.c -index b7dc8d8408..0823469068 100644 ---- a/tests/testutils.c -+++ b/tests/testutils.c -@@ -1136,7 +1136,7 @@ virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void) - { - return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig, - &virTestGenericPrivateDataCallbacks, -- NULL, NULL); -+ NULL, NULL, NULL); - } - - --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Add-spapr-pci-host-bridge-controller-model.patch b/SOURCES/libvirt-conf-Add-spapr-pci-host-bridge-controller-model.patch deleted file mode 100644 index 015d42b..0000000 --- a/SOURCES/libvirt-conf-Add-spapr-pci-host-bridge-controller-model.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 851635352b217b63e7defc703f8a3f2a6719b490 Mon Sep 17 00:00:00 2001 -Message-Id: <851635352b217b63e7defc703f8a3f2a6719b490@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:08 +0200 -Subject: [PATCH] conf: Add 'spapr-pci-host-bridge' controller model - -Adding it to the virDomainControllerPCIModelName enumeration -is enough for existing code to handle it, so parsing and -formatting will work without further tweaking. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 90855eca3f7ceee964727c1d0f54541373d31908) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - docs/schemas/domaincommon.rng | 2 ++ - src/conf/domain_conf.c | 1 + - src/conf/domain_conf.h | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 78023ff4af..964e5c5bd5 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -1900,6 +1900,8 @@ - - - -+ -+ spapr-pci-host-bridge - - pci-bridge - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 8e5c487df8..8a030c9b68 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -349,6 +349,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, - "pxb", - "pxb-pcie", - "pcie-root-port", -+ "spapr-pci-host-bridge", - ); - - VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST, -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 4c33b0d15e..e287e6d7f3 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -710,6 +710,7 @@ typedef enum { - VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB, - VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE, - VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT, -+ VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE, - - VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST - } virDomainControllerPCIModelName; --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch b/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch new file mode 100644 index 0000000..5ff1f1b --- /dev/null +++ b/SOURCES/libvirt-conf-Add-support-for-cputune-cachetune.patch @@ -0,0 +1,794 @@ +From ba1ce05bd6e49217cd8c89b75e741e518d2b9292 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:30 +0100 +Subject: [PATCH] conf: Add support for cputune/cachetune + +More info in the documentation, this is basically the XML parsing/formatting +support, schemas, tests and documentation for the new cputune/cachetune element +that will get used by following patches. + +Signed-off-by: Martin Kletzander +(cherry picked from commit 7387e3fea44e28118e1f72841d79503849e15985) +Signed-off-by: Martin Kletzander + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Downstream changes: + +- Rename test XML files due to ab7a2fe230bb742cc4bc7f8d1475201b97fe49ab + +Signed-off-by: Martin Kletzander +--- + docs/formatdomain.html.in | 54 ++++ + docs/schemas/domaincommon.rng | 32 +++ + src/conf/domain_conf.c | 295 ++++++++++++++++++++- + src/conf/domain_conf.h | 13 + + .../genericxml2xmlindata/generic-cachetune-cdp.xml | 36 +++ + .../generic-cachetune-colliding-allocs.xml | 30 +++ + .../generic-cachetune-colliding-tunes.xml | 32 +++ + .../generic-cachetune-colliding-types.xml | 30 +++ + .../generic-cachetune-small.xml | 29 ++ + tests/genericxml2xmlindata/generic-cachetune.xml | 33 +++ + tests/genericxml2xmltest.c | 10 + + 11 files changed, 592 insertions(+), 2 deletions(-) + create mode 100644 tests/genericxml2xmlindata/generic-cachetune-cdp.xml + create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml + create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml + create mode 100644 tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml + create mode 100644 tests/genericxml2xmlindata/generic-cachetune-small.xml + create mode 100644 tests/genericxml2xmlindata/generic-cachetune.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 0cfbf051b7..f33261d05c 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -689,6 +689,10 @@ + <iothread_quota>-1</iothread_quota> + <vcpusched vcpus='0-4,^3' scheduler='fifo' priority='1'/> + <iothreadsched iothreads='2' scheduler='batch'/> ++ <cachetune vcpus='0-3'> ++ <cache id='0' level='3' type='both' size='3' unit='MiB'/> ++ <cache id='1' level='3' type='both' size='3' unit='MiB'/> ++ </cachetune> + </cputune> + ... + </domain> +@@ -834,6 +838,56 @@ + Since 1.2.13 + + ++
    cachetuneSince 4.1.0
    ++
    ++ Optional cachetune element can control allocations for CPU ++ caches using the resctrl on the host. Whether or not is this supported ++ can be gathered from capabilities where some limitations like minimum ++ size and required granularity are reported as well. The required ++ attribute vcpus specifies to which vCPUs this allocation ++ applies. A vCPU can only be member of one cachetune element ++ allocations. Supported subelements are: ++
    ++
    cache
    ++
    ++ This element controls the allocation of CPU cache and has the ++ following attributes: ++
    ++
    level
    ++
    ++ Host cache level from which to allocate. ++
    ++
    id
    ++
    ++ Host cache id from which to allocate. ++
    ++
    type
    ++
    ++ Type of allocation. Can be code for code ++ (instructions), data for data or both ++ for both code and data (unified). Currently the allocation can ++ be done only with the same type as the host supports, meaning ++ you cannot request both for host with CDP ++ (code/data prioritization) enabled. ++
    ++
    size
    ++
    ++ The size of the region to allocate. The value by default is in ++ bytes, but the unit attribute can be used to scale ++ the value. ++
    ++
    unit (optional)
    ++
    ++ If specified it is the unit such as KiB, MiB, GiB, or TiB ++ (described in the memory element ++ for Memory Allocation) ++ in which size is specified, defaults to bytes. ++
    ++
    ++
    ++
    ++ ++
    + + + +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 05709afc0c..564674b659 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -900,6 +900,38 @@ + +
    + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ both ++ code ++ data ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index ad9c16a1e0..181b035647 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -2886,6 +2886,19 @@ virDomainLoaderDefFree(virDomainLoaderDefPtr loader) + VIR_FREE(loader); + } + ++ ++static void ++virDomainCachetuneDefFree(virDomainCachetuneDefPtr cachetune) ++{ ++ if (!cachetune) ++ return; ++ ++ virObjectUnref(cachetune->alloc); ++ virBitmapFree(cachetune->vcpus); ++ VIR_FREE(cachetune); ++} ++ ++ + void virDomainDefFree(virDomainDefPtr def) + { + size_t i; +@@ -3058,6 +3071,10 @@ void virDomainDefFree(virDomainDefPtr def) + virDomainShmemDefFree(def->shmems[i]); + VIR_FREE(def->shmems); + ++ for (i = 0; i < def->ncachetunes; i++) ++ virDomainCachetuneDefFree(def->cachetunes[i]); ++ VIR_FREE(def->cachetunes); ++ + VIR_FREE(def->keywrap); + + if (def->namespaceData && def->ns.free) +@@ -18233,6 +18250,194 @@ virDomainDefParseBootOptions(virDomainDefPtr def, + } + + ++static int ++virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, ++ xmlNodePtr node, ++ virResctrlAllocPtr alloc) ++{ ++ xmlNodePtr oldnode = ctxt->node; ++ unsigned int level; ++ unsigned int cache; ++ int type; ++ unsigned long long size; ++ char *tmp = NULL; ++ int ret = -1; ++ ++ ctxt->node = node; ++ ++ tmp = virXMLPropString(node, "id"); ++ if (!tmp) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Missing cachetune attribute 'id'")); ++ goto cleanup; ++ } ++ if (virStrToLong_uip(tmp, NULL, 10, &cache) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Invalid cachetune attribute 'id' value '%s'"), ++ tmp); ++ goto cleanup; ++ } ++ VIR_FREE(tmp); ++ ++ tmp = virXMLPropString(node, "level"); ++ if (!tmp) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Missing cachetune attribute 'level'")); ++ goto cleanup; ++ } ++ if (virStrToLong_uip(tmp, NULL, 10, &level) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Invalid cachetune attribute 'level' value '%s'"), ++ tmp); ++ goto cleanup; ++ } ++ VIR_FREE(tmp); ++ ++ tmp = virXMLPropString(node, "type"); ++ if (!tmp) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Missing cachetune attribute 'type'")); ++ goto cleanup; ++ } ++ type = virCacheTypeFromString(tmp); ++ if (type < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Invalid cachetune attribute 'type' value '%s'"), ++ tmp); ++ goto cleanup; ++ } ++ VIR_FREE(tmp); ++ ++ if (virDomainParseScaledValue("./@size", "./@unit", ++ ctxt, &size, 1024, ++ ULLONG_MAX, true) < 0) ++ goto cleanup; ++ ++ if (virResctrlAllocSetSize(alloc, level, type, cache, size) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ ctxt->node = oldnode; ++ VIR_FREE(tmp); ++ return ret; ++} ++ ++ ++static int ++virDomainCachetuneDefParse(virDomainDefPtr def, ++ xmlXPathContextPtr ctxt, ++ xmlNodePtr node, ++ unsigned int flags) ++{ ++ xmlNodePtr oldnode = ctxt->node; ++ xmlNodePtr *nodes = NULL; ++ virBitmapPtr vcpus = NULL; ++ virResctrlAllocPtr alloc = virResctrlAllocNew(); ++ virDomainCachetuneDefPtr tmp_cachetune = NULL; ++ char *tmp = NULL; ++ char *vcpus_str = NULL; ++ char *alloc_id = NULL; ++ ssize_t i = 0; ++ int n; ++ int ret = -1; ++ ++ ctxt->node = node; ++ ++ if (!alloc) ++ goto cleanup; ++ ++ if (VIR_ALLOC(tmp_cachetune) < 0) ++ goto cleanup; ++ ++ vcpus_str = virXMLPropString(node, "vcpus"); ++ if (!vcpus_str) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Missing cachetune attribute 'vcpus'")); ++ goto cleanup; ++ } ++ if (virBitmapParse(vcpus_str, &vcpus, VIR_DOMAIN_CPUMASK_LEN) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Invalid cachetune attribute 'vcpus' value '%s'"), ++ vcpus_str); ++ goto cleanup; ++ } ++ ++ /* We need to limit the bitmap to number of vCPUs. If there's nothing left, ++ * then we can just clean up and return 0 immediately */ ++ virBitmapShrink(vcpus, def->maxvcpus); ++ if (virBitmapIsAllClear(vcpus)) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ if ((n = virXPathNodeSet("./cache", ctxt, &nodes)) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("Cannot extract cache nodes under cachetune")); ++ goto cleanup; ++ } ++ ++ for (i = 0; i < n; i++) { ++ if (virDomainCachetuneDefParseCache(ctxt, nodes[i], alloc) < 0) ++ goto cleanup; ++ } ++ ++ if (virResctrlAllocIsEmpty(alloc)) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ for (i = 0; i < def->ncachetunes; i++) { ++ if (virBitmapOverlaps(def->cachetunes[i]->vcpus, vcpus)) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("Overlapping vcpus in cachetunes")); ++ goto cleanup; ++ } ++ } ++ ++ /* We need to format it back because we need to be consistent in the naming ++ * even when users specify some "sub-optimal" string there. */ ++ VIR_FREE(vcpus_str); ++ vcpus_str = virBitmapFormat(vcpus); ++ if (!vcpus_str) ++ goto cleanup; ++ ++ if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)) ++ alloc_id = virXMLPropString(node, "id"); ++ ++ if (!alloc_id) { ++ /* The number of allocations is limited and the directory structure is flat, ++ * not hierarchical, so we need to have all same allocations in one ++ * directory, so it's nice to have it named appropriately. For now it's ++ * 'vcpus_...' but it's designed in order for it to be changeable in the ++ * future (it's part of the status XML). */ ++ if (virAsprintf(&alloc_id, "vcpus_%s", vcpus_str) < 0) ++ goto cleanup; ++ } ++ ++ if (virResctrlAllocSetID(alloc, alloc_id) < 0) ++ goto cleanup; ++ ++ VIR_STEAL_PTR(tmp_cachetune->vcpus, vcpus); ++ VIR_STEAL_PTR(tmp_cachetune->alloc, alloc); ++ ++ if (VIR_APPEND_ELEMENT(def->cachetunes, def->ncachetunes, tmp_cachetune) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ ctxt->node = oldnode; ++ virDomainCachetuneDefFree(tmp_cachetune); ++ virObjectUnref(alloc); ++ virBitmapFree(vcpus); ++ VIR_FREE(alloc_id); ++ VIR_FREE(vcpus_str); ++ VIR_FREE(nodes); ++ VIR_FREE(tmp); ++ return ret; ++} ++ ++ + static virDomainDefPtr + virDomainDefParseXML(xmlDocPtr xml, + xmlNodePtr root, +@@ -18785,6 +18990,18 @@ virDomainDefParseXML(xmlDocPtr xml, + } + VIR_FREE(nodes); + ++ if ((n = virXPathNodeSet("./cputune/cachetune", ctxt, &nodes)) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("cannot extract cachetune nodes")); ++ goto error; ++ } ++ ++ for (i = 0; i < n; i++) { ++ if (virDomainCachetuneDefParse(def, ctxt, nodes[i], flags) < 0) ++ goto error; ++ } ++ VIR_FREE(nodes); ++ + if (virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, &def->cpu) < 0) + goto error; + +@@ -25736,9 +25953,80 @@ virDomainSchedulerFormat(virBufferPtr buf, + } + + ++static int ++virDomainCachetuneDefFormatHelper(unsigned int level, ++ virCacheType type, ++ unsigned int cache, ++ unsigned long long size, ++ void *opaque) ++{ ++ const char *unit; ++ virBufferPtr buf = opaque; ++ unsigned long long short_size = virFormatIntPretty(size, &unit); ++ ++ virBufferAsprintf(buf, ++ "\n", ++ cache, level, virCacheTypeToString(type), ++ short_size, unit); ++ ++ return 0; ++} ++ ++ ++static int ++virDomainCachetuneDefFormat(virBufferPtr buf, ++ virDomainCachetuneDefPtr cachetune, ++ unsigned int flags) ++{ ++ virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; ++ char *vcpus = NULL; ++ int ret = -1; ++ ++ virBufferSetChildIndent(&childrenBuf, buf); ++ virResctrlAllocForeachSize(cachetune->alloc, ++ virDomainCachetuneDefFormatHelper, ++ &childrenBuf); ++ ++ ++ if (virBufferCheckError(&childrenBuf) < 0) ++ goto cleanup; ++ ++ if (!virBufferUse(&childrenBuf)) { ++ ret = 0; ++ goto cleanup; ++ } ++ ++ vcpus = virBitmapFormat(cachetune->vcpus); ++ if (!vcpus) ++ goto cleanup; ++ ++ virBufferAsprintf(buf, "alloc); ++ if (!alloc_id) ++ goto cleanup; ++ ++ virBufferAsprintf(buf, " id='%s'", alloc_id); ++ } ++ virBufferAddLit(buf, ">\n"); ++ ++ virBufferAddBuffer(buf, &childrenBuf); ++ virBufferAddLit(buf, "\n"); ++ ++ ret = 0; ++ cleanup: ++ virBufferFreeAndReset(&childrenBuf); ++ VIR_FREE(vcpus); ++ return ret; ++} ++ ++ + static int + virDomainCputuneDefFormat(virBufferPtr buf, +- virDomainDefPtr def) ++ virDomainDefPtr def, ++ unsigned int flags) + { + size_t i; + virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; +@@ -25837,6 +26125,9 @@ virDomainCputuneDefFormat(virBufferPtr buf, + def->iothreadids[i]->iothread_id); + } + ++ for (i = 0; i < def->ncachetunes; i++) ++ virDomainCachetuneDefFormat(&childrenBuf, def->cachetunes[i], flags); ++ + if (virBufferCheckError(&childrenBuf) < 0) + return -1; + +@@ -26174,7 +26465,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, + } + } + +- if (virDomainCputuneDefFormat(buf, def) < 0) ++ if (virDomainCputuneDefFormat(buf, def, flags) < 0) + goto error; + + if (virDomainNumatuneFormatXML(buf, def->numa) < 0) +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 5e67c9a9c1..ed7b587bed 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -56,6 +56,7 @@ + # include "virperf.h" + # include "virtypedparam.h" + # include "virsavecookie.h" ++# include "virresctrl.h" + + /* forward declarations of all device types, required by + * virDomainDeviceDef +@@ -2190,6 +2191,15 @@ struct _virDomainCputune { + }; + + ++typedef struct _virDomainCachetuneDef virDomainCachetuneDef; ++typedef virDomainCachetuneDef *virDomainCachetuneDefPtr; ++ ++struct _virDomainCachetuneDef { ++ virBitmapPtr vcpus; ++ virResctrlAllocPtr alloc; ++}; ++ ++ + typedef struct _virDomainVcpuDef virDomainVcpuDef; + typedef virDomainVcpuDef *virDomainVcpuDefPtr; + +@@ -2318,6 +2328,9 @@ struct _virDomainDef { + + virDomainCputune cputune; + ++ virDomainCachetuneDefPtr *cachetunes; ++ size_t ncachetunes; ++ + virDomainNumaPtr numa; + virDomainResourceDefPtr resource; + virDomainIdMapDef idmap; +diff --git a/tests/genericxml2xmlindata/generic-cachetune-cdp.xml b/tests/genericxml2xmlindata/generic-cachetune-cdp.xml +new file mode 100644 +index 0000000000..9718f06098 +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune-cdp.xml +@@ -0,0 +1,36 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml +new file mode 100644 +index 0000000000..82c9176cba +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-allocs.xml +@@ -0,0 +1,30 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml +new file mode 100644 +index 0000000000..a0f37028c9 +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-tunes.xml +@@ -0,0 +1,32 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml b/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml +new file mode 100644 +index 0000000000..c229eccee4 +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune-colliding-types.xml +@@ -0,0 +1,30 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmlindata/generic-cachetune-small.xml b/tests/genericxml2xmlindata/generic-cachetune-small.xml +new file mode 100644 +index 0000000000..ab2d9cf885 +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune-small.xml +@@ -0,0 +1,29 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmlindata/generic-cachetune.xml b/tests/genericxml2xmlindata/generic-cachetune.xml +new file mode 100644 +index 0000000000..645cab7771 +--- /dev/null ++++ b/tests/genericxml2xmlindata/generic-cachetune.xml +@@ -0,0 +1,33 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 4 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c +index 0377a05e9c..4ced5c349c 100644 +--- a/tests/genericxml2xmltest.c ++++ b/tests/genericxml2xmltest.c +@@ -130,6 +130,16 @@ mymain(void) + DO_TEST_FULL("chardev-reconnect-invalid-mode", 0, false, + TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); + ++ DO_TEST("cachetune"); ++ DO_TEST("cachetune-small"); ++ DO_TEST("cachetune-cdp"); ++ DO_TEST_FULL("cachetune-colliding-allocs", false, true, ++ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); ++ DO_TEST_FULL("cachetune-colliding-tunes", false, true, ++ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); ++ DO_TEST_FULL("cachetune-colliding-types", false, true, ++ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); ++ + virObjectUnref(caps); + virObjectUnref(xmlopt); + +-- +2.16.1 + diff --git a/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch b/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch new file mode 100644 index 0000000..fd6612b --- /dev/null +++ b/SOURCES/libvirt-conf-Add-target-type-and-model-for-pl011.patch @@ -0,0 +1,952 @@ +From 623a617e8199a9c7abd1903399fdbeccf4e85add Mon Sep 17 00:00:00 2001 +Message-Id: <623a617e8199a9c7abd1903399fdbeccf4e85add@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:14 +0100 +Subject: [PATCH] conf: Add target type and model for pl011 + +We can finally introduce a specific target model for the pl011 device +used by mach-virt guests, which means isa-serial will no longer show +up to confuse users. + +We make sure migration works in both directions by interpreting the +isa-serial target type, or the lack of target type, appropriately +when parsing the guest XML, and skipping the newly-introduced type +when formatting if for migration. We also verify that pl011 is not +used for non-mach-virt guests and add a bunch of test cases. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1512929 + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit eccdcb81fcfd1641960d397c82986b4517841794) +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 13 ++++--- + docs/schemas/domaincommon.rng | 2 + + src/conf/domain_conf.c | 3 ++ + src/conf/domain_conf.h | 2 + + src/qemu/qemu_command.c | 9 ++++- + src/qemu/qemu_domain.c | 26 +++++++++++++ + src/qemu/qemu_domain_address.c | 1 + + .../qemuxml2argv-mach-virt-console-native.args | 1 + + .../qemuxml2argv-mach-virt-console-native.xml | 17 +++++++++ + .../qemuxml2argv-mach-virt-console-virtio.args | 24 ++++++++++++ + .../qemuxml2argv-mach-virt-console-virtio.xml | 19 ++++++++++ + ...muxml2argv-mach-virt-serial+console-native.args | 1 + + ...emuxml2argv-mach-virt-serial+console-native.xml | 18 +++++++++ + .../qemuxml2argv-mach-virt-serial-compat.args | 1 + + .../qemuxml2argv-mach-virt-serial-compat.xml | 19 ++++++++++ + ...muxml2argv-mach-virt-serial-invalid-machine.xml | 21 +++++++++++ + .../qemuxml2argv-mach-virt-serial-native.args | 23 +++++++++++ + .../qemuxml2argv-mach-virt-serial-native.xml | 16 ++++++++ + .../qemuxml2argv-mach-virt-serial-pci.args | 26 +++++++++++++ + .../qemuxml2argv-mach-virt-serial-pci.xml | 18 +++++++++ + .../qemuxml2argv-mach-virt-serial-usb.args | 27 +++++++++++++ + .../qemuxml2argv-mach-virt-serial-usb.xml | 21 +++++++++++ + tests/qemuxml2argvtest.c | 27 +++++++++++++ + .../qemuxml2xmlout-aarch64-virtio-pci-default.xml | 4 +- + .../qemuxml2xmlout-mach-virt-console-native.xml | 1 + + .../qemuxml2xmlout-mach-virt-console-virtio.xml | 27 +++++++++++++ + ...uxml2xmlout-mach-virt-serial+console-native.xml | 1 + + .../qemuxml2xmlout-mach-virt-serial-compat.xml | 31 +++++++++++++++ + .../qemuxml2xmlout-mach-virt-serial-native.xml | 1 + + .../qemuxml2xmlout-mach-virt-serial-pci.xml | 44 ++++++++++++++++++++++ + .../qemuxml2xmlout-mach-virt-serial-usb.xml | 41 ++++++++++++++++++++ + tests/qemuxml2xmltest.c | 26 +++++++++++++ + 32 files changed, 503 insertions(+), 8 deletions(-) + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 0634f3396a..87389f4e73 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -6463,8 +6463,9 @@ qemu-kvm -net nic,model=? /dev/null + with x86 guests), usb-serial (usable whenever USB support + is available) and pci-serial (usable whenever PCI support + is available); since 3.10.0, +- spapr-vio-serial (usable with ppc64/pseries guests) +- is available as well. ++ spapr-vio-serial (usable with ppc64/pseries guests) and ++ system-serial (usable with aarch64/virt guests) are ++ available as well. +

    + +

    +@@ -6476,7 +6477,8 @@ qemu-kvm -net nic,model=? /dev/null + target type); pci-serial + (usable with the pci-serial target type); + spapr-vty (usable with the spapr-vio-serial +- target type). ++ target type); pl011 (usable with the ++ system-serial target type). +

    + +

    +@@ -6485,12 +6487,13 @@ qemu-kvm -net nic,model=? /dev/null +

    + +

    +- All of the target types support configuring the guest-visible device ++ Most target types support configuring the guest-visible device + address as documented above; more + specifically, acceptable address types are isa (for + isa-serial), usb (for usb-serial), + pci (for pci-serial) and spapr-vio +- (for spapr-vio-serial). ++ (for spapr-vio-serial). The system-serial ++ target type doesn't support specifying an address. +

    + +

    +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 027d9ae7a1..957eae2832 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -3572,6 +3572,7 @@ + usb-serial + pci-serial + spapr-vio-serial ++ system-serial + + + +@@ -3584,6 +3585,7 @@ + usb-serial + pci-serial + spapr-vty ++ pl011 + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 97c7a66b5b..32089df3c2 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -446,6 +446,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, + "usb-serial", + "pci-serial", + "spapr-vio-serial", ++ "system-serial", + ); + + VIR_ENUM_IMPL(virDomainChrChannelTarget, +@@ -474,6 +475,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, + "usb-serial", + "pci-serial", + "spapr-vty", ++ "pl011", + ); + + VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, +@@ -4063,6 +4065,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { + + /* Create a stub console to match the serial port. +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 979e8cca00..d6febf3059 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1078,6 +1078,7 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM, + + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST + } virDomainChrSerialTargetType; +@@ -1111,6 +1112,7 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011, + + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST + } virDomainChrSerialTargetModel; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 056dafea39..483eee6056 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9230,6 +9230,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + return QEMU_CAPS_DEVICE_SPAPR_VTY; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; +@@ -9261,10 +9262,13 @@ qemuChrIsPlatformDevice(const virDomainDef *def, + virDomainChrDefPtr chr) + { + if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) { +- /* TARGET_TYPE_ISA here really means 'the default platform device' */ ++ ++ /* pl011 (used on mach-virt) is a platform device */ + if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +- chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) ++ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM && ++ chr->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011) { + return true; ++ } + } + + /* If we got all the way here and we're still stuck with the default +@@ -10365,6 +10369,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + break; + ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + /* Except from _LAST, which is just a guard value and will never +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 17c898896d..2fc173fa45 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3468,6 +3468,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType) + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + break; +@@ -3489,6 +3490,8 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel) + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; +@@ -3525,6 +3528,16 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) + } + break; + ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Target type '%s' cannot have an " ++ "associated address"), ++ virDomainChrSerialTargetTypeToString(chr->targetType)); ++ return -1; ++ } ++ break; ++ + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + break; +@@ -3536,6 +3549,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + + expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel); + +@@ -3592,6 +3606,12 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, + isCompatible = false; + } + ++ if (!qemuDomainIsVirt(def) && ++ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM || ++ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011)) { ++ isCompatible = false; ++ } ++ + if (!isCompatible) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Serial device with target type '%s' and " +@@ -4243,6 +4263,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + } else if (qemuDomainIsPSeries(def)) { + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; ++ } else if (qemuDomainIsVirt(def)) { ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; + } + } + +@@ -4262,6 +4284,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY; + break; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011; ++ break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ +@@ -5178,6 +5203,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, + if (flags & VIR_DOMAIN_XML_MIGRATABLE) { + switch ((virDomainChrSerialTargetType) serial->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + serial->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; + serial->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE; + break; +diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c +index f62bb2f97e..db9656a3a5 100644 +--- a/src/qemu/qemu_domain_address.c ++++ b/src/qemu/qemu_domain_address.c +@@ -784,6 +784,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + return 0; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args +new file mode 120000 +index 0000000000..1a90484d3b +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.args +@@ -0,0 +1 @@ ++qemuxml2argv-mach-virt-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml +new file mode 100644 +index 0000000000..6aba864d0b +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-native.xml +@@ -0,0 +1,17 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args +new file mode 100644 +index 0000000000..2a862bff18 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.args +@@ -0,0 +1,24 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-aarch64 \ ++-name guest \ ++-S \ ++-M virt \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-device virtio-serial,id=virtio-serial0 \ ++-chardev pty,id=charconsole0 \ ++-device virtconsole,chardev=charconsole0,id=console0 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml +new file mode 100644 +index 0000000000..92704504c8 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-console-virtio.xml +@@ -0,0 +1,19 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args +new file mode 120000 +index 0000000000..1a90484d3b +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.args +@@ -0,0 +1 @@ ++qemuxml2argv-mach-virt-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml +new file mode 100644 +index 0000000000..549b764e98 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial+console-native.xml +@@ -0,0 +1,18 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args +new file mode 120000 +index 0000000000..1a90484d3b +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.args +@@ -0,0 +1 @@ ++qemuxml2argv-mach-virt-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml +new file mode 100644 +index 0000000000..9e6be3ffeb +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-compat.xml +@@ -0,0 +1,19 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml +new file mode 100644 +index 0000000000..a8de76abf9 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-invalid-machine.xml +@@ -0,0 +1,21 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args +new file mode 100644 +index 0000000000..f4bfce376a +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.args +@@ -0,0 +1,23 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-aarch64 \ ++-name guest \ ++-S \ ++-M virt \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-chardev pty,id=charserial0 \ ++-serial chardev:charserial0 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml +new file mode 100644 +index 0000000000..817f606eea +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-native.xml +@@ -0,0 +1,16 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args +new file mode 100644 +index 0000000000..334194efe1 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.args +@@ -0,0 +1,26 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-aarch64 \ ++-name guest \ ++-S \ ++-M virt \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \ ++-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ ++-device pcie-root-port,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \ ++-chardev pty,id=charserial0 \ ++-device pci-serial,chardev=charserial0,id=serial0,bus=pci.2,addr=0x1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml +new file mode 100644 +index 0000000000..29aa7664b1 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-pci.xml +@@ -0,0 +1,18 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args +new file mode 100644 +index 0000000000..44c4027acc +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.args +@@ -0,0 +1,27 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-aarch64 \ ++-name guest \ ++-S \ ++-M virt \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ ++addr=0x1 \ ++-device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \ ++-device qemu-xhci,id=usb,bus=pci.1,addr=0x0 \ ++-chardev pty,id=charserial0 \ ++-device usb-serial,chardev=charserial0,id=serial0,bus=usb.0,port=1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml +new file mode 100644 +index 0000000000..35f192a3e5 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-mach-virt-serial-usb.xml +@@ -0,0 +1,21 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 2b3bbd1b8b..656b8c0995 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1898,6 +1898,33 @@ mymain(void) + QEMU_CAPS_NODEFCONFIG); + DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE); + ++ DO_TEST("mach-virt-serial-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial+console-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial-compat", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial-pci", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_OBJECT_GPEX, ++ QEMU_CAPS_PCI_MULTIFUNCTION, ++ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, ++ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_PCI_SERIAL); ++ DO_TEST("mach-virt-serial-usb", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_OBJECT_GPEX, ++ QEMU_CAPS_PCI_MULTIFUNCTION, ++ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, ++ QEMU_CAPS_DEVICE_QEMU_XHCI, ++ QEMU_CAPS_DEVICE_USB_SERIAL); ++ DO_TEST("mach-virt-console-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-console-virtio", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST_PARSE_ERROR("mach-virt-serial-invalid-machine", NONE); ++ + DO_TEST("disk-ide-drive-split", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_IDE_CD); +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml +index e5496424b3..9796d7f637 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml +@@ -71,7 +71,9 @@ +

    + + +- ++ ++ ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml +new file mode 120000 +index 0000000000..a4768fcf86 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-native.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-mach-virt-serial-compat.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml +new file mode 100644 +index 0000000000..3e46cd2012 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-console-virtio.xml +@@ -0,0 +1,27 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml +new file mode 120000 +index 0000000000..a4768fcf86 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial+console-native.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-mach-virt-serial-compat.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml +new file mode 100644 +index 0000000000..3d7325a8db +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-compat.xml +@@ -0,0 +1,31 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml +new file mode 120000 +index 0000000000..a4768fcf86 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-native.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-mach-virt-serial-compat.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml +new file mode 100644 +index 0000000000..4bcf69a3d1 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-pci.xml +@@ -0,0 +1,44 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-aarch64 ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++ ++
    ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml +new file mode 100644 +index 0000000000..01c2a52555 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-mach-virt-serial-usb.xml +@@ -0,0 +1,41 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-aarch64 ++ ++
    ++ ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index f76bd5a68d..bd18507bb6 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -788,6 +788,32 @@ mymain(void) + DO_TEST("pseries-console-virtio", + QEMU_CAPS_NODEFCONFIG); + ++ DO_TEST("mach-virt-serial-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial+console-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial-compat", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-serial-pci", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_OBJECT_GPEX, ++ QEMU_CAPS_PCI_MULTIFUNCTION, ++ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, ++ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_PCI_BRIDGE, ++ QEMU_CAPS_DEVICE_PCI_SERIAL); ++ DO_TEST("mach-virt-serial-usb", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_OBJECT_GPEX, ++ QEMU_CAPS_PCI_MULTIFUNCTION, ++ QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, ++ QEMU_CAPS_DEVICE_QEMU_XHCI, ++ QEMU_CAPS_DEVICE_USB_SERIAL); ++ DO_TEST("mach-virt-console-native", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST("mach-virt-console-virtio", ++ QEMU_CAPS_NODEFCONFIG); ++ + DO_TEST("balloon-device-auto", NONE); + DO_TEST("balloon-device-period", NONE); + DO_TEST("channel-virtio-auto", NONE); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Add-target-type-and-model-for-spapr-vty.patch b/SOURCES/libvirt-conf-Add-target-type-and-model-for-spapr-vty.patch new file mode 100644 index 0000000..610c5a2 --- /dev/null +++ b/SOURCES/libvirt-conf-Add-target-type-and-model-for-spapr-vty.patch @@ -0,0 +1,1042 @@ +From fd981b46a6729b5d5dac4923b860f888b0c193b9 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:12 +0100 +Subject: [PATCH] conf: Add target type and model for spapr-vty + +We can finally introduce a specific target model for the spapr-vty +device used by pSeries guests, which means isa-serial will no longer +show up to confuse users. + +We make sure migration works in both directions by interpreting the +isa-serial target type, or the lack of target type, appropriately +when parsing the guest XML, and skipping the newly-introduced type +when formatting if for migration. We also verify that spapr-vty is +not used for non-pSeries guests and add a bunch of test cases. + +This commit is best viewed with 'git show -w'. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511421 + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit c498a8921e447715189c8c6d22b7ca24cc810830) +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 13 ++-- + docs/schemas/domaincommon.rng | 2 + + src/conf/domain_conf.c | 6 +- + src/conf/domain_conf.h | 2 + + src/qemu/qemu_command.c | 67 +++++++++------------ + src/qemu/qemu_domain.c | 69 ++++++++++++++++++---- + src/qemu/qemu_domain_address.c | 1 + + .../qemuxml2argv-pseries-basic.args | 2 +- + .../qemuxml2argv-pseries-console-native.args | 1 + + .../qemuxml2argv-pseries-console-native.xml | 17 ++++++ + .../qemuxml2argv-pseries-console-virtio.args | 23 ++++++++ + .../qemuxml2argv-pseries-console-virtio.xml | 19 ++++++ + .../qemuxml2argv-pseries-cpu-compat-power9.args | 2 +- + .../qemuxml2argv-pseries-cpu-compat.args | 2 +- + .../qemuxml2argv-pseries-cpu-exact.args | 2 +- + .../qemuxml2argv-pseries-cpu-le.args | 2 +- + .../qemuxml2argv-pseries-panic-missing.args | 2 +- + .../qemuxml2argv-pseries-panic-no-address.args | 2 +- + ...qemuxml2argv-pseries-serial+console-native.args | 1 + + .../qemuxml2argv-pseries-serial+console-native.xml | 18 ++++++ + .../qemuxml2argv-pseries-serial-compat.args | 1 + + .../qemuxml2argv-pseries-serial-compat.xml | 19 ++++++ + ...qemuxml2argv-pseries-serial-invalid-machine.xml | 19 ++++++ + .../qemuxml2argv-pseries-serial-native.args | 22 +++++++ + .../qemuxml2argv-pseries-serial-native.xml | 16 +++++ + .../qemuxml2argv-pseries-usb-default.args | 2 +- + .../qemuxml2argv-pseries-usb-kbd.args | 2 +- + .../qemuxml2argv-pseries-usb-multi.args | 2 +- + .../qemuxml2argv-pseries-vio-user-assigned.args | 4 +- + .../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 4 +- + tests/qemuxml2argvtest.c | 16 +++++ + .../qemuxml2xmlout-panic-pseries.xml | 4 +- + .../qemuxml2xmlout-pseries-console-native.xml | 1 + + .../qemuxml2xmlout-pseries-console-virtio.xml | 31 ++++++++++ + .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 4 +- + .../qemuxml2xmlout-pseries-cpu-compat.xml | 4 +- + .../qemuxml2xmlout-pseries-cpu-exact.xml | 4 +- + .../qemuxml2xmlout-pseries-panic-missing.xml | 4 +- + .../qemuxml2xmlout-pseries-panic-no-address.xml | 4 +- + ...emuxml2xmlout-pseries-serial+console-native.xml | 1 + + .../qemuxml2xmlout-pseries-serial-compat.xml | 1 + + .../qemuxml2xmlout-pseries-serial-native.xml | 35 +++++++++++ + tests/qemuxml2xmltest.c | 15 +++++ + 43 files changed, 386 insertions(+), 82 deletions(-) + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml + create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index cf1167b9c6..0634f3396a 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -6462,7 +6462,9 @@ qemu-kvm -net nic,model=? /dev/null + since 1.0.2, isa-serial (usable + with x86 guests), usb-serial (usable whenever USB support + is available) and pci-serial (usable whenever PCI support +- is available). ++ is available); since 3.10.0, ++ spapr-vio-serial (usable with ppc64/pseries guests) ++ is available as well. +

    + +

    +@@ -6472,7 +6474,9 @@ qemu-kvm -net nic,model=? /dev/null + isa-serial (usable with the isa-serial target + type); usb-serial (usable with the usb-serial + target type); pci-serial +- (usable with the pci-serial target type). ++ (usable with the pci-serial target type); ++ spapr-vty (usable with the spapr-vio-serial ++ target type). +

    + +

    +@@ -6484,8 +6488,9 @@ qemu-kvm -net nic,model=? /dev/null + All of the target types support configuring the guest-visible device + address as documented above; more + specifically, acceptable address types are isa (for +- isa-serial), usb (for usb-serial) +- and pci (for pci-serial). ++ isa-serial), usb (for usb-serial), ++ pci (for pci-serial) and spapr-vio ++ (for spapr-vio-serial). +

    + +

    +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 3630e539e6..027d9ae7a1 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -3571,6 +3571,7 @@ + isa-serial + usb-serial + pci-serial ++ spapr-vio-serial + + + +@@ -3582,6 +3583,7 @@ + isa-serial + usb-serial + pci-serial ++ spapr-vty + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 692b9d9414..97c7a66b5b 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -444,7 +444,9 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, + "none", + "isa-serial", + "usb-serial", +- "pci-serial") ++ "pci-serial", ++ "spapr-vio-serial", ++); + + VIR_ENUM_IMPL(virDomainChrChannelTarget, + VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST, +@@ -471,6 +473,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, + "isa-serial", + "usb-serial", + "pci-serial", ++ "spapr-vty", + ); + + VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, +@@ -4059,6 +4062,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + + switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { + + /* Create a stub console to match the serial port. +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 9dfe9388cd..979e8cca00 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1077,6 +1077,7 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, + + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST + } virDomainChrSerialTargetType; +@@ -1109,6 +1110,7 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, + + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST + } virDomainChrSerialTargetModel; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index f8d5d317cd..91083dc73d 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9227,6 +9227,8 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) + return QEMU_CAPS_DEVICE_USB_SERIAL; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + return QEMU_CAPS_DEVICE_PCI_SERIAL; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: ++ return QEMU_CAPS_DEVICE_SPAPR_VTY; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: +@@ -10354,52 +10356,39 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + virBuffer cmd = VIR_BUFFER_INITIALIZER; + virQEMUCapsFlags caps; + +- if (qemuDomainIsPSeries(def)) { +- if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +- serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { +- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_VTY)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("spapr-vty not supported in this QEMU binary")); +- goto error; +- } ++ switch ((virDomainChrSerialTargetModel) serial->targetModel) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + +- virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", +- serial->info.alias); +- } +- } else { +- switch ((virDomainChrSerialTargetModel) serial->targetModel) { +- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: +- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: ++ caps = qemuChrSerialTargetModelToCaps(serial->targetModel); + +- caps = qemuChrSerialTargetModelToCaps(serial->targetModel); +- +- if (caps && !virQEMUCapsGet(qemuCaps, caps)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("'%s' is not supported in this QEMU binary"), +- virDomainChrSerialTargetModelTypeToString(serial->targetModel)); +- goto error; +- } +- break; +- +- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: +- break; +- +- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: +- case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: +- /* Except from _LAST, which is just a guard value and will never +- * be used, all of the above are platform devices, which means +- * qemuBuildSerialCommandLine() will have taken the appropriate +- * branch and we will not have ended up here. */ +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Invalid target model for serial device")); ++ if (caps && !virQEMUCapsGet(qemuCaps, caps)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("'%s' is not supported in this QEMU binary"), ++ virDomainChrSerialTargetModelTypeToString(serial->targetModel)); + goto error; + } ++ break; + +- virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s", +- virDomainChrSerialTargetModelTypeToString(serial->targetModel), +- serial->info.alias, serial->info.alias); ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: ++ break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: ++ /* Except from _LAST, which is just a guard value and will never ++ * be used, all of the above are platform devices, which means ++ * qemuBuildSerialCommandLine() will have taken the appropriate ++ * branch and we will not have ended up here. */ ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("Invalid target model for serial device")); ++ goto error; + } + ++ virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s", ++ virDomainChrSerialTargetModelTypeToString(serial->targetModel), ++ serial->info.alias, serial->info.alias); ++ + if (qemuBuildDeviceAddressStr(&cmd, def, &serial->info, qemuCaps) < 0) + goto error; + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 7b5bc97de6..17c898896d 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3466,6 +3466,8 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType) + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + break; +@@ -3485,6 +3487,8 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel) + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; +@@ -3495,8 +3499,7 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel) + + + static int +-qemuDomainChrTargetDefValidate(const virDomainDef *def, +- const virDomainChrDef *chr) ++qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) + { + int expected; + +@@ -3508,11 +3511,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *def, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: +- +- /* Hack required until we have a proper type for pSeries +- * serial consoles */ +- if (qemuDomainIsPSeries(def)) +- return 0; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + + expected = qemuDomainChrSerialTargetTypeToAddressType(chr->targetType); + +@@ -3536,6 +3535,7 @@ qemuDomainChrTargetDefValidate(const virDomainDef *def, + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + + expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel); + +@@ -3573,7 +3573,7 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, + if (qemuDomainChrSourceDefValidate(dev->source) < 0) + return -1; + +- if (qemuDomainChrTargetDefValidate(def, dev) < 0) ++ if (qemuDomainChrTargetDefValidate(dev) < 0) + return -1; + + if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL && +@@ -3583,6 +3583,26 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, + return -1; + } + ++ if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { ++ bool isCompatible = true; ++ ++ if (!qemuDomainIsPSeries(def) && ++ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO || ++ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY)) { ++ isCompatible = false; ++ } ++ ++ if (!isCompatible) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Serial device with target type '%s' and " ++ "target model '%s' not compatible with guest " ++ "architecture or machine type"), ++ virDomainChrSerialTargetTypeToString(dev->targetType), ++ virDomainChrSerialTargetModelTypeToString(dev->targetModel)); ++ return -1; ++ } ++ } ++ + return 0; + } + +@@ -4222,10 +4242,7 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + if (ARCH_IS_X86(def->os.arch)) { + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; + } else if (qemuDomainIsPSeries(def)) { +- /* Setting TYPE_ISA here is just a temporary hack to reduce test +- * suite churn. Later on we will have a proper serial type for +- * pSeries and this line will be updated accordingly. */ +- chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; + } + } + +@@ -4242,6 +4259,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL; + break; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY; ++ break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ +@@ -5147,6 +5167,31 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, + goto cleanup; + } + ++ for (i = 0; i < def->nserials; i++) { ++ virDomainChrDefPtr serial = def->serials[i]; ++ ++ /* Historically, the native console type for some machine types ++ * was not set at all, which means it defaulted to ISA even ++ * though that was not even remotely accurate. To ensure migration ++ * towards older libvirt versions works for such guests, we switch ++ * it back to the default here */ ++ if (flags & VIR_DOMAIN_XML_MIGRATABLE) { ++ switch ((virDomainChrSerialTargetType) serial->targetType) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: ++ serial->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; ++ serial->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE; ++ break; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ /* Nothing to do */ ++ break; ++ } ++ } ++ } ++ + /* Replace the CPU definition updated according to QEMU with the one + * used for starting the domain. The updated def will be sent + * separately for backward compatibility. +diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c +index 989c0e6c93..2319e503eb 100644 +--- a/src/qemu/qemu_domain_address.c ++++ b/src/qemu/qemu_domain_address.c +@@ -782,6 +782,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + return 0; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +index 97a7057ba0..789d9f679e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args +@@ -20,4 +20,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args +new file mode 120000 +index 0000000000..d6c830ecdf +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.args +@@ -0,0 +1 @@ ++qemuxml2argv-pseries-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml +new file mode 100644 +index 0000000000..9f37bf0dec +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-native.xml +@@ -0,0 +1,17 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args +new file mode 100644 +index 0000000000..343018fb3e +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.args +@@ -0,0 +1,23 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-ppc64 \ ++-name guest \ ++-S \ ++-M pseries \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x1 \ ++-chardev pty,id=charconsole0 \ ++-device virtconsole,chardev=charconsole0,id=console0 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml +new file mode 100644 +index 0000000000..0190ab63ac +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-console-virtio.xml +@@ -0,0 +1,19 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args +index af93d63dc9..9bb375aeba 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args +@@ -21,4 +21,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args +index 7740e2f5a9..5174aa760e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args +@@ -21,4 +21,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args +index d2c99a7fa3..3790deca8c 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args +@@ -21,4 +21,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args +index 97a7057ba0..789d9f679e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args +@@ -20,4 +20,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args +index 97a7057ba0..789d9f679e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-missing.args +@@ -20,4 +20,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args +index 97a7057ba0..789d9f679e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-panic-no-address.args +@@ -20,4 +20,4 @@ server,nowait \ + -boot c \ + -usb \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args +new file mode 120000 +index 0000000000..d6c830ecdf +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.args +@@ -0,0 +1 @@ ++qemuxml2argv-pseries-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml +new file mode 100644 +index 0000000000..2733baa980 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial+console-native.xml +@@ -0,0 +1,18 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args +new file mode 120000 +index 0000000000..d6c830ecdf +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.args +@@ -0,0 +1 @@ ++qemuxml2argv-pseries-serial-native.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml +new file mode 100644 +index 0000000000..2e182edbd0 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-compat.xml +@@ -0,0 +1,19 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml +new file mode 100644 +index 0000000000..5482146a57 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-invalid-machine.xml +@@ -0,0 +1,19 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args +new file mode 100644 +index 0000000000..f72b8b6259 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.args +@@ -0,0 +1,22 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-ppc64 \ ++-name guest \ ++-S \ ++-M pseries \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-chardev pty,id=charserial0 \ ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml +new file mode 100644 +index 0000000000..6cec4bc9d3 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-native.xml +@@ -0,0 +1,16 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args +index a92b1e01b1..37c0594032 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args +@@ -20,4 +20,4 @@ server,nowait \ + -boot c \ + -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args +index caaccdbb8e..838b80453a 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args +@@ -20,5 +20,5 @@ server,nowait \ + -boot c \ + -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 \ ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ + -device usb-kbd,id=input0,bus=usb.0,port=1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args +index b9bd905a5d..56bc1d67ef 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args +@@ -21,4 +21,4 @@ server,nowait \ + -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1 \ + -device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args +index 63cf3c1830..0fcfbe3796 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args +@@ -25,6 +25,6 @@ server,nowait \ + -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\ + drive=drive-scsi1-0-0-0,id=scsi1-0-0-0 \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x20000000 \ ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x20000000 \ + -chardev pty,id=charserial1 \ +--device spapr-vty,chardev=charserial1,reg=0x30001000 ++-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args +index 0294067bc8..8a9bdcc4cd 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args +@@ -25,6 +25,6 @@ server,nowait \ + -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=0,lun=0,\ + drive=drive-scsi1-0-0-0,id=scsi1-0-0-0 \ + -chardev pty,id=charserial0 \ +--device spapr-vty,chardev=charserial0,reg=0x30000000 \ ++-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ + -chardev pty,id=charserial1 \ +--device spapr-vty,chardev=charserial1,reg=0x30001000 ++-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000 +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 747ad24663..4b63dd141d 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1875,6 +1875,22 @@ mymain(void) + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); + ++ DO_TEST("pseries-serial-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial+console-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial-compat", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-console-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-console-virtio", ++ QEMU_CAPS_NODEFCONFIG); ++ DO_TEST_PARSE_ERROR("pseries-serial-invalid-machine", NONE); ++ + DO_TEST("disk-ide-drive-split", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_IDE_CD); +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +index 496df0696c..484fe4cfa6 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +@@ -22,8 +22,8 @@ + + + +- +- ++ ++ + +

    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml +new file mode 120000 +index 0000000000..b0e645fc03 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-native.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-pseries-serial-native.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml +new file mode 100644 +index 0000000000..48760f2824 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-console-virtio.xml +@@ -0,0 +1,31 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++
    ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +index 9d4c5efe67..404bb0c768 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +@@ -25,8 +25,8 @@ + + + +- +- ++ ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +index 6059859abd..1891fa5f48 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +@@ -25,8 +25,8 @@ + + + +- +- ++ ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +index f3216523ed..f08f3e005f 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +@@ -26,8 +26,8 @@ + + + +- +- ++ ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +index 496df0696c..484fe4cfa6 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +@@ -22,8 +22,8 @@ + + + +- +- ++ ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +index 496df0696c..484fe4cfa6 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +@@ -22,8 +22,8 @@ + + + +- +- ++ ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml +new file mode 120000 +index 0000000000..b0e645fc03 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial+console-native.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-pseries-serial-native.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml +new file mode 120000 +index 0000000000..b0e645fc03 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-compat.xml +@@ -0,0 +1 @@ ++qemuxml2xmlout-pseries-serial-native.xml +\ No newline at end of file +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml +new file mode 100644 +index 0000000000..fae7c54d5b +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-native.xml +@@ -0,0 +1,35 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
    ++ ++ ++ ++
    ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index 6687997900..ad429ead4d 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -766,6 +766,21 @@ mymain(void) + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); + ++ DO_TEST("pseries-serial-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial+console-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial-compat", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-console-native", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-console-virtio", ++ QEMU_CAPS_NODEFCONFIG); ++ + DO_TEST("balloon-device-auto", NONE); + DO_TEST("balloon-device-period", NONE); + DO_TEST("channel-virtio-auto", NONE); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Check-CPU-cache-for-ABI-stability.patch b/SOURCES/libvirt-conf-Check-CPU-cache-for-ABI-stability.patch deleted file mode 100644 index 13fcb60..0000000 --- a/SOURCES/libvirt-conf-Check-CPU-cache-for-ABI-stability.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b768a8cb9fbd84a96f576d1dd7468f664200683f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Wed, 10 May 2017 13:05:16 +0200 -Subject: [PATCH] conf: Check CPU cache for ABI stability - -Signed-off-by: Jiri Denemark -Reviewed-by: Daniel P. Berrange -(cherry picked from commit 1e9cf6e09ce242c94731bd21707dd3bcd41f854f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1449595 - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index 1b098c476..a4be5742e 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -915,6 +915,16 @@ virCPUDefIsEqual(virCPUDefPtr src, - } - } - -+ if ((src->cache && !dst->cache) || -+ (!src->cache && dst->cache) || -+ (src->cache && dst->cache && -+ (src->cache->level != dst->cache->level || -+ src->cache->mode != dst->cache->mode))) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Target CPU cache does not match source")); -+ goto cleanup; -+ } -+ - identical = true; - - cleanup: --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-Check-virDomainChrSourceDefFormat-return-value.patch b/SOURCES/libvirt-conf-Check-virDomainChrSourceDefFormat-return-value.patch new file mode 100644 index 0000000..0193671 --- /dev/null +++ b/SOURCES/libvirt-conf-Check-virDomainChrSourceDefFormat-return-value.patch @@ -0,0 +1,123 @@ +From 73650fdd9de90d6f5a6f4a3c6c19d60368411b07 Mon Sep 17 00:00:00 2001 +Message-Id: <73650fdd9de90d6f5a6f4a3c6c19d60368411b07@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:02 +0100 +Subject: [PATCH] conf: Check virDomainChrSourceDefFormat() return value + +The function can fail, but none of the caller were accounting +for that. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 2cd323e382b4abfffda52fe49d1b50a087716e01) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 34 ++++++++++++++++++++++++---------- + 1 file changed, 24 insertions(+), 10 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index cf1bd030a0..346edaa6bd 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -24045,7 +24045,9 @@ virDomainChrDefFormat(virBufferPtr buf, + if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) + return -1; + virBufferAddLit(buf, ">\n"); +- virDomainChrSourceDefFormat(buf, def->source, flags); ++ ++ if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0) ++ return -1; + + if (virDomainChrTargetDefFormat(buf, def, flags) < 0) + return -1; +@@ -24066,13 +24068,14 @@ virDomainSmartcardDefFormat(virBufferPtr buf, + const char *mode = virDomainSmartcardTypeToString(def->type); + virBuffer childBuf = VIR_BUFFER_INITIALIZER; + size_t i; ++ int ret = -1; + + virBufferSetChildIndent(&childBuf, buf); + + if (!mode) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected smartcard type %d"), def->type); +- return -1; ++ goto cleanup; + } + + switch (def->type) { +@@ -24089,23 +24092,25 @@ virDomainSmartcardDefFormat(virBufferPtr buf, + break; + + case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH: +- virDomainChrSourceDefFormat(&childBuf, def->data.passthru, flags); ++ if (virDomainChrSourceDefFormat(&childBuf, def->data.passthru, flags) < 0) ++ goto cleanup; + break; + + default: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected smartcard type %d"), def->type); +- return -1; ++ goto cleanup; + } + virDomainDeviceInfoFormat(&childBuf, &def->info, flags); + + if (virBufferCheckError(&childBuf) < 0) +- return -1; ++ goto cleanup; + + virBufferAsprintf(buf, "type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH && +- virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0) +- return -1; ++ virDomainChrAttrsDefFormat(buf, def->data.passthru, false) < 0) { ++ goto cleanup; ++ } + + if (virBufferUse(&childBuf)) { + virBufferAddLit(buf, ">\n"); +@@ -24114,7 +24119,12 @@ virDomainSmartcardDefFormat(virBufferPtr buf, + } else { + virBufferAddLit(buf, "/>\n"); + } +- return 0; ++ ++ ret = 0; ++ ++ cleanup: ++ virBufferFreeAndReset(&childBuf); ++ return ret; + } + + static int +@@ -24416,7 +24426,8 @@ virDomainRNGDefFormat(virBufferPtr buf, + return -1; + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); +- virDomainChrSourceDefFormat(buf, def->source.chardev, flags); ++ if (virDomainChrSourceDefFormat(buf, def->source.chardev, flags) < 0) ++ return -1; + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + +@@ -25261,7 +25272,10 @@ virDomainRedirdevDefFormat(virBufferPtr buf, + return -1; + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); +- virDomainChrSourceDefFormat(buf, def->source, flags); ++ ++ if (virDomainChrSourceDefFormat(buf, def->source, flags) < 0) ++ return -1; ++ + virDomainDeviceInfoFormat(buf, &def->info, + flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT); + virBufferAdjustIndent(buf, -2); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Don-t-assign-value-from-.TypeFromString-directly-to-enum.patch b/SOURCES/libvirt-conf-Don-t-assign-value-from-.TypeFromString-directly-to-enum.patch deleted file mode 100644 index 6d2a136..0000000 --- a/SOURCES/libvirt-conf-Don-t-assign-value-from-.TypeFromString-directly-to-enum.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 8c00ca78eed4ffdb9238b89b58eb5975baf5e339 Mon Sep 17 00:00:00 2001 -Message-Id: <8c00ca78eed4ffdb9238b89b58eb5975baf5e339@dist-git> -From: Peter Krempa -Date: Fri, 19 May 2017 12:24:11 +0200 -Subject: [PATCH] conf: Don't assign value from ..TypeFromString directly to - enum - -Enums are unsigned, so it's impossible to check whether the helper -returned -1 for invalid conversions. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452454 -(cherry picked from commit 85d62624c5d02c38e00a275dc2b2957584454908) - -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 1653aa61d..a918ecd59 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -14065,6 +14065,7 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode, - xmlNodePtr save = ctxt->node; - xmlNodePtr node; - virDomainMemoryDefPtr def; -+ int val; - - ctxt->node = memdevNode; - -@@ -14084,12 +14085,14 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode, - } - VIR_FREE(tmp); - -- tmp = virXMLPropString(memdevNode, "access"); -- if (tmp && -- (def->access = virDomainMemoryAccessTypeFromString(tmp)) <= 0) { -- virReportError(VIR_ERR_XML_ERROR, -- _("invalid access mode '%s'"), tmp); -- goto error; -+ if ((tmp = virXMLPropString(memdevNode, "access"))) { -+ if ((val = virDomainMemoryAccessTypeFromString(tmp)) <= 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("invalid access mode '%s'"), tmp); -+ goto error; -+ } -+ -+ def->access = val; - } - VIR_FREE(tmp); - --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch b/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch new file mode 100644 index 0000000..76a771b --- /dev/null +++ b/SOURCES/libvirt-conf-Don-t-inline-virDomainNetTypeSharesHostView.patch @@ -0,0 +1,136 @@ +From 0597400171b44e0d180196b2c04da72f8b1f225f Mon Sep 17 00:00:00 2001 +Message-Id: <0597400171b44e0d180196b2c04da72f8b1f225f@dist-git> +From: Jiri Denemark +Date: Thu, 2 Nov 2017 19:58:00 +0100 +Subject: [PATCH] conf: Don't inline virDomainNetTypeSharesHostView + +When coverage build is enabled, gcc complains about it: + +In file included from qemu/qemu_agent.h:29:0, + from qemu/qemu_driver.c:47: +qemu/qemu_driver.c: In function 'qemuDomainSetInterfaceParameters': +./conf/domain_conf.h:3397:1: error: inlining failed in call to +'virDomainNetTypeSharesHostView': call is unlikely and code size would +grow [-Werror=inline] + virDomainNetTypeSharesHostView(const virDomainNetDef *net) + ^ + +Signed-off-by: Jiri Denemark +(cherry picked from commit bce925dadaf8fe4693abee88fb68aa7ede9d209e) + +https://bugzilla.redhat.com/show_bug.cgi?id=1472263 + +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 36 ++++++++++++++++++++++++++++++++++++ + src/conf/domain_conf.h | 37 +++---------------------------------- + src/libvirt_private.syms | 1 + + 3 files changed, 40 insertions(+), 34 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 77c20c6972..394afb0d80 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -28082,3 +28082,39 @@ virDomainGenerateMachineName(const char *drivername, + virBufferCheckError(&buf); + return virBufferContentAndReset(&buf); + } ++ ++ ++/** ++ * virDomainNetTypeSharesHostView: ++ * @net: interface ++ * ++ * Some types of interfaces "share" the host view. For instance, ++ * for macvtap interface, every domain RX is the host RX too. And ++ * every domain TX is host TX too. IOW, for some types of ++ * interfaces guest and host are on the same side of RX/TX ++ * barrier. This is important so that we set up QoS correctly and ++ * report proper stats. ++ */ ++bool ++virDomainNetTypeSharesHostView(const virDomainNetDef *net) ++{ ++ virDomainNetType actualType = virDomainNetGetActualType(net); ++ switch (actualType) { ++ case VIR_DOMAIN_NET_TYPE_DIRECT: ++ case VIR_DOMAIN_NET_TYPE_ETHERNET: ++ return true; ++ case VIR_DOMAIN_NET_TYPE_USER: ++ case VIR_DOMAIN_NET_TYPE_VHOSTUSER: ++ case VIR_DOMAIN_NET_TYPE_SERVER: ++ case VIR_DOMAIN_NET_TYPE_CLIENT: ++ case VIR_DOMAIN_NET_TYPE_MCAST: ++ case VIR_DOMAIN_NET_TYPE_NETWORK: ++ case VIR_DOMAIN_NET_TYPE_BRIDGE: ++ case VIR_DOMAIN_NET_TYPE_INTERNAL: ++ case VIR_DOMAIN_NET_TYPE_HOSTDEV: ++ case VIR_DOMAIN_NET_TYPE_UDP: ++ case VIR_DOMAIN_NET_TYPE_LAST: ++ break; ++ } ++ return false; ++} +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 38de70b154..171f340785 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -3382,40 +3382,9 @@ virDomainGenerateMachineName(const char *drivername, + int id, + const char *name, + bool privileged); +-/** +- * virDomainNetTypeSharesHostView: +- * @net: interface +- * +- * Some types of interfaces "share" the host view. For instance, +- * for macvtap interface, every domain RX is the host RX too. And +- * every domain TX is host TX too. IOW, for some types of +- * interfaces guest and host are on the same side of RX/TX +- * barrier. This is important so that we set up QoS correctly and +- * report proper stats. +- */ +-static inline bool +-virDomainNetTypeSharesHostView(const virDomainNetDef *net) +-{ +- virDomainNetType actualType = virDomainNetGetActualType(net); +- switch (actualType) { +- case VIR_DOMAIN_NET_TYPE_DIRECT: +- case VIR_DOMAIN_NET_TYPE_ETHERNET: +- return true; +- case VIR_DOMAIN_NET_TYPE_USER: +- case VIR_DOMAIN_NET_TYPE_VHOSTUSER: +- case VIR_DOMAIN_NET_TYPE_SERVER: +- case VIR_DOMAIN_NET_TYPE_CLIENT: +- case VIR_DOMAIN_NET_TYPE_MCAST: +- case VIR_DOMAIN_NET_TYPE_NETWORK: +- case VIR_DOMAIN_NET_TYPE_BRIDGE: +- case VIR_DOMAIN_NET_TYPE_INTERNAL: +- case VIR_DOMAIN_NET_TYPE_HOSTDEV: +- case VIR_DOMAIN_NET_TYPE_UDP: +- case VIR_DOMAIN_NET_TYPE_LAST: +- break; +- } +- return false; +-} ++ ++bool ++virDomainNetTypeSharesHostView(const virDomainNetDef *net); + + bool + virDomainDefLifecycleActionAllowed(virDomainLifecycle type, +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 448d962b2d..811d9053e6 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -444,6 +444,7 @@ virDomainNetInsert; + virDomainNetRemove; + virDomainNetRemoveHostdev; + virDomainNetTypeFromString; ++virDomainNetTypeSharesHostView; + virDomainNetTypeToString; + virDomainNostateReasonTypeFromString; + virDomainNostateReasonTypeToString; +-- +2.15.0 + diff --git a/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch b/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch new file mode 100644 index 0000000..ecce040 --- /dev/null +++ b/SOURCES/libvirt-conf-Drop-virDomainChrDeviceType.targetTypeAttr.patch @@ -0,0 +1,737 @@ +From 77bc396146f85ba8f767fd51f0238037cb9784cc Mon Sep 17 00:00:00 2001 +Message-Id: <77bc396146f85ba8f767fd51f0238037cb9784cc@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:59 +0100 +Subject: [PATCH] conf: Drop virDomainChrDeviceType.targetTypeAttr + +This attribute was used to decide whether to format the type +attribute of the element, but the logic didn't take into +account all possible cases and as such could lead to unexpected +results. Moreover, it's one more thing to keep track of, and can +easily fall out of sync with other attributes. + +Now that we have VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE, we can +use that value to signal that no specific target type has been +configured for the serial device and as such the attribute should +not be formatted at all. All other values are now formatted. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 4fb8ff9987b7e34d331c4af8f573db11579a0e88) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 11 ++++------- + src/conf/domain_conf.h | 1 - + src/vz/vz_sdk.c | 3 +-- + tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml | 4 ++-- + tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml | 4 ++-- + tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml | 2 +- + tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml | 2 +- + .../qemuhotplug-console-compat-2-live+console-virtio.xml | 4 ++-- + .../qemuhotplug-console-compat-2-live.xml | 4 ++-- + .../qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml | 4 ++-- + tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 ++-- + .../qemuxml2xmlout-bios-nvram-os-interleave.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml | 4 ++-- + .../qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml | 2 +- + .../qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml | 4 ++-- + tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml | 2 +- + .../qemuxml2xmlout-pseries-cpu-compat-power9.xml | 2 +- + .../qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml | 2 +- + .../qemuxml2xmlout-pseries-panic-missing.xml | 2 +- + .../qemuxml2xmlout-pseries-panic-no-address.xml | 2 +- + .../qemuxml2xmlout-q35-virt-manager-basic.xml | 2 +- + .../qemuxml2xmlout-serial-spiceport-nospice.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml | 2 +- + .../qemuxml2xmlout-serial-target-port-auto.xml | 6 +++--- + .../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml | 4 ++-- + .../qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml | 2 +- + tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml | 2 +- + 43 files changed, 56 insertions(+), 61 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 3a5ecd3a9d..586a840672 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -11499,8 +11499,7 @@ virDomainChrDefaultTargetType(int devtype) + } + + static int +-virDomainChrTargetTypeFromString(virDomainChrDefPtr def, +- int devtype, ++virDomainChrTargetTypeFromString(int devtype, + const char *targetType) + { + int ret = -1; +@@ -11528,8 +11527,6 @@ virDomainChrTargetTypeFromString(virDomainChrDefPtr def, + break; + } + +- def->targetTypeAttr = true; +- + return ret; + } + +@@ -11546,7 +11543,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def, + char *stateStr = NULL; + + if ((def->targetType = +- virDomainChrTargetTypeFromString(def, def->deviceType, ++ virDomainChrTargetTypeFromString(def->deviceType, + targetType)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown target type '%s' specified for character device"), +@@ -16466,7 +16463,7 @@ virDomainChrEquals(virDomainChrDefPtr src, + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: +- if (src->targetTypeAttr != tgt->targetTypeAttr) ++ if (src->targetType != tgt->targetType) + return false; + + ATTRIBUTE_FALLTHROUGH; +@@ -24026,7 +24023,7 @@ virDomainChrDefFormat(virBufferPtr buf, + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: +- if (def->targetTypeAttr) { ++ if (def->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + virBufferAsprintf(buf, + "\n", + virDomainChrTargetTypeToString(def->deviceType, +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 9502573b34..bbb056cf21 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1199,7 +1199,6 @@ struct _virDomainChrSourceDef { + struct _virDomainChrDef { + int deviceType; /* enum virDomainChrDeviceType */ + +- bool targetTypeAttr; + int targetType; /* enum virDomainChrConsoleTargetType || + enum virDomainChrChannelTargetType || + enum virDomainChrSerialTargetType according to deviceType */ +diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c +index 3910deeb3a..c8de1b9598 100644 +--- a/src/vz/vz_sdk.c ++++ b/src/vz/vz_sdk.c +@@ -1191,7 +1191,6 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr) + int ret = -1; + + chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; +- chr->targetTypeAttr = false; + pret = PrlVmDev_GetIndex(serialPort, &serialPortIndex); + prlsdkCheckRetGoto(pret, cleanup); + chr->target.port = serialPortIndex; +@@ -2864,7 +2863,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr) + return -1; + } + +- if (chr->targetTypeAttr) { ++ if (chr->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Specified character device target type is not " + "supported by vz driver.")); +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml +index f512844427..7c106f145c 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-console-compat.xml +@@ -28,7 +28,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml +index aac814d59f..e76d0211dc 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-dev.xml +@@ -29,7 +29,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml +index 64819a48ae..ed67ada0d8 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-file.xml +@@ -29,7 +29,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml +index e00afe317f..420771dc9c 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-many.xml +@@ -28,11 +28,11 @@ +
    + + +- ++ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml +index f512844427..7c106f145c 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-pty.xml +@@ -28,7 +28,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml +index c35a4ca73a..3fe61ffa05 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp-telnet.xml +@@ -30,7 +30,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml +index 0d218f5482..3fc9fd39b0 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-tcp.xml +@@ -30,7 +30,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml +index f7069d541f..5b4af3fe95 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-udp.xml +@@ -30,11 +30,11 @@ + + + +- ++ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml +index 14fc8fc7c9..6bb291ff7f 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-unix.xml +@@ -29,7 +29,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml +index 95aa1c7b9b..41954fc85d 100644 +--- a/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml ++++ b/tests/qemuargv2xmldata/qemuargv2xml-serial-vc.xml +@@ -28,7 +28,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +index 4e1dd49c22..427f431cce 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live+console-virtio.xml +@@ -72,13 +72,13 @@ + + + +- ++ + + + + + +- ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +index c56d13ef4a..144f6eff7a 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-console-compat-2-live.xml +@@ -72,13 +72,13 @@ + + + +- ++ + + + + + +- ++ + + + +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml +index a95e29ad8a..e6c4adb6f3 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml ++++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-notls.xml +@@ -29,12 +29,12 @@ + + + +- ++ + + + + +- ++ + + + +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +index c760098fe0..f9724d320e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml ++++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +@@ -110,10 +110,10 @@ +
    + + +- ++ + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml +index 033e86d3a3..5ee73b527e 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-bios-nvram-os-interleave.xml +@@ -33,7 +33,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml +index 840bf69f61..ad77f62d9e 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-chardev-label.xml +@@ -25,13 +25,13 @@ + + + +- ++ + + + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml +index e76f857aee..cd9d75c4b7 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml +@@ -27,7 +27,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml +index 8dc361dfc6..0c0bd7b348 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat.xml +@@ -28,7 +28,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml +index 858b2c6750..305c53eab7 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml +@@ -31,7 +31,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml +index f9f9abd2df..b38b3ce987 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio-many.xml +@@ -30,7 +30,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml +index 1c55017678..06192fbb4a 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-driver.xml +@@ -47,7 +47,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml +index 95b6e2df1a..a6eaa38079 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml +@@ -104,10 +104,10 @@ +
    + + +- ++ + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml +index 7fe69bd6cb..e6ad234240 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml +@@ -55,7 +55,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml +index b631e5b515..66448ec3dd 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml +@@ -44,7 +44,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml +index fd5fdbece5..b1240b8ed1 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml +@@ -57,7 +57,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml +index 4571b6a829..4f7ad323ed 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-mtu.xml +@@ -54,7 +54,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +index 7fb49feb0f..a563b6dddf 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +@@ -22,7 +22,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +index f020056219..59587b3c32 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat-power9.xml +@@ -25,7 +25,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +index 3cbce9fe6a..a39e1fd015 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-compat.xml +@@ -25,7 +25,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +index d69b387686..666eede1a5 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-cpu-exact.xml +@@ -26,7 +26,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +index 7fb49feb0f..a563b6dddf 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +@@ -22,7 +22,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +index 7fb49feb0f..a563b6dddf 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +@@ -22,7 +22,7 @@ + + + +- ++ +
    + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml +index c4ccd98aac..27baaa3f14 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml +@@ -79,7 +79,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml +index 79c4ebc734..63462e6f94 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport-nospice.xml +@@ -28,7 +28,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml +index 9527b2d15f..c90bbeb7d5 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-spiceport.xml +@@ -28,7 +28,7 @@ + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml +index 71516a31a9..a8790b5098 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml +@@ -27,13 +27,13 @@ + + + +- ++ + + +- ++ + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml +index 18f51e5383..a8af87b53b 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml +@@ -29,12 +29,12 @@ + + + +- ++ + + + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml +index 3a95b6088c..6d847de3a2 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost-incorrect.xml +@@ -40,7 +40,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml +index 759b844395..30989658f4 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-tap-vhost.xml +@@ -47,7 +47,7 @@ +
    + + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml +index 8c27470ddf..72cbcc4cb5 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vhost_queues.xml +@@ -46,7 +46,7 @@ +
    + + +- ++ + + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Fix-backwards-migration-of-pSeries-guests.patch b/SOURCES/libvirt-conf-Fix-backwards-migration-of-pSeries-guests.patch deleted file mode 100644 index cb4a237..0000000 --- a/SOURCES/libvirt-conf-Fix-backwards-migration-of-pSeries-guests.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7e3b03cbdee6a9fc694046ea3c98c5cdef941c92 Mon Sep 17 00:00:00 2001 -Message-Id: <7e3b03cbdee6a9fc694046ea3c98c5cdef941c92@dist-git> -From: Andrea Bolognani -Date: Tue, 25 Jul 2017 10:29:27 +0200 -Subject: [PATCH] conf: Fix backwards migration of pSeries guests - -Recent commits made it so that pci-root controllers for -pSeries guests are automatically assigned the -spapr-pci-host-bridge model name; however, that prevents -guests to migrate to older versions of libvirt which don't -know about that model name at all, which at the moment is -all of them :) - -To avoid the issue, just strip the model name from PHBs -when formatting the migratable XML; guests that use more -than one PHB are not going to be migratable anyway. - -Signed-off-by: Andrea Bolognani -(cherry picked from commit 9b45cd8fab1c7d7d07dd3ae64970b3c93b78e04c) - -Conflicts: - - * src/conf/domain_conf.c: - - caused by e146264aaadf5aecf727d8c7b3d85683b55b6c48, - which significantly refactored - virDomainControllerDefFormat(), not being in the tree. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 86415964dc..f28f6aff63 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -21670,6 +21670,23 @@ virDomainControllerDefFormat(virBufferPtr buf, - pcihole64 = true; - if (def->opts.pciopts.modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) - pciModel = true; -+ /* Historically, libvirt didn't support specifying a model name for -+ * pci-root controllers; starting from 3.6.0, however, pSeries guests -+ * use pci-root controllers with model name spapr-pci-host-bridge to -+ * represent all PHBs, including the default one. -+ * -+ * In order to allow migration of pSeries guests from older libvirt -+ * versions and back, we don't format the model name in the migratable -+ * XML if it's spapr-pci-host-bridge, thus making "no model name" and -+ * "spapr-pci-host-bridge model name" basically equivalent. -+ * -+ * The spapr-pci-host-bridge device is specific to pSeries. -+ */ -+ if (def->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && -+ def->opts.pciopts.modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE && -+ flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) { -+ pciModel = false; -+ } - if (def->opts.pciopts.chassisNr != -1 || - def->opts.pciopts.chassis != -1 || - def->opts.pciopts.port != -1 || --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch b/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch new file mode 100644 index 0000000..3747582 --- /dev/null +++ b/SOURCES/libvirt-conf-Fix-memory-leak-for-distances-in-virDomainNumaFree.patch @@ -0,0 +1,35 @@ +From 8e0151c7b6ce80dc8145511848155e6170ce2bf6 Mon Sep 17 00:00:00 2001 +Message-Id: <8e0151c7b6ce80dc8145511848155e6170ce2bf6@dist-git> +From: John Ferlan +Date: Mon, 4 Dec 2017 13:38:53 +0100 +Subject: [PATCH] conf: Fix memory leak for distances in virDomainNumaFree + +https://bugzilla.redhat.com/show_bug.cgi?id=1454889 + +Commit id '74119a03f' neglected to clean up @distances when +the numa definition is cleaned up. + +(cherry picked from commit 9f0ccc717ba9026c30ce38951a354dd66fa12e3b) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/conf/numa_conf.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c +index 8fc3b0a196..466b64d5fa 100644 +--- a/src/conf/numa_conf.c ++++ b/src/conf/numa_conf.c +@@ -362,6 +362,9 @@ virDomainNumaFree(virDomainNumaPtr numa) + for (i = 0; i < numa->nmem_nodes; i++) { + virBitmapFree(numa->mem_nodes[i].cpumask); + virBitmapFree(numa->mem_nodes[i].nodeset); ++ ++ if (numa->mem_nodes[i].ndistances > 0) ++ VIR_FREE(numa->mem_nodes[i].distances); + } + VIR_FREE(numa->mem_nodes); + +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch b/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch new file mode 100644 index 0000000..69ef6d6 --- /dev/null +++ b/SOURCES/libvirt-conf-Fix-message-when-maximum-vCPU-count-is-less-than-current.patch @@ -0,0 +1,37 @@ +From 73e3efc5dae126514b00a8538664609810cadbc4 Mon Sep 17 00:00:00 2001 +Message-Id: <73e3efc5dae126514b00a8538664609810cadbc4@dist-git> +From: Peter Krempa +Date: Mon, 13 Nov 2017 13:48:09 +0100 +Subject: [PATCH] conf: Fix message when maximum vCPU count is less than + current + +Reword the message and drop the numbers (which were reversed) from it +so that it actually makes sense. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509151 +(cherry picked from commit 50712e14f40ffdac8a71ce9ef091e4e7bd822585) +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 3b337d1a64..ca5d0bcc54 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -1505,9 +1505,9 @@ virDomainDefSetVcpus(virDomainDefPtr def, + size_t i; + + if (vcpus > def->maxvcpus) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("maxvcpus must not be less than current vcpus (%u < %zu)"), +- vcpus, def->maxvcpus); ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("maximum vCPU count must not be less than current " ++ "vCPU count")); + return -1; + } + +-- +2.15.0 + diff --git a/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch b/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch new file mode 100644 index 0000000..a1d532b --- /dev/null +++ b/SOURCES/libvirt-conf-Format-cache-banks-in-capabilities-with-virFormatIntPretty.patch @@ -0,0 +1,166 @@ +From 5a978253cced5135a6dd01c730faea2fd21a5dc9 Mon Sep 17 00:00:00 2001 +Message-Id: <5a978253cced5135a6dd01c730faea2fd21a5dc9@dist-git> +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:18 +0100 +Subject: [PATCH] conf: Format cache banks in capabilities with + virFormatIntPretty + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Signed-off-by: Martin Kletzander +Reviewed-by: John Ferlan +(cherry picked from commit 63d95a19cc72d120d40092c1e97235d7b9d4eb29) +Signed-off-by: Martin Kletzander +--- + src/conf/capabilities.c | 50 ++++++++++++++-------- + tests/vircaps2xmldata/vircaps-x86_64-caches.xml | 2 +- + .../vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml | 4 +- + .../vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml | 4 +- + tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 4 +- + 5 files changed, 39 insertions(+), 25 deletions(-) + +diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c +index 1f7d8cdb31..798c9bdaea 100644 +--- a/src/conf/capabilities.c ++++ b/src/conf/capabilities.c +@@ -883,7 +883,8 @@ virCapabilitiesFormatCaches(virBufferPtr buf, + for (i = 0; i < ncaches; i++) { + virCapsHostCacheBankPtr bank = caches[i]; + char *cpus_str = virBitmapFormat(bank->cpus); +- bool kilos = !(bank->size % 1024); ++ const char *unit = NULL; ++ unsigned long long short_size = virFormatIntPretty(bank->size, &unit); + + if (!cpus_str) + return -1; +@@ -897,34 +898,47 @@ virCapabilitiesFormatCaches(virBufferPtr buf, + "size='%llu' unit='%s' cpus='%s'", + bank->id, bank->level, + virCacheTypeToString(bank->type), +- bank->size >> (kilos * 10), +- kilos ? "KiB" : "B", +- cpus_str); ++ short_size, unit, cpus_str); + VIR_FREE(cpus_str); + + virBufferSetChildIndent(&controlBuf, buf); + for (j = 0; j < bank->ncontrols; j++) { +- bool min_kilos = !(bank->controls[j]->granularity % 1024); ++ const char *min_unit; ++ virResctrlInfoPtr controls = bank->controls[j]; ++ unsigned long long gran_short_size = controls->granularity; ++ unsigned long long min_short_size = controls->min; + +- /* Only use KiB if both values are divisible */ +- if (bank->controls[j]->min) +- min_kilos = min_kilos && !(bank->controls[j]->min % 1024); ++ gran_short_size = virFormatIntPretty(gran_short_size, &unit); ++ min_short_size = virFormatIntPretty(min_short_size, &min_unit); + +- virBufferAsprintf(&controlBuf, +- "controls[j]->granularity >> (min_kilos * 10)); ++ /* Only use the smaller unit if they are different */ ++ if (min_short_size) { ++ unsigned long long gran_div; ++ unsigned long long min_div; + +- if (bank->controls[j]->min) { +- virBufferAsprintf(&controlBuf, +- " min='%llu'", +- bank->controls[j]->min >> (min_kilos * 10)); ++ gran_div = controls->granularity / gran_short_size; ++ min_div = controls->min / min_short_size; ++ ++ if (min_div > gran_div) { ++ min_short_size *= min_div / gran_div; ++ } else if (min_div < gran_div) { ++ unit = min_unit; ++ gran_short_size *= gran_div / min_div; ++ } + } + ++ virBufferAsprintf(&controlBuf, ++ "\n", +- min_kilos ? "KiB" : "B", +- virCacheTypeToString(bank->controls[j]->scope), +- bank->controls[j]->max_allocation); ++ unit, ++ virCacheTypeToString(controls->scope), ++ controls->max_allocation); + } + + if (virBufferCheckError(&controlBuf) < 0) +diff --git a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml +index fe0be6d08f..0c6f3769a2 100644 +--- a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml ++++ b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml +@@ -29,7 +29,7 @@ + + + +- ++ + + + +diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml +index 7361537bfb..443917c62d 100644 +--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml ++++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml +@@ -41,11 +41,11 @@ + + + +- ++ + + + +- ++ + + + +diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml +index 4e91c87de3..0cd25e59a9 100644 +--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml ++++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml +@@ -22,8 +22,8 @@ + + + +- +- ++ ++ + + + +diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml +index eb02ad3322..7629259294 100644 +--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml ++++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml +@@ -41,10 +41,10 @@ + + + +- ++ + + +- ++ + + + +-- +2.16.1 + diff --git a/SOURCES/libvirt-conf-Implement-isolation-rules.patch b/SOURCES/libvirt-conf-Implement-isolation-rules.patch deleted file mode 100644 index 603e2e0..0000000 --- a/SOURCES/libvirt-conf-Implement-isolation-rules.patch +++ /dev/null @@ -1,164 +0,0 @@ -From 672fd7d403ef52f10084c5c0b6aaeeb94f6fba2a Mon Sep 17 00:00:00 2001 -Message-Id: <672fd7d403ef52f10084c5c0b6aaeeb94f6fba2a@dist-git> -From: Andrea Bolognani -Date: Tue, 18 Jul 2017 12:10:06 +0200 -Subject: [PATCH] conf: Implement isolation rules - -These rules will make it possible for libvirt to -automatically assign PCI addresses in a way that -respects any isolation constraints devices might -have. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 209dc615e898f027b6dc8fa6acd3aeba5fd465bd) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_addr.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++--- - src/conf/domain_addr.h | 3 +++ - 2 files changed, 72 insertions(+), 4 deletions(-) - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index a067493136..d586bb7e47 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -369,6 +369,20 @@ virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) - } - - -+bool -+virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus) -+{ -+ size_t i; -+ -+ for (i = bus->minSlot; i <= bus->maxSlot; i++) { -+ if (bus->slot[i].functions) -+ return false; -+ } -+ -+ return true; -+} -+ -+ - /* Ensure addr fits in the address set, by expanding it if needed - * - * Return value: -@@ -548,7 +562,7 @@ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, - virDomainPCIConnectFlags flags, -- unsigned int isolationGroup ATTRIBUTE_UNUSED, -+ unsigned int isolationGroup, - bool fromConfig) - { - int ret = -1; -@@ -586,6 +600,26 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, - bus->slot[addr->slot].aggregate = true; - } - -+ if (virDomainPCIAddressBusIsEmpty(bus) && !bus->isolationGroupLocked) { -+ /* The first device decides the isolation group for the -+ * entire bus */ -+ bus->isolationGroup = isolationGroup; -+ VIR_DEBUG("PCI bus %.4x:%.2x assigned isolation group %u because of " -+ "first device %s", -+ addr->domain, addr->bus, isolationGroup, addrStr); -+ } else if (bus->isolationGroup != isolationGroup && fromConfig) { -+ /* If this is not the first function and its isolation group -+ * doesn't match the bus', then it should not be using this -+ * address. However, if the address comes from the user then -+ * we comply with the request and change the isolation group -+ * back to the default (because at that point isolation can't -+ * be guaranteed anymore) */ -+ bus->isolationGroup = 0; -+ VIR_DEBUG("PCI bus %.4x:%.2x assigned isolation group %u because of " -+ "user assigned address %s", -+ addr->domain, addr->bus, isolationGroup, addrStr); -+ } -+ - /* mark the requested function as reserved */ - bus->slot[addr->slot].functions |= (1 << addr->function); - VIR_DEBUG("Reserving PCI address %s (aggregate='%s')", addrStr, -@@ -763,7 +797,7 @@ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr next_addr, - virDomainPCIConnectFlags flags, -- unsigned int isolationGroup ATTRIBUTE_UNUSED, -+ unsigned int isolationGroup, - int function) - { - virPCIDeviceAddress a = { 0 }; -@@ -779,12 +813,17 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - else - a.function = function; - -- /* "Begin at the beginning," the King said, very gravely, "and go on -- * till you come to the end: then stop." */ -+ /* When looking for a suitable bus for the device, start by being -+ * very strict and ignoring all those where the isolation groups -+ * don't match. This ensures all devices sharing the same isolation -+ * group will end up on the same bus */ - for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) { - virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus]; - bool found = false; - -+ if (bus->isolationGroup != isolationGroup) -+ continue; -+ - a.slot = bus->minSlot; - - if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, -@@ -796,6 +835,32 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - goto success; - } - -+ /* We haven't been able to find a perfectly matching bus, but we -+ * might still be able to make this work by altering the isolation -+ * group for a bus that's currently empty. So let's try that */ -+ for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) { -+ virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus]; -+ bool found = false; -+ -+ /* We can only change the isolation group for a bus when -+ * plugging in the first device; moreover, some buses are -+ * prevented from ever changing it */ -+ if (!virDomainPCIAddressBusIsEmpty(bus) || bus->isolationGroupLocked) -+ continue; -+ -+ a.slot = bus->minSlot; -+ -+ if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, -+ flags, &found) < 0) { -+ goto error; -+ } -+ -+ /* The isolation group for the bus will actually be changed -+ * later, in virDomainPCIAddressReserveAddrInternal() */ -+ if (found) -+ goto success; -+ } -+ - /* There were no free slots after the last used one */ - if (addrs->dryRun) { - /* a is already set to the first new bus */ -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index 01dbc5114f..ae6a342dbc 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -150,6 +150,9 @@ int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, - bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) - ATTRIBUTE_NONNULL(1); - -+bool virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus) -+ ATTRIBUTE_NONNULL(1); -+ - bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch b/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch new file mode 100644 index 0000000..d3f07fc --- /dev/null +++ b/SOURCES/libvirt-conf-Improve-error-handling-in-virDomainChrDefFormat.patch @@ -0,0 +1,54 @@ +From f2dd85b3b81cd5c0842ffb55554c1a9cb5e8764b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:01 +0100 +Subject: [PATCH] conf: Improve error handling in virDomainChrDefFormat() + +We don't need to store the return value since we never modify it. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit be956c4e38770dd61998815bbea4b7c2fc38a7d6) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index d68a5f415c..cf1bd030a0 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -24028,8 +24028,6 @@ virDomainChrDefFormat(virBufferPtr buf, + const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); + bool tty_compat; + +- int ret = 0; +- + if (!elementName) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected char device type %d"), +@@ -24050,14 +24048,14 @@ virDomainChrDefFormat(virBufferPtr buf, + virDomainChrSourceDefFormat(buf, def->source, flags); + + if (virDomainChrTargetDefFormat(buf, def, flags) < 0) +- return -1; ++ return -1; + + virDomainDeviceInfoFormat(buf, &def->info, flags); + + virBufferAdjustIndent(buf, -2); + virBufferAsprintf(buf, "\n", elementName); + +- return ret; ++ return 0; + } + + static int +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch b/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch new file mode 100644 index 0000000..5d75d47 --- /dev/null +++ b/SOURCES/libvirt-conf-Improve-virDomainChrTargetDefFormat.patch @@ -0,0 +1,89 @@ +From 6e8cb0e122f7c269d1252ed7d55a7c82ae0062eb Mon Sep 17 00:00:00 2001 +Message-Id: <6e8cb0e122f7c269d1252ed7d55a7c82ae0062eb@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:03 +0100 +Subject: [PATCH] conf: Improve virDomainChrTargetDefFormat() + +Make the switch statement type-aware, avoid calling +virDomainChrTargetTypeToString() more than once and check its +return value before using it. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 46084f2aa1e9188709fcd7abc5c41fe165b2b19b) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 346edaa6bd..2489705d6b 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -23945,7 +23945,7 @@ virDomainChrTargetDefFormat(virBufferPtr buf, + const char *targetType = virDomainChrTargetTypeToString(def->deviceType, + def->targetType); + +- switch (def->deviceType) { ++ switch ((virDomainChrDeviceType) def->deviceType) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: { + if (!targetType) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +@@ -23992,28 +23992,43 @@ virDomainChrTargetDefFormat(virBufferPtr buf, + } + + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: ++ if (!targetType) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("Could not format console target type")); ++ return -1; ++ } ++ + virBufferAsprintf(buf, + "\n", +- virDomainChrTargetTypeToString(def->deviceType, +- def->targetType), +- def->target.port); ++ targetType, def->target.port); + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: ++ if (!targetType) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("Could not format serial target type")); ++ return -1; ++ } ++ + if (def->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + virBufferAsprintf(buf, + "\n", +- virDomainChrTargetTypeToString(def->deviceType, +- def->targetType), ++ targetType, + def->target.port); + break; + } + ATTRIBUTE_FALLTHROUGH; + +- default: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + virBufferAsprintf(buf, "\n", + def->target.port); + break; ++ ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("unexpected char device type %d"), ++ def->deviceType); ++ return -1; + } + + return 0; +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch b/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch new file mode 100644 index 0000000..18c006d --- /dev/null +++ b/SOURCES/libvirt-conf-Introduce-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE.patch @@ -0,0 +1,159 @@ +From 4f4db541098163a2061cd63ce6bfb83ce2ed38b5 Mon Sep 17 00:00:00 2001 +Message-Id: <4f4db541098163a2061cd63ce6bfb83ce2ed38b5@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:58 +0100 +Subject: [PATCH] conf: Introduce VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE + +This is the first step in getting rid of the assumption that +isa-serial is the default target type for serial devices. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 6385c8c14233388d929ed62717684e7352543416) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 8 +++++--- + src/conf/domain_conf.h | 3 ++- + src/qemu/qemu_command.c | 13 +++++++++++++ + src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ + src/qemu/qemu_domain_address.c | 1 + + 5 files changed, 42 insertions(+), 4 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 41674a85af..3a5ecd3a9d 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -441,6 +441,7 @@ VIR_ENUM_IMPL(virDomainChrDeviceState, VIR_DOMAIN_CHR_DEVICE_STATE_LAST, + + VIR_ENUM_IMPL(virDomainChrSerialTarget, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST, ++ "none", + "isa-serial", + "usb-serial", + "pci-serial") +@@ -4025,7 +4026,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + + /* modify it to be a serial port */ + def->serials[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; +- def->serials[0]->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ def->serials[0]->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; + def->serials[0]->target.port = 0; + } else { + /* if the console source doesn't match */ +@@ -4049,7 +4050,8 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { + + switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) { +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { + + /* Create a stub console to match the serial port. + * console[0] either does not exist +@@ -11485,7 +11487,7 @@ virDomainChrDefaultTargetType(int devtype) + return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: +- return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 09635763a1..9502573b34 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1073,7 +1073,8 @@ typedef enum { + } virDomainChrDeviceType; + + typedef enum { +- VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA = 0, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE = 0, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 3d970ed9d1..d593e60198 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9255,6 +9255,14 @@ qemuChrIsPlatformDevice(const virDomainDef *def, + return true; + } + ++ /* If we got all the way here and we're still stuck with the default ++ * target type for a serial device, it means we have no clue what kind of ++ * device we're talking about and we must treat it as a platform device. */ ++ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && ++ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { ++ return true; ++ } ++ + return false; + } + +@@ -10378,7 +10386,12 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + } + break; + ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ /* Except from _LAST, which is just a guard value and will never ++ * be used, all of the above are platform devices, which means ++ * qemuBuildSerialCommandLine() will have taken the appropriate ++ * branch and we will not have ended up here. */ + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Invalid target type for serial device")); + goto error; +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index b15d994774..e43f7496c2 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -4095,6 +4095,27 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; + } + ++ /* Historically, isa-serial and the default matched, so in order to ++ * maintain backwards compatibility we map them here. The actual default ++ * will be picked below based on the architecture and machine type. */ ++ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && ++ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) { ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; ++ } ++ ++ /* Set the default serial type */ ++ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && ++ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { ++ if (ARCH_IS_X86(def->os.arch)) { ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ } else if (qemuDomainIsPSeries(def)) { ++ /* Setting TYPE_ISA here is just a temporary hack to reduce test ++ * suite churn. Later on we will have a proper serial type for ++ * pSeries and this line will be updated accordingly. */ ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ } ++ } ++ + /* clear auto generated unix socket path for inactive definitions */ + if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { + if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) +diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c +index 7f4ac0f45a..989c0e6c93 100644 +--- a/src/qemu/qemu_domain_address.c ++++ b/src/qemu/qemu_domain_address.c +@@ -782,6 +782,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + return 0; + } +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Introduce-isolation-groups.patch b/SOURCES/libvirt-conf-Introduce-isolation-groups.patch deleted file mode 100644 index ef6ce9f..0000000 --- a/SOURCES/libvirt-conf-Introduce-isolation-groups.patch +++ /dev/null @@ -1,324 +0,0 @@ -From 0b739987779a9f197d558f9c3b31d557a564bb6d Mon Sep 17 00:00:00 2001 -Message-Id: <0b739987779a9f197d558f9c3b31d557a564bb6d@dist-git> -From: Andrea Bolognani -Date: Tue, 18 Jul 2017 12:10:05 +0200 -Subject: [PATCH] conf: Introduce isolation groups - -Isolation groups will eventually allow us to make sure certain -devices, eg. PCI hostdevs, are assigned to guest PCI buses in -a way that guarantees improved isolation, error detection and -recovery for machine types and hypervisors that support it, -eg. pSeries guest on QEMU. - -This patch merely defines storage for the new information -we're going to need later on and makes sure it is passed from -the hypervisor driver (QEMU / bhyve) down to the generic PCI -address allocation code. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit b8b6abbcd431d02ac106ee729204552d80762aae) - -Conflicts: - - * src/conf/device_conf.h: - - caused by 54fa1b44afc8bfe4a36c7c4e3b2fe1fafde0506c, where - virDomainDeviceInfo::loadparm is introduced, not being - present in the tree; - - * src/conf/domain_conf.c: - - caused mostly by the absence of commit - 0c53382d820aac4767895a727c01de23397a6aaa and hence the - virDomainSkipBackcompatConsole() function, but - 54fa1b44afc8bfe4a36c7c4e3b2fe1fafde0506c mentioned above - also plays a role. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/bhyve/bhyve_device.c | 4 ++-- - src/conf/device_conf.h | 10 ++++++++++ - src/conf/domain_addr.c | 17 ++++++++++++----- - src/conf/domain_addr.h | 9 ++++++++- - src/conf/domain_conf.c | 2 ++ - src/qemu/qemu_domain_address.c | 35 ++++++++++++++++++----------------- - 6 files changed, 52 insertions(+), 25 deletions(-) - -diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c -index fdfd512e10..03aa6c93bd 100644 ---- a/src/bhyve/bhyve_device.c -+++ b/src/bhyve/bhyve_device.c -@@ -57,7 +57,7 @@ bhyveCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, - } - - if (virDomainPCIAddressReserveAddr(addrs, addr, -- VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) { -+ VIR_PCI_CONNECT_TYPE_PCI_DEVICE, 0) < 0) { - goto cleanup; - } - -@@ -100,7 +100,7 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, - lpc_addr.slot = 0x1; - - if (virDomainPCIAddressReserveAddr(addrs, &lpc_addr, -- VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) { -+ VIR_PCI_CONNECT_TYPE_PCI_DEVICE, 0) < 0) { - goto error; - } - -diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h -index a20de853f8..6436a8cf3f 100644 ---- a/src/conf/device_conf.h -+++ b/src/conf/device_conf.h -@@ -167,6 +167,16 @@ struct _virDomainDeviceInfo { - * assignment, never saved and never reported. - */ - int pciConnectFlags; /* enum virDomainPCIConnectFlags */ -+ -+ /* PCI devices will only be automatically placed on a PCI bus -+ * that shares the same isolation group */ -+ unsigned int isolationGroup; -+ -+ /* Usually, PCI buses will take on the same isolation group -+ * as the first device that is plugged into them, but in some -+ * cases we might want to prevent that from happening by -+ * locking the isolation group */ -+ bool isolationGroupLocked; - }; - - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index 8990372ae0..a067493136 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -548,6 +548,7 @@ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, - virDomainPCIConnectFlags flags, -+ unsigned int isolationGroup ATTRIBUTE_UNUSED, - bool fromConfig) - { - int ret = -1; -@@ -600,9 +601,11 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, - int - virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, -- virDomainPCIConnectFlags flags) -+ virDomainPCIConnectFlags flags, -+ unsigned int isolationGroup) - { -- return virDomainPCIAddressReserveAddrInternal(addrs, addr, flags, true); -+ return virDomainPCIAddressReserveAddrInternal(addrs, addr, flags, -+ isolationGroup, true); - } - - int -@@ -638,7 +641,8 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, - goto cleanup; - - ret = virDomainPCIAddressReserveAddrInternal(addrs, &dev->addr.pci, -- flags, true); -+ flags, dev->isolationGroup, -+ true); - } else { - ret = virDomainPCIAddressReserveNextAddr(addrs, dev, flags, -1); - } -@@ -759,6 +763,7 @@ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr next_addr, - virDomainPCIConnectFlags flags, -+ unsigned int isolationGroup ATTRIBUTE_UNUSED, - int function) - { - virPCIDeviceAddress a = { 0 }; -@@ -839,10 +844,12 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - { - virPCIDeviceAddress addr; - -- if (virDomainPCIAddressGetNextAddr(addrs, &addr, flags, function) < 0) -+ if (virDomainPCIAddressGetNextAddr(addrs, &addr, flags, -+ dev->isolationGroup, function) < 0) - return -1; - -- if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, false) < 0) -+ if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, -+ dev->isolationGroup, false) < 0) - return -1; - - if (!addrs->dryRun) { -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index 49f30332f0..01dbc5114f 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -100,6 +100,12 @@ typedef struct { - * bit is set, that function is in use by a device. - */ - virDomainPCIAddressSlot slot[VIR_PCI_ADDRESS_SLOT_LAST + 1]; -+ -+ /* See virDomainDeviceInfo::isolationGroup */ -+ unsigned int isolationGroup; -+ -+ /* See virDomainDeviceInfo::isolationGroupLocked */ -+ bool isolationGroupLocked; - } virDomainPCIAddressBus; - typedef virDomainPCIAddressBus *virDomainPCIAddressBusPtr; - -@@ -155,7 +161,8 @@ int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, - - int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, -- virDomainPCIConnectFlags flags) -+ virDomainPCIConnectFlags flags, -+ unsigned int isolationGroup) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - - int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index f28f6aff63..5941a3a4c4 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -3608,6 +3608,8 @@ void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) - memset(&info->addr, 0, sizeof(info->addr)); - info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; - VIR_FREE(info->romfile); -+ info->isolationGroup = 0; -+ info->isolationGroupLocked = false; - } - - -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index d19ffea7c9..02e214b8dd 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -1032,7 +1032,8 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, - } - - if (virDomainPCIAddressReserveAddr(addrs, addr, -- info->pciConnectFlags) < 0) { -+ info->pciConnectFlags, -+ info->isolationGroup) < 0) { - goto cleanup; - } - -@@ -1077,6 +1078,10 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, - if (virDomainPCIAddressBusSetModel(&addrs->buses[idx], cont->model) < 0) - goto error; - -+ /* Forward the information about isolation groups */ -+ addrs->buses[idx].isolationGroup = cont->info.isolationGroup; -+ addrs->buses[idx].isolationGroupLocked = cont->info.isolationGroupLocked; -+ - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) - hasPCIeRoot = true; - } -@@ -1193,7 +1198,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, - if (addrs->nbuses) { - memset(&tmp_addr, 0, sizeof(tmp_addr)); - tmp_addr.slot = 1; -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - } - -@@ -1228,7 +1233,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, - goto cleanup; - } - } else { -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - primaryVideo->info.addr.pci = tmp_addr; - primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; -@@ -1253,7 +1258,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, - VIR_DEBUG("PCI address 0:0:2.0 in use, future addition of a video" - " device will not be possible without manual" - " intervention"); -- } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { -+ } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) { - goto cleanup; - } - } -@@ -1329,10 +1334,8 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - assign = true; - } - if (assign) { -- if (virDomainPCIAddressReserveAddr(addrs, -- &tmp_addr, flags) < 0) { -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; -- } - - cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; - cont->info.addr.pci.domain = 0; -@@ -1354,10 +1357,8 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - memset(&tmp_addr, 0, sizeof(tmp_addr)); - tmp_addr.slot = 0x1E; - if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) { -- if (virDomainPCIAddressReserveAddr(addrs, -- &tmp_addr, flags) < 0) { -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; -- } - - cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; - cont->info.addr.pci.domain = 0; -@@ -1380,12 +1381,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - tmp_addr.slot = 0x1F; - tmp_addr.function = 0; - tmp_addr.multi = VIR_TRISTATE_SWITCH_ON; -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - - tmp_addr.function = 3; - tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT; -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - } - -@@ -1419,7 +1420,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - goto cleanup; - } - } else { -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; - primaryVideo->info.addr.pci = tmp_addr; -@@ -1445,8 +1446,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - " device will not be possible without manual" - " intervention"); - virResetLastError(); -- } else if (virDomainPCIAddressReserveAddr(addrs, -- &tmp_addr, flags) < 0) { -+ } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) { - goto cleanup; - } - } -@@ -1467,7 +1467,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - !virDeviceInfoPCIAddressWanted(&sound->info)) { - continue; - } -- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) -+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) - goto cleanup; - - sound->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; -@@ -1671,7 +1671,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, - if (foundAddr) { - /* Reserve this function on the slot we found */ - if (virDomainPCIAddressReserveAddr(addrs, &addr, -- cont->info.pciConnectFlags) < 0) { -+ cont->info.pciConnectFlags, -+ cont->info.isolationGroup) < 0) { - goto error; - } - --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Introduce-virDomainChrTargetDefFormat.patch b/SOURCES/libvirt-conf-Introduce-virDomainChrTargetDefFormat.patch new file mode 100644 index 0000000..b4d2573 --- /dev/null +++ b/SOURCES/libvirt-conf-Introduce-virDomainChrTargetDefFormat.patch @@ -0,0 +1,115 @@ +From 10d833e6bb2798e23beb01ac50d6588bec15b8ad Mon Sep 17 00:00:00 2001 +Message-Id: <10d833e6bb2798e23beb01ac50d6588bec15b8ad@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:00 +0100 +Subject: [PATCH] conf: Introduce virDomainChrTargetDefFormat() + +Move formatting of the element for char devices out of +virDomainChrDefFormat() and into its own function. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 00b7f81fa8f4e32a722ee2ccbb1862f03be062c0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 67 ++++++++++++++++++++++++++++++-------------------- + 1 file changed, 40 insertions(+), 27 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 586a840672..d68a5f415c 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -23936,38 +23936,15 @@ virDomainChrSourceDefFormat(virBufferPtr buf, + return -1; + } + ++ + static int +-virDomainChrDefFormat(virBufferPtr buf, +- virDomainChrDefPtr def, +- unsigned int flags) ++virDomainChrTargetDefFormat(virBufferPtr buf, ++ const virDomainChrDef *def, ++ unsigned int flags) + { +- const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); + const char *targetType = virDomainChrTargetTypeToString(def->deviceType, + def->targetType); +- bool tty_compat; + +- int ret = 0; +- +- if (!elementName) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("unexpected char device type %d"), +- def->deviceType); +- return -1; +- } +- +- virBufferAsprintf(buf, "<%s", elementName); +- virBufferAdjustIndent(buf, 2); +- tty_compat = (def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && +- def->target.port == 0 && +- def->source->type == VIR_DOMAIN_CHR_TYPE_PTY && +- !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && +- def->source->data.file.path); +- if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) +- return -1; +- virBufferAddLit(buf, ">\n"); +- virDomainChrSourceDefFormat(buf, def->source, flags); +- +- /* Format block */ + switch (def->deviceType) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: { + if (!targetType) { +@@ -24039,6 +24016,42 @@ virDomainChrDefFormat(virBufferPtr buf, + break; + } + ++ return 0; ++} ++ ++ ++static int ++virDomainChrDefFormat(virBufferPtr buf, ++ virDomainChrDefPtr def, ++ unsigned int flags) ++{ ++ const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); ++ bool tty_compat; ++ ++ int ret = 0; ++ ++ if (!elementName) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("unexpected char device type %d"), ++ def->deviceType); ++ return -1; ++ } ++ ++ virBufferAsprintf(buf, "<%s", elementName); ++ virBufferAdjustIndent(buf, 2); ++ tty_compat = (def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && ++ def->target.port == 0 && ++ def->source->type == VIR_DOMAIN_CHR_TYPE_PTY && ++ !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && ++ def->source->data.file.path); ++ if (virDomainChrAttrsDefFormat(buf, def->source, tty_compat) < 0) ++ return -1; ++ virBufferAddLit(buf, ">\n"); ++ virDomainChrSourceDefFormat(buf, def->source, flags); ++ ++ if (virDomainChrTargetDefFormat(buf, def, flags) < 0) ++ return -1; ++ + virDomainDeviceInfoFormat(buf, &def->info, flags); + + virBufferAdjustIndent(buf, -2); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Introduce-virSaveCookie.patch b/SOURCES/libvirt-conf-Introduce-virSaveCookie.patch deleted file mode 100644 index fedfc8b..0000000 --- a/SOURCES/libvirt-conf-Introduce-virSaveCookie.patch +++ /dev/null @@ -1,290 +0,0 @@ -From 5785b4ff7c33f5e2eb16530f20b6b45d8809aae7 Mon Sep 17 00:00:00 2001 -Message-Id: <5785b4ff7c33f5e2eb16530f20b6b45d8809aae7@dist-git> -From: Jiri Denemark -Date: Fri, 2 Jun 2017 00:44:06 +0200 -Subject: [PATCH] conf: Introduce virSaveCookie - -The code will be used by snapshots and domain save/restore code to store -additional data for a saved running domain. It is analogous to migration -cookies, but simple and one way only. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit e37daa1fb69ec30042cbc38d489217edb656bc30) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - po/POTFILES.in | 1 + - src/Makefile.am | 1 + - src/conf/virsavecookie.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++ - src/conf/virsavecookie.h | 62 ++++++++++++++++++++ - src/libvirt_private.syms | 7 +++ - 5 files changed, 215 insertions(+) - create mode 100644 src/conf/virsavecookie.c - create mode 100644 src/conf/virsavecookie.h - -diff --git a/po/POTFILES.in b/po/POTFILES.in -index 064abd5bbb..cf64115719 100644 ---- a/po/POTFILES.in -+++ b/po/POTFILES.in -@@ -47,6 +47,7 @@ src/conf/virdomainobjlist.c - src/conf/virinterfaceobj.c - src/conf/virnodedeviceobj.c - src/conf/virnwfilterobj.c -+src/conf/virsavecookie.c - src/conf/virsecretobj.c - src/conf/virstorageobj.c - src/cpu/cpu.c -diff --git a/src/Makefile.am b/src/Makefile.am -index 75e4344198..53550280bf 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -336,6 +336,7 @@ DOMAIN_CONF_SOURCES = \ - conf/domain_conf.c conf/domain_conf.h \ - conf/domain_audit.c conf/domain_audit.h \ - conf/domain_nwfilter.c conf/domain_nwfilter.h \ -+ conf/virsavecookie.c conf/virsavecookie.h \ - conf/snapshot_conf.c conf/snapshot_conf.h \ - conf/numa_conf.c conf/numa_conf.h \ - conf/virdomainobjlist.c conf/virdomainobjlist.h -diff --git a/src/conf/virsavecookie.c b/src/conf/virsavecookie.c -new file mode 100644 -index 0000000000..502c04d0f4 ---- /dev/null -+++ b/src/conf/virsavecookie.c -@@ -0,0 +1,144 @@ -+/** -+ * virsavecookie.c: Save cookie handling -+ * -+ * Copyright (C) 2017 Red Hat, Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see -+ * . -+ */ -+ -+#include -+ -+#include "virerror.h" -+#include "virlog.h" -+#include "virobject.h" -+#include "virbuffer.h" -+#include "virxml.h" -+#include "virsavecookie.h" -+ -+#define VIR_FROM_THIS VIR_FROM_CONF -+ -+VIR_LOG_INIT("conf.savecookie"); -+ -+ -+static int -+virSaveCookieParseNode(xmlXPathContextPtr ctxt, -+ virObjectPtr *obj, -+ virSaveCookieCallbacksPtr saveCookie) -+{ -+ *obj = NULL; -+ -+ if (!xmlStrEqual(ctxt->node->name, BAD_CAST "cookie")) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("XML does not contain expected 'cookie' element")); -+ return -1; -+ } -+ -+ if (!saveCookie || !saveCookie->parse) -+ return 0; -+ -+ return saveCookie->parse(ctxt, obj); -+} -+ -+ -+int -+virSaveCookieParse(xmlXPathContextPtr ctxt, -+ virObjectPtr *obj, -+ virSaveCookieCallbacksPtr saveCookie) -+{ -+ xmlNodePtr node = ctxt->node; -+ int ret = -1; -+ -+ *obj = NULL; -+ -+ if (!(ctxt->node = virXPathNode("./cookie", ctxt))) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ ret = virSaveCookieParseNode(ctxt, obj, saveCookie); -+ -+ cleanup: -+ ctxt->node = node; -+ return ret; -+} -+ -+ -+int -+virSaveCookieParseString(const char *xml, -+ virObjectPtr *obj, -+ virSaveCookieCallbacksPtr saveCookie) -+{ -+ xmlDocPtr doc = NULL; -+ xmlXPathContextPtr ctxt = NULL; -+ int ret = -1; -+ -+ *obj = NULL; -+ -+ if (!xml) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ if (!(doc = virXMLParseStringCtxt(xml, _("(save cookie)"), &ctxt))) -+ goto cleanup; -+ -+ ret = virSaveCookieParseNode(ctxt, obj, saveCookie); -+ -+ cleanup: -+ xmlXPathFreeContext(ctxt); -+ xmlFreeDoc(doc); -+ return ret; -+} -+ -+ -+int -+virSaveCookieFormatBuf(virBufferPtr buf, -+ virObjectPtr obj, -+ virSaveCookieCallbacksPtr saveCookie) -+{ -+ if (!obj || !saveCookie || !saveCookie->format) -+ return 0; -+ -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ -+ if (saveCookie->format(buf, obj) < 0) -+ return -1; -+ -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ -+ return 0; -+} -+ -+ -+char * -+virSaveCookieFormat(virObjectPtr obj, -+ virSaveCookieCallbacksPtr saveCookie) -+{ -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ -+ if (virSaveCookieFormatBuf(&buf, obj, saveCookie) < 0) -+ goto error; -+ -+ if (virBufferCheckError(&buf) < 0) -+ goto error; -+ -+ return virBufferContentAndReset(&buf); -+ -+ error: -+ virBufferFreeAndReset(&buf); -+ return NULL; -+} -diff --git a/src/conf/virsavecookie.h b/src/conf/virsavecookie.h -new file mode 100644 -index 0000000000..4aed18466c ---- /dev/null -+++ b/src/conf/virsavecookie.h -@@ -0,0 +1,62 @@ -+/** -+ * virsavecookie.h: Save cookie handling -+ * -+ * Copyright (C) 2017 Red Hat, Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see -+ * . -+ */ -+#ifndef __VIR_SAVE_COOKIE_H__ -+# define __VIR_SAVE_COOKIE_H__ -+ -+# include -+ -+# include "internal.h" -+# include "virobject.h" -+# include "virbuffer.h" -+ -+ -+typedef int (*virSaveCookieParseFunc)(xmlXPathContextPtr ctxt, -+ virObjectPtr *obj); -+typedef int (*virSaveCookieFormatFunc)(virBufferPtr buf, -+ virObjectPtr obj); -+ -+typedef struct _virSaveCookieCallbacks virSaveCookieCallbacks; -+typedef virSaveCookieCallbacks *virSaveCookieCallbacksPtr; -+struct _virSaveCookieCallbacks { -+ virSaveCookieParseFunc parse; -+ virSaveCookieFormatFunc format; -+}; -+ -+ -+int -+virSaveCookieParse(xmlXPathContextPtr ctxt, -+ virObjectPtr *obj, -+ virSaveCookieCallbacksPtr saveCookie); -+ -+int -+virSaveCookieParseString(const char *xml, -+ virObjectPtr *obj, -+ virSaveCookieCallbacksPtr saveCookie); -+ -+int -+virSaveCookieFormatBuf(virBufferPtr buf, -+ virObjectPtr obj, -+ virSaveCookieCallbacksPtr saveCookie); -+ -+char * -+virSaveCookieFormat(virObjectPtr obj, -+ virSaveCookieCallbacksPtr saveCookie); -+ -+#endif /*__VIR_SAVE_COOKIE_H__ */ -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index a578dfba34..b4769080e8 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -971,6 +971,13 @@ virNWFilterObjTestUnassignDef; - virNWFilterObjUnlock; - - -+# conf/virsavecookie.h -+virSaveCookieFormat; -+virSaveCookieFormatBuf; -+virSaveCookieParse; -+virSaveCookieParseString; -+ -+ - # conf/virsecretobj.h - virSecretLoadAllConfigs; - virSecretObjDeleteConfig; --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Make-error-reporting-in-virCPUDefIsEqual-optional.patch b/SOURCES/libvirt-conf-Make-error-reporting-in-virCPUDefIsEqual-optional.patch deleted file mode 100644 index 7e24d8f..0000000 --- a/SOURCES/libvirt-conf-Make-error-reporting-in-virCPUDefIsEqual-optional.patch +++ /dev/null @@ -1,213 +0,0 @@ -From c1ad40f4ad3813ff3013efba80983f62113fc092 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Wed, 31 May 2017 16:42:42 +0200 -Subject: [PATCH] conf: Make error reporting in virCPUDefIsEqual optional - -The function will be used in paths where mismatching CPU defs are not an -error. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 25ec7f6fe959f2811bb014a8c1f0c92bdf9ca13d) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 83 +++++++++++++++++++++++--------------------------- - src/conf/cpu_conf.h | 3 +- - src/conf/domain_conf.c | 2 +- - 3 files changed, 41 insertions(+), 47 deletions(-) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index a4be5742e3..ffb2e83d67 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -811,7 +811,8 @@ virCPUDefAddFeature(virCPUDefPtr def, - - bool - virCPUDefIsEqual(virCPUDefPtr src, -- virCPUDefPtr dst) -+ virCPUDefPtr dst, -+ bool reportError) - { - bool identical = false; - size_t i; -@@ -819,98 +820,89 @@ virCPUDefIsEqual(virCPUDefPtr src, - if (!src && !dst) - return true; - -+#define MISMATCH(fmt, ...) \ -+ if (reportError) \ -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, fmt, __VA_ARGS__) -+ - if ((src && !dst) || (!src && dst)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("Target CPU does not match source")); -+ MISMATCH("%s", _("Target CPU does not match source")); - goto cleanup; - } - - if (src->type != dst->type) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU type %s does not match source %s"), -- virCPUTypeToString(dst->type), -- virCPUTypeToString(src->type)); -+ MISMATCH(_("Target CPU type %s does not match source %s"), -+ virCPUTypeToString(dst->type), -+ virCPUTypeToString(src->type)); - goto cleanup; - } - - if (src->mode != dst->mode) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU mode %s does not match source %s"), -- virCPUModeTypeToString(dst->mode), -- virCPUModeTypeToString(src->mode)); -+ MISMATCH(_("Target CPU mode %s does not match source %s"), -+ virCPUModeTypeToString(dst->mode), -+ virCPUModeTypeToString(src->mode)); - goto cleanup; - } - - if (src->arch != dst->arch) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU arch %s does not match source %s"), -- virArchToString(dst->arch), -- virArchToString(src->arch)); -+ MISMATCH(_("Target CPU arch %s does not match source %s"), -+ virArchToString(dst->arch), -+ virArchToString(src->arch)); - goto cleanup; - } - - if (STRNEQ_NULLABLE(src->model, dst->model)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU model %s does not match source %s"), -- NULLSTR(dst->model), NULLSTR(src->model)); -+ MISMATCH(_("Target CPU model %s does not match source %s"), -+ NULLSTR(dst->model), NULLSTR(src->model)); - goto cleanup; - } - - if (STRNEQ_NULLABLE(src->vendor, dst->vendor)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU vendor %s does not match source %s"), -- NULLSTR(dst->vendor), NULLSTR(src->vendor)); -+ MISMATCH(_("Target CPU vendor %s does not match source %s"), -+ NULLSTR(dst->vendor), NULLSTR(src->vendor)); - goto cleanup; - } - - if (STRNEQ_NULLABLE(src->vendor_id, dst->vendor_id)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU vendor id %s does not match source %s"), -- NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id)); -+ MISMATCH(_("Target CPU vendor id %s does not match source %s"), -+ NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id)); - goto cleanup; - } - - if (src->sockets != dst->sockets) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU sockets %d does not match source %d"), -- dst->sockets, src->sockets); -+ MISMATCH(_("Target CPU sockets %d does not match source %d"), -+ dst->sockets, src->sockets); - goto cleanup; - } - - if (src->cores != dst->cores) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU cores %d does not match source %d"), -- dst->cores, src->cores); -+ MISMATCH(_("Target CPU cores %d does not match source %d"), -+ dst->cores, src->cores); - goto cleanup; - } - - if (src->threads != dst->threads) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU threads %d does not match source %d"), -- dst->threads, src->threads); -+ MISMATCH(_("Target CPU threads %d does not match source %d"), -+ dst->threads, src->threads); - goto cleanup; - } - - if (src->nfeatures != dst->nfeatures) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU feature count %zu does not match source %zu"), -- dst->nfeatures, src->nfeatures); -+ MISMATCH(_("Target CPU feature count %zu does not match source %zu"), -+ dst->nfeatures, src->nfeatures); - goto cleanup; - } - - for (i = 0; i < src->nfeatures; i++) { - if (STRNEQ(src->features[i].name, dst->features[i].name)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU feature %s does not match source %s"), -- dst->features[i].name, src->features[i].name); -+ MISMATCH(_("Target CPU feature %s does not match source %s"), -+ dst->features[i].name, src->features[i].name); - goto cleanup; - } - - if (src->features[i].policy != dst->features[i].policy) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target CPU feature policy %s does not match source %s"), -- virCPUFeaturePolicyTypeToString(dst->features[i].policy), -- virCPUFeaturePolicyTypeToString(src->features[i].policy)); -+ MISMATCH(_("Target CPU feature policy %s does not match source %s"), -+ virCPUFeaturePolicyTypeToString(dst->features[i].policy), -+ virCPUFeaturePolicyTypeToString(src->features[i].policy)); - goto cleanup; - } - } -@@ -920,11 +912,12 @@ virCPUDefIsEqual(virCPUDefPtr src, - (src->cache && dst->cache && - (src->cache->level != dst->cache->level || - src->cache->mode != dst->cache->mode))) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("Target CPU cache does not match source")); -+ MISMATCH("%s", _("Target CPU cache does not match source")); - goto cleanup; - } - -+#undef MISMATCH -+ - identical = true; - - cleanup: -diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h -index 09438b68b4..b0d891552a 100644 ---- a/src/conf/cpu_conf.h -+++ b/src/conf/cpu_conf.h -@@ -189,7 +189,8 @@ virCPUDefParseXML(xmlNodePtr node, - - bool - virCPUDefIsEqual(virCPUDefPtr src, -- virCPUDefPtr dst); -+ virCPUDefPtr dst, -+ bool reportError); - - char * - virCPUDefFormat(virCPUDefPtr def, -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index bab85c6362..2197330a22 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -20042,7 +20042,7 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, - goto error; - } - -- if (!virCPUDefIsEqual(src->cpu, dst->cpu)) -+ if (!virCPUDefIsEqual(src->cpu, dst->cpu, true)) - goto error; - - if (!virSysinfoIsEqual(src->sysinfo, dst->sysinfo)) --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Make-virDomainSnapshotDefFormat-easier-to-read.patch b/SOURCES/libvirt-conf-Make-virDomainSnapshotDefFormat-easier-to-read.patch deleted file mode 100644 index 5ed7558..0000000 --- a/SOURCES/libvirt-conf-Make-virDomainSnapshotDefFormat-easier-to-read.patch +++ /dev/null @@ -1,113 +0,0 @@ -From d1adb920ad7f460e32b1cc68e68120b3c655bc18 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Thu, 1 Jun 2017 15:57:55 +0200 -Subject: [PATCH] conf: Make virDomainSnapshotDefFormat easier to read - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 00968dca967f4bf9d4f496e5c971bff3f8147ed8) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/conf/snapshot_conf.c | 30 +++++++++++++++++++++--------- - 1 file changed, 21 insertions(+), 9 deletions(-) - -diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c -index b6cba5ac38..7daa9b22ad 100644 ---- a/src/conf/snapshot_conf.c -+++ b/src/conf/snapshot_conf.c -@@ -686,11 +686,13 @@ virDomainSnapshotDiskDefFormat(virBufferPtr buf, - virBufferAddLit(buf, "\n"); - } - --char *virDomainSnapshotDefFormat(const char *domain_uuid, -- virDomainSnapshotDefPtr def, -- virCapsPtr caps, -- unsigned int flags, -- int internal) -+ -+char * -+virDomainSnapshotDefFormat(const char *domain_uuid, -+ virDomainSnapshotDefPtr def, -+ virCapsPtr caps, -+ unsigned int flags, -+ int internal) - { - virBuffer buf = VIR_BUFFER_INITIALIZER; - size_t i; -@@ -702,12 +704,14 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid, - - virBufferAddLit(&buf, "\n"); - virBufferAdjustIndent(&buf, 2); -+ - virBufferEscapeString(&buf, "%s\n", def->name); - if (def->description) - virBufferEscapeString(&buf, "%s\n", - def->description); - virBufferAsprintf(&buf, "%s\n", - virDomainSnapshotStateTypeToString(def->state)); -+ - if (def->parent) { - virBufferAddLit(&buf, "\n"); - virBufferAdjustIndent(&buf, 2); -@@ -715,14 +719,17 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid, - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "\n"); - } -+ - virBufferAsprintf(&buf, "%lld\n", - def->creationTime); -+ - if (def->memory) { - virBufferAsprintf(&buf, "memory)); - virBufferEscapeString(&buf, " file='%s'", def->file); - virBufferAddLit(&buf, "/>\n"); - } -+ - if (def->ndisks) { - virBufferAddLit(&buf, "\n"); - virBufferAdjustIndent(&buf, 2); -@@ -731,11 +738,10 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid, - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "\n"); - } -+ - if (def->dom) { -- if (virDomainDefFormatInternal(def->dom, caps, flags, &buf) < 0) { -- virBufferFreeAndReset(&buf); -- return NULL; -- } -+ if (virDomainDefFormatInternal(def->dom, caps, flags, &buf) < 0) -+ goto error; - } else if (domain_uuid) { - virBufferAddLit(&buf, "\n"); - virBufferAdjustIndent(&buf, 2); -@@ -743,8 +749,10 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid, - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "\n"); - } -+ - if (internal) - virBufferAsprintf(&buf, "%d\n", def->current); -+ - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "\n"); - -@@ -752,6 +760,10 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid, - return NULL; - - return virBufferContentAndReset(&buf); -+ -+ error: -+ virBufferFreeAndReset(&buf); -+ return NULL; - } - - /* Snapshot Obj functions */ --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Move-index-number-checking-to-drivers.patch b/SOURCES/libvirt-conf-Move-index-number-checking-to-drivers.patch deleted file mode 100644 index 52cbf17..0000000 --- a/SOURCES/libvirt-conf-Move-index-number-checking-to-drivers.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 711a3ca4a1c0c9bc31a98cd6afcedeb3107157c8 Mon Sep 17 00:00:00 2001 -Message-Id: <711a3ca4a1c0c9bc31a98cd6afcedeb3107157c8@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:06 +0200 -Subject: [PATCH] conf: Move index number checking to drivers - -pSeries guests will soon be allowed to have multiple -PHBs (pci-root controllers), which of course means that -all but one of them will have a non-zero index; hence, -we'll need to relax the current check. - -However, right now the check is performed in the conf -module, which is generic rather than tied to the QEMU -driver, and where we don't have information such as the -guest machine type available. - -To make this change of behavior possible down the line, -we need to move the check from the XML parser to the -drivers. Luckily, only QEMU and bhyve are using PCI -controllers, so this doesn't result in much duplication. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 620c390c7308f61027cf28000fcfcfcb01e3ae89) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/bhyve/bhyve_domain.c | 15 +++++++++++++++ - src/conf/domain_conf.c | 6 ------ - src/qemu/qemu_domain.c | 9 +++++++++ - 3 files changed, 24 insertions(+), 6 deletions(-) - -diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c -index 20c82937b5..71764554eb 100644 ---- a/src/bhyve/bhyve_domain.c -+++ b/src/bhyve/bhyve_domain.c -@@ -122,6 +122,21 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - bhyveDomainDiskDefAssignAddress(driver, disk, def) < 0) - return -1; - } -+ -+ if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER) { -+ virDomainControllerDefPtr cont = dev->data.controller; -+ -+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && -+ (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || -+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && -+ cont->idx != 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("pci-root and pcie-root controllers " -+ "should have index 0")); -+ return -1; -+ } -+ } -+ - return 0; - } - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index d8ca25da38..8e5c487df8 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -9157,12 +9157,6 @@ virDomainControllerDefParseXML(xmlNodePtr node, - "have an address")); - goto error; - } -- if (def->idx > 0) { -- virReportError(VIR_ERR_XML_ERROR, "%s", -- _("pci-root and pcie-root controllers " -- "should have index 0")); -- goto error; -- } - if ((rc = virDomainParseScaledValue("./pcihole64", NULL, - ctxt, &bytes, 1024, - 1024ULL * ULONG_MAX, false)) < 0) -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 1528c6a137..87a437eccf 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3378,6 +3378,15 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - break; - - case VIR_DOMAIN_CONTROLLER_TYPE_PCI: -+ if ((cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || -+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && -+ cont->idx != 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("pci-root and pcie-root controllers " -+ "should have index 0")); -+ return -1; -+ } -+ - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS && - !qemuDomainIsI440FX(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Move-target-index-validation.patch b/SOURCES/libvirt-conf-Move-target-index-validation.patch deleted file mode 100644 index 6c37fc1..0000000 --- a/SOURCES/libvirt-conf-Move-target-index-validation.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 3e5618223a9e21597ed9e95edfc79139563be301 Mon Sep 17 00:00:00 2001 -Message-Id: <3e5618223a9e21597ed9e95edfc79139563be301@dist-git> -From: Andrea Bolognani -Date: Mon, 21 Aug 2017 14:46:38 +0200 -Subject: [PATCH] conf: Move target index validation - -Validation should happen after parsing, so the proper -location for it is virDomainControllerDefValidate() -rather than virDomainControllerDefParseXML(). - -Signed-off-by: Andrea Bolognani -(cherry picked from commit c9d75d655ae73693a08123aca75677caf579f9e9) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1479647 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 40 ++++++++++++++++++++++++---------------- - 1 file changed, 24 insertions(+), 16 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7ba2bc01ca..7889f5335c 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -5046,12 +5046,34 @@ static int - virDomainControllerDefValidate(const virDomainControllerDef *controller) - { - if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { -+ const virDomainPCIControllerOpts *opts = &controller->opts.pciopts; -+ - if (controller->idx > 255) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("PCI controller index %d too high, maximum is 255"), - controller->idx); - return -1; - } -+ -+ /* Only validate the target index if it's been set */ -+ if (opts->targetIndex != -1) { -+ -+ if (opts->targetIndex < 0 || opts->targetIndex > 31) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("PCI controller target index '%d' out of " -+ "range - must be 0-31"), -+ opts->targetIndex); -+ return -1; -+ } -+ -+ if ((controller->idx == 0 && opts->targetIndex != 0) || -+ (controller->idx != 0 && opts->targetIndex == 0)) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Only the PCI controller with index 0 can " -+ "have target index 0, and vice versa")); -+ return -1; -+ } -+ } - } - return 0; - } -@@ -9292,27 +9314,13 @@ virDomainControllerDefParseXML(xmlNodePtr node, - } - if (targetIndex) { - if (virStrToLong_i(targetIndex, NULL, 0, -- &def->opts.pciopts.targetIndex) < 0) { -+ &def->opts.pciopts.targetIndex) < 0 || -+ def->opts.pciopts.targetIndex == -1) { - virReportError(VIR_ERR_XML_ERROR, - _("Invalid target index '%s' in PCI controller"), - targetIndex); - goto error; - } -- if (def->opts.pciopts.targetIndex < 0 || -- def->opts.pciopts.targetIndex > 31) { -- virReportError(VIR_ERR_XML_ERROR, -- _("PCI controller target index '%s' out of " -- "range - must be 0-31"), -- targetIndex); -- goto error; -- } -- if ((def->idx == 0 && def->opts.pciopts.targetIndex != 0) || -- (def->idx != 0 && def->opts.pciopts.targetIndex == 0)) { -- virReportError(VIR_ERR_XML_ERROR, "%s", -- _("Only the PCI controller with index 0 can " -- "have target index 0, and vice versa")); -- goto error; -- } - } - if (numaNode >= 0) { - if (def->idx == 0) { --- -2.14.1 - diff --git a/SOURCES/libvirt-conf-Move-virDomainPCIAddressBusIsFullyReserved.patch b/SOURCES/libvirt-conf-Move-virDomainPCIAddressBusIsFullyReserved.patch deleted file mode 100644 index 838066c..0000000 --- a/SOURCES/libvirt-conf-Move-virDomainPCIAddressBusIsFullyReserved.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 9d0d053dc7f8af8ebb3c7fbb3a11335e4b50717b Mon Sep 17 00:00:00 2001 -Message-Id: <9d0d053dc7f8af8ebb3c7fbb3a11335e4b50717b@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:08:58 +0200 -Subject: [PATCH] conf: Move virDomainPCIAddressBusIsFullyReserved() - -This function was private to the QEMU driver and was, -accordingly, called qemuDomainPCIBusFullyReserved(). - -However the function is really not QEMU-specific at -all, so it makes sense to move it closer to the -virDomainPCIAddressBus struct it operates on. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit c79f97c83ce1421f79756a9a344e8e77ceeeb1d8) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_addr.c | 14 ++++++++++++++ - src/conf/domain_addr.h | 3 +++ - src/libvirt_private.syms | 1 + - src/qemu/qemu_domain_address.c | 15 +-------------- - 4 files changed, 19 insertions(+), 14 deletions(-) - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index 639168effa..0ae1ed93af 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -355,6 +355,20 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, - } - - -+bool -+virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) -+{ -+ size_t i; -+ -+ for (i = bus->minSlot; i <= bus->maxSlot; i++) { -+ if (!bus->slot[i].functions) -+ return false; -+ } -+ -+ return true; -+} -+ -+ - /* Ensure addr fits in the address set, by expanding it if needed - * - * Return value: -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index f884b8af2b..c90a335919 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -141,6 +141,9 @@ int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, - virDomainControllerModelPCI model) - ATTRIBUTE_NONNULL(1); - -+bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) -+ ATTRIBUTE_NONNULL(1); -+ - bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 9c596e3f1c..7876ffb208 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -105,6 +105,7 @@ virDomainCCWAddressSetFree; - virDomainCCWAddressValidate; - virDomainGetBlkioParametersAssignFromDef; - virDomainPCIAddressAsString; -+virDomainPCIAddressBusIsFullyReserved; - virDomainPCIAddressBusSetModel; - virDomainPCIAddressEnsureAddr; - virDomainPCIAddressFlagsCompatible; -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 3da6b7369d..ff57edb564 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -1494,19 +1494,6 @@ qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def, - } - - --static bool --qemuDomainPCIBusFullyReserved(virDomainPCIAddressBusPtr bus) --{ -- size_t i; -- -- for (i = bus->minSlot; i <= bus->maxSlot; i++) -- if (!bus->slot[i].functions) -- return false; -- -- return true; --} -- -- - /* - * This assigns static PCI slots to all configured devices. - * The ordering here is chosen to match the ordering used -@@ -2038,7 +2025,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - bool buses_reserved = true; - - for (i = 0; i < addrs->nbuses; i++) { -- if (!qemuDomainPCIBusFullyReserved(&addrs->buses[i])) { -+ if (!virDomainPCIAddressBusIsFullyReserved(&addrs->buses[i])) { - buses_reserved = false; - break; - } --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Parse-and-format-target-index.patch b/SOURCES/libvirt-conf-Parse-and-format-target-index.patch deleted file mode 100644 index fcc68a5..0000000 --- a/SOURCES/libvirt-conf-Parse-and-format-target-index.patch +++ /dev/null @@ -1,161 +0,0 @@ -From 4c2b1b9cf0bcd8af7a7d011cd758bb6f11e5477b Mon Sep 17 00:00:00 2001 -Message-Id: <4c2b1b9cf0bcd8af7a7d011cd758bb6f11e5477b@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:09 +0200 -Subject: [PATCH] conf: Parse and format - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 47dd6e282ab8b0db662092cf0cc53163d805ac4d) - -Conflicts: - * src/conf/domain_conf.c: - - caused by e146264aaadf5aecf727d8c7b3d85683b55b6c48, - which significantly refactored - virDomainControllerDefFormat(), not being in the tree. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 6 ++++++ - docs/schemas/domaincommon.rng | 5 +++++ - src/conf/domain_conf.c | 32 ++++++++++++++++++++++++++++++++ - src/conf/domain_conf.h | 1 + - 4 files changed, 44 insertions(+) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index dc8e7d2dc7..bc67a53408 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3760,6 +3760,12 @@ - libvirt API to attach host devices to the correct - pci-expander-bus when assigning them to the domain). - -+
    index
    -+
    -+ pci-root controllers for pSeries guests use this attribute to -+ record the order they will show up in the guest. -+ Since 3.6.0 -+
    - -

    - For machine types which provide an implicit PCI bus, the pci-root -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 964e5c5bd5..b1461d4c61 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -1945,6 +1945,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 8a030c9b68..599db5cafe 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1854,6 +1854,7 @@ virDomainControllerDefNew(virDomainControllerType type) - def->opts.pciopts.chassis = -1; - def->opts.pciopts.port = -1; - def->opts.pciopts.busNr = -1; -+ def->opts.pciopts.targetIndex = -1; - def->opts.pciopts.numaNode = -1; - break; - case VIR_DOMAIN_CONTROLLER_TYPE_IDE: -@@ -8964,6 +8965,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, - char *chassis = NULL; - char *port = NULL; - char *busNr = NULL; -+ char *targetIndex = NULL; - int numaNode = -1; - char *ioeventfd = NULL; - char *portsStr = NULL; -@@ -9036,6 +9038,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, - chassis = virXMLPropString(cur, "chassis"); - port = virXMLPropString(cur, "port"); - busNr = virXMLPropString(cur, "busNr"); -+ targetIndex = virXMLPropString(cur, "index"); - processedTarget = true; - } - } -@@ -9254,6 +9257,30 @@ virDomainControllerDefParseXML(xmlNodePtr node, - goto error; - } - } -+ if (targetIndex) { -+ if (virStrToLong_i(targetIndex, NULL, 0, -+ &def->opts.pciopts.targetIndex) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("Invalid target index '%s' in PCI controller"), -+ targetIndex); -+ goto error; -+ } -+ if (def->opts.pciopts.targetIndex < 0 || -+ def->opts.pciopts.targetIndex > 31) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("PCI controller target index '%s' out of " -+ "range - must be 0-31"), -+ targetIndex); -+ goto error; -+ } -+ if ((def->idx == 0 && def->opts.pciopts.targetIndex != 0) || -+ (def->idx != 0 && def->opts.pciopts.targetIndex == 0)) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Only the PCI controller with index 0 can " -+ "have target index 0, and vice versa")); -+ goto error; -+ } -+ } - if (numaNode >= 0) - def->opts.pciopts.numaNode = numaNode; - break; -@@ -9275,6 +9302,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, - VIR_FREE(chassis); - VIR_FREE(port); - VIR_FREE(busNr); -+ VIR_FREE(targetIndex); - VIR_FREE(ioeventfd); - VIR_FREE(portsStr); - VIR_FREE(iothread); -@@ -21615,6 +21643,7 @@ virDomainControllerDefFormat(virBufferPtr buf, - def->opts.pciopts.chassis != -1 || - def->opts.pciopts.port != -1 || - def->opts.pciopts.busNr != -1 || -+ def->opts.pciopts.targetIndex != -1 || - def->opts.pciopts.numaNode != -1) - pciTarget = true; - break; -@@ -21655,6 +21684,9 @@ virDomainControllerDefFormat(virBufferPtr buf, - if (def->opts.pciopts.busNr != -1) - virBufferAsprintf(buf, " busNr='%d'", - def->opts.pciopts.busNr); -+ if (def->opts.pciopts.targetIndex != -1) -+ virBufferAsprintf(buf, " index='%d'", -+ def->opts.pciopts.targetIndex); - if (def->opts.pciopts.numaNode == -1) { - virBufferAddLit(buf, "/>\n"); - } else { -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index e287e6d7f3..50fdc6e2a6 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -786,6 +786,7 @@ struct _virDomainPCIControllerOpts { - int chassis; - int port; - int busNr; /* used by pci-expander-bus, -1 == unspecified */ -+ int targetIndex; /* used by spapr-pci-host-bridge, -1 == unspecified */ - /* numaNode is a *subelement* of target (to match existing - * item in memory target config) -1 == unspecified - */ --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Parse-and-format-virDomainChrSerialTargetModel.patch b/SOURCES/libvirt-conf-Parse-and-format-virDomainChrSerialTargetModel.patch new file mode 100644 index 0000000..560296f --- /dev/null +++ b/SOURCES/libvirt-conf-Parse-and-format-virDomainChrSerialTargetModel.patch @@ -0,0 +1,253 @@ +From f39b12fb966c2dfe7841a299f00ff5c6fa68095e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:07 +0100 +Subject: [PATCH] conf: Parse and format virDomainChrSerialTargetModel + +This information will be used to select, and store in the guest +configuration in order to guarantee ABI stability, the concrete +(hypervisor-specific) model for serial devices. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 5ad9d9afd4738ea716a6f820bbb53eecf5604a2f) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 16 ++++++++-- + docs/schemas/domaincommon.rng | 15 +++++++++ + src/conf/domain_conf.c | 72 ++++++++++++++++++++++++++++++++++++++++++- + src/conf/domain_conf.h | 12 ++++++++ + 4 files changed, 112 insertions(+), 3 deletions(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index f57a124056..cf1167b9c6 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -6447,7 +6447,9 @@ qemu-kvm -net nic,model=? /dev/null + <devices> + <!-- USB serial port --> + <serial type='pty'> +- <target type='usb-serial' port='0'/> ++ <target type='usb-serial' port='0'> ++ <model name='usb-serial'/> ++ </target> + <address type='usb' bus='0' port='1'/> + </serial> + </devices> +@@ -6463,6 +6465,16 @@ qemu-kvm -net nic,model=? /dev/null + is available). +

    + ++

    ++ Since 3.10.0, the target ++ element can have an optional model subelement; ++ valid values for its name attribute are: ++ isa-serial (usable with the isa-serial target ++ type); usb-serial (usable with the usb-serial ++ target type); pci-serial ++ (usable with the pci-serial target type). ++

    ++ +

    + If any of the attributes is not specified by the user, libvirt will + choose a value suitable for most users. +@@ -6489,7 +6501,7 @@ qemu-kvm -net nic,model=? /dev/null + <!-- Serial console --> + <console type='pty'> + <source path='/dev/pts/2'/> +- <target type='serial' port='0'/> ++ <target type='serial' port='0'/> + </console> + </devices> + ... +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 367861c1ea..3630e539e6 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -3575,6 +3575,18 @@ + + + ++ ++ ++ ++ ++ isa-serial ++ usb-serial ++ pci-serial ++ ++ ++ ++ ++ + + + +@@ -3589,6 +3601,9 @@ + + + ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 44d9bbe01d..692b9d9414 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -465,6 +465,14 @@ VIR_ENUM_IMPL(virDomainChrConsoleTarget, + "sclp", + "sclplm") + ++VIR_ENUM_IMPL(virDomainChrSerialTargetModel, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST, ++ "none", ++ "isa-serial", ++ "usb-serial", ++ "pci-serial", ++); ++ + VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, + "parallel", + "serial", +@@ -11530,14 +11538,42 @@ virDomainChrTargetTypeFromString(int devtype, + return ret; + } + ++static int ++virDomainChrTargetModelFromString(int devtype, ++ const char *targetModel) ++{ ++ int ret = -1; ++ ++ if (!targetModel) ++ return 0; ++ ++ switch ((virDomainChrDeviceType) devtype) { ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: ++ ret = virDomainChrSerialTargetModelTypeFromString(targetModel); ++ break; ++ ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: ++ /* Target model not supported yet */ ++ ret = 0; ++ break; ++ } ++ ++ return ret; ++} ++ + static int + virDomainChrDefParseTargetXML(virDomainChrDefPtr def, + xmlNodePtr cur, + unsigned int flags) + { + int ret = -1; ++ xmlNodePtr child; + unsigned int port; + char *targetType = virXMLPropString(cur, "type"); ++ char *targetModel = NULL; + char *addrStr = NULL; + char *portStr = NULL; + char *stateStr = NULL; +@@ -11551,6 +11587,24 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def, + goto error; + } + ++ child = cur->children; ++ while (child != NULL) { ++ if (child->type == XML_ELEMENT_NODE && ++ virXMLNodeNameEqual(child, "model")) { ++ targetModel = virXMLPropString(child, "name"); ++ } ++ child = child->next; ++ } ++ ++ if ((def->targetModel = ++ virDomainChrTargetModelFromString(def->deviceType, ++ targetModel)) < 0) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("unknown target model '%s' specified for character device"), ++ targetModel); ++ goto error; ++ } ++ + switch (def->deviceType) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + switch (def->targetType) { +@@ -11639,6 +11693,7 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def, + ret = 0; + error: + VIR_FREE(targetType); ++ VIR_FREE(targetModel); + VIR_FREE(addrStr); + VIR_FREE(portStr); + VIR_FREE(stateStr); +@@ -24019,8 +24074,23 @@ virDomainChrTargetDefFormat(virBufferPtr buf, + } + + virBufferAsprintf(buf, +- "port='%d'/>\n", ++ "port='%d'", + def->target.port); ++ ++ if (def->targetModel != VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE) { ++ virBufferAddLit(buf, ">\n"); ++ ++ virBufferAdjustIndent(buf, 2); ++ virBufferAsprintf(buf, ++ "\n", ++ virDomainChrSerialTargetModelTypeToString(def->targetModel)); ++ virBufferAdjustIndent(buf, -2); ++ ++ virBufferAddLit(buf, "\n"); ++ } else { ++ virBufferAddLit(buf, "/>\n"); ++ } ++ + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index bbb056cf21..9dfe9388cd 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1104,6 +1104,17 @@ typedef enum { + VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST + } virDomainChrConsoleTargetType; + ++typedef enum { ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, ++ ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST ++} virDomainChrSerialTargetModel; ++ ++VIR_ENUM_DECL(virDomainChrSerialTargetModel); ++ + typedef enum { + VIR_DOMAIN_CHR_TYPE_NULL, + VIR_DOMAIN_CHR_TYPE_VC, +@@ -1202,6 +1213,7 @@ struct _virDomainChrDef { + int targetType; /* enum virDomainChrConsoleTargetType || + enum virDomainChrChannelTargetType || + enum virDomainChrSerialTargetType according to deviceType */ ++ int targetModel; /* enum virDomainChrSerialTargetModel */ + + union { + int port; /* parallel, serial, console */ +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Pass-xmlopt-to-virDomainSnapshotDefFormat.patch b/SOURCES/libvirt-conf-Pass-xmlopt-to-virDomainSnapshotDefFormat.patch deleted file mode 100644 index d546c53..0000000 --- a/SOURCES/libvirt-conf-Pass-xmlopt-to-virDomainSnapshotDefFormat.patch +++ /dev/null @@ -1,251 +0,0 @@ -From 49f9421cddc176e39cbb062f26e80ec93341ef0d Mon Sep 17 00:00:00 2001 -Message-Id: <49f9421cddc176e39cbb062f26e80ec93341ef0d@dist-git> -From: Jiri Denemark -Date: Fri, 2 Jun 2017 00:27:33 +0200 -Subject: [PATCH] conf: Pass xmlopt to virDomainSnapshotDefFormat - -This will be used later when a save cookie will become part of the -snapshot XML using new driver specific parser/formatter functions. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 957cd268a98043fe061227a8e829c622a6fb4b86) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/conf/snapshot_conf.c | 1 + - src/conf/snapshot_conf.h | 1 + - src/esx/esx_driver.c | 2 +- - src/qemu/qemu_domain.c | 4 +++- - src/qemu/qemu_domain.h | 1 + - src/qemu/qemu_driver.c | 16 ++++++++++++---- - src/test/test_driver.c | 1 + - src/vbox/vbox_common.c | 4 ++-- - src/vz/vz_driver.c | 1 + - tests/domainsnapshotxml2xmltest.c | 1 + - 10 files changed, 24 insertions(+), 8 deletions(-) - -diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c -index 7daa9b22ad..e3bba985d7 100644 ---- a/src/conf/snapshot_conf.c -+++ b/src/conf/snapshot_conf.c -@@ -691,6 +691,7 @@ char * - virDomainSnapshotDefFormat(const char *domain_uuid, - virDomainSnapshotDefPtr def, - virCapsPtr caps, -+ virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED, - unsigned int flags, - int internal) - { -diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h -index da904f9460..2ce526fa6b 100644 ---- a/src/conf/snapshot_conf.h -+++ b/src/conf/snapshot_conf.h -@@ -114,6 +114,7 @@ void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def); - char *virDomainSnapshotDefFormat(const char *domain_uuid, - virDomainSnapshotDefPtr def, - virCapsPtr caps, -+ virDomainXMLOptionPtr xmlopt, - unsigned int flags, - int internal); - int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot, -diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c -index 166d4bcfcc..c4e1f58a0b 100644 ---- a/src/esx/esx_driver.c -+++ b/src/esx/esx_driver.c -@@ -4282,7 +4282,7 @@ esxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - - virUUIDFormat(snapshot->domain->uuid, uuid_string); - -- xml = virDomainSnapshotDefFormat(uuid_string, &def, priv->caps, -+ xml = virDomainSnapshotDefFormat(uuid_string, &def, priv->caps, priv->xmlopt, - virDomainDefFormatConvertXMLFlags(flags), - 0); - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 11be085801..09903bdd5f 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -4794,6 +4794,7 @@ int - qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, - virDomainSnapshotObjPtr snapshot, - virCapsPtr caps, -+ virDomainXMLOptionPtr xmlopt, - char *snapshotDir) - { - char *newxml = NULL; -@@ -4804,7 +4805,7 @@ qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, - - virUUIDFormat(vm->def->uuid, uuidstr); - newxml = virDomainSnapshotDefFormat( -- uuidstr, snapshot->def, caps, -+ uuidstr, snapshot->def, caps, xmlopt, - virDomainDefFormatConvertXMLFlags(QEMU_DOMAIN_FORMAT_LIVE_FLAGS), - 1); - if (newxml == NULL) -@@ -4965,6 +4966,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, - } else { - parentsnap->def->current = true; - if (qemuDomainSnapshotWriteMetadata(vm, parentsnap, driver->caps, -+ driver->xmlopt, - cfg->snapshotDir) < 0) { - VIR_WARN("failed to set parent snapshot '%s' as current", - snap->def->parent); -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 2994398a9e..4db92fac8a 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -557,6 +557,7 @@ const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver); - int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, - virDomainSnapshotObjPtr snapshot, - virCapsPtr caps, -+ virDomainXMLOptionPtr xmlopt, - char *snapshotDir); - - int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 354329fe64..2688c3eec7 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14650,7 +14650,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - if (update_current) { - vm->current_snapshot->def->current = false; - if (qemuDomainSnapshotWriteMetadata(vm, vm->current_snapshot, -- driver->caps, -+ driver->caps, driver->xmlopt, - cfg->snapshotDir) < 0) - goto endjob; - vm->current_snapshot = NULL; -@@ -14700,6 +14700,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, - endjob: - if (snapshot && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) { - if (qemuDomainSnapshotWriteMetadata(vm, snap, driver->caps, -+ driver->xmlopt, - cfg->snapshotDir) < 0) { - /* if writing of metadata fails, error out rather than trying - * to silently carry on without completing the snapshot */ -@@ -15037,7 +15038,8 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - - virUUIDFormat(snapshot->domain->uuid, uuidstr); - -- xml = virDomainSnapshotDefFormat(uuidstr, snap->def, driver->caps, -+ xml = virDomainSnapshotDefFormat(uuidstr, snap->def, -+ driver->caps, driver->xmlopt, - virDomainDefFormatConvertXMLFlags(flags), - 0); - -@@ -15219,7 +15221,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - if (vm->current_snapshot) { - vm->current_snapshot->def->current = false; - if (qemuDomainSnapshotWriteMetadata(vm, vm->current_snapshot, -- driver->caps, cfg->snapshotDir) < 0) -+ driver->caps, driver->xmlopt, -+ cfg->snapshotDir) < 0) - goto endjob; - vm->current_snapshot = NULL; - /* XXX Should we restore vm->current_snapshot after this point -@@ -15459,6 +15462,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - cleanup: - if (ret == 0) { - if (qemuDomainSnapshotWriteMetadata(vm, snap, driver->caps, -+ driver->xmlopt, - cfg->snapshotDir) < 0) - ret = -1; - else -@@ -15495,6 +15499,7 @@ struct _virQEMUSnapReparent { - virDomainSnapshotObjPtr parent; - virDomainObjPtr vm; - virCapsPtr caps; -+ virDomainXMLOptionPtr xmlopt; - int err; - virDomainSnapshotObjPtr last; - }; -@@ -15523,7 +15528,8 @@ qemuDomainSnapshotReparentChildren(void *payload, - if (!snap->sibling) - rep->last = snap; - -- rep->err = qemuDomainSnapshotWriteMetadata(rep->vm, snap, rep->caps, -+ rep->err = qemuDomainSnapshotWriteMetadata(rep->vm, snap, -+ rep->caps, rep->xmlopt, - rep->cfg->snapshotDir); - return 0; - } -@@ -15594,6 +15600,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, - if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) { - snap->def->current = true; - if (qemuDomainSnapshotWriteMetadata(vm, snap, driver->caps, -+ driver->xmlopt, - cfg->snapshotDir) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to set snapshot '%s' as current"), -@@ -15611,6 +15618,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, - rep.err = 0; - rep.last = NULL; - rep.caps = driver->caps; -+ rep.xmlopt = driver->xmlopt; - virDomainSnapshotForEachChild(snap, - qemuDomainSnapshotReparentChildren, - &rep); -diff --git a/src/test/test_driver.c b/src/test/test_driver.c -index 39df646260..c8085dd797 100644 ---- a/src/test/test_driver.c -+++ b/src/test/test_driver.c -@@ -6348,6 +6348,7 @@ testDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - virUUIDFormat(snapshot->domain->uuid, uuidstr); - - xml = virDomainSnapshotDefFormat(uuidstr, snap->def, privconn->caps, -+ privconn->xmlopt, - virDomainDefFormatConvertXMLFlags(flags), - 0); - -diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c -index dcc64b579c..c739031660 100644 ---- a/src/vbox/vbox_common.c -+++ b/src/vbox/vbox_common.c -@@ -5115,7 +5115,7 @@ vboxSnapshotRedefine(virDomainPtr dom, - VIR_FREE(currentSnapshotXmlFilePath); - if (virAsprintf(¤tSnapshotXmlFilePath, "%s%s.xml", machineLocationPath, snapshotMachineDesc->currentSnapshot) < 0) - goto cleanup; -- char *snapshotContent = virDomainSnapshotDefFormat(NULL, def, data->caps, VIR_DOMAIN_DEF_FORMAT_SECURE, 0); -+ char *snapshotContent = virDomainSnapshotDefFormat(NULL, def, data->caps, data->xmlopt, VIR_DOMAIN_DEF_FORMAT_SECURE, 0); - if (snapshotContent == NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to get snapshot content")); -@@ -6037,7 +6037,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, - - virUUIDFormat(dom->uuid, uuidstr); - memcpy(def->dom->uuid, dom->uuid, VIR_UUID_BUFLEN); -- ret = virDomainSnapshotDefFormat(uuidstr, def, data->caps, -+ ret = virDomainSnapshotDefFormat(uuidstr, def, data->caps, data->xmlopt, - virDomainDefFormatConvertXMLFlags(flags), - 0); - -diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c -index 26c4f48459..f0b6722a6e 100644 ---- a/src/vz/vz_driver.c -+++ b/src/vz/vz_driver.c -@@ -2309,6 +2309,7 @@ vzDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) - virUUIDFormat(snapshot->domain->uuid, uuidstr); - - xml = virDomainSnapshotDefFormat(uuidstr, snap->def, privconn->driver->caps, -+ privconn->driver->xmlopt, - virDomainDefFormatConvertXMLFlags(flags), - 0); - -diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c -index f5fec47520..df204f9f16 100644 ---- a/tests/domainsnapshotxml2xmltest.c -+++ b/tests/domainsnapshotxml2xmltest.c -@@ -101,6 +101,7 @@ testCompareXMLToXMLFiles(const char *inxml, - goto cleanup; - - if (!(actual = virDomainSnapshotDefFormat(uuid, def, driver.caps, -+ driver.xmlopt, - VIR_DOMAIN_DEF_FORMAT_SECURE, - internal))) - goto cleanup; --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Properly-parse-backingStore.patch b/SOURCES/libvirt-conf-Properly-parse-backingStore.patch new file mode 100644 index 0000000..5e9b08e --- /dev/null +++ b/SOURCES/libvirt-conf-Properly-parse-backingStore.patch @@ -0,0 +1,200 @@ +From fee89d5de8520422225dc06fa95cc2dad66d7ebe Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Mon, 13 Nov 2017 13:25:01 +0100 +Subject: [PATCH] conf: Properly parse + +The terminator would not be parsed properly since the XPath selector was +looking for an populated element, and also the code did not bother +assigning the terminating virStorageSourcePtr to the backingStore +property of the parent. + +Some tests would catch it if there wasn't bigger fallout from the change +to backing store termination in a693fdba0111. Fix them properly now. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509110 +(cherry picked from commit 19448a2561699807c075e071a45df292efd01f6b) +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 18 ++++++++---------- + ...base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 1 + + .../qemuxml2xmlout-disk-active-commit.xml | 1 + + .../qemuxml2xmlout-disk-backing-chains-active.xml | 3 +++ + .../qemuxml2xmlout-disk-mirror-active.xml | 4 ++++ + .../qemuxml2xmlout-disk-mirror-old.xml | 4 ++++ + .../qemuxml2xmlout-seclabel-static-labelskip.xml | 1 + + 7 files changed, 22 insertions(+), 10 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 27cfecffda..3b337d1a64 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -8539,16 +8539,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, + char *idx = NULL; + int ret = -1; + +- if (!(ctxt->node = virXPathNode("./backingStore[*]", ctxt))) { +- ret = 0; +- goto cleanup; +- } +- +- if (!(type = virXMLPropString(ctxt->node, "type"))) { +- /* terminator does not have a type */ +- if (VIR_ALLOC(backingStore) < 0) +- goto cleanup; +- ++ if (!(ctxt->node = virXPathNode("./backingStore", ctxt))) { + ret = 0; + goto cleanup; + } +@@ -8556,6 +8547,13 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, + if (VIR_ALLOC(backingStore) < 0) + goto cleanup; + ++ /* terminator does not have a type */ ++ if (!(type = virXMLPropString(ctxt->node, "type"))) { ++ VIR_STEAL_PTR(src->backingStore, backingStore); ++ ret = 0; ++ goto cleanup; ++ } ++ + if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && + (idx = virXMLPropString(ctxt->node, "index")) && + virStrToLong_uip(idx, NULL, 10, &backingStore->id) < 0) { +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml +index 9482b6794a..16caeb3542 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml +index 5766e4aea8..cc26af1096 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-active-commit.xml +@@ -20,6 +20,7 @@ + + + ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml +index 828defcc25..d1fd2442c3 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-backing-chains-active.xml +@@ -49,6 +49,7 @@ + + + ++ + + + +@@ -63,6 +64,7 @@ + + + ++ + +

    + +@@ -79,6 +81,7 @@ + + + ++ + + +
    +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml +index 252bde3389..c1e8a33ec1 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-active.xml +@@ -16,6 +16,7 @@ + /usr/bin/qemu-system-i686 + + ++ + + + +@@ -24,12 +25,14 @@ + + + ++ + + +
    + + + ++ + + + +@@ -39,6 +42,7 @@ + + + ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml +index f4bd39a580..e390bc02f2 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml +@@ -16,6 +16,7 @@ + /usr/bin/qemu-system-i686 + + ++ + + + +@@ -24,12 +25,14 @@ + + + ++ + + +
    + + + ++ + + + +@@ -39,6 +42,7 @@ + + + ++ + +
    + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml +index 91f573db7d..d37b950cbf 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-static-labelskip.xml +@@ -18,6 +18,7 @@ + + + ++ + +
    + +-- +2.15.0 + diff --git a/SOURCES/libvirt-conf-Refactor-virCPUDefParseXML.patch b/SOURCES/libvirt-conf-Refactor-virCPUDefParseXML.patch deleted file mode 100644 index eaa2ab7..0000000 --- a/SOURCES/libvirt-conf-Refactor-virCPUDefParseXML.patch +++ /dev/null @@ -1,413 +0,0 @@ -From 7bdac52dd6979f76f9a75a404a76e79f7da11a06 Mon Sep 17 00:00:00 2001 -Message-Id: <7bdac52dd6979f76f9a75a404a76e79f7da11a06@dist-git> -From: Jiri Denemark -Date: Tue, 23 May 2017 09:29:36 +0200 -Subject: [PATCH] conf: Refactor virCPUDefParseXML - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 702013f3b3ad8bd28c326058e2dd9ea8afbd1e61) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 109 +++++++++++++++++++++++++++---------------------- - src/conf/cpu_conf.h | 9 ++-- - src/conf/domain_conf.c | 12 +----- - src/cpu/cpu.c | 5 +-- - tests/cputest.c | 5 +-- - 5 files changed, 72 insertions(+), 68 deletions(-) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index ffb2e83d67..da40e9ba97 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -245,12 +245,25 @@ virCPUDefCopy(const virCPUDef *cpu) - } - - --virCPUDefPtr --virCPUDefParseXML(xmlNodePtr node, -- xmlXPathContextPtr ctxt, -- virCPUType type) -+/* -+ * Parses CPU definition XML from a node pointed to by @xpath. If @xpath is -+ * NULL, the current node of @ctxt is used (i.e., it is a shortcut to "."). -+ * -+ * Missing element in the XML document is not considered an error unless -+ * @xpath is NULL in which case the function expects it was provided with a -+ * valid element already. In other words, the function returns success -+ * and sets @cpu to NULL if @xpath is not NULL and the node pointed to by -+ * @xpath is not found. -+ * -+ * Returns 0 on success, -1 on error. -+ */ -+int -+virCPUDefParseXML(xmlXPathContextPtr ctxt, -+ const char *xpath, -+ virCPUType type, -+ virCPUDefPtr *cpu) - { -- virCPUDefPtr def; -+ virCPUDefPtr def = NULL; - xmlNodePtr *nodes = NULL; - xmlNodePtr oldnode = ctxt->node; - int n; -@@ -258,15 +271,23 @@ virCPUDefParseXML(xmlNodePtr node, - char *cpuMode; - char *fallback = NULL; - char *vendor_id = NULL; -+ int ret = -1; - -- if (!xmlStrEqual(node->name, BAD_CAST "cpu")) { -+ *cpu = NULL; -+ -+ if (xpath && !(ctxt->node = virXPathNode(xpath, ctxt))) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ if (!xmlStrEqual(ctxt->node->name, BAD_CAST "cpu")) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("XML does not contain expected 'cpu' element")); -- return NULL; -+ goto cleanup; - } - - if (VIR_ALLOC(def) < 0) -- return NULL; -+ goto cleanup; - - if (type == VIR_CPU_TYPE_AUTO) { - if (virXPathBoolean("boolean(./arch)", ctxt)) { -@@ -274,7 +295,7 @@ virCPUDefParseXML(xmlNodePtr node, - virReportError(VIR_ERR_XML_ERROR, "%s", - _("'arch' element cannot be used inside 'cpu'" - " element with 'match' attribute'")); -- goto error; -+ goto cleanup; - } - def->type = VIR_CPU_TYPE_HOST; - } else { -@@ -284,12 +305,12 @@ virCPUDefParseXML(xmlNodePtr node, - def->type = type; - } - -- if ((cpuMode = virXMLPropString(node, "mode"))) { -+ if ((cpuMode = virXMLPropString(ctxt->node, "mode"))) { - if (def->type == VIR_CPU_TYPE_HOST) { - VIR_FREE(cpuMode); - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Attribute mode is only allowed for guest CPU")); -- goto error; -+ goto cleanup; - } else { - def->mode = virCPUModeTypeFromString(cpuMode); - -@@ -298,7 +319,7 @@ virCPUDefParseXML(xmlNodePtr node, - _("Invalid mode attribute '%s'"), - cpuMode); - VIR_FREE(cpuMode); -- goto error; -+ goto cleanup; - } - VIR_FREE(cpuMode); - } -@@ -310,7 +331,7 @@ virCPUDefParseXML(xmlNodePtr node, - } - - if (def->type == VIR_CPU_TYPE_GUEST) { -- char *match = virXMLPropString(node, "match"); -+ char *match = virXMLPropString(ctxt->node, "match"); - char *check; - - if (!match) { -@@ -326,11 +347,11 @@ virCPUDefParseXML(xmlNodePtr node, - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Invalid match attribute for CPU " - "specification")); -- goto error; -+ goto cleanup; - } - } - -- if ((check = virXMLPropString(node, "check"))) { -+ if ((check = virXMLPropString(ctxt->node, "check"))) { - int value = virCPUCheckTypeFromString(check); - VIR_FREE(check); - -@@ -338,7 +359,7 @@ virCPUDefParseXML(xmlNodePtr node, - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Invalid check attribute for CPU " - "specification")); -- goto error; -+ goto cleanup; - } - def->check = value; - } -@@ -349,13 +370,13 @@ virCPUDefParseXML(xmlNodePtr node, - if (!arch) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Missing CPU architecture")); -- goto error; -+ goto cleanup; - } - if ((def->arch = virArchFromString(arch)) == VIR_ARCH_NONE) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unknown architecture %s"), arch); - VIR_FREE(arch); -- goto error; -+ goto cleanup; - } - VIR_FREE(arch); - } -@@ -364,7 +385,7 @@ virCPUDefParseXML(xmlNodePtr node, - def->type == VIR_CPU_TYPE_HOST) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Missing CPU model name")); -- goto error; -+ goto cleanup; - } - - if (def->type == VIR_CPU_TYPE_GUEST && -@@ -374,7 +395,7 @@ virCPUDefParseXML(xmlNodePtr node, - if ((def->fallback = virCPUFallbackTypeFromString(fallback)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Invalid fallback attribute")); -- goto error; -+ goto cleanup; - } - } - -@@ -384,14 +405,14 @@ virCPUDefParseXML(xmlNodePtr node, - virReportError(VIR_ERR_XML_ERROR, - _("vendor_id must be exactly %d characters long"), - VIR_CPU_VENDOR_ID_LENGTH); -- goto error; -+ goto cleanup; - } - - /* ensure that the string can be passed to qemu*/ - if (strchr(vendor_id, ',')) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("vendor id is invalid")); -- goto error; -+ goto cleanup; - } - - def->vendor_id = vendor_id; -@@ -403,61 +424,54 @@ virCPUDefParseXML(xmlNodePtr node, - if (def->vendor && !def->model) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("CPU vendor specified without CPU model")); -- goto error; -+ goto cleanup; - } - - if (virXPathNode("./topology[1]", ctxt)) { -- int ret; - unsigned long ul; - -- ret = virXPathULong("string(./topology[1]/@sockets)", -- ctxt, &ul); -- if (ret < 0) { -+ if (virXPathULong("string(./topology[1]/@sockets)", ctxt, &ul) < 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Missing 'sockets' attribute in CPU topology")); -- goto error; -+ goto cleanup; - } - def->sockets = (unsigned int) ul; - -- ret = virXPathULong("string(./topology[1]/@cores)", -- ctxt, &ul); -- if (ret < 0) { -+ if (virXPathULong("string(./topology[1]/@cores)", ctxt, &ul) < 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Missing 'cores' attribute in CPU topology")); -- goto error; -+ goto cleanup; - } - def->cores = (unsigned int) ul; - -- ret = virXPathULong("string(./topology[1]/@threads)", -- ctxt, &ul); -- if (ret < 0) { -+ if (virXPathULong("string(./topology[1]/@threads)", ctxt, &ul) < 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Missing 'threads' attribute in CPU topology")); -- goto error; -+ goto cleanup; - } - def->threads = (unsigned int) ul; - - if (!def->sockets || !def->cores || !def->threads) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Invalid CPU topology")); -- goto error; -+ goto cleanup; - } - } - - if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) < 0) -- goto error; -+ goto cleanup; - - if (n > 0) { - if (!def->model && def->mode == VIR_CPU_MODE_CUSTOM) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Non-empty feature list specified without " - "CPU model")); -- goto error; -+ goto cleanup; - } - - if (VIR_RESIZE_N(def->features, def->nfeatures_max, - def->nfeatures, n) < 0) -- goto error; -+ goto cleanup; - - def->nfeatures = n; - } -@@ -480,7 +494,7 @@ virCPUDefParseXML(xmlNodePtr node, - if (policy < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Invalid CPU feature policy")); -- goto error; -+ goto cleanup; - } - } else { - policy = -1; -@@ -490,7 +504,7 @@ virCPUDefParseXML(xmlNodePtr node, - VIR_FREE(name); - virReportError(VIR_ERR_XML_ERROR, "%s", - _("Invalid CPU feature name")); -- goto error; -+ goto cleanup; - } - - for (j = 0; j < i; j++) { -@@ -499,7 +513,7 @@ virCPUDefParseXML(xmlNodePtr node, - _("CPU feature '%s' specified more than once"), - name); - VIR_FREE(name); -- goto error; -+ goto cleanup; - } - } - -@@ -542,17 +556,16 @@ virCPUDefParseXML(xmlNodePtr node, - def->cache->mode = mode; - } - -+ VIR_STEAL_PTR(*cpu, def); -+ ret = 0; -+ - cleanup: - ctxt->node = oldnode; - VIR_FREE(fallback); - VIR_FREE(vendor_id); - VIR_FREE(nodes); -- return def; -- -- error: - virCPUDefFree(def); -- def = NULL; -- goto cleanup; -+ return ret; - } - - -diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h -index b0d891552a..b44974f47e 100644 ---- a/src/conf/cpu_conf.h -+++ b/src/conf/cpu_conf.h -@@ -182,10 +182,11 @@ virCPUDefCopy(const virCPUDef *cpu); - virCPUDefPtr - virCPUDefCopyWithoutModel(const virCPUDef *cpu); - --virCPUDefPtr --virCPUDefParseXML(xmlNodePtr node, -- xmlXPathContextPtr ctxt, -- virCPUType mode); -+int -+virCPUDefParseXML(xmlXPathContextPtr ctxt, -+ const char *xpath, -+ virCPUType mode, -+ virCPUDefPtr *cpu); - - bool - virCPUDefIsEqual(virCPUDefPtr src, -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 2197330a22..395dcc0531 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -17418,16 +17418,8 @@ virDomainDefParseXML(xmlDocPtr xml, - } - VIR_FREE(nodes); - -- /* analysis of cpu handling */ -- if ((node = virXPathNode("./cpu[1]", ctxt)) != NULL) { -- xmlNodePtr oldnode = ctxt->node; -- ctxt->node = node; -- def->cpu = virCPUDefParseXML(node, ctxt, VIR_CPU_TYPE_GUEST); -- ctxt->node = oldnode; -- -- if (def->cpu == NULL) -- goto error; -- } -+ if (virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, &def->cpu) < 0) -+ goto error; - - if (virDomainNumaDefCPUParseXML(def->numa, ctxt) < 0) - goto error; -diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c -index 702b14dbb7..96160901e1 100644 ---- a/src/cpu/cpu.c -+++ b/src/cpu/cpu.c -@@ -130,7 +130,7 @@ virCPUCompareXML(virArch arch, - if (!(doc = virXMLParseStringCtxt(xml, _("(CPU_definition)"), &ctxt))) - goto cleanup; - -- if (!(cpu = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_AUTO))) -+ if (virCPUDefParseXML(ctxt, NULL, VIR_CPU_TYPE_AUTO, &cpu) < 0) - goto cleanup; - - ret = virCPUCompare(arch, host, cpu, failIncompatible); -@@ -562,8 +562,7 @@ cpuBaselineXML(const char **xmlCPUs, - if (!(doc = virXMLParseStringCtxt(xmlCPUs[i], _("(CPU_definition)"), &ctxt))) - goto error; - -- cpus[i] = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_HOST); -- if (cpus[i] == NULL) -+ if (virCPUDefParseXML(ctxt, NULL, VIR_CPU_TYPE_HOST, &cpus[i]) < 0) - goto error; - - xmlXPathFreeContext(ctxt); -diff --git a/tests/cputest.c b/tests/cputest.c -index efa891dc18..97b34de9ed 100644 ---- a/tests/cputest.c -+++ b/tests/cputest.c -@@ -88,7 +88,7 @@ cpuTestLoadXML(virArch arch, const char *name) - if (!(doc = virXMLParseFileCtxt(xml, &ctxt))) - goto cleanup; - -- cpu = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_AUTO); -+ virCPUDefParseXML(ctxt, NULL, VIR_CPU_TYPE_AUTO, &cpu); - - cleanup: - xmlXPathFreeContext(ctxt); -@@ -126,8 +126,7 @@ cpuTestLoadMultiXML(virArch arch, - - for (i = 0; i < n; i++) { - ctxt->node = nodes[i]; -- cpus[i] = virCPUDefParseXML(nodes[i], ctxt, VIR_CPU_TYPE_HOST); -- if (!cpus[i]) -+ if (virCPUDefParseXML(ctxt, NULL, VIR_CPU_TYPE_HOST, &cpus[i]) < 0) - goto cleanup_cpus; - } - --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch b/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch new file mode 100644 index 0000000..c95b076 --- /dev/null +++ b/SOURCES/libvirt-conf-Remove-ATTRIBUTE_FALLTHROUGH-from-virDomainChrTargetDefFormat.patch @@ -0,0 +1,55 @@ +From d91de09fa0a626e200ac0db133a6af69a0706105 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:04 +0100 +Subject: [PATCH] conf: Remove ATTRIBUTE_FALLTHROUGH from + virDomainChrTargetDefFormat() + +Formatting the element for serial devices will become a +bit more complicated later on, and leaving the fallthrough behavior +there would do nothing but complicate it further. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 7983068fa50ea5222e62b24ea912a529994276f0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 2489705d6b..44d9bbe01d 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -24010,14 +24010,18 @@ virDomainChrTargetDefFormat(virBufferPtr buf, + return -1; + } + ++ virBufferAddLit(buf, "targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) { + virBufferAsprintf(buf, +- "\n", +- targetType, +- def->target.port); +- break; ++ "type='%s' ", ++ targetType); + } +- ATTRIBUTE_FALLTHROUGH; ++ ++ virBufferAsprintf(buf, ++ "port='%d'/>\n", ++ def->target.port); ++ break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + virBufferAsprintf(buf, "\n", +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Rename-mode-parameter-in-virCPUDefParseXML.patch b/SOURCES/libvirt-conf-Rename-mode-parameter-in-virCPUDefParseXML.patch deleted file mode 100644 index 1c46aaf..0000000 --- a/SOURCES/libvirt-conf-Rename-mode-parameter-in-virCPUDefParseXML.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 46761b7fdb0707036482c98eb3a80279753df484 Mon Sep 17 00:00:00 2001 -Message-Id: <46761b7fdb0707036482c98eb3a80279753df484@dist-git> -From: Jiri Denemark -Date: Mon, 24 Apr 2017 15:38:41 +0200 -Subject: [PATCH] conf: Rename mode parameter in virCPUDefParseXML - -The type of this parameter is virCPUType so calling it 'mode' is pretty -strange, 'type' is a much better name. - -Signed-off-by: Jiri Denemark -(cherry picked from commit e841a41169dd726af13f29cb57fbafe658b7011a) - -https://bugzilla.redhat.com/show_bug.cgi?id=1428952 - -Signed-off-by: Jiri Denemark ---- - src/conf/cpu_conf.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c -index b78531e60..623b1699f 100644 ---- a/src/conf/cpu_conf.c -+++ b/src/conf/cpu_conf.c -@@ -230,7 +230,7 @@ virCPUDefCopy(const virCPUDef *cpu) - virCPUDefPtr - virCPUDefParseXML(xmlNodePtr node, - xmlXPathContextPtr ctxt, -- virCPUType mode) -+ virCPUType type) - { - virCPUDefPtr def; - xmlNodePtr *nodes = NULL; -@@ -250,7 +250,7 @@ virCPUDefParseXML(xmlNodePtr node, - if (VIR_ALLOC(def) < 0) - return NULL; - -- if (mode == VIR_CPU_TYPE_AUTO) { -+ if (type == VIR_CPU_TYPE_AUTO) { - if (virXPathBoolean("boolean(./arch)", ctxt)) { - if (virXPathBoolean("boolean(./@match)", ctxt)) { - virReportError(VIR_ERR_XML_ERROR, "%s", -@@ -263,7 +263,7 @@ virCPUDefParseXML(xmlNodePtr node, - def->type = VIR_CPU_TYPE_GUEST; - } - } else { -- def->type = mode; -+ def->type = type; - } - - if ((cpuMode = virXMLPropString(node, "mode"))) { --- -2.12.2 - diff --git a/SOURCES/libvirt-conf-Resolve-corner-case-on-fc_host-deletion.patch b/SOURCES/libvirt-conf-Resolve-corner-case-on-fc_host-deletion.patch deleted file mode 100644 index b5bfc3e..0000000 --- a/SOURCES/libvirt-conf-Resolve-corner-case-on-fc_host-deletion.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 70c60798f09324a9e4d91f787cad493a1ceca5d9 Mon Sep 17 00:00:00 2001 -Message-Id: <70c60798f09324a9e4d91f787cad493a1ceca5d9@dist-git> -From: John Ferlan -Date: Wed, 24 May 2017 10:27:57 -0400 -Subject: [PATCH] conf: Resolve corner case on fc_host deletion - -https://bugzilla.redhat.com/show_bug.cgi?id=1420740 - -Testing found an inventive way to cause an error at shutdown by providing the -parent name for the fc host creation using the "same name" as the HBA. Since -the code thus assumed the parent host name provided was the parent HBA and -just extracted out the host number and sent that along to the vport_destroy -this avoided checks made for equality. - -So just add the equality check to that path to resolve. - -(cherry picked from commit 2c8e30ee7e287d6490f643ccd2d7653a834e75e5) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/conf/node_device_conf.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index ac61db34c..2d0b14850 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -2300,17 +2300,25 @@ virNodeDeviceDeleteVport(virConnectPtr conn, - goto cleanup; - } - -+ if (virAsprintf(&scsi_host_name, "scsi_%s", name) < 0) -+ goto cleanup; -+ - /* If at startup time we provided a parent, then use that to - * get the parent_host value; otherwise, we have to determine - * the parent scsi_host which we did not save at startup time - */ - if (fchost->parent) { -+ /* Someone provided a parent string at startup time that -+ * was the same as the scsi_host - meaning we have a pool -+ * backed to an HBA, so there won't be a vHBA to delete */ -+ if (STREQ(scsi_host_name, fchost->parent)) { -+ ret = 0; -+ goto cleanup; -+ } -+ - if (virSCSIHostGetNumber(fchost->parent, &parent_host) < 0) - goto cleanup; - } else { -- if (virAsprintf(&scsi_host_name, "scsi_%s", name) < 0) -- goto cleanup; -- - if (!(vhba_parent = virNodeDeviceGetParentName(conn, scsi_host_name))) - goto cleanup; - --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch b/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch new file mode 100644 index 0000000..baa288e --- /dev/null +++ b/SOURCES/libvirt-conf-Run-devicePostParse-again-for-the-first-serial-device.patch @@ -0,0 +1,60 @@ +From 0c9561ff6de749954395f562cbb8e3d12954566c Mon Sep 17 00:00:00 2001 +Message-Id: <0c9561ff6de749954395f562cbb8e3d12954566c@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:57 +0100 +Subject: [PATCH] conf: Run devicePostParse() again for the first serial device + +The devicePostParse() callback is invoked for all devices so that +drivers have a chance to set their own specific values; however, +virDomainDefAddImplicitDevices() runs *after* the devicePostParse() +callbacks have been invoked and can add new devices, in which case +the driver wouldn't have a chance to customize them. + +Work around the issue by invoking the devicePostParse() callback +after virDomainDefAddImplicitDevices(), only for the first serial +devices, which might have been added by it. The same was already +happening for the first video device for the very same reason. + +This will become important later on, when we will change +virDomainDefAddConsoleCompat() not to set a targetType for +automatically added serial devices. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 2628afc143224d38e6ef8c06a8fbec1d0f69fb86) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 4b5e7c214f..41674a85af 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -4948,6 +4948,18 @@ virDomainDefPostParseCommon(virDomainDefPtr def, + return -1; + } + ++ if (def->nserials != 0) { ++ virDomainDeviceDef device = { ++ .type = VIR_DOMAIN_DEVICE_CHR, ++ .data.chr = def->serials[0], ++ }; ++ ++ /* serials[0] might have been added in AddImplicitDevices, after we've ++ * done the per-device post-parse */ ++ if (virDomainDefPostParseDeviceIterator(def, &device, NULL, data) < 0) ++ return -1; ++ } ++ + /* clean up possibly duplicated metadata entries */ + virXMLNodeSanitizeNamespaces(def->metadata); + +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-Simplify-slot-allocation.patch b/SOURCES/libvirt-conf-Simplify-slot-allocation.patch deleted file mode 100644 index 9d214e6..0000000 --- a/SOURCES/libvirt-conf-Simplify-slot-allocation.patch +++ /dev/null @@ -1,136 +0,0 @@ -From af91509dfc59e90262117b96a2a365d5ece29393 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:03 +0200 -Subject: [PATCH] conf: Simplify slot allocation - -The current algorithm for slot allocation tries to be clever -and avoid looking at buses / slots more than once unless it's -necessary. Unfortunately that makes the code more complex, -and it will cause problem later on in some situations unless -even more complex code is added. - -Since the performance gains are going to be pretty modest -anyway, we can just get rid of the extra complexity and use a -completely straighforward implementation instead. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 2bd0658d7cc886209a53bae23c20adbb7d4f91ac) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_addr.c | 47 +++++++++-------------------------------------- - src/conf/domain_addr.h | 2 -- - 2 files changed, 9 insertions(+), 40 deletions(-) - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index b17bb61a1d..b8e5902c07 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -755,46 +755,34 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - virDomainPCIConnectFlags flags, - int function) - { -- /* default to starting the search for a free slot from -- * the first slot of domain 0 bus 0... -- */ - virPCIDeviceAddress a = { 0 }; -- bool found = false; - - if (addrs->nbuses == 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", _("No PCI buses available")); - goto error; - } - -- /* ...unless this search is for the exact same type of device as -- * last time, then continue the search from the slot where we -- * found the previous match (it's possible there will still be a -- * function available on that slot). -- */ -- if (flags == addrs->lastFlags) -- a = addrs->lastaddr; -- else -- a.slot = addrs->buses[0].minSlot; -- - /* if the caller asks for "any function", give them function 0 */ - if (function == -1) - a.function = 0; - else - a.function = function; - -- while (a.bus < addrs->nbuses) { -- if (virDomainPCIAddressFindUnusedFunctionOnBus(&addrs->buses[a.bus], -- &a, function, -+ /* "Begin at the beginning," the King said, very gravely, "and go on -+ * till you come to the end: then stop." */ -+ for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) { -+ virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus]; -+ bool found = false; -+ -+ a.slot = bus->minSlot; -+ -+ if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, - flags, &found) < 0) { - goto error; - } - - if (found) - goto success; -- -- /* nothing on this bus, go to the next bus */ -- if (++a.bus < addrs->nbuses) -- a.slot = addrs->buses[a.bus].minSlot; - } - - /* There were no free slots after the last used one */ -@@ -805,20 +793,6 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - /* this device will use the first slot of the new bus */ - a.slot = addrs->buses[a.bus].minSlot; - goto success; -- } else if (flags == addrs->lastFlags) { -- /* Check the buses from 0 up to the last used one */ -- for (a.bus = 0; a.bus <= addrs->lastaddr.bus; a.bus++) { -- a.slot = addrs->buses[a.bus].minSlot; -- -- if (virDomainPCIAddressFindUnusedFunctionOnBus(&addrs->buses[a.bus], -- &a, function, -- flags, &found) < 0) { -- goto error; -- } -- -- if (found) -- goto success; -- } - } - - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -865,9 +839,6 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, false) < 0) - return -1; - -- addrs->lastaddr = addr; -- addrs->lastFlags = flags; -- - if (!addrs->dryRun) { - dev->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; - dev->addr.pci = addr; -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index bb10f1abf3..a5afefda95 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -106,8 +106,6 @@ typedef virDomainPCIAddressBus *virDomainPCIAddressBusPtr; - struct _virDomainPCIAddressSet { - virDomainPCIAddressBus *buses; - size_t nbuses; -- virPCIDeviceAddress lastaddr; -- virDomainPCIConnectFlags lastFlags; - bool dryRun; /* on a dry run, new buses are auto-added - and addresses aren't saved in device infos */ - }; --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch b/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch new file mode 100644 index 0000000..571ab1d --- /dev/null +++ b/SOURCES/libvirt-conf-Sort-cache-banks-in-capabilities-XML.patch @@ -0,0 +1,67 @@ +From 6532e10f6ddec18ab70f58dc660062d369b82304 Mon Sep 17 00:00:00 2001 +Message-Id: <6532e10f6ddec18ab70f58dc660062d369b82304@dist-git> +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:17 +0100 +Subject: [PATCH] conf: Sort cache banks in capabilities XML + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Because the cache banks are initialized based on the order in which their +respective directories exist on the filesystem, they can appear in different +order. This is here mainly for tests because the cache directory might have +different order of children nodes and tests would fail otherwise. It should not +be the case with sysfs, but one can never be sure. And this does not take +almost any extra time, mainly because it gets initialized once per driver. + +Signed-off-by: Martin Kletzander +Reviewed-by: John Ferlan +(cherry picked from commit b4698edcb0a459332b24410f59698005af37eecb) +Signed-off-by: Martin Kletzander +--- + src/conf/capabilities.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c +index 9920a675ac..1f7d8cdb31 100644 +--- a/src/conf/capabilities.c ++++ b/src/conf/capabilities.c +@@ -1561,6 +1561,23 @@ virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr) + VIR_FREE(ptr); + } + ++ ++static int ++virCapsHostCacheBankSorter(const void *a, ++ const void *b) ++{ ++ virCapsHostCacheBankPtr ca = *(virCapsHostCacheBankPtr *)a; ++ virCapsHostCacheBankPtr cb = *(virCapsHostCacheBankPtr *)b; ++ ++ if (ca->level < cb->level) ++ return -1; ++ if (ca->level > cb->level) ++ return 1; ++ ++ return ca->id - cb->id; ++} ++ ++ + int + virCapabilitiesInitCaches(virCapsPtr caps) + { +@@ -1700,6 +1717,12 @@ virCapabilitiesInitCaches(virCapsPtr caps) + goto cleanup; + } + ++ /* Sort the array in order for the tests to be predictable. This way we can ++ * still traverse the directory instead of guessing names (in case there is ++ * 'index1' and 'index3' but no 'index2'). */ ++ qsort(caps->host.caches, caps->host.ncaches, ++ sizeof(*caps->host.caches), virCapsHostCacheBankSorter); ++ + ret = 0; + cleanup: + VIR_FREE(type); +-- +2.16.1 + diff --git a/SOURCES/libvirt-conf-Tweak-virDomainPCIAddressGetNextAddr-signature.patch b/SOURCES/libvirt-conf-Tweak-virDomainPCIAddressGetNextAddr-signature.patch deleted file mode 100644 index ebfcb3a..0000000 --- a/SOURCES/libvirt-conf-Tweak-virDomainPCIAddressGetNextAddr-signature.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 2d719331886e3f4ed927449ffde6a854e9deec1b Mon Sep 17 00:00:00 2001 -Message-Id: <2d719331886e3f4ed927449ffde6a854e9deec1b@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:08:59 +0200 -Subject: [PATCH] conf: Tweak virDomainPCIAddressGetNextAddr() signature - -Move @function after @flags to match other functions in the -same module like virDomainPCIAddressReserveNextAddr(). - -Also move virDomainPCIAddressReserveNextAddr() closer to -virDomainPCIAddressReserveAddr() in the header file. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit c949f6e69cbe91b9897e37e525181710f5c75b35) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_addr.c | 6 +++--- - src/conf/domain_addr.h | 12 ++++++------ - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index 0ae1ed93af..b17bb61a1d 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -752,8 +752,8 @@ virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus, - static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) - virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr next_addr, -- int function, -- virDomainPCIConnectFlags flags) -+ virDomainPCIConnectFlags flags, -+ int function) - { - /* default to starting the search for a free slot from - * the first slot of domain 0 bus 0... -@@ -859,7 +859,7 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - { - virPCIDeviceAddress addr; - -- if (virDomainPCIAddressGetNextAddr(addrs, &addr, function, flags) < 0) -+ if (virDomainPCIAddressGetNextAddr(addrs, &addr, flags, function) < 0) - return -1; - - if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, false) < 0) -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index c90a335919..bb10f1abf3 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -158,6 +158,12 @@ int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, - virDomainPCIConnectFlags flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - -+int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, -+ virDomainDeviceInfoPtr dev, -+ virDomainPCIConnectFlags flags, -+ int function) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -+ - int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, - virDomainPCIConnectFlags flags) -@@ -167,12 +173,6 @@ int virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - --int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, -- virDomainDeviceInfoPtr dev, -- virDomainPCIConnectFlags flags, -- int function) -- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -- - void virDomainPCIAddressSetAllMulti(virDomainDefPtr def) - ATTRIBUTE_NONNULL(1); - --- -2.13.3 - diff --git a/SOURCES/libvirt-conf-Use-the-correct-limit-for-the-number-of-PHBs.patch b/SOURCES/libvirt-conf-Use-the-correct-limit-for-the-number-of-PHBs.patch deleted file mode 100644 index 4ceca53..0000000 --- a/SOURCES/libvirt-conf-Use-the-correct-limit-for-the-number-of-PHBs.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e2bf7a17d464c989378278c3121425e7b90442e3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Mon, 21 Aug 2017 14:46:39 +0200 -Subject: [PATCH] conf: Use the correct limit for the number of PHBs - -I mistakenly thought pSeries guests supported 32 PHBs, -but it turns out they only support 31. Validate the -target index accordingly. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1479647 - -Signed-off-by: Andrea Bolognani -(cherry picked from commit 64357c3f9373127aa8bdf5a829df4a9d895e1ef9) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1479647 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 4 ++-- - .../qemuxml2argv-pseries-phb-invalid-target-index-3.xml | 6 +++--- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7889f5335c..3d38f668fa 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -5058,10 +5058,10 @@ virDomainControllerDefValidate(const virDomainControllerDef *controller) - /* Only validate the target index if it's been set */ - if (opts->targetIndex != -1) { - -- if (opts->targetIndex < 0 || opts->targetIndex > 31) { -+ if (opts->targetIndex < 0 || opts->targetIndex > 30) { - virReportError(VIR_ERR_XML_ERROR, - _("PCI controller target index '%d' out of " -- "range - must be 0-31"), -+ "range - must be 0-30"), - opts->targetIndex); - return -1; - } -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-invalid-target-index-3.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-invalid-target-index-3.xml -index 864c5d8758..3d99da4995 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-invalid-target-index-3.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-invalid-target-index-3.xml -@@ -8,10 +8,10 @@ - - - /usr/bin/qemu-system-ppc64 -- -+ - -- -+ - - - --- -2.14.1 - diff --git a/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch b/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch new file mode 100644 index 0000000..3121e3d --- /dev/null +++ b/SOURCES/libvirt-conf-Use-virResctrlInfo-in-capabilities.patch @@ -0,0 +1,131 @@ +From af86f99a7745f9d54c3f4e42f58130478e6aa9f5 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:26 +0100 +Subject: [PATCH] conf: Use virResctrlInfo in capabilities + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 3bbae43d8cc79ef1cd0b9a4ea2440203a0edc959) +Signed-off-by: Martin Kletzander +--- + src/conf/capabilities.c | 53 ++++++++++++++++++++++++------------------------- + src/conf/capabilities.h | 2 ++ + 2 files changed, 28 insertions(+), 27 deletions(-) + +diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c +index e93eaed2f0..edf9f54f77 100644 +--- a/src/conf/capabilities.c ++++ b/src/conf/capabilities.c +@@ -245,6 +245,7 @@ virCapabilitiesDispose(void *object) + VIR_FREE(caps->host.netprefix); + VIR_FREE(caps->host.pagesSize); + virCPUDefFree(caps->host.cpu); ++ virObjectUnref(caps->host.resctrl); + } + + /** +@@ -1592,6 +1593,20 @@ virCapsHostCacheBankSorter(const void *a, + } + + ++static int ++virCapabilitiesInitResctrl(virCapsPtr caps) ++{ ++ if (caps->host.resctrl) ++ return 0; ++ ++ caps->host.resctrl = virResctrlInfoNew(); ++ if (!caps->host.resctrl) ++ return -1; ++ ++ return virResctrlGetInfo(caps->host.resctrl); ++} ++ ++ + int + virCapabilitiesInitCaches(virCapsPtr caps) + { +@@ -1600,7 +1615,6 @@ virCapabilitiesInitCaches(virCapsPtr caps) + ssize_t pos = -1; + DIR *dirp = NULL; + int ret = -1; +- int typeret; + char *path = NULL; + char *type = NULL; + struct dirent *ent = NULL; +@@ -1611,6 +1625,9 @@ virCapabilitiesInitCaches(virCapsPtr caps) + * lose information. */ + const int cache_min_level = 3; + ++ if (virCapabilitiesInitResctrl(caps) < 0) ++ return -1; ++ + /* offline CPUs don't provide cache info */ + if (virFileReadValueBitmap(&cpus, "%s/cpu/online", SYSFS_SYSTEM_PATH) < 0) + return -1; +@@ -1676,32 +1693,6 @@ virCapabilitiesInitCaches(virCapsPtr caps) + SYSFS_SYSTEM_PATH, pos, ent->d_name) < 0) + goto cleanup; + +- typeret = virResctrlGetCacheControlType(bank->level); +- if (typeret < 0) +- goto cleanup; +- +- if (typeret == 1) { +- if (virResctrlGetCacheInfo(bank->level, +- bank->size, +- VIR_CACHE_TYPE_BOTH, +- &bank->controls, +- &bank->ncontrols) < 0) +- goto cleanup; +- } else if (typeret == 2) { +- if (virResctrlGetCacheInfo(bank->level, +- bank->size, +- VIR_CACHE_TYPE_CODE, +- &bank->controls, +- &bank->ncontrols) < 0) +- goto cleanup; +- if (virResctrlGetCacheInfo(bank->level, +- bank->size, +- VIR_CACHE_TYPE_DATA, +- &bank->controls, +- &bank->ncontrols) < 0) +- goto cleanup; +- } +- + kernel_type = virCacheKernelTypeFromString(type); + if (kernel_type < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, +@@ -1717,6 +1708,14 @@ virCapabilitiesInitCaches(virCapsPtr caps) + break; + } + if (i == caps->host.ncaches) { ++ /* If it is a new cache, then update its resctrl information. */ ++ if (virResctrlInfoGetCache(caps->host.resctrl, ++ bank->level, ++ bank->size, ++ &bank->ncontrols, ++ &bank->controls) < 0) ++ goto cleanup; ++ + if (VIR_APPEND_ELEMENT(caps->host.caches, + caps->host.ncaches, + bank) < 0) { +diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h +index 27b88cb5ed..694a3590bf 100644 +--- a/src/conf/capabilities.h ++++ b/src/conf/capabilities.h +@@ -170,6 +170,8 @@ struct _virCapsHost { + size_t nnumaCell_max; + virCapsHostNUMACellPtr *numaCell; + ++ virResctrlInfoPtr resctrl; ++ + size_t ncaches; + virCapsHostCacheBankPtr *caches; + +-- +2.16.1 + diff --git a/SOURCES/libvirt-conf-add-ABI-stability-checks-for-IOMMU-options.patch b/SOURCES/libvirt-conf-add-ABI-stability-checks-for-IOMMU-options.patch deleted file mode 100644 index c3c59ef..0000000 --- a/SOURCES/libvirt-conf-add-ABI-stability-checks-for-IOMMU-options.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 4383e358e2d8a85bd46936c997071c3b776fffd0 Mon Sep 17 00:00:00 2001 -Message-Id: <4383e358e2d8a85bd46936c997071c3b776fffd0@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:59 +0200 -Subject: [PATCH] conf: add ABI stability checks for IOMMU options -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit 935d927aa881753fff30f6236eedcf9680bca638) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7bf480f2a..370916396 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -19682,6 +19682,16 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, - } - } - -+ /* ioapic */ -+ if (src->ioapic != dst->ioapic) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("State of ioapic differs: " -+ "source: '%s', destination: '%s'"), -+ virDomainIOAPICTypeToString(src->ioapic), -+ virDomainIOAPICTypeToString(dst->ioapic)); -+ return false; -+ } -+ - return true; - } - -@@ -19821,6 +19831,22 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, - virDomainIOMMUModelTypeToString(src->model)); - return false; - } -+ if (src->intremap != dst->intremap) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain IOMMU device intremap value '%s' " -+ "does not match source '%s'"), -+ virTristateSwitchTypeToString(dst->intremap), -+ virTristateSwitchTypeToString(src->intremap)); -+ return false; -+ } -+ if (src->caching_mode != dst->caching_mode) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain IOMMU device caching mode '%s' " -+ "does not match source '%s'"), -+ virTristateSwitchTypeToString(dst->caching_mode), -+ virTristateSwitchTypeToString(src->caching_mode)); -+ return false; -+ } - return true; - } - --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch b/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch new file mode 100644 index 0000000..a1b7f82 --- /dev/null +++ b/SOURCES/libvirt-conf-add-VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP.patch @@ -0,0 +1,605 @@ +From f93cc7753900a7ff80a32dae2fd3337939909b86 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pino Toscano +Date: Wed, 29 Nov 2017 16:23:15 +0100 +Subject: [PATCH] conf: add VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP + +Introduce specific a target types with two models for the console +devices (sclp and sclplm) used in s390 and s390x guests, so isa-serial +is no more used for them. + +This makes usable on s390 and s390x guests, with at most only +a single sclpconsole and one sclplmconsole devices usable in a single +guest (due to limitations in QEMU, which will enforce already at +runtime). + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1449265 + +Signed-off-by: Pino Toscano +Reviewed-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 21332bf6587c23409fecb06ab81dbc14dd52c10b) +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 19 ++++++++---- + docs/schemas/domaincommon.rng | 3 ++ + src/conf/domain_conf.c | 4 +++ + src/conf/domain_conf.h | 3 ++ + src/qemu/qemu_command.c | 6 ++++ + src/qemu/qemu_domain.c | 20 +++++++++++++ + src/qemu/qemu_domain_address.c | 1 + + .../qemuxml2argv-s390-serial-2.args | 24 +++++++++++++++ + .../qemuxml2argv-s390-serial-2.xml | 19 ++++++++++++ + .../qemuxml2argv-s390-serial-console.args | 25 ++++++++++++++++ + .../qemuxml2argv-s390-serial-console.xml | 15 ++++++++++ + .../qemuxml2argvdata/qemuxml2argv-s390-serial.args | 22 ++++++++++++++ + .../qemuxml2argvdata/qemuxml2argv-s390-serial.xml | 14 +++++++++ + tests/qemuxml2argvtest.c | 16 ++++++++++ + .../qemuxml2xmlout-s390-serial-2.xml | 33 +++++++++++++++++++++ + .../qemuxml2xmlout-s390-serial-console.xml | 34 ++++++++++++++++++++++ + .../qemuxml2xmlout-s390-serial.xml | 28 ++++++++++++++++++ + tests/qemuxml2xmltest.c | 6 ++++ + 18 files changed, 286 insertions(+), 6 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 87389f4e73..62dd6e1ec4 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -6463,8 +6463,9 @@ qemu-kvm -net nic,model=? /dev/null + with x86 guests), usb-serial (usable whenever USB support + is available) and pci-serial (usable whenever PCI support + is available); since 3.10.0, +- spapr-vio-serial (usable with ppc64/pseries guests) and +- system-serial (usable with aarch64/virt guests) are ++ spapr-vio-serial (usable with ppc64/pseries guests), ++ system-serial (usable with aarch64/virt guests) and ++ sclp-serial (usable with s390 and s390x guests) are + available as well. +

    + +@@ -6478,7 +6479,9 @@ qemu-kvm -net nic,model=? /dev/null + (usable with the pci-serial target type); + spapr-vty (usable with the spapr-vio-serial + target type); pl011 (usable with the +- system-serial target type). ++ system-serial target type); sclpconsole and ++ sclplmconsole (usable with the sclp-serial ++ target type). +

    + +

    +@@ -6493,7 +6496,8 @@ qemu-kvm -net nic,model=? /dev/null + isa-serial), usb (for usb-serial), + pci (for pci-serial) and spapr-vio + (for spapr-vio-serial). The system-serial +- target type doesn't support specifying an address. ++ and sclp-serial target types don't support specifying an ++ address. +

    + +

    +@@ -6541,8 +6545,11 @@ qemu-kvm -net nic,model=? /dev/null + virtio (usable whenever VirtIO support is available); + xen, lxc, uml and + openvz (available when the corresponding hypervisor is in +- use); sclp and sclplm (usable for s390 and +- s390x QEMU guests). ++ use). sclp and sclplm (usable for s390 and ++ s390x QEMU guests) are supported for compatibility reasons but should ++ not be used for new guests: use the sclpconsole and ++ sclplmconsole target models, respectively, with the ++ serial element instead. +

    + +

    +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 957eae2832..5576128db5 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -3573,6 +3573,7 @@ + pci-serial + spapr-vio-serial + system-serial ++ sclp-serial + + + +@@ -3586,6 +3587,8 @@ + pci-serial + spapr-vty + pl011 ++ sclpconsole ++ sclplmconsole + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 32089df3c2..c58dae197c 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -447,6 +447,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, + "pci-serial", + "spapr-vio-serial", + "system-serial", ++ "sclp-serial", + ); + + VIR_ENUM_IMPL(virDomainChrChannelTarget, +@@ -476,6 +477,8 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, + "pci-serial", + "spapr-vty", + "pl011", ++ "sclpconsole", ++ "sclplmconsole", + ); + + VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST, +@@ -4066,6 +4069,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: { + + /* Create a stub console to match the serial port. +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index d6febf3059..0e97f0437e 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1079,6 +1079,7 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP, + + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST + } virDomainChrSerialTargetType; +@@ -1113,6 +1114,8 @@ typedef enum { + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE, ++ VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE, + + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST + } virDomainChrSerialTargetModel; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 483eee6056..a2cfb3d4a3 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9229,6 +9229,10 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) + return QEMU_CAPS_DEVICE_PCI_SERIAL; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + return QEMU_CAPS_DEVICE_SPAPR_VTY; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: ++ return QEMU_CAPS_DEVICE_SCLPCONSOLE; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: ++ return QEMU_CAPS_DEVICE_SCLPLMCONSOLE; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: +@@ -10355,6 +10359,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + + caps = qemuChrSerialTargetModelToCaps(serial->targetModel); + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 2fc173fa45..91c0e163e1 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3469,6 +3469,7 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType) + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + break; +@@ -3492,6 +3493,9 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel) + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + break; +@@ -3529,6 +3533,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target type '%s' cannot have an " +@@ -3550,6 +3555,8 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr) + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + + expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel); + +@@ -3612,6 +3619,13 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, + isCompatible = false; + } + ++ if (!ARCH_IS_S390(def->os.arch) && ++ (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP || ++ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE || ++ dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE)) { ++ isCompatible = false; ++ } ++ + if (!isCompatible) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Serial device with target type '%s' and " +@@ -4265,6 +4279,8 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO; + } else if (qemuDomainIsVirt(def)) { + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; ++ } else if (ARCH_IS_S390(def->os.arch)) { ++ chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + } + } + +@@ -4287,6 +4303,9 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: + chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011; + break; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: ++ chr->targetModel = VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE; ++ break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ +@@ -5210,6 +5229,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + /* Nothing to do */ +diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c +index db9656a3a5..a40cdb3993 100644 +--- a/src/qemu/qemu_domain_address.c ++++ b/src/qemu/qemu_domain_address.c +@@ -785,6 +785,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + return 0; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args +new file mode 100644 +index 0000000000..346dcd16bb +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.args +@@ -0,0 +1,24 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-s390x \ ++-name QEMUGuest1 \ ++-S \ ++-M s390-ccw-virtio \ ++-m 214 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-chardev pty,id=charserial0 \ ++-device sclpconsole,chardev=charserial0,id=serial0 \ ++-chardev pty,id=charserial1 \ ++-device sclplmconsole,chardev=charserial1,id=serial1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml +new file mode 100644 +index 0000000000..b6eb377c98 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-2.xml +@@ -0,0 +1,19 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args +new file mode 100644 +index 0000000000..c405fb59ee +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args +@@ -0,0 +1,25 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-s390x \ ++-name QEMUGuest1 \ ++-S \ ++-M s390-ccw-virtio \ ++-m 214 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ ++-chardev pty,id=charserial0 \ ++-device sclpconsole,chardev=charserial0,id=serial0 \ ++-chardev pty,id=charconsole1 \ ++-device virtconsole,chardev=charconsole1,id=console1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml +new file mode 100644 +index 0000000000..c841f1f245 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.xml +@@ -0,0 +1,15 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args +new file mode 100644 +index 0000000000..20968f7945 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.args +@@ -0,0 +1,22 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-s390x \ ++-name QEMUGuest1 \ ++-S \ ++-M s390-ccw-virtio \ ++-m 214 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-chardev pty,id=charserial0 \ ++-device sclpconsole,chardev=charserial0,id=serial0 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml +new file mode 100644 +index 0000000000..55b45bac00 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial.xml +@@ -0,0 +1,14 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 656b8c0995..852525e7b4 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -2049,6 +2049,22 @@ mymain(void) + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, + QEMU_CAPS_VIRTIO_S390); ++ DO_TEST("s390-serial", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_VIRTIO_CCW, ++ QEMU_CAPS_VIRTIO_S390, ++ QEMU_CAPS_DEVICE_SCLPCONSOLE); ++ DO_TEST("s390-serial-2", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_VIRTIO_CCW, ++ QEMU_CAPS_VIRTIO_S390, ++ QEMU_CAPS_DEVICE_SCLPCONSOLE, ++ QEMU_CAPS_DEVICE_SCLPLMCONSOLE); ++ DO_TEST("s390-serial-console", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_VIRTIO_CCW, ++ QEMU_CAPS_VIRTIO_S390, ++ QEMU_CAPS_DEVICE_SCLPCONSOLE); + + DO_TEST("ppc-dtb", + QEMU_CAPS_KVM, +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml +new file mode 100644 +index 0000000000..bb9ca30f1d +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-2.xml +@@ -0,0 +1,33 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml +new file mode 100644 +index 0000000000..db3023b7a6 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml +@@ -0,0 +1,34 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-s390x ++ ++

    ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml +new file mode 100644 +index 0000000000..9c9b4dd27a +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial.xml +@@ -0,0 +1,28 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-s390x ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index bd18507bb6..8766646738 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -1155,6 +1155,12 @@ mymain(void) + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-panic-no-address", + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); ++ DO_TEST("s390-serial", ++ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); ++ DO_TEST("s390-serial-2", ++ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); ++ DO_TEST("s390-serial-console", ++ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + + DO_TEST("pcihole64", NONE); + DO_TEST("pcihole64-gib", NONE); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-add-a-new-parse-flag-VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION.patch b/SOURCES/libvirt-conf-add-a-new-parse-flag-VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION.patch deleted file mode 100644 index 6ce10e4..0000000 --- a/SOURCES/libvirt-conf-add-a-new-parse-flag-VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION.patch +++ /dev/null @@ -1,72 +0,0 @@ -From b24b004e1196889201142d1fc7d51e2fafdbe328 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Thu, 20 Apr 2017 09:16:20 +0200 -Subject: [PATCH] conf: add a new parse flag - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION - -So far there is probably no change that is allowed to be done -by the VIR_DOMAIN_DEF_PARSE_ABI_UPDATE flag that would break -guest ABI but this may change in the future. - -This introduces new VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION -which should be used only for ABI updates that are "safe" for -persistent migration. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 5c7d88085a762cf4ecc9416a3b7581fa45738c2a) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373184 - -Signed-off-by: Pavel Hrdina ---- - src/conf/domain_conf.c | 3 ++- - src/conf/domain_conf.h | 4 ++++ - src/qemu/qemu_migration_cookie.c | 2 +- - 3 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 1b0a55b27..71f0c95c3 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -3805,7 +3805,8 @@ virDomainDefPostParseMemory(virDomainDefPtr def, - /* Attempt to infer the initial memory size from the sum NUMA memory sizes - * in case ABI updates are allowed or the element wasn't specified */ - if (def->mem.total_memory == 0 || -- parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) -+ parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE || -+ parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION) - numaMemory = virDomainNumaGetMemorySize(def->numa); - - /* calculate the sizes of hotplug memory */ -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 47eaacef3..71e651975 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2725,6 +2725,10 @@ typedef enum { - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10, - /* skip parsing of security labels */ - VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 11, -+ /* Allows updates in post parse callback for incoming persistent migration -+ * that would break ABI otherwise. This should be used only if it's safe -+ * to do such change. */ -+ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 12, - } virDomainDefParseFlags; - - typedef enum { -diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c -index bd12f1124..12887892d 100644 ---- a/src/qemu/qemu_migration_cookie.c -+++ b/src/qemu/qemu_migration_cookie.c -@@ -1173,7 +1173,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, - mig->persistent = virDomainDefParseNode(doc, nodes[0], - caps, driver->xmlopt, NULL, - VIR_DOMAIN_DEF_PARSE_INACTIVE | -- VIR_DOMAIN_DEF_PARSE_ABI_UPDATE | -+ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE); - if (!mig->persistent) { - /* virDomainDefParseNode already reported --- -2.12.2 - diff --git a/SOURCES/libvirt-conf-add-caching_mode-attribute-to-iommu-device.patch b/SOURCES/libvirt-conf-add-caching_mode-attribute-to-iommu-device.patch deleted file mode 100644 index 5e209b4..0000000 --- a/SOURCES/libvirt-conf-add-caching_mode-attribute-to-iommu-device.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 3b7b827deb9eb7f43f548aabd27c300ae24c7db3 Mon Sep 17 00:00:00 2001 -Message-Id: <3b7b827deb9eb7f43f548aabd27c300ae24c7db3@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:56 +0200 -Subject: [PATCH] conf: add caching_mode attribute to iommu device -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a new attribute to control the caching mode. - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit d12781b47eb0c9f3a498d88b632c327aa08aaf8a) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 9 ++++ - docs/schemas/domaincommon.rng | 5 +++ - src/conf/domain_conf.c | 24 +++++++++-- - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-intel-iommu-caching-mode.xml | 50 ++++++++++++++++++++++ - .../qemuxml2xmlout-intel-iommu-caching-mode.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 7 files changed, 88 insertions(+), 3 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 41b8bfb50..43a75c1ee 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -7424,6 +7424,15 @@ qemu-kvm -net nic,model=? /dev/null - Since 3.4.0 (QEMU/KVM only) -

    - -+
    caching_mode
    -+
    -+

    -+ The caching_mode attribute with possible values -+ on and off can be used to -+ turn on the VT-d caching mode (useful for assigned devices). -+ Since 3.4.0 (QEMU/KVM only) -+

    -+
    - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index a400d961b..12ccbd4e2 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3900,6 +3900,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 45473f65b..e77b542f3 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -14167,6 +14167,15 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, - iommu->intremap = val; - } - -+ VIR_FREE(tmp); -+ if ((tmp = virXPathString("string(./driver/@caching_mode)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(tmp)) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, _("unknown caching_mode value: %s"), tmp); -+ goto cleanup; -+ } -+ iommu->caching_mode = val; -+ } -+ - ret = iommu; - iommu = NULL; - -@@ -24114,9 +24123,18 @@ virDomainIOMMUDefFormat(virBufferPtr buf, - - virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2); - -- if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT) { -- virBufferAsprintf(&childBuf, "\n", -- virTristateSwitchTypeToString(iommu->intremap)); -+ if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || -+ iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAddLit(&childBuf, "intremap != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&childBuf, " intremap='%s'", -+ virTristateSwitchTypeToString(iommu->intremap)); -+ } -+ if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&childBuf, " caching_mode='%s'", -+ virTristateSwitchTypeToString(iommu->caching_mode)); -+ } -+ virBufferAddLit(&childBuf, "/>\n"); - } - - virBufferAsprintf(buf, " -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+
    -+ -+ -+ -+ -+
    -+ -+ -+ -+ -+
    -+ -+ -+
    -+ -+ -+
    -+ -+ -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.xml -new file mode 120000 -index 000000000..d971a35dc ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-caching-mode.xml -@@ -0,0 +1 @@ -+../qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 0482ad9cb..e1938421a 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -1129,6 +1129,7 @@ mymain(void) - QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACHINE_IOMMU); - DO_TEST("intel-iommu-ioapic", NONE); -+ DO_TEST("intel-iommu-caching-mode", NONE); - - DO_TEST("cpu-check-none", NONE); - DO_TEST("cpu-check-partial", NONE); --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-add-driver-intremap-to-iommu.patch b/SOURCES/libvirt-conf-add-driver-intremap-to-iommu.patch deleted file mode 100644 index 8bd9e7f..0000000 --- a/SOURCES/libvirt-conf-add-driver-intremap-to-iommu.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 2bb15d3f041ec2506012aa701547334af429b915 Mon Sep 17 00:00:00 2001 -Message-Id: <2bb15d3f041ec2506012aa701547334af429b915@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:54 +0200 -Subject: [PATCH] conf: add to -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a new attribute to control interrupt remapping. - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit 2020e2c6f2656ca1aa9032859ccde76185c37c39) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 24 +++++++++++++- - docs/schemas/domaincommon.rng | 9 +++++ - src/conf/domain_conf.c | 38 +++++++++++++++++++--- - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-intel-iommu-ioapic.xml | 4 ++- - 5 files changed, 70 insertions(+), 6 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 869c1f73e..41b8bfb50 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -7393,7 +7393,9 @@ qemu-kvm -net nic,model=? /dev/null -
    - ...
    - <devices>
    --  <iommu model='intel'/>
    -+  <iommu model='intel'>
    -+    <driver intremap='on'/>
    -+  </iommu>
    - </devices>
    - ...
    - 
    -@@ -7404,6 +7406,26 @@ qemu-kvm -net nic,model=? /dev/null - Currently only the intel model is supported. -

    - -+
    driver
    -+
    -+

    -+ The driver subelement can be used to configure -+ additional options: -+

    -+
    -+
    intremap
    -+
    -+

    -+ The intremap attribute with possible values -+ on and off can be used to -+ turn on interrupt remapping, a part of the VT-d functionality. -+ Currently this requires split I/O APIC -+ (<ioapic driver='qemu'/>). -+ Since 3.4.0 (QEMU/KVM only) -+

    -+
    -+
    -+
    - - -

    Security label

    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index c72ba7e97..a400d961b 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3893,6 +3893,15 @@ - - intel - -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index d5c4f6ddd..45473f65b 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -14132,12 +14132,16 @@ virDomainMemoryDefParseXML(xmlNodePtr memdevNode, - - - static virDomainIOMMUDefPtr --virDomainIOMMUDefParseXML(xmlNodePtr node) -+virDomainIOMMUDefParseXML(xmlNodePtr node, -+ xmlXPathContextPtr ctxt) - { - virDomainIOMMUDefPtr iommu = NULL, ret = NULL; -+ xmlNodePtr save = ctxt->node; - char *tmp = NULL; - int val; - -+ ctxt->node = node; -+ - if (VIR_ALLOC(iommu) < 0) - goto cleanup; - -@@ -14154,10 +14158,20 @@ virDomainIOMMUDefParseXML(xmlNodePtr node) - - iommu->model = val; - -+ VIR_FREE(tmp); -+ if ((tmp = virXPathString("string(./driver/@intremap)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(tmp)) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, _("unknown intremap value: %s"), tmp); -+ goto cleanup; -+ } -+ iommu->intremap = val; -+ } -+ - ret = iommu; - iommu = NULL; - - cleanup: -+ ctxt->node = save; - VIR_FREE(iommu); - VIR_FREE(tmp); - return ret; -@@ -14310,7 +14324,7 @@ virDomainDeviceDefParse(const char *xmlStr, - goto error; - break; - case VIR_DOMAIN_DEVICE_IOMMU: -- if (!(dev->data.iommu = virDomainIOMMUDefParseXML(node))) -+ if (!(dev->data.iommu = virDomainIOMMUDefParseXML(node, ctxt))) - goto error; - break; - case VIR_DOMAIN_DEVICE_NONE: -@@ -18440,7 +18454,7 @@ virDomainDefParseXML(xmlDocPtr xml, - } - - if (n > 0) { -- if (!(def->iommu = virDomainIOMMUDefParseXML(nodes[0]))) -+ if (!(def->iommu = virDomainIOMMUDefParseXML(nodes[0], ctxt))) - goto error; - } - VIR_FREE(nodes); -@@ -24096,8 +24110,24 @@ static void - virDomainIOMMUDefFormat(virBufferPtr buf, - const virDomainIOMMUDef *iommu) - { -- virBufferAsprintf(buf, "\n", -+ virBuffer childBuf = VIR_BUFFER_INITIALIZER; -+ -+ virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2); -+ -+ if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&childBuf, "\n", -+ virTristateSwitchTypeToString(iommu->intremap)); -+ } -+ -+ virBufferAsprintf(buf, "model)); -+ if (virBufferUse(&childBuf)) { -+ virBufferAddLit(buf, ">\n"); -+ virBufferAddBuffer(buf, &childBuf); -+ virBufferAddLit(buf, "\n"); -+ } else { -+ virBufferAddLit(buf, "/>\n"); -+ } - } - - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 4cb37b1fc..8eb422a57 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2209,6 +2209,7 @@ typedef enum { - - struct _virDomainIOMMUDef { - virDomainIOMMUModel model; -+ virTristateSwitch intremap; - }; - /* - * Guest VM main configuration -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -index 284d63a30..bfe714ad8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -@@ -24,6 +24,8 @@ - - - -- -+ -+ -+ - - --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-add-eim-attribute-to-iommu-driver.patch b/SOURCES/libvirt-conf-add-eim-attribute-to-iommu-driver.patch deleted file mode 100644 index 8297928..0000000 --- a/SOURCES/libvirt-conf-add-eim-attribute-to-iommu-driver.patch +++ /dev/null @@ -1,191 +0,0 @@ -From d7a019948e1c1f0400ee174ef60bf0cb32d181f9 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 26 May 2017 08:52:56 +0200 -Subject: [PATCH] conf: add eim attribute to -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add an attribute to control extended interrupt mode. - -https://bugzilla.redhat.com/show_bug.cgi?id=1451282 - -Reviewed-by: Andrea Bolognani -(cherry picked from commit dc61d927589b2b122868e6abea86b73caa682226) - -Signed-off-by: Ján Tomko - -Also: -https://bugzilla.redhat.com/show_bug.cgi?id=1289153 -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 13 +++++++++ - docs/schemas/domaincommon.rng | 5 ++++ - src/conf/domain_conf.c | 21 +++++++++++++++ - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-intel-iommu-eim.xml | 31 ++++++++++++++++++++++ - .../qemuxml2xmlout-intel-iommu-eim.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 7 files changed, 73 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 43a75c1ee..e886e4e17 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -7433,6 +7433,19 @@ qemu-kvm -net nic,model=? /dev/null - Since 3.4.0 (QEMU/KVM only) -

    - -+
    eim
    -+
    -+

    -+ The eim attribute (with possible values -+ on and off) can be used to -+ configure Extended Interrupt Mode. A q35 domain with -+ split I/O APIC (as described in -+ hypervisor features), -+ and both interrupt remapping and EIM turned on for -+ the IOMMU, will be able to use more than 255 vCPUs. -+ Since 3.4.0 (QEMU/KVM only) -+

    -+
    - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 12ccbd4e2..af7824aa0 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3905,6 +3905,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 370916396..4404b8f73 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -14176,6 +14176,15 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, - iommu->caching_mode = val; - } - -+ VIR_FREE(tmp); -+ if ((tmp = virXPathString("string(./driver/@eim)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(tmp)) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, _("unknown eim value: %s"), tmp); -+ goto cleanup; -+ } -+ iommu->eim = val; -+ } -+ - ret = iommu; - iommu = NULL; - -@@ -19847,6 +19856,14 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, - virTristateSwitchTypeToString(src->caching_mode)); - return false; - } -+ if (src->eim != dst->eim) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain IOMMU device eim value '%s' " -+ "does not match source '%s'"), -+ virTristateSwitchTypeToString(dst->eim), -+ virTristateSwitchTypeToString(src->eim)); -+ return false; -+ } - return true; - } - -@@ -24170,6 +24187,10 @@ virDomainIOMMUDefFormat(virBufferPtr buf, - virBufferAsprintf(&childBuf, " caching_mode='%s'", - virTristateSwitchTypeToString(iommu->caching_mode)); - } -+ if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&childBuf, " eim='%s'", -+ virTristateSwitchTypeToString(iommu->eim)); -+ } - virBufferAddLit(&childBuf, "/>\n"); - } - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 825158a7d..980aafa66 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2211,6 +2211,7 @@ struct _virDomainIOMMUDef { - virDomainIOMMUModel model; - virTristateSwitch intremap; - virTristateSwitch caching_mode; -+ virTristateSwitch eim; - }; - /* - * Guest VM main configuration -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml -new file mode 100644 -index 000000000..8642ed349 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml -@@ -0,0 +1,31 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 288 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml -new file mode 120000 -index 000000000..9fbec36dc ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-eim.xml -@@ -0,0 +1 @@ -+../qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index e1938421a..6283da409 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -1130,6 +1130,7 @@ mymain(void) - QEMU_CAPS_MACHINE_IOMMU); - DO_TEST("intel-iommu-ioapic", NONE); - DO_TEST("intel-iommu-caching-mode", NONE); -+ DO_TEST("intel-iommu-eim", NONE); - - DO_TEST("cpu-check-none", NONE); - DO_TEST("cpu-check-partial", NONE); --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-add-ioapic-driver-to-features.patch b/SOURCES/libvirt-conf-add-ioapic-driver-to-features.patch deleted file mode 100644 index c7b34fa..0000000 --- a/SOURCES/libvirt-conf-add-ioapic-driver-to-features.patch +++ /dev/null @@ -1,249 +0,0 @@ -From abbea18f4b3747d738d05f36884dda3202128b65 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:52 +0200 -Subject: [PATCH] conf: add to -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a new element with a driver attribute. - -Possible values are qemu and kvm. With 'qemu', the I/O -APIC can be put in the userspace even for KVM domains. - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit 8023b21a95f271e51810de7f1362e609eaadc1e4) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 9 ++++++ - docs/schemas/domaincommon.rng | 15 ++++++++++ - src/conf/domain_conf.c | 33 +++++++++++++++++++++- - src/conf/domain_conf.h | 11 ++++++++ - .../qemuxml2argv-intel-iommu-ioapic.xml | 29 +++++++++++++++++++ - .../qemuxml2xmlout-intel-iommu-ioapic.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 7 files changed, 98 insertions(+), 1 deletion(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 7e55b0327..869c1f73e 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -1675,6 +1675,7 @@ - </kvm> - <pvspinlock state='on'/> - <gic version='2'/> -+ <ioapic driver='qemu'/> - - </features> - ... -@@ -1836,6 +1837,14 @@ - for hypervisor to decide. - Since 2.1.0 - -+
    ioapic
    -+
    Tune the I/O APIC. Possible values for the -+ driver attribute are: -+ kvm (default for KVM domains) -+ and qemu which puts I/O APIC in userspace -+ which is also known as a split I/O APIC mode. -+ Since 3.4.0 (QEMU/KVM only) -+
    - - -

    Time keeping

    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 7271f0113..c72ba7e97 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -4515,6 +4515,9 @@ - - - -+ -+ -+ - - - -@@ -4693,6 +4696,18 @@ - - - -+ -+ -+ -+ -+ qemu -+ kvm -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 4096b9caf..d5c4f6ddd 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -141,7 +141,8 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, - "pmu", - "vmport", - "gic", -- "smm") -+ "smm", -+ "ioapic") - - VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, - "default", -@@ -859,6 +860,11 @@ VIR_ENUM_IMPL(virDomainLoader, - "rom", - "pflash") - -+VIR_ENUM_IMPL(virDomainIOAPIC, -+ VIR_DOMAIN_IOAPIC_LAST, -+ "qemu", -+ "kvm") -+ - /* Internal mapping: subset of block job types that can be present in - * XML (remaining types are not two-phase). */ - VIR_ENUM_DECL(virDomainBlockJob) -@@ -17518,6 +17524,24 @@ virDomainDefParseXML(xmlDocPtr xml, - ctxt->node = node; - break; - -+ case VIR_DOMAIN_FEATURE_IOAPIC: -+ node = ctxt->node; -+ ctxt->node = nodes[i]; -+ tmp = virXPathString("string(./@driver)", ctxt); -+ if (tmp) { -+ int value = virDomainIOAPICTypeFromString(tmp); -+ if (value < 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Unknown driver mode: %s"), -+ tmp); -+ goto error; -+ } -+ def->ioapic = value; -+ def->features[val] = VIR_TRISTATE_SWITCH_ON; -+ } -+ ctxt->node = node; -+ break; -+ - /* coverity[dead_error_begin] */ - case VIR_DOMAIN_FEATURE_LAST: - break; -@@ -24598,6 +24622,13 @@ virDomainDefFormatInternal(virDomainDefPtr def, - } - break; - -+ case VIR_DOMAIN_FEATURE_IOAPIC: -+ if (def->features[i] == VIR_TRISTATE_SWITCH_ON) { -+ virBufferAsprintf(buf, "\n", -+ virDomainIOAPICTypeToString(def->ioapic)); -+ } -+ break; -+ - /* coverity[dead_error_begin] */ - case VIR_DOMAIN_FEATURE_LAST: - break; -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index f1e9fc2ba..4cb37b1fc 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -1670,6 +1670,7 @@ typedef enum { - VIR_DOMAIN_FEATURE_VMPORT, - VIR_DOMAIN_FEATURE_GIC, - VIR_DOMAIN_FEATURE_SMM, -+ VIR_DOMAIN_FEATURE_IOAPIC, - - VIR_DOMAIN_FEATURE_LAST - } virDomainFeature; -@@ -1809,6 +1810,15 @@ struct _virDomainLoaderDef { - - void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); - -+typedef enum { -+ VIR_DOMAIN_IOAPIC_QEMU = 0, -+ VIR_DOMAIN_IOAPIC_KVM, -+ -+ VIR_DOMAIN_IOAPIC_LAST -+} virDomainIOAPIC; -+ -+VIR_ENUM_DECL(virDomainIOAPIC); -+ - /* Operating system configuration data & machine / arch */ - typedef struct _virDomainOSDef virDomainOSDef; - typedef virDomainOSDef *virDomainOSDefPtr; -@@ -2258,6 +2268,7 @@ struct _virDomainDef { - unsigned int hyperv_spinlocks; - virGICVersion gic_version; - char *hyperv_vendor_id; -+ virDomainIOAPIC ioapic; - - /* These options are of type virTristateSwitch: ON = keep, OFF = drop */ - int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST]; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -new file mode 100644 -index 000000000..284d63a30 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml -new file mode 120000 -index 000000000..42d17b2c0 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml -@@ -0,0 +1 @@ -+../qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index ff533ab19..0482ad9cb 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -1128,6 +1128,7 @@ mymain(void) - DO_TEST("intel-iommu-machine", - QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACHINE_IOMMU); -+ DO_TEST("intel-iommu-ioapic", NONE); - - DO_TEST("cpu-check-none", NONE); - DO_TEST("cpu-check-partial", NONE); --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-add-iotlb-attribute-to-iommu.patch b/SOURCES/libvirt-conf-add-iotlb-attribute-to-iommu.patch deleted file mode 100644 index d8b4894..0000000 --- a/SOURCES/libvirt-conf-add-iotlb-attribute-to-iommu.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 1e915e38d422df8b3cb4e049e932a5e6900735bc Mon Sep 17 00:00:00 2001 -Message-Id: <1e915e38d422df8b3cb4e049e932a5e6900735bc@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:48:56 +0200 -Subject: [PATCH] conf: add iotlb attribute to iommu -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a new iotlb attribute to the iommu device -to control the device IOTLB support for intel-iommu. - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit 27b187be3988c60cd26e08ab4bcab66bed5a3646) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 10 +++++++ - docs/schemas/domaincommon.rng | 5 ++++ - src/conf/domain_conf.c | 23 +++++++++++++++- - src/conf/domain_conf.h | 1 + - .../qemuxml2argv-intel-iommu-device-iotlb.xml | 31 ++++++++++++++++++++++ - .../qemuxml2xmlout-intel-iommu-device-iotlb.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 7 files changed, 71 insertions(+), 1 deletion(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index e886e4e17e..e8a3367bac 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -7446,6 +7446,16 @@ qemu-kvm -net nic,model=? /dev/null - Since 3.4.0 (QEMU/KVM only) -

    - -+
    iotlb
    -+
    -+

    -+ The iotlb attribute with possible values -+ on and off can be used to -+ turn on the IOTLB used to cache address translation -+ requests from devices. -+ Since 3.5.0 (QEMU/KVM only) -+

    -+
    - - - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index af7824aa02..1b66362f17 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -3910,6 +3910,11 @@ - - - -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 275145b1ec..701a6d2136 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -14196,6 +14196,14 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, - } - iommu->caching_mode = val; - } -+ VIR_FREE(tmp); -+ if ((tmp = virXPathString("string(./driver/@iotlb)", ctxt))) { -+ if ((val = virTristateSwitchTypeFromString(tmp)) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, _("unknown iotlb value: %s"), tmp); -+ goto cleanup; -+ } -+ iommu->iotlb = val; -+ } - - VIR_FREE(tmp); - if ((tmp = virXPathString("string(./driver/@eim)", ctxt))) { -@@ -19877,6 +19885,14 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, - virTristateSwitchTypeToString(src->eim)); - return false; - } -+ if (src->iotlb != dst->iotlb) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain IOMMU device iotlb value '%s' " -+ "does not match source '%s'"), -+ virTristateSwitchTypeToString(dst->iotlb), -+ virTristateSwitchTypeToString(src->iotlb)); -+ return false; -+ } - return true; - } - -@@ -24212,7 +24228,8 @@ virDomainIOMMUDefFormat(virBufferPtr buf, - virBufferAdjustIndent(&childBuf, virBufferGetIndent(buf, false) + 2); - - if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || -- iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT) { -+ iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT || -+ iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAddLit(&childBuf, "intremap != VIR_TRISTATE_SWITCH_ABSENT) { - virBufferAsprintf(&childBuf, " intremap='%s'", -@@ -24226,6 +24243,10 @@ virDomainIOMMUDefFormat(virBufferPtr buf, - virBufferAsprintf(&childBuf, " eim='%s'", - virTristateSwitchTypeToString(iommu->eim)); - } -+ if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&childBuf, " iotlb='%s'", -+ virTristateSwitchTypeToString(iommu->iotlb)); -+ } - virBufferAddLit(&childBuf, "/>\n"); - } - -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 706d106ad9..e6c20a9e1e 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2213,6 +2213,7 @@ struct _virDomainIOMMUDef { - virTristateSwitch intremap; - virTristateSwitch caching_mode; - virTristateSwitch eim; -+ virTristateSwitch iotlb; - }; - /* - * Guest VM main configuration -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml -new file mode 100644 -index 0000000000..3eb08ab9af ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml -@@ -0,0 +1,31 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.xml -new file mode 120000 -index 0000000000..3120d9f677 ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-device-iotlb.xml -@@ -0,0 +1 @@ -+../qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 6283da4096..3f7c268e43 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -1131,6 +1131,7 @@ mymain(void) - DO_TEST("intel-iommu-ioapic", NONE); - DO_TEST("intel-iommu-caching-mode", NONE); - DO_TEST("intel-iommu-eim", NONE); -+ DO_TEST("intel-iommu-device-iotlb", NONE); - - DO_TEST("cpu-check-none", NONE); - DO_TEST("cpu-check-partial", NONE); --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-docs-Add-support-for-coalesce-setting-s.patch b/SOURCES/libvirt-conf-docs-Add-support-for-coalesce-setting-s.patch deleted file mode 100644 index f7166fc..0000000 --- a/SOURCES/libvirt-conf-docs-Add-support-for-coalesce-setting-s.patch +++ /dev/null @@ -1,557 +0,0 @@ -From 705cbf8998e405b98f2d536f6d92c524755fe219 Mon Sep 17 00:00:00 2001 -Message-Id: <705cbf8998e405b98f2d536f6d92c524755fe219@dist-git> -From: Martin Kletzander -Date: Tue, 25 Apr 2017 13:41:16 +0200 -Subject: [PATCH] conf, docs: Add support for coalesce setting(s) - -https://bugzilla.redhat.com/show_bug.cgi?id=1414627 - -We are currently parsing only rx/frames/max because that's the only -value that makes sense for us. The tun device just added support for -this one and the others are only supported by hardware devices which -we don't need to worry about as the only way we'd pass those to the -domain is using or . And in -those cases the guest can modify the settings itself. - -Signed-off-by: Martin Kletzander -(cherry picked from commit 523c9960621eaf307ae8d4ae2735fb66f89d5634) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 27 +++++ - docs/schemas/domaincommon.rng | 131 +++++++++++++++++++++ - src/conf/domain_conf.c | 80 +++++++++++++ - src/conf/domain_conf.h | 2 + - src/qemu/qemu_domain.c | 31 +++++ - .../qemuxml2argvdata/qemuxml2argv-net-coalesce.xml | 68 +++++++++++ - .../qemuxml2xmlout-net-coalesce.xml | 71 +++++++++++ - tests/qemuxml2xmltest.c | 1 + - 8 files changed, 411 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index aee1e1442..7374cb243 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5437,6 +5437,33 @@ qemu-kvm -net nic,model=? /dev/null - Since 3.1.0 -

    - -+
    Coalesce settings
    -+
    -+...
    -+<devices>
    -+  <interface type='network'>
    -+    <source network='default'/>
    -+    <target dev='vnet0'/>
    -+    <coalesce>
    -+      <rx>
    -+        <frames max='7'/>
    -+      </rx>
    -+    </coalesce>
    -+  </interface>
    -+</devices>
    -+...
    -+ -+

    -+ This element provides means of setting coalesce settings for -+ some interface devices (currently only type network -+ and bridge. Currently there is just one attribute, -+ max, to tweak, in element frames for -+ the rx group, which accepts a non-negative integer -+ that specifies the maximum number of packets that will be -+ received before an interrupt. -+ Since 3.3.0 -+

    -+ -
    IP configuration
    -
    - ...
    -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
    -index d5c28ee3c..7a9b4b702 100644
    ---- a/docs/schemas/domaincommon.rng
    -+++ b/docs/schemas/domaincommon.rng
    -@@ -2509,6 +2509,9 @@
    -         
    -       
    -       
    -+        
    -+      
    -+      
    -         
    -           
    -             
    -@@ -5746,4 +5749,132 @@
    -       
    -     
    -   
    -+
    -+  
    -+    
    -+      
    -+        
    -+          
    -+            
    -+              
    -+                
    -+                  
    -+                    
    -+                  
    -+                
    -+                
    -+              
    -+            
    -+            
    -+          
    -+        
    -+        
    -+      
    -+    
    -+  
    -+
    - 
    -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
    -index 71f0c95c3..f2801ec84 100644
    ---- a/src/conf/domain_conf.c
    -+++ b/src/conf/domain_conf.c
    -@@ -6759,6 +6759,77 @@ virDomainNetIPInfoParseXML(const char *source,
    -     return ret;
    - }
    - 
    -+
    -+static virNetDevCoalescePtr
    -+virDomainNetDefCoalesceParseXML(xmlNodePtr node,
    -+                                xmlXPathContextPtr ctxt)
    -+{
    -+    virNetDevCoalescePtr ret = NULL;
    -+    xmlNodePtr save = NULL;
    -+    char *str = NULL;
    -+    unsigned long long tmp = 0;
    -+
    -+    save = ctxt->node;
    -+    ctxt->node = node;
    -+
    -+    str = virXPathString("string(./rx/frames/@max)", ctxt);
    -+    if (!str)
    -+        goto cleanup;
    -+
    -+    if (!ret && VIR_ALLOC(ret) < 0)
    -+        goto cleanup;
    -+
    -+    if (virStrToLong_ullp(str, NULL, 10, &tmp) < 0) {
    -+        virReportError(VIR_ERR_XML_DETAIL,
    -+                       _("cannot parse value '%s' for coalesce parameter"),
    -+                       str);
    -+        VIR_FREE(str);
    -+        goto error;
    -+    }
    -+    VIR_FREE(str);
    -+
    -+    if (tmp > UINT32_MAX) {
    -+        virReportError(VIR_ERR_OVERFLOW,
    -+                       _("value '%llu' is too big for coalesce "
    -+                         "parameter, maximum is '%lu'"),
    -+                       tmp, (unsigned long) UINT32_MAX);
    -+        goto error;
    -+    }
    -+    ret->rx_max_coalesced_frames = tmp;
    -+
    -+ cleanup:
    -+    ctxt->node = save;
    -+    return ret;
    -+
    -+ error:
    -+    VIR_FREE(ret);
    -+    goto cleanup;
    -+}
    -+
    -+static void
    -+virDomainNetDefCoalesceFormatXML(virBufferPtr buf,
    -+                                 virNetDevCoalescePtr coalesce)
    -+{
    -+    if (!coalesce || !coalesce->rx_max_coalesced_frames)
    -+        return;
    -+
    -+    virBufferAddLit(buf, "\n");
    -+    virBufferAdjustIndent(buf, 2);
    -+
    -+    virBufferAddLit(buf, "\n");
    -+    virBufferAdjustIndent(buf, 2);
    -+
    -+    virBufferAsprintf(buf, "\n",
    -+                      coalesce->rx_max_coalesced_frames);
    -+
    -+    virBufferAdjustIndent(buf, -2);
    -+    virBufferAddLit(buf, "\n");
    -+
    -+    virBufferAdjustIndent(buf, -2);
    -+    virBufferAddLit(buf, "\n");
    -+}
    -+
    -+
    - static int
    - virDomainHostdevDefParseXMLCaps(xmlNodePtr node ATTRIBUTE_UNUSED,
    -                                 xmlXPathContextPtr ctxt,
    -@@ -10242,6 +10313,13 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
    -         goto error;
    -     }
    - 
    -+    node = virXPathNode("./coalesce", ctxt);
    -+    if (node) {
    -+        def->coalesce = virDomainNetDefCoalesceParseXML(node, ctxt);
    -+        if (!def->coalesce)
    -+            goto error;
    -+    }
    -+
    -  cleanup:
    -     ctxt->node = oldnode;
    -     VIR_FREE(macaddr);
    -@@ -22135,6 +22213,8 @@ virDomainNetDefFormat(virBufferPtr buf,
    -     if (def->mtu)
    -         virBufferAsprintf(buf, "\n", def->mtu);
    - 
    -+    virDomainNetDefCoalesceFormatXML(buf, def->coalesce);
    -+
    -     if (virDomainDeviceInfoFormat(buf, &def->info,
    -                                   flags | VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT
    -                                   | VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM) < 0)
    -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
    -index 71e651975..1dbbcdc51 100644
    ---- a/src/conf/domain_conf.h
    -+++ b/src/conf/domain_conf.h
    -@@ -41,6 +41,7 @@
    - # include "numa_conf.h"
    - # include "virnetdevmacvlan.h"
    - # include "virsysinfo.h"
    -+# include "virnetdev.h"
    - # include "virnetdevip.h"
    - # include "virnetdevvportprofile.h"
    - # include "virnetdevbandwidth.h"
    -@@ -1036,6 +1037,7 @@ struct _virDomainNetDef {
    -     int trustGuestRxFilters; /* enum virTristateBool */
    -     int linkstate;
    -     unsigned int mtu;
    -+    virNetDevCoalescePtr coalesce;
    - };
    - 
    - /* Used for prefix of ifname of any network name generated dynamically
    -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
    -index d31645fd1..53586878b 100644
    ---- a/src/qemu/qemu_domain.c
    -+++ b/src/qemu/qemu_domain.c
    -@@ -3012,6 +3012,30 @@ qemuDomainDefValidate(const virDomainDef *def,
    - }
    - 
    - 
    -+static bool
    -+qemuDomainNetSupportsCoalesce(virDomainNetType type)
    -+{
    -+    switch (type) {
    -+    case VIR_DOMAIN_NET_TYPE_NETWORK:
    -+    case VIR_DOMAIN_NET_TYPE_BRIDGE:
    -+        return true;
    -+    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
    -+    case VIR_DOMAIN_NET_TYPE_ETHERNET:
    -+    case VIR_DOMAIN_NET_TYPE_DIRECT:
    -+    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
    -+    case VIR_DOMAIN_NET_TYPE_USER:
    -+    case VIR_DOMAIN_NET_TYPE_SERVER:
    -+    case VIR_DOMAIN_NET_TYPE_CLIENT:
    -+    case VIR_DOMAIN_NET_TYPE_MCAST:
    -+    case VIR_DOMAIN_NET_TYPE_INTERNAL:
    -+    case VIR_DOMAIN_NET_TYPE_UDP:
    -+    case VIR_DOMAIN_NET_TYPE_LAST:
    -+        break;
    -+    }
    -+    return false;
    -+}
    -+
    -+
    - static int
    - qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
    -                             const virDomainDef *def ATTRIBUTE_UNUSED,
    -@@ -3046,6 +3070,13 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
    -                            virDomainNetTypeToString(net->type));
    -             goto cleanup;
    -         }
    -+
    -+        if (net->coalesce && !qemuDomainNetSupportsCoalesce(net->type)) {
    -+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
    -+                           _("coalesce settings on interface type %s are not supported"),
    -+                           virDomainNetTypeToString(net->type));
    -+            goto cleanup;
    -+        }
    -     }
    - 
    -     ret = 0;
    -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml
    -new file mode 100644
    -index 000000000..b51032442
    ---- /dev/null
    -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-coalesce.xml
    -@@ -0,0 +1,68 @@
    -+
    -+  test
    -+  15d091de-0181-456b-9554-e4382dc1f1ab
    -+  1048576
    -+  1048576
    -+  1
    -+  
    -+    hvm
    -+    
    -+    
    -+    
    -+  
    -+  
    -+  destroy
    -+  restart
    -+  restart
    -+  
    -+    /usr/bin/qemu-system-x86_64
    -+    
    -+      
    -+      
    -+      
    -+      
    -+ -+ -+ -+ -+ -+ -+
    -+ -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -new file mode 100644 -index 000000000..fd5fdbece ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-coalesce.xml -@@ -0,0 +1,71 @@ -+ -+ test -+ 15d091de-0181-456b-9554-e4382dc1f1ab -+ 1048576 -+ 1048576 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ destroy -+ restart -+ restart -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+
    -+ -+ -+
    -+ -+ -+
    -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+
    -+ -+ -+ -+ -+ -+
    -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+
    -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index eae999dd6..26a2259fd 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -532,6 +532,7 @@ mymain(void) - DO_TEST("net-bandwidth", NONE); - DO_TEST("net-bandwidth2", NONE); - DO_TEST("net-mtu", NONE); -+ DO_TEST("net-coalesce", NONE); - - DO_TEST("serial-vc", NONE); - DO_TEST("serial-pty", NONE); --- -2.12.2 - diff --git a/SOURCES/libvirt-conf-don-t-ignore-target-dev-blah-for-macvtap-interfaces.patch b/SOURCES/libvirt-conf-don-t-ignore-target-dev-blah-for-macvtap-interfaces.patch deleted file mode 100644 index 4b716d6..0000000 --- a/SOURCES/libvirt-conf-don-t-ignore-target-dev-blah-for-macvtap-interfaces.patch +++ /dev/null @@ -1,71 +0,0 @@ -From c2e748f3d928f8030e5c12b474c427086c962ad4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Tue, 2 May 2017 12:33:11 -0400 -Subject: [PATCH] conf: don't ignore for macvtap - interfaces - -The parser had been clearing out *all* suggested device names for -type='direct' (aka macvtap) interfaces. All of the code implementing -macvtap allows for a user-specified device name, so we should allow -it. In the case that an interface name starts with "macvtap" or -"macvlan" though, we do still clear it out, just as we do with "vnet" -(which is the prefix used for automatically generated tap device -names), since those are the prefixes for the names we autogenerate for -macvtap and macvlan devices. - -Resolves: https://bugzilla.redhat.com/1335798 -(cherry picked from commit 9cb891141c4a5a96243c61518c4e0dbcf6a86c24) - -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 6 +++--- - src/conf/domain_conf.c | 7 ++++++- - 2 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 2dc5e751a..7e55b0327 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5207,9 +5207,9 @@ qemu-kvm -net nic,model=? /dev/null - If no target is specified, certain hypervisors will - automatically generate a name for the created tun device. This - name can be manually specified, however the name should not -- start with either 'vnet' or 'vif', which are prefixes -- reserved by libvirt and certain hypervisors. Manually specified -- targets using these prefixes may be ignored. -+ start with either 'vnet', 'vif', 'macvtap', or 'macvlan', -+ which are prefixes reserved by libvirt and certain hypervisors. -+ Manually specified targets using these prefixes may be ignored. -

    - -

    -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7ab5e5051..84a8a94e5 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -55,6 +55,7 @@ - #include "virtpm.h" - #include "virstring.h" - #include "virnetdev.h" -+#include "virnetdevmacvlan.h" - #include "virhostdev.h" - #include "virmdev.h" - -@@ -10016,8 +10017,12 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, - def->data.direct.linkdev = dev; - dev = NULL; - -- if (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) -+ if (ifname && -+ flags & VIR_DOMAIN_DEF_PARSE_INACTIVE && -+ (STRPREFIX(ifname, VIR_NET_GENERATED_MACVTAP_PREFIX) || -+ STRPREFIX(ifname, VIR_NET_GENERATED_MACVTAP_PREFIX))) { - VIR_FREE(ifname); -+ } - - break; - --- -2.12.2 - diff --git a/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch b/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch new file mode 100644 index 0000000..10cf184 --- /dev/null +++ b/SOURCES/libvirt-conf-fix-migratable-XML-for-graphics-if-socket-is-generated-based-on-config.patch @@ -0,0 +1,57 @@ +From a1c433306e79ec6b5c0ca4b3e3243875ccabdeb2 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Thu, 30 Nov 2017 17:56:41 +0100 +Subject: [PATCH] conf: fix migratable XML for graphics if socket is generated + based on config + +The graphics code is complex and there are a lot of exceptions and +backward compatible combinations. One of them is the possibility +to configure "spice_auto_unix_socket" in qemu.conf which will convert +all spice graphics with listen type "address" without any address +specified to listen type "socket" when the guest is started. + +We don't format this generated socket into migratable XML to make +migration work with older libvirt. However, spice has another +exception that if autoport='no' and there is no port configured +it is converted to listen type "none". Because of this we need +to format autoport='yes' to make sure that the listen type will +be the same as the offline XML. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511407 + +Reviewed-by: Jiri Denemark +Signed-off-by: Pavel Hrdina +(cherry picked from commit cb06ea57ad80a964028f22fb49d6ab96648ae741) +Signed-off-by: Pavel Hrdina +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index c58dae197c..ec138ea861 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -25150,6 +25150,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf, + break; + + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: ++ /* If socket is auto-generated based on config option we don't ++ * add any listen element into migratable XML because the original ++ * listen type is "address". ++ * We need to set autoport to make sure that libvirt on destination ++ * will parse it as listen type "address", without autoport it is ++ * parsed as listen type "none". */ ++ if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) && ++ glisten->fromConfig) { ++ virBufferAddStr(buf, " autoport='yes'"); ++ } ++ break; ++ + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: + break; + } +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch b/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch new file mode 100644 index 0000000..f7b19a7 --- /dev/null +++ b/SOURCES/libvirt-conf-honor-maxnames-in-nodeListDevices-API.patch @@ -0,0 +1,36 @@ +From a64f825a244c77556c0ed7c5f425ba70b28cca70 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Tue, 2 Jan 2018 12:39:13 +0100 +Subject: [PATCH] conf: honor maxnames in nodeListDevices API + +Introduced by commit <4ae9dbea99c>. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572 + +Signed-off-by: Pavel Hrdina +(cherry picked from commit bbf6573e94528ac8a8867855e6671b48e13f1cd1) +Signed-off-by: Pavel Hrdina +Reviewed-by: Erik Skultety +Signed-off-by: Jiri Denemark +--- + src/conf/virnodedeviceobj.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c +index 872ec1fd4b..c4e3a40d3a 100644 +--- a/src/conf/virnodedeviceobj.c ++++ b/src/conf/virnodedeviceobj.c +@@ -798,6 +798,9 @@ virNodeDeviceObjListGetNamesCallback(void *payload, + if (data->error) + return 0; + ++ if (data->nnames >= data->maxnames) ++ return 0; ++ + virObjectLock(obj); + def = obj->def; + +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch b/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch new file mode 100644 index 0000000..edf12a0 --- /dev/null +++ b/SOURCES/libvirt-conf-include-x86-microcode-version-in-virsh-capabiltiies.patch @@ -0,0 +1,133 @@ +From 4f1684dd855d48517e04507edadba2fd454e4ada Mon Sep 17 00:00:00 2001 +Message-Id: <4f1684dd855d48517e04507edadba2fd454e4ada@dist-git> +From: Paolo Bonzini +Date: Tue, 12 Dec 2017 16:23:40 +0100 +Subject: [PATCH] conf: include x86 microcode version in virsh capabiltiies + +A microcode update can cause the CPUID bits to change; an example +from the past was the update that disabled TSX on several Haswell and +Broadwell machines. + +In order to track the x86 microcode version in the QEMU capabilities, +we have to fetch it and store it in the host CPU. This also makes the +version visible in "virsh capabilities", which is a nice side effect. + +CVE-2017-5715 + +Signed-off-by: Paolo Bonzini +Signed-off-by: Jiri Denemark +--- + src/conf/cpu_conf.c | 14 ++++++++++++++ + src/conf/cpu_conf.h | 1 + + src/cpu/cpu_x86.c | 9 +++++++++ + 3 files changed, 24 insertions(+) + +diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c +index 669935acf8..7e00299c66 100644 +--- a/src/conf/cpu_conf.c ++++ b/src/conf/cpu_conf.c +@@ -130,6 +130,7 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst, + VIR_STRDUP(dst->vendor_id, src->vendor_id) < 0 || + VIR_ALLOC_N(dst->features, src->nfeatures) < 0) + return -1; ++ dst->microcodeVersion = src->microcodeVersion; + dst->nfeatures_max = src->nfeatures; + dst->nfeatures = 0; + +@@ -181,6 +182,7 @@ virCPUDefStealModel(virCPUDefPtr dst, + + VIR_STEAL_PTR(dst->model, src->model); + VIR_STEAL_PTR(dst->features, src->features); ++ dst->microcodeVersion = src->microcodeVersion; + dst->nfeatures_max = src->nfeatures_max; + src->nfeatures_max = 0; + dst->nfeatures = src->nfeatures; +@@ -382,6 +384,14 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, + goto cleanup; + } + VIR_FREE(arch); ++ ++ if (virXPathBoolean("boolean(./microcode[1]/@version)", ctxt) > 0 && ++ virXPathUInt("string(./microcode[1]/@version)", ctxt, ++ &def->microcodeVersion) < 0) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("invalid microcode version")); ++ goto cleanup; ++ } + } + + if (!(def->model = virXPathString("string(./model[1])", ctxt)) && +@@ -720,6 +730,10 @@ virCPUDefFormatBuf(virBufferPtr buf, + if (formatModel && def->vendor) + virBufferEscapeString(buf, "%s\n", def->vendor); + ++ if (def->type == VIR_CPU_TYPE_HOST && def->microcodeVersion) ++ virBufferAsprintf(buf, "\n", ++ def->microcodeVersion); ++ + if (def->sockets && def->cores && def->threads) { + virBufferAddLit(buf, "sockets); +diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h +index d1983f5d4f..9f2e7ee264 100644 +--- a/src/conf/cpu_conf.h ++++ b/src/conf/cpu_conf.h +@@ -133,6 +133,7 @@ struct _virCPUDef { + char *vendor_id; /* vendor id returned by CPUID in the guest */ + int fallback; /* enum virCPUFallback */ + char *vendor; ++ unsigned int microcodeVersion; + unsigned int sockets; + unsigned int cores; + unsigned int threads; +diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c +index 693e571a3d..ad35532fc1 100644 +--- a/src/cpu/cpu_x86.c ++++ b/src/cpu/cpu_x86.c +@@ -33,6 +33,7 @@ + #include "virbuffer.h" + #include "virendian.h" + #include "virstring.h" ++#include "virhostcpu.h" + + #define VIR_FROM_THIS VIR_FROM_CPU + +@@ -153,6 +154,8 @@ struct _virCPUx86Map { + }; + + static virCPUx86MapPtr cpuMap; ++static unsigned int microcodeVersion; ++ + int virCPUx86DriverOnceInit(void); + VIR_ONCE_GLOBAL_INIT(virCPUx86Driver); + +@@ -1409,6 +1412,8 @@ virCPUx86DriverOnceInit(void) + if (!(cpuMap = virCPUx86LoadMap())) + return -1; + ++ microcodeVersion = virHostCPUGetMicrocodeVersion(); ++ + return 0; + } + +@@ -2424,6 +2429,9 @@ virCPUx86GetHost(virCPUDefPtr cpu, + virCPUDataPtr cpuData = NULL; + int ret = -1; + ++ if (virCPUx86DriverInitialize() < 0) ++ goto cleanup; ++ + if (!(cpuData = virCPUDataNew(archs[0]))) + goto cleanup; + +@@ -2432,6 +2440,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, + goto cleanup; + + ret = x86DecodeCPUData(cpu, cpuData, models); ++ cpu->microcodeVersion = microcodeVersion; + + cleanup: + virCPUx86DataFree(cpuData); +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-introduce-virDomainControllerDriverFormat.patch b/SOURCES/libvirt-conf-introduce-virDomainControllerDriverFormat.patch deleted file mode 100644 index 5f37f4f..0000000 --- a/SOURCES/libvirt-conf-introduce-virDomainControllerDriverFormat.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 8874ecd393f7098376d9c46c34f43d47a697f932 Mon Sep 17 00:00:00 2001 -Message-Id: <8874ecd393f7098376d9c46c34f43d47a697f932@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:48:55 +0200 -Subject: [PATCH] conf: introduce virDomainControllerDriverFormat -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Split out formatting the subelement of -to make adding new options easier. - -(cherry picked from commit fe262186dccfa5c5cbcfe5ab7eb95195cf3b10f5) -Signed-off-by: Ján Tomko - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 55 +++++++++++++++++++++++++++++--------------------- - 1 file changed, 32 insertions(+), 23 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index e004559f9f..275145b1ec 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -21323,6 +21323,37 @@ virDomainDiskDefFormat(virBufferPtr buf, - #undef FORMAT_IOTUNE - - -+static void -+virDomainControllerDriverFormat(virBufferPtr buf, -+ virDomainControllerDefPtr def) -+{ -+ virBuffer driverBuf = VIR_BUFFER_INITIALIZER; -+ -+ if (def->queues) -+ virBufferAsprintf(&driverBuf, " queues='%u'", def->queues); -+ -+ if (def->cmd_per_lun) -+ virBufferAsprintf(&driverBuf, " cmd_per_lun='%u'", def->cmd_per_lun); -+ -+ if (def->max_sectors) -+ virBufferAsprintf(&driverBuf, " max_sectors='%u'", def->max_sectors); -+ -+ if (def->ioeventfd) { -+ virBufferAsprintf(&driverBuf, " ioeventfd='%s'", -+ virTristateSwitchTypeToString(def->ioeventfd)); -+ } -+ -+ if (def->iothread) -+ virBufferAsprintf(&driverBuf, " iothread='%u'", def->iothread); -+ -+ if (virBufferUse(&driverBuf)) { -+ virBufferAddLit(buf, "\n"); -+ } -+} -+ -+ - static int - virDomainControllerDefFormat(virBufferPtr buf, - virDomainControllerDefPtr def, -@@ -21332,7 +21363,6 @@ virDomainControllerDefFormat(virBufferPtr buf, - const char *model = NULL; - const char *modelName = NULL; - bool pcihole64 = false, pciModel = false, pciTarget = false; -- virBuffer driverBuf = VIR_BUFFER_INITIALIZER; - - if (!type) { - virReportError(VIR_ERR_INTERNAL_ERROR, -@@ -21437,28 +21467,7 @@ virDomainControllerDefFormat(virBufferPtr buf, - } - } - -- if (def->queues) -- virBufferAsprintf(&driverBuf, " queues='%u'", def->queues); -- -- if (def->cmd_per_lun) -- virBufferAsprintf(&driverBuf, " cmd_per_lun='%u'", def->cmd_per_lun); -- -- if (def->max_sectors) -- virBufferAsprintf(&driverBuf, " max_sectors='%u'", def->max_sectors); -- -- if (def->ioeventfd) { -- virBufferAsprintf(&driverBuf, " ioeventfd='%s'", -- virTristateSwitchTypeToString(def->ioeventfd)); -- } -- -- if (def->iothread) -- virBufferAsprintf(&driverBuf, " iothread='%u'", def->iothread); -- -- if (virBufferUse(&driverBuf)) { -- virBufferAddLit(buf, "\n"); -- } -+ virDomainControllerDriverFormat(buf, def); - - if (virDomainDeviceInfoNeedsFormat(&def->info, flags) && - virDomainDeviceInfoFormat(buf, &def->info, flags) < 0) --- -2.13.1 - diff --git a/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch b/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch new file mode 100644 index 0000000..32863e9 --- /dev/null +++ b/SOURCES/libvirt-conf-move-generated-member-from-virMacAddr-to-virDomainNetDef.patch @@ -0,0 +1,162 @@ +From 5b225fe7ac882c8696b9759251c519c785f5407c Mon Sep 17 00:00:00 2001 +Message-Id: <5b225fe7ac882c8696b9759251c519c785f5407c@dist-git> +From: Laine Stump +Date: Tue, 6 Mar 2018 16:19:31 -0500 +Subject: [PATCH] conf: move 'generated' member from virMacAddr to + virDomainNetDef + +Commit 7e62c4cd26d (first appearing in libvirt-3.9.0 as a resolution +to rhbz #1343919) added a "generated" attribute to virMacAddr that was +set whenever a mac address was auto-generated by libvirt. This +knowledge was used in a single place - when trying to match a NetDef +from the Domain to Delete with user-provided XML. Since the XML parser +always auto-generates a MAC address for NetDefs when none is provided, +it was previously impossible to make a search where the MAC address +isn't significant, but the addition of the "generated" attribute made +it possible for the search function to ignore auto-generated MACs. + +This implementation had a problem though - it was adding a field to a +"low level" struct - virMacAddr - which is used in other places with +the assumption that it contains exactly a 6 byte MAC address and +nothing else. In particular, virNWFilterSnoopEthHdr uses virMacAddr as +part of the definition of an ethernet packet header, whose layout must +of course match an actual ethernet packet. Adding the extra bools into +virNWFilterSnoopEthHdr caused the nwfilter driver's "IP discovery via +DHCP packet snooping" functionality to mysteriously stop working. + +In order to fix that behavior, and prevent potential future similar +odd behavior, this patch moves the "generated" member out of +virMacAddr (so that it is again really is just a MAC address) into +virDomainNetDef, and sets it only when virDomainNetGenerateMAC() is +called from virDomainNetDefParseXML() (which is the only time we care +about it). + +Resolves: https://bugzilla.redhat.com/1529338 + +(It should also be applied to any maintenance branch that applies +commit 7e62c4cd26 and friends to resolve +https://bugzilla.redhat.com/1343919) + +Signed-off-by: Laine Stump +(cherry picked from commit e62cb4a9b78c7f4499a206635fb4f06e6ac627e5) +--- + src/conf/domain_conf.c | 3 ++- + src/conf/domain_conf.h | 1 + + src/util/virmacaddr.c | 5 ----- + src/util/virmacaddr.h | 9 +++++++-- + tests/bhyveargv2xmlmock.c | 1 - + 5 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 0af3dd5ab6..1a3db4a7be 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -10989,6 +10989,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, + } + } else { + virDomainNetGenerateMAC(xmlopt, &def->mac); ++ def->mac_generated = true; + } + + if (devaddr) { +@@ -16205,7 +16206,7 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) + size_t i; + int matchidx = -1; + char mac[VIR_MAC_STRING_BUFLEN]; +- bool MACAddrSpecified = !net->mac.generated; ++ bool MACAddrSpecified = !net->mac_generated; + bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info, + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI); + +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index ed7b587bed..3817887322 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -962,6 +962,7 @@ struct _virDomainActualNetDef { + struct _virDomainNetDef { + virDomainNetType type; + virMacAddr mac; ++ bool mac_generated; /* true if mac was *just now* auto-generated by libvirt */ + char *model; + union { + struct { +diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c +index 409fdc34d5..7afe032b9c 100644 +--- a/src/util/virmacaddr.c ++++ b/src/util/virmacaddr.c +@@ -107,7 +107,6 @@ void + virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src) + { + memcpy(dst, src, sizeof(*src)); +- dst->generated = false; + } + + /** +@@ -121,7 +120,6 @@ void + virMacAddrSetRaw(virMacAddrPtr dst, const unsigned char src[VIR_MAC_BUFLEN]) + { + memcpy(dst->addr, src, VIR_MAC_BUFLEN); +- dst->generated = false; + } + + /** +@@ -151,7 +149,6 @@ virMacAddrParse(const char* str, virMacAddrPtr addr) + { + size_t i; + +- addr->generated = false; + errno = 0; + for (i = 0; i < VIR_MAC_BUFLEN; i++) { + char *end_ptr; +@@ -220,7 +217,6 @@ virMacAddrParseHex(const char *str, virMacAddrPtr addr) + str[VIR_MAC_HEXLEN]) + return -1; + +- addr->generated = false; + for (i = 0; i < VIR_MAC_BUFLEN; i++) + addr->addr[i] = (virHexToBin(str[2 * i]) << 4 | + virHexToBin(str[2 * i + 1])); +@@ -236,7 +232,6 @@ void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], + addr->addr[3] = virRandomBits(8); + addr->addr[4] = virRandomBits(8); + addr->addr[5] = virRandomBits(8); +- addr->generated = true; + } + + /* The low order bit of the first byte is the "multicast" bit. */ +diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h +index ef4285d639..d0dd4a45c6 100644 +--- a/src/util/virmacaddr.h ++++ b/src/util/virmacaddr.h +@@ -36,9 +36,14 @@ typedef virMacAddr *virMacAddrPtr; + + struct _virMacAddr { + unsigned char addr[VIR_MAC_BUFLEN]; +- bool generated; /* True if MAC address was autogenerated, +- false otherwise. */ + }; ++/* This struct is used as a part of a larger struct that is ++ * overlaid on an ethernet packet captured with libpcap, so it ++ * must not have any extra members added - it must remain exactly ++ * 6 bytes in length. ++ */ ++verify(sizeof(struct _virMacAddr) == 6); ++ + + int virMacAddrCompare(const char *mac1, const char *mac2); + int virMacAddrCmp(const virMacAddr *mac1, const virMacAddr *mac2); +diff --git a/tests/bhyveargv2xmlmock.c b/tests/bhyveargv2xmlmock.c +index dd25f4e13a..1f08bebb7b 100644 +--- a/tests/bhyveargv2xmlmock.c ++++ b/tests/bhyveargv2xmlmock.c +@@ -16,7 +16,6 @@ virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], + addr->addr[3] = 0; + addr->addr[4] = 0; + addr->addr[5] = 0; +- addr->generated = true; + } + + int +-- +2.16.2 + diff --git a/SOURCES/libvirt-conf-nodedev-Split-virNodeDeviceDefFormat-into-more-functions.patch b/SOURCES/libvirt-conf-nodedev-Split-virNodeDeviceDefFormat-into-more-functions.patch deleted file mode 100644 index 7cd3720..0000000 --- a/SOURCES/libvirt-conf-nodedev-Split-virNodeDeviceDefFormat-into-more-functions.patch +++ /dev/null @@ -1,644 +0,0 @@ -From f636c368f181c9f18ee135e8902490faf30186f9 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:48 +0200 -Subject: [PATCH] conf: nodedev: Split virNodeDeviceDefFormat into more - functions - -Make the code look cleaner by moving the capability specific bits into -separate functions. - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit bfaaaf108da087c38cc0f2890ed96730a3734ba8) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/conf/node_device_conf.c | 578 ++++++++++++++++++++++++-------------------- - 1 file changed, 322 insertions(+), 256 deletions(-) - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index cc3fad8b9..02215f32d 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -155,6 +155,320 @@ virPCIEDeviceInfoFormat(virBufferPtr buf, - } - - -+static void -+virNodeDeviceCapSystemDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ char uuidstr[VIR_UUID_STRING_BUFLEN]; -+ -+ if (data->system.product_name) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.product_name); -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ if (data->system.hardware.vendor_name) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.hardware.vendor_name); -+ if (data->system.hardware.version) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.hardware.version); -+ if (data->system.hardware.serial) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.hardware.serial); -+ virUUIDFormat(data->system.hardware.uuid, uuidstr); -+ virBufferAsprintf(buf, "%s\n", uuidstr); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ if (data->system.firmware.vendor_name) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.firmware.vendor_name); -+ if (data->system.firmware.version) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.firmware.version); -+ if (data->system.firmware.release_date) -+ virBufferEscapeString(buf, "%s\n", -+ data->system.firmware.release_date); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+} -+ -+ -+static void -+virNodeDeviceCapPCIDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ size_t i; -+ -+ virBufferAsprintf(buf, "%d\n", -+ data->pci_dev.domain); -+ virBufferAsprintf(buf, "%d\n", data->pci_dev.bus); -+ virBufferAsprintf(buf, "%d\n", -+ data->pci_dev.slot); -+ virBufferAsprintf(buf, "%d\n", -+ data->pci_dev.function); -+ virBufferAsprintf(buf, "pci_dev.product); -+ if (data->pci_dev.product_name) -+ virBufferEscapeString(buf, ">%s\n", -+ data->pci_dev.product_name); -+ else -+ virBufferAddLit(buf, " />\n"); -+ virBufferAsprintf(buf, "pci_dev.vendor); -+ if (data->pci_dev.vendor_name) -+ virBufferEscapeString(buf, ">%s\n", -+ data->pci_dev.vendor_name); -+ else -+ virBufferAddLit(buf, " />\n"); -+ if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION) { -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ virBufferAsprintf(buf, -+ "

    \n", -+ data->pci_dev.physical_function->domain, -+ data->pci_dev.physical_function->bus, -+ data->pci_dev.physical_function->slot, -+ data->pci_dev.physical_function->function); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION) { -+ virBufferAddLit(buf, "pci_dev.max_virtual_functions) -+ virBufferAsprintf(buf, " maxCount='%u'", -+ data->pci_dev.max_virtual_functions); -+ if (data->pci_dev.num_virtual_functions == 0) { -+ virBufferAddLit(buf, "/>\n"); -+ } else { -+ virBufferAddLit(buf, ">\n"); -+ virBufferAdjustIndent(buf, 2); -+ for (i = 0; i < data->pci_dev.num_virtual_functions; i++) { -+ virBufferAsprintf(buf, -+ "
    \n", -+ data->pci_dev.virtual_functions[i]->domain, -+ data->pci_dev.virtual_functions[i]->bus, -+ data->pci_dev.virtual_functions[i]->slot, -+ data->pci_dev.virtual_functions[i]->function); -+ } -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ } -+ if (data->pci_dev.hdrType) { -+ virBufferAsprintf(buf, "\n", -+ virPCIHeaderTypeToString(data->pci_dev.hdrType)); -+ } -+ if (data->pci_dev.nIommuGroupDevices) { -+ virBufferAsprintf(buf, "\n", -+ data->pci_dev.iommuGroupNumber); -+ virBufferAdjustIndent(buf, 2); -+ for (i = 0; i < data->pci_dev.nIommuGroupDevices; i++) { -+ virBufferAsprintf(buf, -+ "
    \n", -+ data->pci_dev.iommuGroupDevices[i]->domain, -+ data->pci_dev.iommuGroupDevices[i]->bus, -+ data->pci_dev.iommuGroupDevices[i]->slot, -+ data->pci_dev.iommuGroupDevices[i]->function); -+ } -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ if (data->pci_dev.numa_node >= 0) -+ virBufferAsprintf(buf, "\n", -+ data->pci_dev.numa_node); -+ -+ if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCIE) -+ virPCIEDeviceInfoFormat(buf, data->pci_dev.pci_express); -+} -+ -+ -+static void -+virNodeDeviceCapUSBDevDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ virBufferAsprintf(buf, "%d\n", data->usb_dev.bus); -+ virBufferAsprintf(buf, "%d\n", -+ data->usb_dev.device); -+ virBufferAsprintf(buf, "usb_dev.product); -+ if (data->usb_dev.product_name) -+ virBufferEscapeString(buf, ">%s\n", -+ data->usb_dev.product_name); -+ else -+ virBufferAddLit(buf, " />\n"); -+ virBufferAsprintf(buf, "usb_dev.vendor); -+ if (data->usb_dev.vendor_name) -+ virBufferEscapeString(buf, ">%s\n", -+ data->usb_dev.vendor_name); -+ else -+ virBufferAddLit(buf, " />\n"); -+} -+ -+ -+static void -+virNodeDeviceCapUSBInterfaceDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ virBufferAsprintf(buf, "%d\n", -+ data->usb_if.number); -+ virBufferAsprintf(buf, "%d\n", -+ data->usb_if._class); -+ virBufferAsprintf(buf, "%d\n", -+ data->usb_if.subclass); -+ virBufferAsprintf(buf, "%d\n", -+ data->usb_if.protocol); -+ if (data->usb_if.description) -+ virBufferEscapeString(buf, -+ "%s\n", -+ data->usb_if.description); -+} -+ -+ -+static void -+virNodeDeviceCapNetDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ size_t i; -+ -+ virBufferEscapeString(buf, "%s\n", -+ data->net.ifname); -+ if (data->net.address) -+ virBufferEscapeString(buf, "
    %s
    \n", -+ data->net.address); -+ virInterfaceLinkFormat(buf, &data->net.lnk); -+ if (data->net.features) { -+ for (i = 0; i < VIR_NET_DEV_FEAT_LAST; i++) { -+ if (virBitmapIsBitSet(data->net.features, i)) { -+ virBufferAsprintf(buf, "\n", -+ virNetDevFeatureTypeToString(i)); -+ } -+ } -+ } -+ if (data->net.subtype != VIR_NODE_DEV_CAP_NET_LAST) { -+ const char *subtyp = -+ virNodeDevNetCapTypeToString(data->net.subtype); -+ virBufferEscapeString(buf, "\n", -+ subtyp); -+ } -+} -+ -+ -+static void -+virNodeDeviceCapSCSIHostDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ virBufferAsprintf(buf, "%d\n", -+ data->scsi_host.host); -+ if (data->scsi_host.unique_id != -1) -+ virBufferAsprintf(buf, "%d\n", -+ data->scsi_host.unique_id); -+ if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ virBufferEscapeString(buf, "%s\n", -+ data->scsi_host.wwnn); -+ virBufferEscapeString(buf, "%s\n", -+ data->scsi_host.wwpn); -+ virBufferEscapeString(buf, "%s\n", -+ data->scsi_host.fabric_wwn); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS) { -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ virBufferAsprintf(buf, "%d\n", -+ data->scsi_host.max_vports); -+ virBufferAsprintf(buf, "%d\n", -+ data->scsi_host.vports); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+} -+ -+ -+static void -+virNodeDeviceCapSCSIDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ virBufferAsprintf(buf, "%d\n", data->scsi.host); -+ virBufferAsprintf(buf, "%d\n", data->scsi.bus); -+ virBufferAsprintf(buf, "%d\n", -+ data->scsi.target); -+ virBufferAsprintf(buf, "%d\n", data->scsi.lun); -+ if (data->scsi.type) -+ virBufferEscapeString(buf, "%s\n", -+ data->scsi.type); -+} -+ -+ -+static void -+virNodeDeviceCapStorageDefFormat(virBufferPtr buf, -+ const virNodeDevCapData *data) -+{ -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.block); -+ if (data->storage.bus) -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.bus); -+ if (data->storage.drive_type) -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.drive_type); -+ if (data->storage.model) -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.model); -+ if (data->storage.vendor) -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.vendor); -+ if (data->storage.serial) -+ virBufferEscapeString(buf, "%s\n", -+ data->storage.serial); -+ if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_REMOVABLE) { -+ int avl = data->storage.flags & -+ VIR_NODE_DEV_CAP_STORAGE_REMOVABLE_MEDIA_AVAILABLE; -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ virBufferAsprintf(buf, "%d" -+ "\n", avl ? 1 : 0); -+ virBufferAsprintf(buf, "%llu\n", -+ data->storage.removable_media_size); -+ if (data->storage.media_label) -+ virBufferEscapeString(buf, -+ "%s\n", -+ data->storage.media_label); -+ if (data->storage.logical_block_size > 0) -+ virBufferAsprintf(buf, "%llu" -+ "\n", -+ data->storage.logical_block_size); -+ if (data->storage.num_blocks > 0) -+ virBufferAsprintf(buf, -+ "%llu\n", -+ data->storage.num_blocks); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } else { -+ virBufferAsprintf(buf, "%llu\n", -+ data->storage.size); -+ if (data->storage.logical_block_size > 0) -+ virBufferAsprintf(buf, "%llu" -+ "\n", -+ data->storage.logical_block_size); -+ if (data->storage.num_blocks > 0) -+ virBufferAsprintf(buf, "%llu\n", -+ data->storage.num_blocks); -+ } -+ if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE) -+ virBufferAddLit(buf, "\n"); -+} -+ -+ - char * - virNodeDeviceDefFormat(const virNodeDeviceDef *def) - { -@@ -185,7 +499,6 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) - } - - for (caps = def->caps; caps; caps = caps->next) { -- char uuidstr[VIR_UUID_STRING_BUFLEN]; - virNodeDevCapDataPtr data = &caps->data; - - virBufferAsprintf(&buf, "\n", -@@ -193,279 +506,32 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) - virBufferAdjustIndent(&buf, 2); - switch (caps->data.type) { - case VIR_NODE_DEV_CAP_SYSTEM: -- if (data->system.product_name) -- virBufferEscapeString(&buf, "%s\n", -- data->system.product_name); -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- if (data->system.hardware.vendor_name) -- virBufferEscapeString(&buf, "%s\n", -- data->system.hardware.vendor_name); -- if (data->system.hardware.version) -- virBufferEscapeString(&buf, "%s\n", -- data->system.hardware.version); -- if (data->system.hardware.serial) -- virBufferEscapeString(&buf, "%s\n", -- data->system.hardware.serial); -- virUUIDFormat(data->system.hardware.uuid, uuidstr); -- virBufferAsprintf(&buf, "%s\n", uuidstr); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- if (data->system.firmware.vendor_name) -- virBufferEscapeString(&buf, "%s\n", -- data->system.firmware.vendor_name); -- if (data->system.firmware.version) -- virBufferEscapeString(&buf, "%s\n", -- data->system.firmware.version); -- if (data->system.firmware.release_date) -- virBufferEscapeString(&buf, "%s\n", -- data->system.firmware.release_date); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -+ virNodeDeviceCapSystemDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_PCI_DEV: -- virBufferAsprintf(&buf, "%d\n", -- data->pci_dev.domain); -- virBufferAsprintf(&buf, "%d\n", data->pci_dev.bus); -- virBufferAsprintf(&buf, "%d\n", -- data->pci_dev.slot); -- virBufferAsprintf(&buf, "%d\n", -- data->pci_dev.function); -- virBufferAsprintf(&buf, "pci_dev.product); -- if (data->pci_dev.product_name) -- virBufferEscapeString(&buf, ">%s\n", -- data->pci_dev.product_name); -- else -- virBufferAddLit(&buf, " />\n"); -- virBufferAsprintf(&buf, "pci_dev.vendor); -- if (data->pci_dev.vendor_name) -- virBufferEscapeString(&buf, ">%s\n", -- data->pci_dev.vendor_name); -- else -- virBufferAddLit(&buf, " />\n"); -- if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION) { -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- virBufferAsprintf(&buf, -- "
    \n", -- data->pci_dev.physical_function->domain, -- data->pci_dev.physical_function->bus, -- data->pci_dev.physical_function->slot, -- data->pci_dev.physical_function->function); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } -- if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION) { -- virBufferAddLit(&buf, "pci_dev.max_virtual_functions) -- virBufferAsprintf(&buf, " maxCount='%u'", -- data->pci_dev.max_virtual_functions); -- if (data->pci_dev.num_virtual_functions == 0) { -- virBufferAddLit(&buf, "/>\n"); -- } else { -- virBufferAddLit(&buf, ">\n"); -- virBufferAdjustIndent(&buf, 2); -- for (i = 0; i < data->pci_dev.num_virtual_functions; i++) { -- virBufferAsprintf(&buf, -- "
    \n", -- data->pci_dev.virtual_functions[i]->domain, -- data->pci_dev.virtual_functions[i]->bus, -- data->pci_dev.virtual_functions[i]->slot, -- data->pci_dev.virtual_functions[i]->function); -- } -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } -- } -- if (data->pci_dev.hdrType) { -- virBufferAsprintf(&buf, "\n", -- virPCIHeaderTypeToString(data->pci_dev.hdrType)); -- } -- if (data->pci_dev.nIommuGroupDevices) { -- virBufferAsprintf(&buf, "\n", -- data->pci_dev.iommuGroupNumber); -- virBufferAdjustIndent(&buf, 2); -- for (i = 0; i < data->pci_dev.nIommuGroupDevices; i++) { -- virBufferAsprintf(&buf, -- "
    \n", -- data->pci_dev.iommuGroupDevices[i]->domain, -- data->pci_dev.iommuGroupDevices[i]->bus, -- data->pci_dev.iommuGroupDevices[i]->slot, -- data->pci_dev.iommuGroupDevices[i]->function); -- } -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } -- if (data->pci_dev.numa_node >= 0) -- virBufferAsprintf(&buf, "\n", -- data->pci_dev.numa_node); -- -- if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCIE) -- virPCIEDeviceInfoFormat(&buf, data->pci_dev.pci_express); -+ virNodeDeviceCapPCIDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_USB_DEV: -- virBufferAsprintf(&buf, "%d\n", data->usb_dev.bus); -- virBufferAsprintf(&buf, "%d\n", -- data->usb_dev.device); -- virBufferAsprintf(&buf, "usb_dev.product); -- if (data->usb_dev.product_name) -- virBufferEscapeString(&buf, ">%s\n", -- data->usb_dev.product_name); -- else -- virBufferAddLit(&buf, " />\n"); -- virBufferAsprintf(&buf, "usb_dev.vendor); -- if (data->usb_dev.vendor_name) -- virBufferEscapeString(&buf, ">%s\n", -- data->usb_dev.vendor_name); -- else -- virBufferAddLit(&buf, " />\n"); -+ virNodeDeviceCapUSBDevDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_USB_INTERFACE: -- virBufferAsprintf(&buf, "%d\n", -- data->usb_if.number); -- virBufferAsprintf(&buf, "%d\n", -- data->usb_if._class); -- virBufferAsprintf(&buf, "%d\n", -- data->usb_if.subclass); -- virBufferAsprintf(&buf, "%d\n", -- data->usb_if.protocol); -- if (data->usb_if.description) -- virBufferEscapeString(&buf, -- "%s\n", -- data->usb_if.description); -+ virNodeDeviceCapUSBInterfaceDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_NET: -- virBufferEscapeString(&buf, "%s\n", -- data->net.ifname); -- if (data->net.address) -- virBufferEscapeString(&buf, "
    %s
    \n", -- data->net.address); -- virInterfaceLinkFormat(&buf, &data->net.lnk); -- if (data->net.features) { -- for (i = 0; i < VIR_NET_DEV_FEAT_LAST; i++) { -- if (virBitmapIsBitSet(data->net.features, i)) { -- virBufferAsprintf(&buf, "\n", -- virNetDevFeatureTypeToString(i)); -- } -- } -- } -- if (data->net.subtype != VIR_NODE_DEV_CAP_NET_LAST) { -- const char *subtyp = -- virNodeDevNetCapTypeToString(data->net.subtype); -- virBufferEscapeString(&buf, "\n", -- subtyp); -- } -+ virNodeDeviceCapNetDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_SCSI_HOST: -- virBufferAsprintf(&buf, "%d\n", -- data->scsi_host.host); -- if (data->scsi_host.unique_id != -1) -- virBufferAsprintf(&buf, "%d\n", -- data->scsi_host.unique_id); -- if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- virBufferEscapeString(&buf, "%s\n", -- data->scsi_host.wwnn); -- virBufferEscapeString(&buf, "%s\n", -- data->scsi_host.wwpn); -- virBufferEscapeString(&buf, "%s\n", -- data->scsi_host.fabric_wwn); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } -- if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS) { -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- virBufferAsprintf(&buf, "%d\n", -- data->scsi_host.max_vports); -- virBufferAsprintf(&buf, "%d\n", -- data->scsi_host.vports); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } -- -+ virNodeDeviceCapSCSIHostDefFormat(&buf, data); - break; -- - case VIR_NODE_DEV_CAP_SCSI_TARGET: - virBufferEscapeString(&buf, "%s\n", - data->scsi_target.name); - break; -- - case VIR_NODE_DEV_CAP_SCSI: -- virBufferAsprintf(&buf, "%d\n", data->scsi.host); -- virBufferAsprintf(&buf, "%d\n", data->scsi.bus); -- virBufferAsprintf(&buf, "%d\n", -- data->scsi.target); -- virBufferAsprintf(&buf, "%d\n", data->scsi.lun); -- if (data->scsi.type) -- virBufferEscapeString(&buf, "%s\n", -- data->scsi.type); -+ virNodeDeviceCapSCSIDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_STORAGE: -- virBufferEscapeString(&buf, "%s\n", -- data->storage.block); -- if (data->storage.bus) -- virBufferEscapeString(&buf, "%s\n", -- data->storage.bus); -- if (data->storage.drive_type) -- virBufferEscapeString(&buf, "%s\n", -- data->storage.drive_type); -- if (data->storage.model) -- virBufferEscapeString(&buf, "%s\n", -- data->storage.model); -- if (data->storage.vendor) -- virBufferEscapeString(&buf, "%s\n", -- data->storage.vendor); -- if (data->storage.serial) -- virBufferEscapeString(&buf, "%s\n", -- data->storage.serial); -- if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_REMOVABLE) { -- int avl = data->storage.flags & -- VIR_NODE_DEV_CAP_STORAGE_REMOVABLE_MEDIA_AVAILABLE; -- virBufferAddLit(&buf, "\n"); -- virBufferAdjustIndent(&buf, 2); -- virBufferAsprintf(&buf, "%d" -- "\n", avl ? 1 : 0); -- virBufferAsprintf(&buf, "%llu\n", -- data->storage.removable_media_size); -- if (data->storage.media_label) -- virBufferEscapeString(&buf, -- "%s\n", -- data->storage.media_label); -- if (data->storage.logical_block_size > 0) -- virBufferAsprintf(&buf, "%llu" -- "\n", -- data->storage.logical_block_size); -- if (data->storage.num_blocks > 0) -- virBufferAsprintf(&buf, -- "%llu\n", -- data->storage.num_blocks); -- virBufferAdjustIndent(&buf, -2); -- virBufferAddLit(&buf, "\n"); -- } else { -- virBufferAsprintf(&buf, "%llu\n", -- data->storage.size); -- if (data->storage.logical_block_size > 0) -- virBufferAsprintf(&buf, "%llu" -- "\n", -- data->storage.logical_block_size); -- if (data->storage.num_blocks > 0) -- virBufferAsprintf(&buf, "%llu\n", -- data->storage.num_blocks); -- } -- if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE) -- virBufferAddLit(&buf, "\n"); -+ virNodeDeviceCapStorageDefFormat(&buf, data); - break; - case VIR_NODE_DEV_CAP_SCSI_GENERIC: - virBufferEscapeString(&buf, "%s\n", --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch b/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch new file mode 100644 index 0000000..0af72f8 --- /dev/null +++ b/SOURCES/libvirt-conf-qemu-Use-type-aware-switches-where-possible.patch @@ -0,0 +1,115 @@ +From 08c0c0562f8444859cc110e4fc2199d2c4254a53 Mon Sep 17 00:00:00 2001 +Message-Id: <08c0c0562f8444859cc110e4fc2199d2c4254a53@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:54 +0100 +Subject: [PATCH] conf, qemu: Use type-aware switches where possible + +The compiler can warn us if we add a value to the +virDomainChrSerialTargetType enumeration but forget to handle +it properly in the code. Let's take advantage of that. + +This commit is best viewed with 'git diff -w'. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 18dfc0014501c3811ee32669ea96583131dca9b3) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 47 ++++++++++++++++++++++++++++++----------------- + src/qemu/qemu_command.c | 7 ++++++- + 2 files changed, 36 insertions(+), 18 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 530fae9d9d..4b5e7c214f 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -4046,26 +4046,39 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) + def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; + } + } else if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->nserials > 0 && +- def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +- def->serials[0]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) { +- /* Create a stub console to match the serial port. +- * console[0] either does not exist +- * or has a different type than SERIAL or NONE. +- */ +- virDomainChrDefPtr chr; +- if (!(chr = virDomainChrDefNew(NULL))) +- return -1; ++ def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { + +- if (VIR_INSERT_ELEMENT(def->consoles, +- 0, +- def->nconsoles, +- chr) < 0) { +- virDomainChrDefFree(chr); +- return -1; ++ switch ((virDomainChrSerialTargetType) def->serials[0]->targetType) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: { ++ ++ /* Create a stub console to match the serial port. ++ * console[0] either does not exist ++ * or has a different type than SERIAL or NONE. ++ */ ++ virDomainChrDefPtr chr; ++ if (!(chr = virDomainChrDefNew(NULL))) ++ return -1; ++ ++ if (VIR_INSERT_ELEMENT(def->consoles, ++ 0, ++ def->nconsoles, ++ chr) < 0) { ++ virDomainChrDefFree(chr); ++ return -1; ++ } ++ ++ def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; ++ def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; ++ ++ break; + } + +- def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; +- def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ /* Nothing to do */ ++ break; ++ } + } + + return 0; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 19a819a3aa..3d970ed9d1 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -10338,7 +10338,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + serial->info.alias); + } + } else { +- switch (serial->targetType) { ++ switch ((virDomainChrSerialTargetType) serial->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +@@ -10377,6 +10377,11 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + goto error; + } + break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("Invalid target type for serial device")); ++ goto error; + } + + virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s", +-- +2.15.1 + diff --git a/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch b/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch new file mode 100644 index 0000000..7e74c84 --- /dev/null +++ b/SOURCES/libvirt-conf-s-virDomainObjGetShortName-virDomainDefGetShortName.patch @@ -0,0 +1,130 @@ +From db9daffe41e8804f9db0fb70678be99e02efc168 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Thu, 9 Nov 2017 16:06:42 +0100 +Subject: [PATCH] conf: s/virDomainObjGetShortName/virDomainDefGetShortName/ + +https://bugzilla.redhat.com/show_bug.cgi?id=1461214 + +This function works over domain definition and not domain object. +Its name is thus misleading. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit fe70fd0c106e7fbe4f7272e5c041324ea3633ce4) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/conf/domain_conf.c | 4 ++-- + src/conf/domain_conf.h | 2 +- + src/libvirt_private.syms | 2 +- + src/qemu/qemu_conf.c | 2 +- + src/qemu/qemu_domain.c | 4 ++-- + src/qemu/qemu_driver.c | 2 +- + 6 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 394afb0d80..27cfecffda 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -27871,14 +27871,14 @@ virDomainDefHasMemballoon(const virDomainDef *def) + #define VIR_DOMAIN_SHORT_NAME_MAX 20 + + /** +- * virDomainObjGetShortName: ++ * virDomainDefGetShortName: + * @vm: Machine for which to get a name + * @unique: Make sure the name is unique (use id as well) + * + * Shorten domain name to avoid possible path length limitations. + */ + char * +-virDomainObjGetShortName(const virDomainDef *def) ++virDomainDefGetShortName(const virDomainDef *def) + { + wchar_t wshortname[VIR_DOMAIN_SHORT_NAME_MAX + 1] = {0}; + size_t len = 0; +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 171f340785..388fa92dda 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -3366,7 +3366,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, + + bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1); + +-char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1); ++char *virDomainDefGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1); + + int + virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def, +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 811d9053e6..6653f95722 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -262,6 +262,7 @@ virDomainDefGetMemoryInitial; + virDomainDefGetMemoryTotal; + virDomainDefGetOnlineVcpumap; + virDomainDefGetSecurityLabelDef; ++virDomainDefGetShortName; + virDomainDefGetVcpu; + virDomainDefGetVcpuPinInfoHelper; + virDomainDefGetVcpus; +@@ -458,7 +459,6 @@ virDomainObjGetMetadata; + virDomainObjGetOneDef; + virDomainObjGetOneDefState; + virDomainObjGetPersistentDef; +-virDomainObjGetShortName; + virDomainObjGetState; + virDomainObjNew; + virDomainObjParseNode; +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 4e5b33b788..66f9761eea 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1676,7 +1676,7 @@ qemuGetDomainHugepagePath(const virDomainDef *def, + virHugeTLBFSPtr hugepage) + { + char *base = qemuGetBaseHugepagePath(hugepage); +- char *domPath = virDomainObjGetShortName(def); ++ char *domPath = virDomainDefGetShortName(def); + char *ret = NULL; + + if (base && domPath) +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 81bfef946e..27117d83ef 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -1706,7 +1706,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, + { + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + qemuDomainObjPrivatePtr priv = vm->privateData; +- char *domname = virDomainObjGetShortName(vm->def); ++ char *domname = virDomainDefGetShortName(vm->def); + int ret = -1; + + if (!domname) +@@ -8207,7 +8207,7 @@ qemuDomainGetPreservedMountPath(virQEMUDriverConfigPtr cfg, + char *path = NULL; + char *tmp; + const char *suffix = mountpoint + strlen(DEVPREFIX); +- char *domname = virDomainObjGetShortName(vm->def); ++ char *domname = virDomainDefGetShortName(vm->def); + size_t off; + + if (!domname) +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 82c60e6ef1..5617c78997 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -4088,7 +4088,7 @@ getAutoDumpPath(virQEMUDriverPtr driver, + virDomainObjPtr vm) + { + char *dumpfile = NULL; +- char *domname = virDomainObjGetShortName(vm->def); ++ char *domname = virDomainDefGetShortName(vm->def); + char timestr[100]; + struct tm time_info; + time_t curtime = time(NULL); +-- +2.15.0 + diff --git a/SOURCES/libvirt-conf-split-out-virDomainIOMMUDefCheckABIStability.patch b/SOURCES/libvirt-conf-split-out-virDomainIOMMUDefCheckABIStability.patch deleted file mode 100644 index 9d33757..0000000 --- a/SOURCES/libvirt-conf-split-out-virDomainIOMMUDefCheckABIStability.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 244b42c385fc611380bfb2532905a63ce4380254 Mon Sep 17 00:00:00 2001 -Message-Id: <244b42c385fc611380bfb2532905a63ce4380254@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:58 +0200 -Subject: [PATCH] conf: split out virDomainIOMMUDefCheckABIStability -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -(cherry picked from commit 3a276c6524026b661ed7bee4539fc5387b963611) -Signed-off-by: Ján Tomko - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index e77b542f3..7bf480f2a 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -19810,6 +19810,22 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, - - - static bool -+virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, -+ virDomainIOMMUDefPtr dst) -+{ -+ if (src->model != dst->model) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain IOMMU device model '%s' " -+ "does not match source '%s'"), -+ virDomainIOMMUModelTypeToString(dst->model), -+ virDomainIOMMUModelTypeToString(src->model)); -+ return false; -+ } -+ return true; -+} -+ -+ -+static bool - virDomainDefVcpuCheckAbiStability(virDomainDefPtr src, - virDomainDefPtr dst) - { -@@ -20275,14 +20291,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, - } - - if (src->iommu && -- src->iommu->model != dst->iommu->model) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("Target domain IOMMU device model '%s' " -- "does not match source '%s'"), -- virDomainIOMMUModelTypeToString(dst->iommu->model), -- virDomainIOMMUModelTypeToString(src->iommu->model)); -+ !virDomainIOMMUDefCheckABIStability(src->iommu, dst->iommu)) - goto error; -- } - - /* Coverity is not very happy with this - all dead_error_condition */ - #if !STATIC_ANALYSIS --- -2.13.0 - diff --git a/SOURCES/libvirt-conf-use-a-leading-space-in-virDomainVirtioNetDriverFormat.patch b/SOURCES/libvirt-conf-use-a-leading-space-in-virDomainVirtioNetDriverFormat.patch deleted file mode 100644 index fe28da8..0000000 --- a/SOURCES/libvirt-conf-use-a-leading-space-in-virDomainVirtioNetDriverFormat.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 5238dd8211d06fc8c7003bb608e41bb2a4653dec Mon Sep 17 00:00:00 2001 -Message-Id: <5238dd8211d06fc8c7003bb608e41bb2a4653dec@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:48:59 +0200 -Subject: [PATCH] conf: use a leading space in virDomainVirtioNetDriverFormat -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Instead of formatting a space after every option. - -Reviewed-by: Pavel Hrdina -(cherry picked from commit d1feb4773d41b928dc1079dfc19d17b5a0e5957b) -Signed-off-by: Ján Tomko - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 18 ++++++++---------- - 1 file changed, 8 insertions(+), 10 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 701a6d2136..4652e1c72b 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -22053,29 +22053,27 @@ virDomainVirtioNetDriverFormat(char **outstr, - { - virBuffer buf = VIR_BUFFER_INITIALIZER; - if (def->driver.virtio.name) { -- virBufferAsprintf(&buf, "name='%s' ", -+ virBufferAsprintf(&buf, " name='%s'", - virDomainNetBackendTypeToString(def->driver.virtio.name)); - } - if (def->driver.virtio.txmode) { -- virBufferAsprintf(&buf, "txmode='%s' ", -+ virBufferAsprintf(&buf, " txmode='%s'", - virDomainNetVirtioTxModeTypeToString(def->driver.virtio.txmode)); - } - if (def->driver.virtio.ioeventfd) { -- virBufferAsprintf(&buf, "ioeventfd='%s' ", -+ virBufferAsprintf(&buf, " ioeventfd='%s'", - virTristateSwitchTypeToString(def->driver.virtio.ioeventfd)); - } - if (def->driver.virtio.event_idx) { -- virBufferAsprintf(&buf, "event_idx='%s' ", -+ virBufferAsprintf(&buf, " event_idx='%s'", - virTristateSwitchTypeToString(def->driver.virtio.event_idx)); - } - if (def->driver.virtio.queues) -- virBufferAsprintf(&buf, "queues='%u' ", def->driver.virtio.queues); -+ virBufferAsprintf(&buf, " queues='%u'", def->driver.virtio.queues); - if (def->driver.virtio.rx_queue_size) -- virBufferAsprintf(&buf, "rx_queue_size='%u' ", -+ virBufferAsprintf(&buf, " rx_queue_size='%u'", - def->driver.virtio.rx_queue_size); - -- virBufferTrim(&buf, " ", -1); -- - if (virBufferCheckError(&buf) < 0) - return -1; - -@@ -22323,10 +22321,10 @@ virDomainNetDefFormat(virBufferPtr buf, - - if (!gueststr && !hoststr) { - if (str) -- virBufferAsprintf(buf, "\n", str); -+ virBufferAsprintf(buf, "\n", str); - } else { - if (str) -- virBufferAsprintf(buf, "\n", str); -+ virBufferAsprintf(buf, "\n", str); - else - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); --- -2.13.1 - diff --git a/SOURCES/libvirt-cpu-Drop-feature-filtering-from-virCPUUpdate.patch b/SOURCES/libvirt-cpu-Drop-feature-filtering-from-virCPUUpdate.patch deleted file mode 100644 index 239d248..0000000 --- a/SOURCES/libvirt-cpu-Drop-feature-filtering-from-virCPUUpdate.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 2642333131bda397dc4b00fd945efdd34e2aa314 Mon Sep 17 00:00:00 2001 -Message-Id: <2642333131bda397dc4b00fd945efdd34e2aa314@dist-git> -From: Jiri Denemark -Date: Wed, 29 Mar 2017 15:00:21 +0200 -Subject: [PATCH] cpu: Drop feature filtering from virCPUUpdate - -Because of the changes done in the previous commit, @host is already a -migratable CPU and there's no need to do any additional filtering. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 232d87c7dd081d126a079fb45178e0be096cc680) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_x86.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c -index a771b251e..53359ff9b 100644 ---- a/src/cpu/cpu_x86.c -+++ b/src/cpu/cpu_x86.c -@@ -2549,8 +2549,7 @@ x86Baseline(virCPUDefPtr *cpus, - - static int - x86UpdateHostModel(virCPUDefPtr guest, -- const virCPUDef *host, -- virCPUx86MapPtr map) -+ const virCPUDef *host) - { - virCPUDefPtr updated = NULL; - size_t i; -@@ -2559,11 +2558,9 @@ x86UpdateHostModel(virCPUDefPtr guest, - if (!(updated = virCPUDefCopyWithoutModel(host))) - goto cleanup; - -- /* Remove non-migratable features by default */ - updated->type = VIR_CPU_TYPE_GUEST; - updated->mode = VIR_CPU_MODE_CUSTOM; -- if (virCPUDefCopyModelFilter(updated, host, true, -- x86FeatureIsMigratable, map) < 0) -+ if (virCPUDefCopyModel(updated, host, true) < 0) - goto cleanup; - - if (guest->vendor_id) { -@@ -2627,7 +2624,7 @@ virCPUx86Update(virCPUDefPtr guest, - - if (guest->mode == VIR_CPU_MODE_HOST_MODEL || - guest->match == VIR_CPU_MATCH_MINIMUM) -- ret = x86UpdateHostModel(guest, host, map); -+ ret = x86UpdateHostModel(guest, host); - else - ret = 0; - --- -2.12.2 - diff --git a/SOURCES/libvirt-cpu-Introduce-virCPUCopyMigratable.patch b/SOURCES/libvirt-cpu-Introduce-virCPUCopyMigratable.patch deleted file mode 100644 index 382224f..0000000 --- a/SOURCES/libvirt-cpu-Introduce-virCPUCopyMigratable.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 57b2e02a1c4cf52f3ea1ec3af469dd4e44402595 Mon Sep 17 00:00:00 2001 -Message-Id: <57b2e02a1c4cf52f3ea1ec3af469dd4e44402595@dist-git> -From: Jiri Denemark -Date: Wed, 29 Mar 2017 14:45:44 +0200 -Subject: [PATCH] cpu: Introduce virCPUCopyMigratable - -This new internal API makes a copy of virCPUDef while removing all -features which would block migration. It uses cpu_map.xml as a database -of such features, which should only be used as a fallback when we cannot -get the data from a hypervisor. The main goal of this API is to decouple -this filtering from virCPUUpdate so that the hypervisor driver can -filter the features according to the hypervisor. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 05e91c79f19e0be96526098d58a3498dac3f8529) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu.c | 31 +++++++++++++++++++++++++++++++ - src/cpu/cpu.h | 8 ++++++++ - src/cpu/cpu_x86.c | 25 +++++++++++++++++++++++++ - src/libvirt_private.syms | 1 + - 4 files changed, 65 insertions(+) - -diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c -index 93647a2ed..8a407ac18 100644 ---- a/src/cpu/cpu.c -+++ b/src/cpu/cpu.c -@@ -1130,3 +1130,34 @@ virCPUExpandFeatures(virArch arch, - VIR_DEBUG("nfeatures=%zu", cpu->nfeatures); - return 0; - } -+ -+ -+/** -+ * virCPUCopyMigratable: -+ * -+ * @arch: CPU architecture -+ * @cpu: CPU definition to be copied -+ * -+ * Makes a copy of @cpu with all features which would block migration removed. -+ * If this doesn't make sense for a given architecture, the function returns a -+ * plain copy of @cpu (i.e., a copy with no features removed). -+ * -+ * Returns the copy of the CPU or NULL on error. -+ */ -+virCPUDefPtr -+virCPUCopyMigratable(virArch arch, -+ virCPUDefPtr cpu) -+{ -+ struct cpuArchDriver *driver; -+ -+ VIR_DEBUG("arch=%s, cpu=%p, model=%s", -+ virArchToString(arch), cpu, NULLSTR(cpu->model)); -+ -+ if (!(driver = cpuGetSubDriver(arch))) -+ return NULL; -+ -+ if (driver->copyMigratable) -+ return driver->copyMigratable(cpu); -+ else -+ return virCPUDefCopy(cpu); -+} -diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h -index 8c238ad55..352445c40 100644 ---- a/src/cpu/cpu.h -+++ b/src/cpu/cpu.h -@@ -118,6 +118,9 @@ typedef int - typedef int - (*virCPUArchExpandFeatures)(virCPUDefPtr cpu); - -+typedef virCPUDefPtr -+(*virCPUArchCopyMigratable)(virCPUDefPtr cpu); -+ - struct cpuArchDriver { - const char *name; - const virArch *arch; -@@ -138,6 +141,7 @@ struct cpuArchDriver { - virCPUArchTranslate translate; - virCPUArchConvertLegacy convertLegacy; - virCPUArchExpandFeatures expandFeatures; -+ virCPUArchCopyMigratable copyMigratable; - }; - - -@@ -254,6 +258,10 @@ int - virCPUExpandFeatures(virArch arch, - virCPUDefPtr cpu); - -+virCPUDefPtr -+virCPUCopyMigratable(virArch arch, -+ virCPUDefPtr cpu); -+ - /* virCPUDataFormat and virCPUDataParse are implemented for unit tests only and - * have no real-life usage - */ -diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c -index 48648a7f4..a771b251e 100644 ---- a/src/cpu/cpu_x86.c -+++ b/src/cpu/cpu_x86.c -@@ -2903,6 +2903,30 @@ virCPUx86ExpandFeatures(virCPUDefPtr cpu) - } - - -+static virCPUDefPtr -+virCPUx86CopyMigratable(virCPUDefPtr cpu) -+{ -+ virCPUDefPtr copy; -+ virCPUx86MapPtr map; -+ -+ if (!(map = virCPUx86GetMap())) -+ return NULL; -+ -+ if (!(copy = virCPUDefCopyWithoutModel(cpu))) -+ return NULL; -+ -+ if (virCPUDefCopyModelFilter(copy, cpu, false, -+ x86FeatureIsMigratable, map) < 0) -+ goto error; -+ -+ return copy; -+ -+ error: -+ virCPUDefFree(copy); -+ return NULL; -+} -+ -+ - int - virCPUx86DataAddCPUID(virCPUDataPtr cpuData, - const virCPUx86CPUID *cpuid) -@@ -2978,4 +3002,5 @@ struct cpuArchDriver cpuDriverX86 = { - .getModels = virCPUx86GetModels, - .translate = virCPUx86Translate, - .expandFeatures = virCPUx86ExpandFeatures, -+ .copyMigratable = virCPUx86CopyMigratable, - }; -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 9a334311d..cc78c5975 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -1018,6 +1018,7 @@ virCPUCheckFeature; - virCPUCompare; - virCPUCompareXML; - virCPUConvertLegacy; -+virCPUCopyMigratable; - virCPUDataCheckFeature; - virCPUDataFormat; - virCPUDataFree; --- -2.12.2 - diff --git a/SOURCES/libvirt-cpu-Introduce-virCPUGetHostIsSupported.patch b/SOURCES/libvirt-cpu-Introduce-virCPUGetHostIsSupported.patch deleted file mode 100644 index 87757a9..0000000 --- a/SOURCES/libvirt-cpu-Introduce-virCPUGetHostIsSupported.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 401cbf50f18234b0631b4b0e01b9e403137fee95 Mon Sep 17 00:00:00 2001 -Message-Id: <401cbf50f18234b0631b4b0e01b9e403137fee95@dist-git> -From: Jiri Denemark -Date: Tue, 11 Apr 2017 20:45:07 +0200 -Subject: [PATCH] cpu: Introduce virCPUGetHostIsSupported - -Sometimes we want to call virCPUGetHost only when it is implemented for -a given architecture to avoid logging expected and possibly misleading -errors. The new virCPUGetHostIsSupported API may be used to guard such -calls to virCPUGetHost. - -Signed-off-by: Jiri Denemark -(cherry picked from commit bf1a881715c905c67f7d38dcd5bd6c2afbff1f9b) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu.c | 20 ++++++++++++++++++++ - src/cpu/cpu.h | 3 +++ - src/libvirt_private.syms | 1 + - 3 files changed, 24 insertions(+) - -diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c -index 8a407ac18..702b14dbb 100644 ---- a/src/cpu/cpu.c -+++ b/src/cpu/cpu.c -@@ -358,6 +358,26 @@ virCPUDataFree(virCPUDataPtr data) - - - /** -+ * virCPUGetHostIsSupported: -+ * -+ * @arch: CPU architecture -+ * -+ * Check whether virCPUGetHost is supported for @arch. -+ * -+ * Returns true if virCPUGetHost is supported, false otherwise. -+ */ -+bool -+virCPUGetHostIsSupported(virArch arch) -+{ -+ struct cpuArchDriver *driver; -+ -+ VIR_DEBUG("arch=%s", virArchToString(arch)); -+ -+ return (driver = cpuGetSubDriver(arch)) && driver->getHost; -+} -+ -+ -+/** - * virCPUGetHost: - * - * @arch: CPU architecture -diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h -index 352445c40..c6ca111e9 100644 ---- a/src/cpu/cpu.h -+++ b/src/cpu/cpu.h -@@ -183,6 +183,9 @@ virCPUDataNew(virArch arch); - void - virCPUDataFree(virCPUDataPtr data); - -+bool -+virCPUGetHostIsSupported(virArch arch); -+ - virCPUDefPtr - virCPUGetHost(virArch arch, - virCPUType type, -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index cc78c5975..d802e7598 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -1026,6 +1026,7 @@ virCPUDataNew; - virCPUDataParse; - virCPUExpandFeatures; - virCPUGetHost; -+virCPUGetHostIsSupported; - virCPUGetModels; - virCPUProbeHost; - virCPUTranslate; --- -2.12.2 - diff --git a/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch b/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch new file mode 100644 index 0000000..a915513 --- /dev/null +++ b/SOURCES/libvirt-cpu-add-CPU-features-and-model-for-indirect-branch-prediction-protection.patch @@ -0,0 +1,171 @@ +From 9df09ec5e1afef8659271c6cc4a5b741d5d06815 Mon Sep 17 00:00:00 2001 +Message-Id: <9df09ec5e1afef8659271c6cc4a5b741d5d06815@dist-git> +From: Paolo Bonzini +Date: Tue, 12 Dec 2017 16:23:42 +0100 +Subject: [PATCH] cpu: add CPU features and model for indirect branch + prediction protection + +CVE-2017-5715 + +Signed-off-by: Paolo Bonzini +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_map.xml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 58 insertions(+) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index 96f4ce60dd..a7888ec134 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -292,6 +292,15 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -420,6 +429,11 @@ + + + ++ ++ ++ ++ ++ + + + +@@ -866,6 +880,10 @@ + + + ++ ++ ++ ++ + + + +@@ -903,6 +921,10 @@ + + + ++ ++ ++ ++ + + + +@@ -946,6 +968,10 @@ + + + ++ ++ ++ ++ + + + +@@ -995,6 +1021,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1048,6 +1078,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1103,6 +1137,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1160,6 +1198,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1219,6 +1261,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1287,6 +1333,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1362,6 +1412,10 @@ + + + ++ ++ ++ ++ + + + +@@ -1700,6 +1754,10 @@ + + + ++ ++ ++ ++ + + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-cpu_ppc64-Add-support-for-host-model-on-POWER9.patch b/SOURCES/libvirt-cpu_ppc64-Add-support-for-host-model-on-POWER9.patch deleted file mode 100644 index db7e944..0000000 --- a/SOURCES/libvirt-cpu_ppc64-Add-support-for-host-model-on-POWER9.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 3feb7797cfe7ac9cfd05fbc5d008527b1a88c06a Mon Sep 17 00:00:00 2001 -Message-Id: <3feb7797cfe7ac9cfd05fbc5d008527b1a88c06a@dist-git> -From: Jiri Denemark -Date: Wed, 17 May 2017 16:39:16 +0200 -Subject: [PATCH] cpu_ppc64: Add support for host-model on POWER9 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 5c8c2d1633f3d2500e49132296793fc267648d2b) - -https://bugzilla.redhat.com/show_bug.cgi?id=1450770 - -Signed-off-by: Jiri Denemark ---- - src/cpu/cpu_ppc64.c | 8 ++++---- - .../qemuxml2argv-pseries-cpu-compat-power9.args | 24 ++++++++++++++++++++++ - .../qemuxml2argv-pseries-cpu-compat-power9.xml | 21 +++++++++++++++++++ - tests/qemuxml2argvtest.c | 7 +++++++ - tests/testutilsqemu.c | 13 +++++++++++- - tests/testutilsqemu.h | 1 + - 6 files changed, 69 insertions(+), 5 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.xml - -diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c -index f64592b558..bf08599049 100644 ---- a/src/cpu/cpu_ppc64.c -+++ b/src/cpu/cpu_ppc64.c -@@ -92,22 +92,22 @@ ppc64CheckCompatibilityMode(const char *host_model, - if (!compat_mode) - return VIR_CPU_COMPARE_IDENTICAL; - -- /* Valid host CPUs: POWER6, POWER7, POWER8 */ -+ /* Valid host CPUs: POWER6, POWER7, POWER8, POWER9 */ - if (!STRPREFIX(host_model, "POWER") || - !(tmp = (char *) host_model + strlen("POWER")) || - virStrToLong_i(tmp, NULL, 10, &host) < 0 || -- host < 6 || host > 8) { -+ host < 6 || host > 9) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", - _("Host CPU does not support compatibility modes")); - goto out; - } - -- /* Valid compatibility modes: power6, power7, power8 */ -+ /* Valid compatibility modes: power6, power7, power8, power9 */ - if (!STRPREFIX(compat_mode, "power") || - !(tmp = (char *) compat_mode + strlen("power")) || - virStrToLong_i(tmp, NULL, 10, &compat) < 0 || -- compat < 6 || compat > 8) { -+ compat < 6 || compat > 9) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown compatibility mode %s"), - compat_mode); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args -new file mode 100644 -index 0000000000..af93d63dc9 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.args -@@ -0,0 +1,24 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-ppc64 \ -+-name QEMUGuest1 \ -+-S \ -+-M pseries \ -+-cpu host,compat=power9 \ -+-m 256 \ -+-smp 4,sockets=4,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefconfig \ -+-nodefaults \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ -+-boot c \ -+-usb \ -+-chardev pty,id=charserial0 \ -+-device spapr-vty,chardev=charserial0,reg=0x30000000 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.xml -new file mode 100644 -index 0000000000..30ab5c2679 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat-power9.xml -@@ -0,0 +1,21 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 4 -+ -+ hvm -+ -+ -+ power9 -+ -+ -+ -+ /usr/bin/qemu-system-ppc64 -+ -+
    -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 5ca27f105d..6ac24c9bb0 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1688,6 +1688,13 @@ mymain(void) - QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, - QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ DO_TEST_FAILURE("pseries-cpu-compat-power9", QEMU_CAPS_KVM); -+ -+ qemuTestSetHostCPU(driver.caps, cpuPower9); -+ DO_TEST("pseries-cpu-compat-power9", -+ QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ qemuTestSetHostCPU(driver.caps, NULL); -+ - qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); - - DO_TEST("pseries-panic-missing", -diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c -index 4cc482dfb0..fe2941efbf 100644 ---- a/tests/testutilsqemu.c -+++ b/tests/testutilsqemu.c -@@ -17,6 +17,7 @@ - virCPUDefPtr cpuDefault; - virCPUDefPtr cpuHaswell; - virCPUDefPtr cpuPower8; -+virCPUDefPtr cpuPower9; - - static virCPUFeatureDef cpuDefaultFeatures[] = { - { (char *) "ds", -1 }, -@@ -94,6 +95,15 @@ static virCPUDef cpuPower8Data = { - .threads = 8, - }; - -+static virCPUDef cpuPower9Data = { -+ .type = VIR_CPU_TYPE_HOST, -+ .arch = VIR_ARCH_PPC64, -+ .model = (char *) "POWER9", -+ .sockets = 1, -+ .cores = 16, -+ .threads = 1, -+}; -+ - static virCapsGuestMachinePtr *testQemuAllocMachines(int *nmachines) - { - virCapsGuestMachinePtr *machines; -@@ -334,7 +344,8 @@ virCapsPtr testQemuCapsInit(void) - - if (!(cpuDefault = virCPUDefCopy(&cpuDefaultData)) || - !(cpuHaswell = virCPUDefCopy(&cpuHaswellData)) || -- !(cpuPower8 = virCPUDefCopy(&cpuPower8Data))) -+ !(cpuPower8 = virCPUDefCopy(&cpuPower8Data)) || -+ !(cpuPower9 = virCPUDefCopy(&cpuPower9Data))) - goto cleanup; - - qemuTestSetHostCPU(caps, NULL); -diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h -index 047a64d1ac..781b435cc2 100644 ---- a/tests/testutilsqemu.h -+++ b/tests/testutilsqemu.h -@@ -21,6 +21,7 @@ virQEMUCapsPtr qemuTestParseCapabilities(virCapsPtr caps, - extern virCPUDefPtr cpuDefault; - extern virCPUDefPtr cpuHaswell; - extern virCPUDefPtr cpuPower8; -+extern virCPUDefPtr cpuPower9; - - void qemuTestSetHostArch(virCapsPtr caps, - virArch arch); --- -2.13.1 - diff --git a/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch b/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch new file mode 100644 index 0000000..b81e716 --- /dev/null +++ b/SOURCES/libvirt-cpu_x86-Copy-CPU-signature-from-ancestor.patch @@ -0,0 +1,47 @@ +From 38b3d773dddd7f3cfe715b9cbabaa296c16c1290 Mon Sep 17 00:00:00 2001 +Message-Id: <38b3d773dddd7f3cfe715b9cbabaa296c16c1290@dist-git> +From: Jiri Denemark +Date: Fri, 5 Jan 2018 17:43:03 +0100 +Subject: [PATCH] cpu_x86: Copy CPU signature from ancestor + +When specifying a new CPU model in cpu_map.xml as an extension to an +existing model, we forgot to copy the signature (family + model) from +the original CPU model. + +We don't use this way of specifying CPU models, but it's still supported +and it becomes useful when someone wants to quickly hack up a CPU model +for testing or when creating additional variants of existing models to +help with fixing some spectral issues. + +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +(cherry picked from commit b427cf4831d0ea7aac9dd1a3aa7682478356a483) + +https://bugzilla.redhat.com/show_bug.cgi?id=1533125 + +The new -IBRS and -IBPB CPU models were defined via inheritance from +their original models in RHEL. Thus when the host CPU matches the +signature of the original model from cpu_map.xml, libvirt will detect +the host CPU as the original model + the new feature rather than +reporting it as the -IBRS/-IBPB variant. + +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_x86.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c +index ad35532fc1..001109f701 100644 +--- a/src/cpu/cpu_x86.c ++++ b/src/cpu/cpu_x86.c +@@ -1227,6 +1227,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, + VIR_FREE(name); + + model->vendor = ancestor->vendor; ++ model->signature = ancestor->signature; + if (x86DataCopy(&model->data, &ancestor->data) < 0) + goto error; + } +-- +2.15.1 + diff --git a/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch b/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch new file mode 100644 index 0000000..b757b16 --- /dev/null +++ b/SOURCES/libvirt-cpu_x86-Rename-virCPUx86MapInitialize.patch @@ -0,0 +1,52 @@ +From b200b9cbb5c6c7d3d3b1bb4f745a7371cc35a429 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Wed, 13 Dec 2017 22:30:31 +0100 +Subject: [PATCH] cpu_x86: Rename virCPUx86MapInitialize + +The function will be used to initialize internal data of the x86 CPU +driver (including the CPU map). + +CVE-2017-5715 + +Signed-off-by: Jiri Denemark +--- + src/cpu/cpu_x86.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c +index a6cbd45766..693e571a3d 100644 +--- a/src/cpu/cpu_x86.c ++++ b/src/cpu/cpu_x86.c +@@ -153,8 +153,8 @@ struct _virCPUx86Map { + }; + + static virCPUx86MapPtr cpuMap; +-int virCPUx86MapOnceInit(void); +-VIR_ONCE_GLOBAL_INIT(virCPUx86Map); ++int virCPUx86DriverOnceInit(void); ++VIR_ONCE_GLOBAL_INIT(virCPUx86Driver); + + + typedef enum { +@@ -1404,7 +1404,7 @@ virCPUx86LoadMap(void) + + + int +-virCPUx86MapOnceInit(void) ++virCPUx86DriverOnceInit(void) + { + if (!(cpuMap = virCPUx86LoadMap())) + return -1; +@@ -1416,7 +1416,7 @@ virCPUx86MapOnceInit(void) + static virCPUx86MapPtr + virCPUx86GetMap(void) + { +- if (virCPUx86MapInitialize() < 0) ++ if (virCPUx86DriverInitialize() < 0) + return NULL; + + return cpuMap; +-- +2.15.1 + diff --git a/SOURCES/libvirt-daemon-Don-t-initialize-SASL-context-if-not-necessary.patch b/SOURCES/libvirt-daemon-Don-t-initialize-SASL-context-if-not-necessary.patch deleted file mode 100644 index 159fca0..0000000 --- a/SOURCES/libvirt-daemon-Don-t-initialize-SASL-context-if-not-necessary.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8c9296cbe21657aadbc4bff88eabd617168349f6 Mon Sep 17 00:00:00 2001 -Message-Id: <8c9296cbe21657aadbc4bff88eabd617168349f6@dist-git> -From: Peter Krempa -Date: Fri, 2 Jun 2017 15:07:59 +0200 -Subject: [PATCH] daemon: Don't initialize SASL context if not necessary - -SASL context would be initialized even if the corresponding TCP or TLS -sockets are not enabled. - -fe772f24a68 attempted to fix the symptom by commenting out the settings, -but that did not fix the root cause. 3c647ee4bbb later reverted those -changes so that the more secure algorithm is used. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450095 -(cherry picked from commit ed914284ba74afb7dd16dcb623073bb1a1d5cd21) - -Signed-off-by: Jiri Denemark ---- - daemon/libvirtd.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c -index 891238bcbe..bac4bc1b65 100644 ---- a/daemon/libvirtd.c -+++ b/daemon/libvirtd.c -@@ -613,11 +613,11 @@ daemonSetupNetworking(virNetServerPtr srv, - - #if WITH_SASL - if (config->auth_unix_rw == REMOTE_AUTH_SASL || -- config->auth_unix_ro == REMOTE_AUTH_SASL || -+ (sock_path_ro && config->auth_unix_ro == REMOTE_AUTH_SASL) || - # if WITH_GNUTLS -- config->auth_tls == REMOTE_AUTH_SASL || -+ (ipsock && config->listen_tls && config->auth_tls == REMOTE_AUTH_SASL) || - # endif -- config->auth_tcp == REMOTE_AUTH_SASL) { -+ (ipsock && config->listen_tcp && config->auth_tcp == REMOTE_AUTH_SASL)) { - saslCtxt = virNetSASLContextNewServer( - (const char *const*)config->sasl_allowed_username_list); - if (!saslCtxt) --- -2.13.1 - diff --git a/SOURCES/libvirt-disk-Force-usage-of-parted-when-checking-disk-format-for-bsd.patch b/SOURCES/libvirt-disk-Force-usage-of-parted-when-checking-disk-format-for-bsd.patch deleted file mode 100644 index e867cc5..0000000 --- a/SOURCES/libvirt-disk-Force-usage-of-parted-when-checking-disk-format-for-bsd.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 911438df6c652e377f80712c67da90aed91444b7 Mon Sep 17 00:00:00 2001 -Message-Id: <911438df6c652e377f80712c67da90aed91444b7@dist-git> -From: John Ferlan -Date: Wed, 26 Apr 2017 08:41:09 -0400 -Subject: [PATCH] disk: Force usage of parted when checking disk format for - "bsd" - -https://bugzilla.redhat.com/show_bug.cgi?id=1439132 - -Add "bsd" to the list of format types to not checked during blkid -processing even though it supposedly knows the format - for some -(now unknown) reason it's returning partition table not found. So -let's just let PARTED handle "bsd" too. - -Signed-off-by: John Ferlan -(cherry picked from commit 98f424d5038b362d1b62549930d0b9253106bdca) -Signed-off-by: Jiri Denemark ---- - src/storage/storage_util.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c -index 7a458b828..adec9ab6f 100644 ---- a/src/storage/storage_util.c -+++ b/src/storage/storage_util.c -@@ -3002,10 +3002,12 @@ virStorageBackendBLKIDFindPart(blkid_probe probe, - - /* A blkid_known_pttype on "dvh" and "pc98" returns a failure; - * however, the blkid_do_probe for "dvh" returns "sgi" and -- * for "pc98" it returns "dos". So since those will cause problems -+ * for "pc98" it returns "dos". Although "bsd" is recognized, -+ * it seems that the parted created partition table is not being -+ * properly recogized. Since each of these will cause problems - * with startup comparison, let's just treat them as UNKNOWN causing - * the caller to fallback to using PARTED */ -- if (STREQ(format, "dvh") || STREQ(format, "pc98")) -+ if (STREQ(format, "dvh") || STREQ(format, "pc98") || STREQ(format, "bsd")) - return VIR_STORAGE_BLKID_PROBE_UNKNOWN; - - /* Make sure we're doing a partitions probe from the start */ --- -2.12.2 - diff --git a/SOURCES/libvirt-disk-Resolve-issues-with-disk-partition-build-start-checks.patch b/SOURCES/libvirt-disk-Resolve-issues-with-disk-partition-build-start-checks.patch deleted file mode 100644 index 77b111d..0000000 --- a/SOURCES/libvirt-disk-Resolve-issues-with-disk-partition-build-start-checks.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 5c1a822cfa7993b1f55f90b75b66c86787a063d1 Mon Sep 17 00:00:00 2001 -Message-Id: <5c1a822cfa7993b1f55f90b75b66c86787a063d1@dist-git> -From: John Ferlan -Date: Wed, 26 Apr 2017 08:41:08 -0400 -Subject: [PATCH] disk: Resolve issues with disk partition build/start checks - -https://bugzilla.redhat.com/show_bug.cgi?id=1439132 - -Commit id 'a48c674fb' added a check for format types "dvh" and "pc98" -to use the parted print processing instead of using blkid processing -in order to validate the label on the disk was what is expected for -disk pool startup. However, commit id 'a4cb4a74f' really messed things -up by missing an else condition causing PARTEDFindLabel to always -return DIFFERENT. - -Signed-off-by: John Ferlan -(cherry picked from commit f2a123203105b4fe010aea866e87f8bcf5f31193) -Signed-off-by: Jiri Denemark ---- - src/storage/storage_util.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c -index 0ceaab6b9..7a458b828 100644 ---- a/src/storage/storage_util.c -+++ b/src/storage/storage_util.c -@@ -3213,8 +3213,8 @@ virStorageBackendPARTEDFindLabel(const char *device, - /* Does the on disk match what the pool desired? */ - if (STREQ(start, format)) - ret = VIR_STORAGE_PARTED_MATCH; -- -- ret = VIR_STORAGE_PARTED_DIFFERENT; -+ else -+ ret = VIR_STORAGE_PARTED_DIFFERENT; - - cleanup: - virCommandFree(cmd); --- -2.12.2 - diff --git a/SOURCES/libvirt-disk-Use-virStorageBackendZeroPartitionTable.patch b/SOURCES/libvirt-disk-Use-virStorageBackendZeroPartitionTable.patch deleted file mode 100644 index 705de4d..0000000 --- a/SOURCES/libvirt-disk-Use-virStorageBackendZeroPartitionTable.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 9aeaadcf7d7f33cc5208bcbc788676f27691843a Mon Sep 17 00:00:00 2001 -Message-Id: <9aeaadcf7d7f33cc5208bcbc788676f27691843a@dist-git> -From: John Ferlan -Date: Wed, 26 Apr 2017 08:41:14 -0400 -Subject: [PATCH] disk: Use virStorageBackendZeroPartitionTable - -https://bugzilla.redhat.com/show_bug.cgi?id=1439132 - -During 'matrix' testing of all possible combinations I found that if -device is formated with "gpt" first, then an attempt is made to format -using "mac", a startup will fail. - -Deeper analysis by Peter Krempa indicates that the "mac" table fits -into the first block on the disk. Since the GPT disklabel is stored -at LBA address 1 it is not overwritten at all. Thus it's apparent that -the (blkid) detection tool then prefers GPT over a older disklabel. - -The GPT disklabel has also a secondary copy at the last LBA of the disk. - -So, follow the same logic as the logical pool in clearing a 1MB swath -at the beginning and end of the device to avoid potential issues with -larger sector sizes for the device. - -Also fixed a minor formatting nit in virStorageBackendDeviceIsEmpty call. - -(cherry picked from commit 3c4f2e3fb725054921f855a229afc7daca7119ae) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/storage/storage_backend_disk.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c -index 39371f2d9..e8f67bb00 100644 ---- a/src/storage/storage_backend_disk.c -+++ b/src/storage/storage_backend_disk.c -@@ -491,11 +491,15 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED, - ok_to_mklabel = true; - } else { - if (virStorageBackendDeviceIsEmpty(pool->def->source.devices[0].path, -- fmt, true)) -+ fmt, true)) - ok_to_mklabel = true; - } - - if (ok_to_mklabel) { -+ if (virStorageBackendZeroPartitionTable(pool->def->source.devices[0].path, -+ 1024 * 1024) < 0) -+ goto error; -+ - /* eg parted /dev/sda mklabel --script msdos */ - if (format == VIR_STORAGE_POOL_DISK_UNKNOWN) - format = pool->def->source.format = VIR_STORAGE_POOL_DISK_DOS; --- -2.12.2 - diff --git a/SOURCES/libvirt-docs-Document-the-mediated-devices-within-the-nodedev-driver.patch b/SOURCES/libvirt-docs-Document-the-mediated-devices-within-the-nodedev-driver.patch deleted file mode 100644 index fa10ab2..0000000 --- a/SOURCES/libvirt-docs-Document-the-mediated-devices-within-the-nodedev-driver.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 9a202d80f7b60fcf6caf059570bfd2d0b0cbe8a4 Mon Sep 17 00:00:00 2001 -Message-Id: <9a202d80f7b60fcf6caf059570bfd2d0b0cbe8a4@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:55 +0200 -Subject: [PATCH] docs: Document the mediated devices within the nodedev driver - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit a0a0b3cf71cbee1df40dd0fdebd7bb6a84682f09) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - docs/drvnodedev.html.in | 168 +++++++++++++++++++++++++++++++++++++++++++++++- - tools/virsh.pod | 7 +- - 2 files changed, 171 insertions(+), 4 deletions(-) - -diff --git a/docs/drvnodedev.html.in b/docs/drvnodedev.html.in -index 0a3870343..26c52dd0d 100644 ---- a/docs/drvnodedev.html.in -+++ b/docs/drvnodedev.html.in -@@ -9,7 +9,7 @@ - (historically also referred to as node devices) like USB, PCI, SCSI, and - network devices. This also includes various virtualization capabilities - which the aforementioned devices provide for utilization, for example -- SR-IOV, NPIV, DRM, etc. -+ SR-IOV, NPIV, MDEV, DRM, etc. -

    - -

    -@@ -75,6 +75,7 @@ - storage (Since 1.0.4), - scsi_generic (Since 1.0.7), - drm (Since 3.1.0), and -+ mdev (Since 3.4.0). - This element can be nested in which case it further specifies a - device's capability. Refer to specific device types to see more values - for the type attribute which are exclusive. -@@ -185,5 +186,170 @@ - ... - <device>

    - -+

    MDEV capability

    -+

    -+ A PCI device capable of creating mediated devices will include a nested -+ capability mdev_types which enumerates all supported mdev -+ types on the physical device, along with the type attributes available -+ through sysfs: -+

    -+ -+
    -+
    type
    -+
    -+ This element describes a mediated device type which acts as an -+ abstract template defining a resource allocation for instances of this -+ device type. The element has one attribute id which holds -+ an official vendor-supplied identifier for the type. -+ Since 3.4.0 -+
    -+ -+
    name
    -+
    -+ The name element holds a vendor-supplied code name for -+ the given mediated device type. This is an optional element. -+ Since 3.4.0 -+
    -+ -+
    deviceAPI
    -+
    -+ The value of this element describes how an instance of the given type -+ will be presented to the guest by the VFIO framework. -+ Since 3.4.0 -+
    -+ -+
    availableInstances
    -+
    -+ This element reports the current state of resource allocation. In other -+ words, how many instances of the given type can still be successfully -+ created on the physical device. -+ Since 3.4.0 -+
    -+
    -+ -+

    -+ For a more info about mediated devices, refer to the -+ paragraph below. -+

    -+ -+
    -+<device>
    -+...
    -+  <driver>
    -+    <name>nvidia</name>
    -+  </driver>
    -+  <capability type='pci'>
    -+...
    -+    <capability type='mdev_types'>
    -+      <type id='nvidia-11'>
    -+        <name>GRID M60-0B</name>
    -+        <deviceAPI>vfio-pci</deviceAPI>
    -+        <availableInstances>16</availableInstances>
    -+      </type>
    -+      <!-- Here would come the rest of the available mdev types -->
    -+    </capability>
    -+...
    -+  </capability>
    -+</device>
    -+ -+

    Mediated devices (MDEVs)

    -+

    -+ Mediated devices (Since 3.2.0) are software -+ devices defining resource allocation on the backing physical device which -+ in turn allows the parent physical device's resources to be divided into -+ several mediated devices, thus sharing the physical device's performance -+ among multiple guests. Unlike SR-IOV however, where a PCIe device appears -+ as multiple separate PCIe devices on the host's PCI bus, mediated devices -+ only appear on the mdev virtual bus. Therefore, no detach/reattach -+ procedure from/to the host driver procedure is involved even though -+ mediated devices are used in a direct device assignment manner. -+

    -+ -+

    -+ The following sub-elements and attributes are exposed within the -+ capability element: -+

    -+ -+
    -+
    type
    -+
    -+ This element describes a mediated device type which acts as an -+ abstract template defining a resource allocation for instances of this -+ device type. The element has one attribute id which holds -+ an official vendor-supplied identifier for the type. -+ Since 3.4.0 -+
    -+ -+
    iommuGroup
    -+
    -+ This element supports a single attribute number which holds -+ the IOMMU group number the mediated device belongs to. -+ Since 3.4.0 -+
    -+
    -+ -+

    Example of a mediated device

    -+
    -+<device>
    -+  <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name>
    -+  <path>/sys/devices/pci0000:00/0000:00:02.0/4b20d080-1b54-4048-85b3-a6a62d165c01</path>
    -+  <parent>pci_0000_06_00_0</parent>
    -+  <driver>
    -+    <name>vfio_mdev</name>
    -+  </driver>
    -+  <capability type='mdev'>
    -+    <type id='nvidia-11'/>
    -+    <iommuGroup number='12'/>
    -+  <capability/>
    -+<device/>
    -+ -+

    -+ The support of mediated device's framework in libvirt's node device driver -+ covers the following features: -+

    -+ -+
      -+
    • -+ list available mediated devices on the host -+ (Since 3.4.0) -+
    • -+
    • -+ display device details -+ (Since 3.4.0) -+
    • -+
    -+ -+

    -+ Because mediated devices are instantiated from vendor specific templates, -+ simply called 'types', information describing these types is contained -+ within the parent device's capabilities -+ (see the example in PCI host devices). -+

    -+ -+

    -+ To see the supported mediated device types on a specific physical device -+ use the following: -+

    -+ -+
    -+$ ls /sys/class/mdev_bus/<device>/mdev_supported_types
    -+ -+

    -+ To manually instantiate a mediated device, use one of the following as a -+ reference: -+

    -+ -+
    -+$ uuidgen > /sys/class/mdev_bus/<device>/mdev_supported_types/<type>/create
    -+...
    -+$ echo <UUID> > /sys/class/mdev_bus/<device>/mdev_supported_types/<type>/create
    -+ -+

    -+ Manual removal of a mediated device is then performed as follows: -+

    -+ -+
    -+$ echo 1 > /sys/bus/mdev/devices/<uuid>/remove
    -+ - - -diff --git a/tools/virsh.pod b/tools/virsh.pod -index 0dd1fc7b2..11bacefa9 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -3155,10 +3155,11 @@ for HBA). - - List all of the devices available on the node that are known by libvirt. - I is used to filter the list by capability types, the types must be --separated by comma, e.g. --cap pci,scsi, valid capability types include -+separated by comma, e.g. --cap pci,scsi. Valid capability types include - 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target', --'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm'.If I<--tree> --is used, the output is formatted in a tree representing parents of each -+'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev', -+'mdev_types'. -+If I<--tree> is used, the output is formatted in a tree representing parents of each - node. I and I<--tree> are mutually exclusive. - - =item B I --- -2.13.0 - diff --git a/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch b/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch new file mode 100644 index 0000000..7467515 --- /dev/null +++ b/SOURCES/libvirt-docs-Improve-documentation-for-serial-consoles.patch @@ -0,0 +1,294 @@ +From 07ed5aa86d223b1e99ef716429be60c1823ce0f5 Mon Sep 17 00:00:00 2001 +Message-Id: <07ed5aa86d223b1e99ef716429be60c1823ce0f5@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:55 +0100 +Subject: [PATCH] docs: Improve documentation for serial consoles + +Our current documentation is missing some information and doesn't +do a great job at explaining how the and elements +are connected. Let's try to fix that. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 4567cecb372c48095fce23ce3040d1c687cc3640) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 224 +++++++++++++++++++++++++++++++++------------- + 1 file changed, 164 insertions(+), 60 deletions(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 4f28dce355..f57a124056 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -6434,77 +6434,68 @@ qemu-kvm -net nic,model=? /dev/null +
    + ...
    + <devices>
    ++  <!-- Serial port -->
    +   <serial type='pty'>
    +     <source path='/dev/pts/3'/>
    +     <target port='0'/>
    +   </serial>
    + </devices>
    ++...
    ++ ++
    ++...
    ++<devices>
    ++  <!-- USB serial port -->
    ++  <serial type='pty'>
    ++    <target type='usb-serial' port='0'/>
    ++    <address type='usb' bus='0' port='1'/>
    ++  </serial>
    ++</devices>
    + ...
    + +

    +- target can have a port attribute, which +- specifies the port number. Ports are numbered starting from 0. There are +- usually 0, 1 or 2 serial ports. There is also an optional +- type attribute since 1.0.2 +- which has three choices for its value, one is isa-serial, +- then usb-serial and last one is pci-serial. +- If type is missing, isa-serial will be used by +- default. For usb-serial an optional sub-element +- <address/> with type='usb' can tie the +- device to a particular controller, documented above. +- Similarly, pci-serial can be used to attach the device to +- the pci bus (since 1.2.16). Again, it has +- optional sub-element <address/> with +- type='pci' to select desired location on the PCI bus. ++ The target element can have an optional port ++ attribute, which specifies the port number (starting from 0), and an ++ optional type attribute: valid values are, ++ since 1.0.2, isa-serial (usable ++ with x86 guests), usb-serial (usable whenever USB support ++ is available) and pci-serial (usable whenever PCI support ++ is available). ++

    ++ ++

    ++ If any of the attributes is not specified by the user, libvirt will ++ choose a value suitable for most users. ++

    ++ ++

    ++ All of the target types support configuring the guest-visible device ++ address as documented above; more ++ specifically, acceptable address types are isa (for ++ isa-serial), usb (for usb-serial) ++ and pci (for pci-serial). ++

    ++ ++

    ++ For the relationship between serial ports and consoles, ++ see below. +

    + +
    Console
    + +-

    +- The console element is used to represent interactive consoles. Depending +- on the type of guest in use, the consoles might be paravirtualized devices, +- or they might be a clone of a serial device, according to the following +- rules: +-

    +- +-
      +-
    • If no targetType attribute is set, then the default +- device type is according to the hypervisor's rules. The default +- type will be added when re-querying the XML fed into libvirt. +- For fully virtualized guests, the default device type will usually +- be a serial port.
    • +-
    • If the targetType attribute is serial, +- then if no <serial> element exists, the console +- element will be copied to the serial element. If a <serial> +- element does already exist, the console element will be ignored.
    • +-
    • If the targetType attribute is not serial, +- it will be treated normally.
    • +-
    • Only the first console element may use a targetType +- of serial. Secondary consoles must all be paravirtualized. +-
    • +-
    • On S390, the console element may use a +- targetType of sclp or sclplm +- (line mode). SCLP is the native console type for S390. There's no +- controller associated to SCLP consoles. +- Since 1.0.2 +-
    • +-
    +- +-

    +- A virtio console device is exposed in the +- guest as /dev/hvc[0-7] (for more information, see +- http://fedoraproject.org/wiki/Features/VirtioSerial) +- Since 0.8.3 +-

    +- +
    + ...
    + <devices>
    ++  <!-- Serial console -->
    +   <console type='pty'>
    +-    <source path='/dev/pts/4'/>
    +-    <target port='0'/>
    ++    <source path='/dev/pts/2'/>
    ++    <target type='serial' port='0'/>
    +   </console>
    ++</devices>
    ++...
    + ++
    ++...
    +   <!-- KVM virtio console -->
    +   <console type='pty'>
    +     <source path='/dev/pts/5'/>
    +@@ -6513,21 +6504,134 @@ qemu-kvm -net nic,model=? /dev/null
    + </devices>
    + ...
    + ++

    ++ The console element is used to represent interactive ++ serial consoles. Depending on the type of guest in use and the specifics ++ of the configuration, the console element might represent ++ the same device as an existing serial element or a separate ++ device. ++

    ++ ++

    ++ A target subelement is supported and works the same ++ way as with the serial element ++ (see above for details). ++ Valid values for the type attribute are: ++ serial (described below); ++ virtio (usable whenever VirtIO support is available); ++ xen, lxc, uml and ++ openvz (available when the corresponding hypervisor is in ++ use); sclp and sclplm (usable for s390 and ++ s390x QEMU guests). ++

    ++ ++

    ++ Of the target types listed above, serial is special in ++ that it doesn't represents a separate device, but rather the same ++ device as the first serial element. Due to this, there can ++ only be a single console element with target type ++ serial per guest. ++

    ++ ++

    ++ Virtio consoles are usually accessible as /dev/hvc[0-7] ++ from inside the guest; for more information, see ++ http://fedoraproject.org/wiki/Features/VirtioSerial. ++ Since 0.8.3 ++

    ++ ++

    ++ For the relationship between serial ports and consoles, ++ see below. ++

    ++ ++
    Relationship between serial ports and consoles
    ++ ++

    ++ Due to hystorical reasons, the serial and ++ console elements have partially overlapping scopes. ++

    ++ ++

    ++ In general, both elements are used to configure one or more serial ++ consoles to be used for interacting with the guest. The main difference ++ between the two is that serial is used for emulated, ++ usually native, serial consoles, whereas console is used ++ for paravirtualized ones. ++

    ++ ++

    ++ Both emulated and paravirtualized serial consoles have advantages and ++ disadvantages: ++

    ++ ++
      ++
    • ++ emulated serial consoles are usually initialized much earlier than ++ paravirtualized ones, so they can be used to control the bootloader ++ and display both firmware and early boot messages; ++
    • ++
    • ++ on several platforms, there can only be a single emulated serial ++ console per guest but paravirtualized consoles don't suffer from the ++ same limitation. ++
    • ++
    ++ ++

    ++ A configuration such as: ++

    ++ +
    + ...
    +-<devices>
    +-  <!-- KVM S390 sclp console -->
    ++</devices>
    +   <console type='pty'>
    +-    <source path='/dev/pts/1'/>
    +-    <target type='sclp' port='0'/>
    ++    <target type='serial'/>
    ++  </console>
    ++  <console type='pty'>
    ++    <target type='virtio'/>
    +   </console>
    + </devices>
    + ...
    + +

    +- If the console is presented as a serial port, the target +- element has the same attributes as for a serial port. There is usually +- only 1 console. ++ will work on any platform and will result in one emulated serial console ++ for early boot logging / interactive / recovery use, and one ++ paravirtualized serial console to be used eg. as a side channel. Most ++ people will be fine with having just the first console ++ element in their configuration. ++

    ++ ++

    ++ Note that, due to the compatibility concerns mentioned earlier, all the ++ following configurations: ++

    ++ ++
    ++...
    ++</devices>
    ++  <serial type='pty'/>
    ++</devices>
    ++...
    ++ ++
    ++...
    ++</devices>
    ++  <console type='pty'/>
    ++</devices>
    ++...
    ++ ++
    ++...
    ++</devices>
    ++  <serial type='pty'/>
    ++  <console type='pty'/>
    ++</devices>
    ++...
    ++ ++

    ++ will be treated the same and will result in a single emulated serial ++ console being available to the guest. +

    + +
    Channel
    +-- +2.15.1 + diff --git a/SOURCES/libvirt-docs-Provide-a-nodedev-driver-stub-documentation.patch b/SOURCES/libvirt-docs-Provide-a-nodedev-driver-stub-documentation.patch deleted file mode 100644 index f7047b8..0000000 --- a/SOURCES/libvirt-docs-Provide-a-nodedev-driver-stub-documentation.patch +++ /dev/null @@ -1,237 +0,0 @@ -From 8c30b1e683b37d67d7fe827f6ab63174c596494e Mon Sep 17 00:00:00 2001 -Message-Id: <8c30b1e683b37d67d7fe827f6ab63174c596494e@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:49 +0200 -Subject: [PATCH] docs: Provide a nodedev driver stub documentation - -There's lot more to document about the nodedev driver, besides PCI and -SR-IOV (even this might need to be extended), but let's start small-ish -and at least have a page for it linked from the drivers.html. - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit a94d431dc46070034de7798f572dc1d257542a50) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - docs/drivers.html.in | 6 +- - docs/drvnodedev.html.in | 189 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 194 insertions(+), 1 deletion(-) - create mode 100644 docs/drvnodedev.html.in - -diff --git a/docs/drivers.html.in b/docs/drivers.html.in -index be7483b9b..61993861e 100644 ---- a/docs/drivers.html.in -+++ b/docs/drivers.html.in -@@ -4,7 +4,11 @@ - -

    Internal drivers

    - --
      -+ - -

      - The libvirt public API delegates its implementation to one or -diff --git a/docs/drvnodedev.html.in b/docs/drvnodedev.html.in -new file mode 100644 -index 000000000..0a3870343 ---- /dev/null -+++ b/docs/drvnodedev.html.in -@@ -0,0 +1,189 @@ -+ -+ -+ -+ -+

      Host device management

      -+ -+

      -+ Libvirt provides management of both physical and virtual host devices -+ (historically also referred to as node devices) like USB, PCI, SCSI, and -+ network devices. This also includes various virtualization capabilities -+ which the aforementioned devices provide for utilization, for example -+ SR-IOV, NPIV, DRM, etc. -+

      -+ -+

      -+ The node device driver provides means to list and show details about host -+ devices (virsh nodedev-list, -+ virsh nodedev-dumpxml), which are generic and can be used -+ with all devices. It also provides means to create and destroy devices -+ (virsh nodedev-create, virsh nodedev-destroy) -+ which are meant to be used to create virtual devices, currently only -+ supported by NPIV -+ (more info about NPIV)). -+ Devices on the host system are arranged in a tree-like hierarchy, with -+ the root node being called computer. The node device driver -+ supports two backends to manage the devices, HAL and udev, with the former -+ being deprecated in favour of the latter. -+

      -+ -+

      -+ The generic format of a host device XML can be seen below. -+ To identify a device both within the host and the device tree hierarchy, -+ the following elements are used: -+

      -+
      -+
      name
      -+
      -+ The device's name will be generated by libvirt using the subsystem, -+ like pci and the device's sysfs basename. -+
      -+
      path
      -+
      -+ Fully qualified sysfs path to the device. -+
      -+
      parent
      -+
      -+ This element identifies the parent node in the device hierarchy. The -+ value of the element will correspond with the device parent's -+ name element or computer if the device does -+ not have any parent. -+
      -+
      driver
      -+
      -+ This elements reports the driver in use for this device. The presence -+ of this element in the output XML depends on whether the underlying -+ device manager (most likely udev) exposes information about the -+ driver. -+
      -+
      capability
      -+
      -+ Describes the device in terms of feature support. The element has one -+ mandatory attribute type the value of which determines -+ the type of the device. Currently recognized values for the attribute -+ are: -+ system, -+ pci, -+ usb, -+ usb_device, -+ net, -+ scsi, -+ scsi_host (Since 0.4.7), -+ fc_host, -+ vports, -+ scsi_target (Since 0.7.3), -+ storage (Since 1.0.4), -+ scsi_generic (Since 1.0.7), -+ drm (Since 3.1.0), and -+ This element can be nested in which case it further specifies a -+ device's capability. Refer to specific device types to see more values -+ for the type attribute which are exclusive. -+
      -+
      -+ -+

      Basic structure of a node device

      -+
      -+<device>
      -+  <name>pci_0000_00_17_0</name>
      -+  <path>/sys/devices/pci0000:00/0000:00:17.0</path>
      -+  <parent>computer</parent>
      -+  <driver>
      -+    <name>ahci</name>
      -+  </driver>
      -+  <capability type='pci'>
      -+...
      -+  </capability>
      -+</device>
      -+ -+
        -+ -+

        PCI host devices

        -+
        -+
        capability
        -+
        -+ When used as top level element, the supported values for the -+ type attribute are pci and -+ phys_function (see SR-IOV below). -+
        -+
        -+
        -+<device>
        -+  <name>pci_0000_04_00_1</name>
        -+  <path>/sys/devices/pci0000:00/0000:00:06.0/0000:04:00.1</path>
        -+  <parent>pci_0000_00_06_0</parent>
        -+  <driver>
        -+    <name>igb</name>
        -+  </driver>
        -+  <capability type='pci'>
        -+    <domain>0</domain>
        -+    <bus>4</bus>
        -+    <slot>0</slot>
        -+    <function>1</function>
        -+    <product id='0x10c9'>82576 Gigabit Network Connection</product>
        -+    <vendor id='0x8086'>Intel Corporation</vendor>
        -+    <iommuGroup number='15'>
        -+      <address domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
        -+    </iommuGroup>
        -+    <numa node='0'/>
        -+    <pci-express>
        -+      <link validity='cap' port='1' speed='2.5' width='2'/>
        -+      <link validity='sta' speed='2.5' width='2'/>
        -+    </pci-express>
        -+  </capability>
        -+</device>
        -+ -+

        -+ The XML format for a PCI device stays the same for any further -+ capabilities it supports, a single nested <capability> -+ element will be included for each capability the device supports. -+

        -+ -+

        SR-IOV capability

        -+

        -+ Single root input/output virtualization (SR-IOV) allows sharing of the -+ PCIe resources by multiple virtual environments. That is achieved by -+ slicing up a single full-featured physical resource called physical -+ function (PF) into multiple devices called virtual functions (VFs) sharing -+ their configuration with the underlying PF. Despite the SR-IOV -+ specification, the amount of VFs that can be created on a PF varies among -+ manufacturers. -+

        -+ -+

        -+ Suppose the NIC above was also SR-IOV capable, it would -+ also include a nested -+ <capability> element enumerating all virtual -+ functions available on the physical device (physical port) like in the -+ example below. -+

        -+ -+
        -+<capability type='pci'>
        -+...
        -+  <capability type='virt_functions' maxCount='7'>
        -+    <address domain='0x0000' bus='0x04' slot='0x10' function='0x1'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x10' function='0x3'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x10' function='0x5'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x10' function='0x7'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x11' function='0x1'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x11' function='0x3'/>
        -+    <address domain='0x0000' bus='0x04' slot='0x11' function='0x5'/>
        -+  </capability>
        -+...
        -+</capability>
        -+

        -+ A SR-IOV child device on the other hand, would then report its top level -+ capability type as a phys_function instead: -+

        -+ -+
        -+<device>
        -+...
        -+  <capability type='phys_function'>
        -+    <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
        -+  </capability>
        -+...
        -+<device>
        -+ -+ -+ --- -2.13.0 - diff --git a/SOURCES/libvirt-docs-correct-improper-information-about-domain-states-in-virsh-manpage.patch b/SOURCES/libvirt-docs-correct-improper-information-about-domain-states-in-virsh-manpage.patch deleted file mode 100644 index 866c030..0000000 --- a/SOURCES/libvirt-docs-correct-improper-information-about-domain-states-in-virsh-manpage.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 7a40c13d93a300f6f2c493c864da7342f34e9a6c Mon Sep 17 00:00:00 2001 -Message-Id: <7a40c13d93a300f6f2c493c864da7342f34e9a6c@dist-git> -From: Laine Stump -Date: Tue, 6 Jun 2017 12:07:49 -0400 -Subject: [PATCH] docs: correct improper information about domain states in - virsh manpage - -Commit 24d4a0a1f removed the non-existent "dying" state from the list -of possible domain states given in the virsh manpage, but didn't -correct the count of states from 8 down to 7. This patch fixes that -mismatch by completely removing any reference to the exact number of -states (thus preventing a potential future mismatch), while wording -the sentence in a more readable/truthful manner. - -(cherry picked from commit c44482eb4fb703391f2ee00c23b2187e0415e799) - -https://bugzilla.redhat.com/show_bug.cgi?id=1408778 - -Signed-off-by: Jiri Denemark ---- - tools/virsh.pod | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/tools/virsh.pod b/tools/virsh.pod -index 0315f1f265..6386c39fbc 100644 ---- a/tools/virsh.pod -+++ b/tools/virsh.pod -@@ -418,8 +418,9 @@ State is the run state (see below). - - B - --The State field lists 8 states for a domain, and which ones the --current domain is in. -+The State field lists what state each domain is currently in. A domain -+can be in one of the following possible states: -+ - - =over 4 - --- -2.13.1 - diff --git a/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch b/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch new file mode 100644 index 0000000..b6944df --- /dev/null +++ b/SOURCES/libvirt-docs-domain-Fix-documentation-of-the-snapshot-attribute-for-disk.patch @@ -0,0 +1,51 @@ +From 60643d072a849ffbb01e8313124154f7aecc02ad Mon Sep 17 00:00:00 2001 +Message-Id: <60643d072a849ffbb01e8313124154f7aecc02ad@dist-git> +From: Peter Krempa +Date: Thu, 7 Dec 2017 14:36:06 +0100 +Subject: [PATCH] docs: domain: Fix documentation of the 'snapshot' attribute + for + +Emphasise the valid values by wrapping them in and reword the +last sentence so that the invalid value example can be dropped. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1523070 +(cherry picked from commit 1e98d450f27ae0131ac2ac8aa1c1d7a254d22dd1) +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 6807da5c6f..0cfbf051b7 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -2573,17 +2573,16 @@ +
        snapshot
        +
        + Indicates the default behavior of the disk during disk snapshots: +- "internal" requires a file format such as qcow2 that can store +- both the snapshot and the data changes since the snapshot; +- "external" will separate the snapshot from the live data; and +- "no" means the disk will not participate in snapshots. Read-only +- disks default to "no", while the default for other disks depends +- on the hypervisor's capabilities. Some hypervisors allow a +- per-snapshot choice as well, during ++ "internal" requires a file format such as qcow2 that ++ can store both the snapshot and the data changes since the snapshot; ++ "external" will separate the snapshot from the live ++ data; and "no" means the disk will not participate in ++ snapshots. Read-only disks default to "no", while the ++ default for other disks depends on the hypervisor's capabilities. ++ Some hypervisors allow a per-snapshot choice as well, during + domain snapshot creation. +- Not all snapshot modes are supported; for example, +- snapshot='yes' with a transient disk generally +- does not make sense. ++ Not all snapshot modes are supported; for example, enabling ++ snapshots with a transient disk generally does not make sense. + Since 0.9.5 +
        + +-- +2.15.1 + diff --git a/SOURCES/libvirt-docs-fix-typo-in-closing-HTML-element.patch b/SOURCES/libvirt-docs-fix-typo-in-closing-HTML-element.patch deleted file mode 100644 index 0469959..0000000 --- a/SOURCES/libvirt-docs-fix-typo-in-closing-HTML-element.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3983bc29326d6f247d4dc3517ca42896042c02e0 Mon Sep 17 00:00:00 2001 -Message-Id: <3983bc29326d6f247d4dc3517ca42896042c02e0@dist-git> -From: "Daniel P. Berrange" -Date: Tue, 25 Apr 2017 13:41:18 +0200 -Subject: [PATCH] docs: fix typo in closing HTML element - -https://bugzilla.redhat.com/show_bug.cgi?id=1414627 - -Signed-off-by: Daniel P. Berrange -(cherry picked from commit dfda3a8ed988e6542294b85b78e816d593b22dc3) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index 7374cb243..c82cd69a2 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -5457,7 +5457,7 @@ qemu-kvm -net nic,model=? /dev/null - This element provides means of setting coalesce settings for - some interface devices (currently only type network - and bridge. Currently there is just one attribute, -- max, to tweak, in element frames for -+ max, to tweak, in element frames for - the rx group, which accepts a non-negative integer - that specifies the maximum number of packets that will be - received before an interrupt. --- -2.12.2 - diff --git a/SOURCES/libvirt-fixup_resctrlinfo.patch b/SOURCES/libvirt-fixup_resctrlinfo.patch new file mode 100644 index 0000000..1c0125e --- /dev/null +++ b/SOURCES/libvirt-fixup_resctrlinfo.patch @@ -0,0 +1,76 @@ +From ff96b6f60e7062da45f24366db871c3ce675892e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:28 +0100 +Subject: [PATCH] fixup_resctrlinfo + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 434848d7dca9d1a7838ab53bbfdcf580ef7f2cc2) +Signed-off-by: Martin Kletzander +--- + src/util/virresctrl.c | 29 +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c +index f122af2050..d439e7792c 100644 +--- a/src/util/virresctrl.c ++++ b/src/util/virresctrl.c +@@ -200,6 +200,8 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl) + } + + while ((rv = virDirRead(dirp, &ent, SYSFS_RESCTRL_PATH "/info")) > 0) { ++ VIR_DEBUG("Parsing info type '%s'", ent->d_name); ++ + if (ent->d_type != DT_DIR) + continue; + +@@ -207,16 +209,14 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl) + continue; + + if (virStrToLong_uip(ent->d_name + 1, &endptr, 10, &level) < 0) { +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Cannot parse resctrl cache info level")); +- goto cleanup; ++ VIR_DEBUG("Cannot parse resctrl cache info level '%s'", ent->d_name + 1); ++ continue; + } + + type = virResctrlTypeFromString(endptr); + if (type < 0) { +- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Cannot parse resctrl cache info type")); +- goto cleanup; ++ VIR_DEBUG("Cannot parse resctrl cache info type '%s'", endptr); ++ continue; + } + + if (VIR_ALLOC(i_type) < 0) +@@ -259,10 +259,19 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl) + level - resctrl->nlevels + 1) < 0) + goto cleanup; + +- if (!resctrl->levels[level] && +- (VIR_ALLOC(resctrl->levels[level]) < 0 || +- VIR_ALLOC_N(resctrl->levels[level]->types, VIR_CACHE_TYPE_LAST) < 0)) +- goto cleanup; ++ if (!resctrl->levels[level]) { ++ virResctrlInfoPerTypePtr *types = NULL; ++ ++ if (VIR_ALLOC_N(types, VIR_CACHE_TYPE_LAST) < 0) ++ goto cleanup; ++ ++ if (VIR_ALLOC(resctrl->levels[level]) < 0) { ++ VIR_FREE(types); ++ goto cleanup; ++ } ++ resctrl->levels[level]->types = types; ++ } ++ + i_level = resctrl->levels[level]; + + if (i_level->types[type]) { +-- +2.16.1 + diff --git a/SOURCES/libvirt-locking-Add-support-for-sanlock_strerror.patch b/SOURCES/libvirt-locking-Add-support-for-sanlock_strerror.patch deleted file mode 100644 index 1d51b32..0000000 --- a/SOURCES/libvirt-locking-Add-support-for-sanlock_strerror.patch +++ /dev/null @@ -1,339 +0,0 @@ -From 6744458379e73967a95507d3c0b91b52a62fc3ec Mon Sep 17 00:00:00 2001 -Message-Id: <6744458379e73967a95507d3c0b91b52a62fc3ec@dist-git> -From: Jiri Denemark -Date: Thu, 27 Apr 2017 11:54:44 +0200 -Subject: [PATCH] locking: Add support for sanlock_strerror - -The recently added sanlock_strerror function can be used to translate -sanlock's numeric errors into human readable strings. - -https://bugzilla.redhat.com/show_bug.cgi?id=1409511 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 23377c539b72a7fc4e2749a068711fe1f626998d) -Signed-off-by: Jiri Denemark ---- - m4/virt-sanlock.m4 | 7 ++ - src/locking/lock_driver_sanlock.c | 154 ++++++++++++++++++++++++++------------ - 2 files changed, 115 insertions(+), 46 deletions(-) - -diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4 -index e4476cae4..00de7980e 100644 ---- a/m4/virt-sanlock.m4 -+++ b/m4/virt-sanlock.m4 -@@ -61,6 +61,13 @@ AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ - [whether sanlock supports sanlock_write_lockspace]) - fi - -+ AC_CHECK_LIB([sanlock_client], [sanlock_strerror], -+ [sanlock_strerror=yes], [sanlock_strerror=no]) -+ if test "x$sanlock_strerror" = "xyes" ; then -+ AC_DEFINE_UNQUOTED([HAVE_SANLOCK_STRERROR], 1, -+ [whether sanlock supports sanlock_strerror]) -+ fi -+ - CPPFLAGS="$old_cppflags" - LIBS="$old_libs" - fi -diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c -index 280219f72..b5e69c472 100644 ---- a/src/locking/lock_driver_sanlock.c -+++ b/src/locking/lock_driver_sanlock.c -@@ -97,6 +97,25 @@ struct _virLockManagerSanlockPrivate { - bool registered; - }; - -+ -+static bool -+ATTRIBUTE_NONNULL(2) -+virLockManagerSanlockError(int err, -+ char **message) -+{ -+ if (err <= -200) { -+#if HAVE_SANLOCK_STRERROR -+ ignore_value(VIR_STRDUP_QUIET(*message, sanlock_strerror(err))); -+#else -+ ignore_value(virAsprintfQuiet(message, _("sanlock error %d"), err)); -+#endif -+ return true; -+ } else { -+ return false; -+ } -+} -+ -+ - /* - * sanlock plugin for the libvirt virLockManager API - */ -@@ -263,14 +282,17 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver) - } - - if ((rv = sanlock_align(&ls.host_id_disk)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to query sector size %s: error %d"), -- path, rv); -- else -+ _("Unable to query sector size %s: %s"), -+ path, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to query sector size %s"), - path); -+ } - goto error_unlink; - } - -@@ -292,14 +314,17 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver) - } - - if ((rv = virLockManagerSanlockInitLockspace(driver, &ls) < 0)) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to initialize lockspace %s: error %d"), -- path, rv); -- else -+ _("Unable to initialize lockspace %s: %s"), -+ path, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to initialize lockspace %s"), - path); -+ } - goto error_unlink; - } - VIR_DEBUG("Lockspace %s has been initialized", path); -@@ -362,14 +387,17 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver) - goto retry; - } - if (-rv != EEXIST) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to add lockspace %s: error %d"), -- path, rv); -- else -+ _("Unable to add lockspace %s: %s"), -+ path, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to add lockspace %s"), - path); -+ } - goto error; - } else { - VIR_DEBUG("Lockspace %s is already registered", path); -@@ -694,14 +722,17 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriverPtr driver, - } - - if ((rv = sanlock_align(&res->disks[0])) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to query sector size %s: error %d"), -- res->disks[0].path, rv); -- else -+ _("Unable to query sector size %s: %s"), -+ res->disks[0].path, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to query sector size %s"), - res->disks[0].path); -+ } - goto error_unlink; - } - -@@ -723,14 +754,17 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriverPtr driver, - } - - if ((rv = sanlock_init(NULL, res, 0, 0)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to initialize lease %s: error %d"), -- res->disks[0].path, rv); -- else -+ _("Unable to initialize lease %s: %s"), -+ res->disks[0].path, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to initialize lease %s"), - res->disks[0].path); -+ } - goto error_unlink; - } - VIR_DEBUG("Lease %s has been initialized", res->disks[0].path); -@@ -867,10 +901,12 @@ virLockManagerSanlockRegisterKillscript(int sock, - } - - if ((rv = sanlock_killpath(sock, 0, path, args)) < 0) { -- if (rv <= -200) { -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to register lock failure action:" -- " error %d"), rv); -+ _("Failed to register lock failure action: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); - } else { - virReportSystemError(-rv, "%s", - _("Failed to register lock failure" -@@ -934,13 +970,16 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock, - if (priv->vm_pid == getpid()) { - VIR_DEBUG("Register sanlock %d", flags); - if ((sock = sanlock_register()) < 0) { -- if (sock <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(sock, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to open socket to sanlock daemon: error %d"), -- sock); -- else -+ _("Failed to open socket to sanlock daemon: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-sock, "%s", - _("Failed to open socket to sanlock daemon")); -+ } - goto error; - } - -@@ -971,14 +1010,17 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock, - if ((rv = sanlock_state_to_args((char *)state, - &res_count, - &res_args)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unable to parse lock state %s: error %d"), -- state, rv); -- else -+ _("Unable to parse lock state %s: %s"), -+ state, NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, - _("Unable to parse lock state %s"), - state); -+ } - goto error; - } - res_free = true; -@@ -992,12 +1034,16 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock, - if ((rv = sanlock_acquire(sock, priv->vm_pid, 0, - priv->res_count, priv->res_args, - opt)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_RESOURCE_BUSY, -- _("Failed to acquire lock: error %d"), rv); -- else -+ _("Failed to acquire lock: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, "%s", - _("Failed to acquire lock")); -+ } - goto error; - } - } -@@ -1016,12 +1062,16 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock, - - if (flags & VIR_LOCK_MANAGER_ACQUIRE_RESTRICT) { - if ((rv = sanlock_restrict(sock, SANLK_RESTRICT_ALL)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to restrict process: error %d"), rv); -- else -+ _("Failed to restrict process: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, "%s", - _("Failed to restrict process")); -+ } - goto error; - } - } -@@ -1068,12 +1118,16 @@ static int virLockManagerSanlockRelease(virLockManagerPtr lock, - - if (state) { - if ((rv = sanlock_inquire(-1, priv->vm_pid, 0, &res_count, state)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to inquire lock: error %d"), rv); -- else -+ _("Failed to inquire lock: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, "%s", - _("Failed to inquire lock")); -+ } - return -1; - } - -@@ -1083,12 +1137,16 @@ static int virLockManagerSanlockRelease(virLockManagerPtr lock, - - if ((rv = sanlock_release(-1, priv->vm_pid, 0, res_count, - priv->res_args)) < 0) { -- if (rv <= -200) -+ char *err = NULL; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to release lock: error %d"), rv); -- else -+ _("Failed to release lock: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, "%s", - _("Failed to release lock")); -+ } - return -1; - } - -@@ -1118,12 +1176,16 @@ static int virLockManagerSanlockInquire(virLockManagerPtr lock, - } - - if ((rv = sanlock_inquire(-1, priv->vm_pid, 0, &res_count, state)) < 0) { -- if (rv <= -200) -+ char *err; -+ if (virLockManagerSanlockError(rv, &err)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Failed to inquire lock: error %d"), rv); -- else -+ _("Failed to inquire lock: %s"), -+ NULLSTR(err)); -+ VIR_FREE(err); -+ } else { - virReportSystemError(-rv, "%s", - _("Failed to inquire lock")); -+ } - return -1; - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-logical-Increase-the-size-of-the-data-to-wipe.patch b/SOURCES/libvirt-logical-Increase-the-size-of-the-data-to-wipe.patch deleted file mode 100644 index 87be249..0000000 --- a/SOURCES/libvirt-logical-Increase-the-size-of-the-data-to-wipe.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f4b39613c3c345e33fa749911f34127cf91c07fc Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Wed, 26 Apr 2017 08:41:13 -0400 -Subject: [PATCH] logical: Increase the size of the data to wipe - -https://bugzilla.redhat.com/show_bug.cgi?id=1439132 -https://bugzilla.redhat.com/show_bug.cgi?id=1373711 - -Since a sector size may be larger than 512 bytes, let's just increase -the size to wipe to 1MB rather than 2KB - -(cherry picked from commit d942bf6e9e8e3991808ca5185098257e84acab5d) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/storage/storage_backend_logical.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c -index a8650368b..ed26c2450 100644 ---- a/src/storage/storage_backend_logical.c -+++ b/src/storage/storage_backend_logical.c -@@ -100,7 +100,7 @@ virStorageBackendLogicalInitializeDevice(const char *path) - * a whole disk as a PV. So we just blank them out regardless - * rather than trying to figure out if we're a disk or partition - */ -- if (virStorageBackendZeroPartitionTable(path, 4 * PV_BLANK_SECTOR_SIZE) < 0) -+ if (virStorageBackendZeroPartitionTable(path, 1024 * 1024) < 0) - return -1; - - /* --- -2.12.2 - diff --git a/SOURCES/libvirt-logical-Use-virStorageBackendZeroPartitionTable.patch b/SOURCES/libvirt-logical-Use-virStorageBackendZeroPartitionTable.patch deleted file mode 100644 index 78c876e..0000000 --- a/SOURCES/libvirt-logical-Use-virStorageBackendZeroPartitionTable.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 0ea93040c8172ff8848b6295e53b7bd26f66ef05 Mon Sep 17 00:00:00 2001 -Message-Id: <0ea93040c8172ff8848b6295e53b7bd26f66ef05@dist-git> -From: John Ferlan -Date: Wed, 26 Apr 2017 08:41:12 -0400 -Subject: [PATCH] logical: Use virStorageBackendZeroPartitionTable - -https://bugzilla.redhat.com/show_bug.cgi?id=1439132 -https://bugzilla.redhat.com/show_bug.cgi?id=1373711 - -Rather than open code it, use the new function which uses the wipe algorithm -in order to zero the front and tail of the partition. - -(cherry picked from commit c6aa81c65abe3f327af870d5789a98a0c9b276d1) -Signed-off-by: John Ferlan -Signed-off-by: Jiri Denemark ---- - src/storage/storage_backend_logical.c | 44 +---------------------------------- - 1 file changed, 1 insertion(+), 43 deletions(-) - -diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c -index d87aaf0b6..a8650368b 100644 ---- a/src/storage/storage_backend_logical.c -+++ b/src/storage/storage_backend_logical.c -@@ -92,9 +92,6 @@ virStorageBackendLogicalRemoveDevice(const char *path) - static int - virStorageBackendLogicalInitializeDevice(const char *path) - { -- int fd = -1; -- char zeros[4 * PV_BLANK_SECTOR_SIZE] = {0}; -- off_t size; - int ret = -1; - virCommandPtr pvcmd = NULL; - -@@ -103,46 +100,8 @@ virStorageBackendLogicalInitializeDevice(const char *path) - * a whole disk as a PV. So we just blank them out regardless - * rather than trying to figure out if we're a disk or partition - */ -- if ((fd = open(path, O_WRONLY)) < 0) { -- virReportSystemError(errno, _("cannot open device '%s'"), path); -+ if (virStorageBackendZeroPartitionTable(path, 4 * PV_BLANK_SECTOR_SIZE) < 0) - return -1; -- } -- -- if ((size = lseek(fd, 0, SEEK_END)) == (off_t)-1) { -- virReportSystemError(errno, -- _("failed to seek to end of %s"), path); -- goto cleanup; -- } -- -- if (size < 4 * PV_BLANK_SECTOR_SIZE) { -- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, -- _("cannot initialize '%s' detected size='%zd' less " -- "than minimum required='%d"), -- path, (ssize_t) size, 4 * PV_BLANK_SECTOR_SIZE); -- goto cleanup; -- } -- if ((size = lseek(fd, 0, SEEK_SET)) == (off_t)-1) { -- virReportSystemError(errno, -- _("failed to seek to start of %s"), path); -- goto cleanup; -- } -- -- if (safewrite(fd, zeros, sizeof(zeros)) < 0) { -- virReportSystemError(errno, _("cannot clear device header of '%s'"), -- path); -- goto cleanup; -- } -- -- if (fsync(fd) < 0) { -- virReportSystemError(errno, _("cannot flush header of device'%s'"), -- path); -- goto cleanup; -- } -- -- if (VIR_CLOSE(fd) < 0) { -- virReportSystemError(errno, _("cannot close device '%s'"), path); -- goto cleanup; -- } - - /* - * Initialize the physical volume because vgcreate is not -@@ -155,7 +114,6 @@ virStorageBackendLogicalInitializeDevice(const char *path) - ret = 0; - - cleanup: -- VIR_FORCE_CLOSE(fd); - virCommandFree(pvcmd); - - return ret; --- -2.12.2 - diff --git a/SOURCES/libvirt-mdev-Fix-daemon-crash-on-domain-shutdown-after-reconnect.patch b/SOURCES/libvirt-mdev-Fix-daemon-crash-on-domain-shutdown-after-reconnect.patch deleted file mode 100644 index 3162d40..0000000 --- a/SOURCES/libvirt-mdev-Fix-daemon-crash-on-domain-shutdown-after-reconnect.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 2122aadba5eb30ae466a3e825bbe9ed75b8d9735 Mon Sep 17 00:00:00 2001 -Message-Id: <2122aadba5eb30ae466a3e825bbe9ed75b8d9735@dist-git> -From: Erik Skultety -Date: Thu, 4 May 2017 13:50:00 +0200 -Subject: [PATCH] mdev: Fix daemon crash on domain shutdown after reconnect - -The problem resides in virHostdevUpdateActiveMediatedDevices which gets -called during qemuProcessReconnect. The issue here is that -virMediatedDeviceListAdd takes a pointer to the item to be added to the -list to which VIR_APPEND_ELEMENT is used, which also clears the pointer. -However, in this case only the local copy of the pointer got cleared, -leaving the original pointing to valid memory. To sum it up, during -cleanup phase, the original pointer is freed and the daemon crashes -basically any time it would access it. - -Backtrace: -0x00007ffff3ccdeba in __strcmp_sse2_unaligned -0x00007ffff72a444a in virMediatedDeviceListFindIndex -0x00007ffff7241446 in virHostdevReAttachMediatedDevices -0x00007fffc60215d9 in qemuHostdevReAttachMediatedDevices -0x00007fffc60216dc in qemuHostdevReAttachDomainDevices -0x00007fffc6046e6f in qemuProcessStop -0x00007fffc6091596 in processMonitorEOFEvent -0x00007fffc6091793 in qemuProcessEventHandler -0x00007ffff7294bf5 in virThreadPoolWorker -0x00007ffff7294184 in virThreadHelper -0x00007ffff3fdc3c4 in start_thread () from /lib64/libpthread.so.0 -0x00007ffff3d269cf in clone () from /lib64/libc.so.6 - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446455 - -Signed-off-by: Erik Skultety -Reviewed-by: Laine Stump -(cherry picked from commit 92e30a4dace54d06433f763e1acba0a81bb5c82e) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/util/virhostdev.c | 4 ++-- - src/util/virmdev.c | 13 ++++++++----- - src/util/virmdev.h | 2 +- - 3 files changed, 11 insertions(+), 8 deletions(-) - -diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c -index 2c557f5bb..579563c3f 100644 ---- a/src/util/virhostdev.c -+++ b/src/util/virhostdev.c -@@ -1294,7 +1294,7 @@ virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr, - - virMediatedDeviceSetUsedBy(mdev, drv_name, dom_name); - -- if (virMediatedDeviceListAdd(mgr->activeMediatedHostdevs, mdev) < 0) -+ if (virMediatedDeviceListAdd(mgr->activeMediatedHostdevs, &mdev) < 0) - goto cleanup; - } - -@@ -1790,7 +1790,7 @@ virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr, - if (!(mdev = virMediatedDeviceNew(src->uuidstr, src->model))) - goto cleanup; - -- if (virMediatedDeviceListAdd(list, mdev) < 0) { -+ if (virMediatedDeviceListAdd(list, &mdev) < 0) { - virMediatedDeviceFree(mdev); - goto cleanup; - } -diff --git a/src/util/virmdev.c b/src/util/virmdev.c -index c1499d238..c861d21c9 100644 ---- a/src/util/virmdev.c -+++ b/src/util/virmdev.c -@@ -312,16 +312,19 @@ virMediatedDeviceListDispose(void *obj) - } - - -+/* The reason for @dev to be double pointer is that VIR_APPEND_ELEMENT clears -+ * the pointer and we need to clear the original not a copy on the stack -+ */ - int - virMediatedDeviceListAdd(virMediatedDeviceListPtr list, -- virMediatedDevicePtr dev) -+ virMediatedDevicePtr *dev) - { -- if (virMediatedDeviceListFind(list, dev)) { -+ if (virMediatedDeviceListFind(list, *dev)) { - virReportError(VIR_ERR_INTERNAL_ERROR, -- _("device %s is already in use"), dev->path); -+ _("device %s is already in use"), (*dev)->path); - return -1; - } -- return VIR_APPEND_ELEMENT(list->devs, list->count, dev); -+ return VIR_APPEND_ELEMENT(list->devs, list->count, *dev); - } - - -@@ -457,7 +460,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, - * - caller is responsible for NOT freeing devices in @src on success - * - we're responsible for performing a rollback on failure - */ -- if (virMediatedDeviceListAdd(dst, mdev) < 0) -+ if (virMediatedDeviceListAdd(dst, &mdev) < 0) - goto rollback; - - VIR_DEBUG("'%s' added to list of active mediated devices used by '%s'", -diff --git a/src/util/virmdev.h b/src/util/virmdev.h -index 2f3d6bb84..8bb46b9c5 100644 ---- a/src/util/virmdev.h -+++ b/src/util/virmdev.h -@@ -86,7 +86,7 @@ virMediatedDeviceListNew(void); - - int - virMediatedDeviceListAdd(virMediatedDeviceListPtr list, -- virMediatedDevicePtr dev); -+ virMediatedDevicePtr *dev); - - virMediatedDevicePtr - virMediatedDeviceListGet(virMediatedDeviceListPtr list, --- -2.13.0 - diff --git a/SOURCES/libvirt-mdev-Pass-a-uuidstr-rather-than-an-mdev-object-to-some-util-functions.patch b/SOURCES/libvirt-mdev-Pass-a-uuidstr-rather-than-an-mdev-object-to-some-util-functions.patch deleted file mode 100644 index 1f4d74a..0000000 --- a/SOURCES/libvirt-mdev-Pass-a-uuidstr-rather-than-an-mdev-object-to-some-util-functions.patch +++ /dev/null @@ -1,269 +0,0 @@ -From ebb336d5b22b9707b53bcc4fd2e24845666fdc4f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:50 +0200 -Subject: [PATCH] mdev: Pass a uuidstr rather than an mdev object to some util - functions - -Namely, this patch is about virMediatedDeviceGetIOMMUGroup{Dev,Num} -functions. There's no compelling reason why these functions should take -an object, on the contrary, having to create an object every time one -needs to query the IOMMU group number, discarding the object afterwards, -seems odd. - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit 3a2a2a7401d06a8f06fa75359190f59737c5dc5d) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 8 +------- - src/security/security_apparmor.c | 10 +--------- - src/security/security_dac.c | 20 ++------------------ - src/security/security_selinux.c | 20 ++------------------ - src/util/virmdev.c | 21 +++++++++++++-------- - src/util/virmdev.h | 4 ++-- - 6 files changed, 21 insertions(+), 62 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 117c6142b..04d1b39db 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -7216,7 +7216,6 @@ qemuDomainGetHostdevPath(virDomainDefPtr def, - virUSBDevicePtr usb = NULL; - virSCSIDevicePtr scsi = NULL; - virSCSIVHostDevicePtr host = NULL; -- virMediatedDevicePtr mdev = NULL; - char *tmpPath = NULL; - bool freeTmpPath = false; - bool includeVFIO = false; -@@ -7317,11 +7316,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def, - } - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: -- if (!(mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model))) -- goto cleanup; -- -- if (!(tmpPath = virMediatedDeviceGetIOMMUGroupDev(mdev))) -+ if (!(tmpPath = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto cleanup; - - freeTmpPath = true; -@@ -7377,7 +7372,6 @@ qemuDomainGetHostdevPath(virDomainDefPtr def, - virUSBDeviceFree(usb); - virSCSIDeviceFree(scsi); - virSCSIVHostDeviceFree(host); -- virMediatedDeviceFree(mdev); - if (freeTmpPath) - VIR_FREE(tmpPath); - return ret; -diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c -index fc5581526..62672b0af 100644 ---- a/src/security/security_apparmor.c -+++ b/src/security/security_apparmor.c -@@ -905,21 +905,13 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - char *vfiodev = NULL; -- virMediatedDevicePtr mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model); - -- if (!mdev) -+ if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto done; - -- if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdev))) { -- virMediatedDeviceFree(mdev); -- goto done; -- } -- - ret = AppArmorSetSecurityHostdevLabelHelper(vfiodev, ptr); - - VIR_FREE(vfiodev); -- virMediatedDeviceFree(mdev); - break; - } - -diff --git a/src/security/security_dac.c b/src/security/security_dac.c -index 922e48494..7dcf4c15f 100644 ---- a/src/security/security_dac.c -+++ b/src/security/security_dac.c -@@ -968,21 +968,13 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr mgr, - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - char *vfiodev = NULL; -- virMediatedDevicePtr mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model); - -- if (!mdev) -+ if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto done; - -- if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdev))) { -- virMediatedDeviceFree(mdev); -- goto done; -- } -- - ret = virSecurityDACSetHostdevLabelHelper(vfiodev, &cbdata); - - VIR_FREE(vfiodev); -- virMediatedDeviceFree(mdev); - break; - } - -@@ -1144,21 +1136,13 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerPtr mgr, - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - char *vfiodev = NULL; -- virMediatedDevicePtr mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model); - -- if (!mdev) -+ if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto done; - -- if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdev))) { -- virMediatedDeviceFree(mdev); -- goto done; -- } -- - ret = virSecurityDACRestoreFileLabel(virSecurityManagerGetPrivateData(mgr), - vfiodev); - VIR_FREE(vfiodev); -- virMediatedDeviceFree(mdev); - break; - } - -diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c -index df7c96833..c7a2dfe98 100644 ---- a/src/security/security_selinux.c -+++ b/src/security/security_selinux.c -@@ -1843,21 +1843,13 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManagerPtr mgr, - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - char *vfiodev = NULL; -- virMediatedDevicePtr mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model); - -- if (!mdev) -+ if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto done; - -- if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdev))) { -- virMediatedDeviceFree(mdev); -- goto done; -- } -- - ret = virSecuritySELinuxSetHostdevLabelHelper(vfiodev, &data); - - VIR_FREE(vfiodev); -- virMediatedDeviceFree(mdev); - break; - } - -@@ -2092,21 +2084,13 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManagerPtr mgr, - - case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - char *vfiodev = NULL; -- virMediatedDevicePtr mdev = virMediatedDeviceNew(mdevsrc->uuidstr, -- mdevsrc->model); - -- if (!mdev) -+ if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuidstr))) - goto done; - -- if (!(vfiodev = virMediatedDeviceGetIOMMUGroupDev(mdev))) { -- virMediatedDeviceFree(mdev); -- goto done; -- } -- - ret = virSecuritySELinuxRestoreFileLabel(mgr, vfiodev); - - VIR_FREE(vfiodev); -- virMediatedDeviceFree(mdev); - break; - } - -diff --git a/src/util/virmdev.c b/src/util/virmdev.c -index c861d21c9..169deedfd 100644 ---- a/src/util/virmdev.c -+++ b/src/util/virmdev.c -@@ -209,43 +209,48 @@ virMediatedDeviceGetPath(virMediatedDevicePtr dev) - * for freeing the result. - */ - char * --virMediatedDeviceGetIOMMUGroupDev(virMediatedDevicePtr dev) -+virMediatedDeviceGetIOMMUGroupDev(const char *uuidstr) - { -- char *resultpath = NULL; -+ char *result_path = NULL; - char *iommu_path = NULL; - char *vfio_path = NULL; -+ char *dev_path = virMediatedDeviceGetSysfsPath(uuidstr); - -- if (virAsprintf(&iommu_path, "%s/iommu_group", dev->path) < 0) -+ if (!dev_path) - return NULL; - -+ if (virAsprintf(&iommu_path, "%s/iommu_group", dev_path) < 0) -+ goto cleanup; -+ - if (!virFileExists(iommu_path)) { - virReportSystemError(errno, _("failed to access '%s'"), iommu_path); - goto cleanup; - } - -- if (virFileResolveLink(iommu_path, &resultpath) < 0) { -+ if (virFileResolveLink(iommu_path, &result_path) < 0) { - virReportSystemError(errno, _("failed to resolve '%s'"), iommu_path); - goto cleanup; - } - -- if (virAsprintf(&vfio_path, "/dev/vfio/%s", last_component(resultpath)) < 0) -+ if (virAsprintf(&vfio_path, "/dev/vfio/%s", last_component(result_path)) < 0) - goto cleanup; - - cleanup: -- VIR_FREE(resultpath); -+ VIR_FREE(result_path); - VIR_FREE(iommu_path); -+ VIR_FREE(dev_path); - return vfio_path; - } - - - int --virMediatedDeviceGetIOMMUGroupNum(virMediatedDevicePtr dev) -+virMediatedDeviceGetIOMMUGroupNum(const char *uuidstr) - { - char *vfio_path = NULL; - char *group_num_str = NULL; - unsigned int group_num = -1; - -- if (!(vfio_path = virMediatedDeviceGetIOMMUGroupDev(dev))) -+ if (!(vfio_path = virMediatedDeviceGetIOMMUGroupDev(uuidstr))) - return -1; - - group_num_str = last_component(vfio_path); -diff --git a/src/util/virmdev.h b/src/util/virmdev.h -index 8bb46b9c5..0b8e830f4 100644 ---- a/src/util/virmdev.h -+++ b/src/util/virmdev.h -@@ -65,10 +65,10 @@ virMediatedDeviceSetUsedBy(virMediatedDevicePtr dev, - const char *domname); - - char * --virMediatedDeviceGetIOMMUGroupDev(virMediatedDevicePtr dev); -+virMediatedDeviceGetIOMMUGroupDev(const char *uuidstr); - - int --virMediatedDeviceGetIOMMUGroupNum(virMediatedDevicePtr dev); -+virMediatedDeviceGetIOMMUGroupNum(const char *uuidstr); - - char * - virMediatedDeviceGetSysfsPath(const char *uuidstr); --- -2.13.0 - diff --git a/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch b/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch new file mode 100644 index 0000000..bf807c0 --- /dev/null +++ b/SOURCES/libvirt-migration.html-Clarify-configuration-file-handling-docs.patch @@ -0,0 +1,162 @@ +From d52ae79470eb8725b63a6470e393149b48f508da Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 8 Dec 2017 10:31:38 +0100 +Subject: [PATCH] migration.html: Clarify configuration file handling docs + +Migration never removes any configuration files on the destination host. +Thus when the domain is already defined on the destination, it will stay +persistent even after migration without --persist. + +https://bugzilla.redhat.com/show_bug.cgi?id=1514930 + +Signed-off-by: Jiri Denemark +(cherry picked from commit 2c01e4febcd161226ce707892d8e53f4e66f708f) +Signed-off-by: Jiri Denemark +--- + docs/migration.html.in | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/docs/migration.html.in b/docs/migration.html.in +index de7d4def75..7c345b65b7 100644 +--- a/docs/migration.html.in ++++ b/docs/migration.html.in +@@ -206,14 +206,14 @@ +

        Configuration file handling

        + +

        +- There are two types of virtual machine known to libvirt. A transient ++ There are two types of virtual machines known to libvirt. A transient + guest only exists while it is running, and has no configuration file stored + on disk. A persistent guest maintains a configuration file on disk + even when it is not running. +

        + +

        +- By default, a migration operation will not attempt to change any configuration ++ By default, a migration operation will not attempt to modify any configuration + files that may be stored on either the source or destination host. It is the + administrator, or management application's, responsibility to manage distribution + of configuration files (if desired). It is important to note that the /etc/libvirt +@@ -230,14 +230,14 @@ + host and removed on the original. + +

      • Centralized configuration files outside libvirt, in a database. A data center +- management application may not storage configuration files at all. Instead it ++ management application may not store configuration files at all. Instead it + may generate libvirt XML on the fly when a guest is booted. It will typically + use transient guests, and thus not have to consider configuration files during + migration. +
      • +
      • Distributed configuration inside libvirt. The configuration file for each + guest is copied to every host where the guest is able to run. Upon migration +- the existing config merely needs to be updated with any changes ++ the existing config merely needs to be updated with any changes. +
      • +
      • Ad-hoc configuration management inside libvirt. Each guest is tied to a + specific host and rarely migrated. When migration is required, the config +@@ -246,7 +246,7 @@ +
      + +

      +- As mentioned above, libvirt will not touch configuration files during ++ As mentioned above, libvirt will not modify configuration files during + migration by default. The virsh command has two flags to + influence this behaviour. The --undefine-source flag + will cause the configuration file to be removed on the source host +@@ -265,12 +265,12 @@ + After migration + + +- Guest type ++ Source type + Source config + Dest config + --undefine-source + --persist +- Guest type ++ Dest type + Source config + Dest config + +@@ -325,9 +325,9 @@ + Y + N + N +- Transient +- N ++ Persistent + N ++ Y
      (unchanged dest config) + + + Transient +@@ -335,9 +335,9 @@ + Y + Y + N +- Transient +- N ++ Persistent + N ++ Y
      (unchanged dest config) + + + Transient +@@ -347,7 +347,7 @@ + Y + Persistent + N +- Y ++ Y
      (replaced with source) + + + Transient +@@ -357,7 +357,7 @@ + Y + Persistent + N +- Y ++ Y
      (replaced with source) + + + +@@ -411,7 +411,7 @@ + N + Persistent + Y +- Y ++ Y
      (unchanged dest config) + + + Persistent +@@ -421,7 +421,7 @@ + N + Persistent + N +- Y ++ Y
      (unchanged dest config) + + + Persistent +@@ -431,7 +431,7 @@ + Y + Persistent + Y +- Y ++ Y
      (replaced with source) + + + Persistent +@@ -441,7 +441,7 @@ + Y + Persistent + N +- Y ++ Y
      (replaced with source) + + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-network-better-log-message-when-network-is-inactive-during-reconnect.patch b/SOURCES/libvirt-network-better-log-message-when-network-is-inactive-during-reconnect.patch deleted file mode 100644 index 6689d63..0000000 --- a/SOURCES/libvirt-network-better-log-message-when-network-is-inactive-during-reconnect.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c85276bfbfda6818ae1dddbe91d971cb26669044 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Laine Stump -Date: Tue, 2 May 2017 12:31:52 -0400 -Subject: [PATCH] network: better log message when network is inactive during - reconnect - -If the network isn't active during networkNotifyActualDevice(), we -would log an error message stating that the bridge device didn't -exist. This patch adds a check to see if the network is active, making -the logs more useful in the case that it isn't. - -Partially resolves: https://bugzilla.redhat.com/1442700 - -(cherry picked from commit 7949de960eaba07661c1e0ab6e4aa945db8c1b25) - -Signed-off-by: Jiri Denemark ---- - src/network/bridge_driver.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c -index cb91a2c90..41bce794a 100644 ---- a/src/network/bridge_driver.c -+++ b/src/network/bridge_driver.c -@@ -4682,6 +4682,13 @@ networkNotifyActualDevice(virDomainDefPtr dom, - } - netdef = network->def; - -+ if (!virNetworkObjIsActive(network)) { -+ virReportError(VIR_ERR_OPERATION_INVALID, -+ _("network '%s' is not active"), -+ netdef->name); -+ goto error; -+ } -+ - /* if we're restarting libvirtd after an upgrade from a version - * that didn't save bridge name in actualNetDef for - * actualType==network, we need to copy it in so that it will be --- -2.12.2 - diff --git a/SOURCES/libvirt-nodedev-Increase-the-netlink-socket-buffer-size-to-the-one-used-by-udev.patch b/SOURCES/libvirt-nodedev-Increase-the-netlink-socket-buffer-size-to-the-one-used-by-udev.patch deleted file mode 100644 index 526a99f..0000000 --- a/SOURCES/libvirt-nodedev-Increase-the-netlink-socket-buffer-size-to-the-one-used-by-udev.patch +++ /dev/null @@ -1,53 +0,0 @@ -From c0b489c317a0cd3b709008d742d6653634455ded Mon Sep 17 00:00:00 2001 -Message-Id: -From: "ning.bo" -Date: Mon, 29 May 2017 16:22:50 +0200 -Subject: [PATCH] nodedev: Increase the netlink socket buffer size to the one - used by udev - -When a number of SRIOV VFs (up to 128 on Intel XL710) is created: -for i in `seq 0 1`; do - echo 63 > /sys/class/net//device/sriov_numvfs -done - -libvirtd will then report "udev_monitor_receive_device returned NULL" -error because the netlink socket buffer is not big enough (using GDB on -libudev confirmed this with ENOBUFFS) and thus some udev events were -dropped. This results in some devices being missing in the nodedev-list -output. This patch overrides the system's rmem_max limit but for that, -we need to make sure we've got root privileges. - -https://bugzilla.redhat.com/show_bug.cgi?id=1450960 - -Signed-off-by: ning.bo -Signed-off-by: Erik Skultety -(cherry picked from commit d1eea6c12aad5cb503562a52915138bf0d0a70a2) - -https://bugzilla.redhat.com/show_bug.cgi?id=1442307 -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/node_device/node_device_udev.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c -index 37528ee48..20c0fc837 100644 ---- a/src/node_device/node_device_udev.c -+++ b/src/node_device/node_device_udev.c -@@ -1732,6 +1732,13 @@ static int nodeStateInitialize(bool privileged, - - udev_monitor_enable_receiving(priv->udev_monitor); - -+ /* mimic udevd's behaviour and override the systems rmem_max limit in case -+ * there's a significant number of device 'add' events -+ */ -+ if (geteuid() == 0) -+ udev_monitor_set_receive_buffer_size(priv->udev_monitor, -+ 128 * 1024 * 1024); -+ - /* We register the monitor with the event callback so we are - * notified by udev of device changes before we enumerate existing - * devices because libvirt will simply recreate the device if we --- -2.13.0 - diff --git a/SOURCES/libvirt-nodedev-Introduce-mdev-capability-for-mediated-devices.patch b/SOURCES/libvirt-nodedev-Introduce-mdev-capability-for-mediated-devices.patch deleted file mode 100644 index 9db594c..0000000 --- a/SOURCES/libvirt-nodedev-Introduce-mdev-capability-for-mediated-devices.patch +++ /dev/null @@ -1,282 +0,0 @@ -From 8e5ac9cdbe38dd3b3320b97385d8e2cf0e862ef7 Mon Sep 17 00:00:00 2001 -Message-Id: <8e5ac9cdbe38dd3b3320b97385d8e2cf0e862ef7@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:54 +0200 -Subject: [PATCH] nodedev: Introduce mdev capability for mediated devices - -Start discovering the mediated devices on the host system and format the -attributes for the mediated device into the XML. Compared to the parent -device which reports generic information about the abstract mediated -devices types, a child device only reports the type name it has been -instantiated from and the IOMMU group number, since that's device -specific compared to the rest of the info that can be gathered about -mediated devices at the moment. -This patch introduces both the formatting and parsing routines, updates -nodedev.rng schema, adding a testcase as well. - -The resulting mdev child device XML: - - mdev_4b20d080_1b54_4048_85b3_a6a62d165c01 - /sys/devices/.../4b20d080-1b54-4048-85b3-a6a62d165c01 - pci_0000_06_00_0 - - vfio_mdev - - - - - - - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit 88ef73e13cddc8c0ff01dfe7a914342f8720c517) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - docs/schemas/nodedev.rng | 17 +++++++++ - src/conf/node_device_conf.c | 41 +++++++++++++++++++++ - src/conf/node_device_conf.h | 8 ++++ - src/node_device/node_device_udev.c | 43 +++++++++++++++++++++- - .../mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml | 8 ++++ - tests/nodedevxml2xmltest.c | 1 + - 6 files changed, 117 insertions(+), 1 deletion(-) - create mode 100644 tests/nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml - -diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng -index e0a2c5032..924f73861 100644 ---- a/docs/schemas/nodedev.rng -+++ b/docs/schemas/nodedev.rng -@@ -83,6 +83,7 @@ - - - -+ - - - -@@ -580,6 +581,22 @@ - - - -+ -+ -+ mdev -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index de8ba8f9d..ac61db34c 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -577,6 +577,10 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) - virBufferEscapeString(&buf, "%s\n", virNodeDevDRMTypeToString(data->drm.type)); - break; - case VIR_NODE_DEV_CAP_MDEV: -+ virBufferEscapeString(&buf, "\n", data->mdev.type); -+ virBufferAsprintf(&buf, "\n", -+ data->mdev.iommuGroupNumber); -+ break; - case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: -@@ -1647,6 +1651,39 @@ virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, - } - - -+static int -+virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, -+ virNodeDeviceDefPtr def, -+ xmlNodePtr node, -+ virNodeDevCapMdevPtr mdev) -+{ -+ xmlNodePtr orignode; -+ int ret = -1; -+ -+ orignode = ctxt->node; -+ ctxt->node = node; -+ -+ if (!(mdev->type = virXPathString("string(./type[1]/@id)", ctxt))) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("missing type id attribute for '%s'"), def->name); -+ goto out; -+ } -+ -+ if (virNodeDevCapsDefParseULong("number(./iommuGroup[1]/@number)", ctxt, -+ &mdev->iommuGroupNumber, def, -+ _("missing iommuGroup number attribute for " -+ "'%s'"), -+ _("invalid iommuGroup number attribute for " -+ "'%s'")) < 0) -+ goto out; -+ -+ ret = 0; -+ out: -+ ctxt->node = orignode; -+ return ret; -+} -+ -+ - static virNodeDevCapsDefPtr - virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, -@@ -1715,6 +1752,8 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, - ret = virNodeDevCapDRMParseXML(ctxt, def, node, &caps->data.drm); - break; - case VIR_NODE_DEV_CAP_MDEV: -+ ret = virNodeDevCapMdevParseXML(ctxt, def, node, &caps->data.mdev); -+ break; - case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: -@@ -2037,6 +2076,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) - VIR_FREE(data->sg.path); - break; - case VIR_NODE_DEV_CAP_MDEV: -+ VIR_FREE(data->mdev.type); -+ break; - case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_DRM: - case VIR_NODE_DEV_CAP_FC_HOST: -diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h -index 18aaff8b5..5743f9d3e 100644 ---- a/src/conf/node_device_conf.h -+++ b/src/conf/node_device_conf.h -@@ -143,6 +143,13 @@ struct _virNodeDevCapMdevType { - unsigned int available_instances; - }; - -+typedef struct _virNodeDevCapMdev virNodeDevCapMdev; -+typedef virNodeDevCapMdev *virNodeDevCapMdevPtr; -+struct _virNodeDevCapMdev { -+ char *type; -+ unsigned int iommuGroupNumber; -+}; -+ - typedef struct _virNodeDevCapPCIDev virNodeDevCapPCIDev; - typedef virNodeDevCapPCIDev *virNodeDevCapPCIDevPtr; - struct _virNodeDevCapPCIDev { -@@ -276,6 +283,7 @@ struct _virNodeDevCapData { - virNodeDevCapStorage storage; - virNodeDevCapSCSIGeneric sg; - virNodeDevCapDRM drm; -+ virNodeDevCapMdev mdev; - }; - }; - -diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c -index b89099c82..37528ee48 100644 ---- a/src/node_device/node_device_udev.c -+++ b/src/node_device/node_device_udev.c -@@ -1073,6 +1073,42 @@ udevProcessSCSIGeneric(struct udev_device *dev, - } - - static int -+udevProcessMediatedDevice(struct udev_device *dev, -+ virNodeDeviceDefPtr def) -+{ -+ int ret = -1; -+ const char *uuidstr = NULL; -+ int iommugrp = -1; -+ char *linkpath = NULL; -+ char *realpath = NULL; -+ virNodeDevCapMdevPtr data = &def->caps->data.mdev; -+ -+ if (virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)) < 0) -+ goto cleanup; -+ -+ if (virFileResolveLink(linkpath, &realpath) < 0) -+ goto cleanup; -+ -+ if (VIR_STRDUP(data->type, last_component(realpath)) < 0) -+ goto cleanup; -+ -+ uuidstr = udev_device_get_sysname(dev); -+ if ((iommugrp = virMediatedDeviceGetIOMMUGroupNum(uuidstr)) < 0) -+ goto cleanup; -+ -+ if (udevGenerateDeviceName(dev, def, NULL) != 0) -+ goto cleanup; -+ -+ data->iommuGroupNumber = iommugrp; -+ -+ ret = 0; -+ cleanup: -+ VIR_FREE(linkpath); -+ VIR_FREE(realpath); -+ return ret; -+} -+ -+static int - udevGetDeviceNodes(struct udev_device *device, - virNodeDeviceDefPtr def) - { -@@ -1140,12 +1176,16 @@ udevGetDeviceType(struct udev_device *device, - if (udevHasDeviceProperty(device, "INTERFACE")) - *type = VIR_NODE_DEV_CAP_NET; - -- /* SCSI generic device doesn't set DEVTYPE property */ -+ /* Neither SCSI generic devices nor mediated devices set DEVTYPE -+ * property, therefore we need to rely on the SUBSYSTEM property */ - if (udevGetStringProperty(device, "SUBSYSTEM", &subsystem) < 0) - return -1; - - if (STREQ_NULLABLE(subsystem, "scsi_generic")) - *type = VIR_NODE_DEV_CAP_SCSI_GENERIC; -+ else if (STREQ_NULLABLE(subsystem, "mdev")) -+ *type = VIR_NODE_DEV_CAP_MDEV; -+ - VIR_FREE(subsystem); - } - -@@ -1185,6 +1225,7 @@ static int udevGetDeviceDetails(struct udev_device *device, - case VIR_NODE_DEV_CAP_DRM: - return udevProcessDRMDevice(device, def); - case VIR_NODE_DEV_CAP_MDEV: -+ return udevProcessMediatedDevice(device, def); - case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_SYSTEM: - case VIR_NODE_DEV_CAP_FC_HOST: -diff --git a/tests/nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml b/tests/nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml -new file mode 100644 -index 000000000..470e5917e ---- /dev/null -+++ b/tests/nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml -@@ -0,0 +1,8 @@ -+ -+ mdev_3627463d_b7f0_4fea_b468_f1da537d301b -+ computer -+ -+ -+ -+ -+ -diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c -index eb5c50b86..26f0d25bc 100644 ---- a/tests/nodedevxml2xmltest.c -+++ b/tests/nodedevxml2xmltest.c -@@ -102,6 +102,7 @@ mymain(void) - DO_TEST("pci_0000_02_10_7_sriov_pf_vfs_all_header_type"); - DO_TEST("drm_renderD129"); - DO_TEST("pci_0000_02_10_7_mdev_types"); -+ DO_TEST("mdev_3627463d_b7f0_4fea_b468_f1da537d301b"); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; - } --- -2.13.0 - diff --git a/SOURCES/libvirt-nodedev-Introduce-new-mdev_types-and-mdev-nodedev-capabilities.patch b/SOURCES/libvirt-nodedev-Introduce-new-mdev_types-and-mdev-nodedev-capabilities.patch deleted file mode 100644 index 11333ed..0000000 --- a/SOURCES/libvirt-nodedev-Introduce-new-mdev_types-and-mdev-nodedev-capabilities.patch +++ /dev/null @@ -1,193 +0,0 @@ -From 74e4d42a25e8e8823ce4e7c3544b8f1944cdb471 Mon Sep 17 00:00:00 2001 -Message-Id: <74e4d42a25e8e8823ce4e7c3544b8f1944cdb471@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:52 +0200 -Subject: [PATCH] nodedev: Introduce new mdev_types and mdev nodedev - capabilities - -The reason for introducing two capabilities, one for the device itself -(cap 'mdev') and one for the parent device listing the available types -('mdev_types'), is that we should be able to do -'virsh nodedev-list --cap' not only for existing mdev devices but also -for devices that support creation of mdev devices, since one day libvirt -might be actually able to create the mdev devices in an automated way -(just like we do for NPIV/vHBA). - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit 4385df97fed24279fa8595a1a49c9f9b3eba5be1) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt-nodedev.h | 2 ++ - src/conf/node_device_conf.c | 10 +++++++++- - src/conf/node_device_conf.h | 6 +++++- - src/conf/virnodedeviceobj.c | 4 +++- - src/libvirt-nodedev.c | 2 ++ - src/node_device/node_device_driver.c | 2 ++ - src/node_device/node_device_udev.c | 3 +++ - tools/virsh-nodedev.c | 6 ++++++ - 8 files changed, 32 insertions(+), 3 deletions(-) - -diff --git a/include/libvirt/libvirt-nodedev.h b/include/libvirt/libvirt-nodedev.h -index 85003903d..1e3043787 100644 ---- a/include/libvirt/libvirt-nodedev.h -+++ b/include/libvirt/libvirt-nodedev.h -@@ -79,6 +79,8 @@ typedef enum { - VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = 1 << 10, /* Capable of vport */ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = 1 << 11, /* Capable of scsi_generic */ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM = 1 << 12, /* DRM device */ -+ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES = 1 << 13, /* Capable of mediated devices */ -+ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV = 1 << 14, /* Mediated device */ - } virConnectListAllNodeDeviceFlags; - - int virConnectListAllNodeDevices (virConnectPtr conn, -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index 56a26b578..90a087a37 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -60,7 +60,9 @@ VIR_ENUM_IMPL(virNodeDevCap, VIR_NODE_DEV_CAP_LAST, - "fc_host", - "vports", - "scsi_generic", -- "drm") -+ "drm", -+ "mdev_types", -+ "mdev") - - VIR_ENUM_IMPL(virNodeDevNetCap, VIR_NODE_DEV_CAP_NET_LAST, - "80203", -@@ -540,6 +542,8 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) - case VIR_NODE_DEV_CAP_DRM: - virBufferEscapeString(&buf, "%s\n", virNodeDevDRMTypeToString(data->drm.type)); - break; -+ case VIR_NODE_DEV_CAP_MDEV: -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: - case VIR_NODE_DEV_CAP_LAST: -@@ -1612,6 +1616,8 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, - case VIR_NODE_DEV_CAP_DRM: - ret = virNodeDevCapDRMParseXML(ctxt, def, node, &caps->data.drm); - break; -+ case VIR_NODE_DEV_CAP_MDEV: -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: - case VIR_NODE_DEV_CAP_SCSI_GENERIC: -@@ -1929,6 +1935,8 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) - case VIR_NODE_DEV_CAP_SCSI_GENERIC: - VIR_FREE(data->sg.path); - break; -+ case VIR_NODE_DEV_CAP_MDEV: -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_DRM: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: -diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h -index a5d5cdd2a..e168f2e27 100644 ---- a/src/conf/node_device_conf.h -+++ b/src/conf/node_device_conf.h -@@ -64,6 +64,8 @@ typedef enum { - VIR_NODE_DEV_CAP_VPORTS, /* HBA which is capable of vports */ - VIR_NODE_DEV_CAP_SCSI_GENERIC, /* SCSI generic device */ - VIR_NODE_DEV_CAP_DRM, /* DRM device */ -+ VIR_NODE_DEV_CAP_MDEV_TYPES, /* Device capable of mediated devices */ -+ VIR_NODE_DEV_CAP_MDEV, /* Mediated device */ - - VIR_NODE_DEV_CAP_LAST - } virNodeDevCapType; -@@ -351,7 +353,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); - VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST | \ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS | \ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC | \ -- VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM) -+ VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM | \ -+ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES | \ -+ VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV) - - char * - virNodeDeviceGetParentName(virConnectPtr conn, -diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c -index 3fe3ae5fe..21d5d3f75 100644 ---- a/src/conf/virnodedeviceobj.c -+++ b/src/conf/virnodedeviceobj.c -@@ -494,7 +494,9 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj, - MATCH(FC_HOST) || - MATCH(VPORTS) || - MATCH(SCSI_GENERIC) || -- MATCH(DRM))) -+ MATCH(DRM) || -+ MATCH(MDEV_TYPES) || -+ MATCH(MDEV))) - return false; - } - -diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c -index 83376b0d9..44e2b4efd 100644 ---- a/src/libvirt-nodedev.c -+++ b/src/libvirt-nodedev.c -@@ -98,6 +98,8 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags) - * VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS - * VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC - * VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM -+ * VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES -+ * VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV - * - * Returns the number of node devices found or -1 and sets @devices to NULL in - * case of error. On success, the array stored into @devices is guaranteed to -diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c -index 99f7bc547..082160d98 100644 ---- a/src/node_device/node_device_driver.c -+++ b/src/node_device/node_device_driver.c -@@ -82,6 +82,8 @@ static int update_caps(virNodeDeviceObjPtr dev) - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: - case VIR_NODE_DEV_CAP_SCSI_GENERIC: -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: -+ case VIR_NODE_DEV_CAP_MDEV: - case VIR_NODE_DEV_CAP_LAST: - break; - } -diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c -index 591da8db2..d4489e2a5 100644 ---- a/src/node_device/node_device_udev.c -+++ b/src/node_device/node_device_udev.c -@@ -43,6 +43,7 @@ - #include "virpci.h" - #include "virstring.h" - #include "virnetdev.h" -+#include "virmdev.h" - - #define VIR_FROM_THIS VIR_FROM_NODEDEV - -@@ -1064,6 +1065,8 @@ static int udevGetDeviceDetails(struct udev_device *device, - return udevProcessSCSIGeneric(device, def); - case VIR_NODE_DEV_CAP_DRM: - return udevProcessDRMDevice(device, def); -+ case VIR_NODE_DEV_CAP_MDEV: -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: - case VIR_NODE_DEV_CAP_SYSTEM: - case VIR_NODE_DEV_CAP_FC_HOST: - case VIR_NODE_DEV_CAP_VPORTS: -diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c -index c69144021..ad96dda1f 100644 ---- a/tools/virsh-nodedev.c -+++ b/tools/virsh-nodedev.c -@@ -454,6 +454,12 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) - case VIR_NODE_DEV_CAP_DRM: - flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM; - break; -+ case VIR_NODE_DEV_CAP_MDEV_TYPES: -+ flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES; -+ break; -+ case VIR_NODE_DEV_CAP_MDEV: -+ flags |= VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV; -+ break; - case VIR_NODE_DEV_CAP_LAST: - break; - } --- -2.13.0 - diff --git a/SOURCES/libvirt-nodedev-Introduce-the-mdev-capability-to-a-PCI-parent-device.patch b/SOURCES/libvirt-nodedev-Introduce-the-mdev-capability-to-a-PCI-parent-device.patch deleted file mode 100644 index 32d38c3..0000000 --- a/SOURCES/libvirt-nodedev-Introduce-the-mdev-capability-to-a-PCI-parent-device.patch +++ /dev/null @@ -1,522 +0,0 @@ -From 909d3ff4c0e4ab7486c60dade9900462c896d3ba Mon Sep 17 00:00:00 2001 -Message-Id: <909d3ff4c0e4ab7486c60dade9900462c896d3ba@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:53 +0200 -Subject: [PATCH] nodedev: Introduce the mdev capability to a PCI parent device - -The parent device needs to report the generic stuff about the supported -mediated devices types, like device API, available instances, type name, -etc. Therefore this patch introduces a new nested capability element of -type 'mdev_types' with the resulting XML of the following format: - - - ... - - ... - - - optional_vendor_supplied_codename - vfio-pci - NUM - - ... - - ... - - - - ... - - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit 500cbc066a5362834462c4eefb260b7c96a8554f) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - docs/schemas/nodedev.rng | 26 +++++ - src/conf/node_device_conf.c | 101 +++++++++++++++++ - src/conf/node_device_conf.h | 15 +++ - src/conf/virnodedeviceobj.c | 20 +++- - src/libvirt_private.syms | 1 + - src/node_device/node_device_udev.c | 119 +++++++++++++++++++++ - .../pci_0000_02_10_7_mdev_types.xml | 32 ++++++ - tests/nodedevxml2xmltest.c | 1 + - 8 files changed, 313 insertions(+), 2 deletions(-) - create mode 100644 tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml - -diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng -index 0f90a73c8..e0a2c5032 100644 ---- a/docs/schemas/nodedev.rng -+++ b/docs/schemas/nodedev.rng -@@ -205,6 +205,32 @@ - - - -+ -+ -+ mdev_types -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ vfio-pci -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index 90a087a37..de8ba8f9d 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -89,6 +89,19 @@ virNodeDevCapsDefParseString(const char *xpath, - - - void -+virNodeDevCapMdevTypeFree(virNodeDevCapMdevTypePtr type) -+{ -+ if (!type) -+ return; -+ -+ VIR_FREE(type->id); -+ VIR_FREE(type->name); -+ VIR_FREE(type->device_api); -+ VIR_FREE(type); -+} -+ -+ -+void - virNodeDeviceDefFree(virNodeDeviceDefPtr def) - { - virNodeDevCapsDefPtr caps; -@@ -265,6 +278,27 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf, - virBufferAsprintf(buf, "\n", - virPCIHeaderTypeToString(data->pci_dev.hdrType)); - } -+ if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_MDEV) { -+ virBufferAddLit(buf, "\n"); -+ virBufferAdjustIndent(buf, 2); -+ for (i = 0; i < data->pci_dev.nmdev_types; i++) { -+ virNodeDevCapMdevTypePtr type = data->pci_dev.mdev_types[i]; -+ virBufferEscapeString(buf, "\n", type->id); -+ virBufferAdjustIndent(buf, 2); -+ if (type->name) -+ virBufferEscapeString(buf, "%s\n", -+ type->name); -+ virBufferEscapeString(buf, "%s\n", -+ type->device_api); -+ virBufferAsprintf(buf, -+ "%u\n", -+ type->available_instances); -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } -+ virBufferAdjustIndent(buf, -2); -+ virBufferAddLit(buf, "\n"); -+ } - if (data->pci_dev.nIommuGroupDevices) { - virBufferAsprintf(buf, "\n", - data->pci_dev.iommuGroupNumber); -@@ -1365,6 +1399,67 @@ virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt, - - - static int -+virNodeDevPCICapMdevTypesParseXML(xmlXPathContextPtr ctxt, -+ virNodeDevCapPCIDevPtr pci_dev) -+{ -+ int ret = -1; -+ xmlNodePtr orignode = NULL; -+ xmlNodePtr *nodes = NULL; -+ int nmdev_types = -1; -+ virNodeDevCapMdevTypePtr type = NULL; -+ size_t i; -+ -+ if ((nmdev_types = virXPathNodeSet("./type", ctxt, &nodes)) < 0) -+ goto cleanup; -+ -+ orignode = ctxt->node; -+ for (i = 0; i < nmdev_types; i++) { -+ ctxt->node = nodes[i]; -+ -+ if (VIR_ALLOC(type) < 0) -+ goto cleanup; -+ -+ if (!(type->id = virXPathString("string(./@id[1])", ctxt))) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("missing 'id' attribute for mediated device's " -+ " element")); -+ goto cleanup; -+ } -+ -+ if (!(type->device_api = virXPathString("string(./deviceAPI[1])", ctxt))) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("missing device API for mediated device type '%s'"), -+ type->id); -+ goto cleanup; -+ } -+ -+ if (virXPathUInt("number(./availableInstances)", ctxt, -+ &type->available_instances) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, -+ _("missing number of available instances for " -+ "mediated device type '%s'"), -+ type->id); -+ goto cleanup; -+ } -+ -+ type->name = virXPathString("string(./name)", ctxt); -+ -+ if (VIR_APPEND_ELEMENT(pci_dev->mdev_types, -+ pci_dev->nmdev_types, type) < 0) -+ goto cleanup; -+ } -+ -+ pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_MDEV; -+ ret = 0; -+ cleanup: -+ VIR_FREE(nodes); -+ virNodeDevCapMdevTypeFree(type); -+ ctxt->node = orignode; -+ return ret; -+} -+ -+ -+static int - virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, - xmlNodePtr node, - virNodeDevCapPCIDevPtr pci_dev) -@@ -1386,6 +1481,9 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, - } else if (STREQ(type, "virt_functions") && - virNodeDevPCICapSRIOVVirtualParseXML(ctxt, pci_dev) < 0) { - goto cleanup; -+ } else if (STREQ(type, "mdev_types") && -+ virNodeDevPCICapMdevTypesParseXML(ctxt, pci_dev) < 0) { -+ goto cleanup; - } else { - int hdrType = virPCIHeaderTypeFromString(type); - -@@ -1898,6 +1996,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) - VIR_FREE(data->pci_dev.iommuGroupDevices[i]); - VIR_FREE(data->pci_dev.iommuGroupDevices); - virPCIEDeviceInfoFree(data->pci_dev.pci_express); -+ for (i = 0; i < data->pci_dev.nmdev_types; i++) -+ virNodeDevCapMdevTypeFree(data->pci_dev.mdev_types[i]); -+ VIR_FREE(data->pci_dev.mdev_types); - break; - case VIR_NODE_DEV_CAP_USB_DEV: - VIR_FREE(data->usb_dev.product_name); -diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h -index e168f2e27..18aaff8b5 100644 ---- a/src/conf/node_device_conf.h -+++ b/src/conf/node_device_conf.h -@@ -95,6 +95,7 @@ typedef enum { - VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION = (1 << 0), - VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION = (1 << 1), - VIR_NODE_DEV_CAP_FLAG_PCIE = (1 << 2), -+ VIR_NODE_DEV_CAP_FLAG_PCI_MDEV = (1 << 3), - } virNodeDevPCICapFlags; - - typedef enum { -@@ -133,6 +134,15 @@ struct _virNodeDevCapSystem { - virNodeDevCapSystemFirmware firmware; - }; - -+typedef struct _virNodeDevCapMdevType virNodeDevCapMdevType; -+typedef virNodeDevCapMdevType *virNodeDevCapMdevTypePtr; -+struct _virNodeDevCapMdevType { -+ char *id; -+ char *name; -+ char *device_api; -+ unsigned int available_instances; -+}; -+ - typedef struct _virNodeDevCapPCIDev virNodeDevCapPCIDev; - typedef virNodeDevCapPCIDev *virNodeDevCapPCIDevPtr; - struct _virNodeDevCapPCIDev { -@@ -156,6 +166,8 @@ struct _virNodeDevCapPCIDev { - int numa_node; - virPCIEDeviceInfoPtr pci_express; - int hdrType; /* enum virPCIHeaderType or -1 */ -+ virNodeDevCapMdevTypePtr *mdev_types; -+ size_t nmdev_types; - }; - - typedef struct _virNodeDevCapUSBDev virNodeDevCapUSBDev; -@@ -340,6 +352,9 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def); - void - virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); - -+void -+virNodeDevCapMdevTypeFree(virNodeDevCapMdevTypePtr type); -+ - # define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \ - (VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM | \ - VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV | \ -diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c -index 21d5d3f75..ac25fb598 100644 ---- a/src/conf/virnodedeviceobj.c -+++ b/src/conf/virnodedeviceobj.c -@@ -42,11 +42,13 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *dev, - virNodeDevCapTypeToString(VIR_NODE_DEV_CAP_FC_HOST); - const char *vports_cap = - virNodeDevCapTypeToString(VIR_NODE_DEV_CAP_VPORTS); -+ const char *mdev_types = -+ virNodeDevCapTypeToString(VIR_NODE_DEV_CAP_MDEV_TYPES); - - while (caps) { -- if (STREQ(cap, virNodeDevCapTypeToString(caps->data.type))) -+ if (STREQ(cap, virNodeDevCapTypeToString(caps->data.type))) { - return 1; -- else if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) -+ } else if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST) { - if ((STREQ(cap, fc_host_cap) && - (caps->data.scsi_host.flags & - VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST)) || -@@ -54,6 +56,13 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *dev, - (caps->data.scsi_host.flags & - VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS))) - return 1; -+ } else if (caps->data.type == VIR_NODE_DEV_CAP_PCI_DEV) { -+ if ((STREQ(cap, mdev_types)) && -+ (caps->data.pci_dev.flags & -+ VIR_NODE_DEV_CAP_FLAG_PCI_MDEV)) -+ return 1; -+ } -+ - caps = caps->next; - } - return 0; -@@ -468,6 +477,13 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj, - VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS)) - return true; - } -+ -+ if (cap->data.type == VIR_NODE_DEV_CAP_PCI_DEV) { -+ if (type == VIR_NODE_DEV_CAP_MDEV_TYPES && -+ (cap->data.pci_dev.flags & -+ VIR_NODE_DEV_CAP_FLAG_PCI_MDEV)) -+ return true; -+ } - } - - return false; -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 7e1a06db3..343966cd0 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -692,6 +692,7 @@ virNetDevIPRouteParseXML; - - - # conf/node_device_conf.h -+virNodeDevCapMdevTypeFree; - virNodeDevCapsDefFree; - virNodeDevCapTypeFromString; - virNodeDevCapTypeToString; -diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c -index d4489e2a5..b89099c82 100644 ---- a/src/node_device/node_device_udev.c -+++ b/src/node_device/node_device_udev.c -@@ -314,6 +314,119 @@ static int udevTranslatePCIIds(unsigned int vendor, - } - - -+static int -+udevFillMdevType(struct udev_device *device, -+ const char *dir, -+ virNodeDevCapMdevTypePtr type) -+{ -+ int ret = -1; -+ char *attrpath = NULL; -+ -+#define MDEV_GET_SYSFS_ATTR(attr_name, cb, ...) \ -+ do { \ -+ if (virAsprintf(&attrpath, "%s/%s", dir, #attr_name) < 0) \ -+ goto cleanup; \ -+ \ -+ if (cb(device, attrpath, __VA_ARGS__) < 0) \ -+ goto cleanup; \ -+ \ -+ VIR_FREE(attrpath); \ -+ } while (0) \ -+ -+ if (VIR_STRDUP(type->id, last_component(dir)) < 0) -+ goto cleanup; -+ -+ /* query udev for the attributes under subdirectories using the relative -+ * path stored in @dir, i.e. 'mdev_supported_types/' -+ */ -+ MDEV_GET_SYSFS_ATTR(name, udevGetStringSysfsAttr, &type->name); -+ MDEV_GET_SYSFS_ATTR(device_api, udevGetStringSysfsAttr, &type->device_api); -+ MDEV_GET_SYSFS_ATTR(available_instances, udevGetUintSysfsAttr, -+ &type->available_instances, 10); -+ -+#undef MDEV_GET_SYSFS_ATTR -+ -+ ret = 0; -+ cleanup: -+ VIR_FREE(attrpath); -+ return ret; -+} -+ -+ -+static int -+udevPCIGetMdevTypesCap(struct udev_device *device, -+ virNodeDevCapPCIDevPtr pcidata) -+{ -+ int ret = -1; -+ int dirret = -1; -+ DIR *dir = NULL; -+ struct dirent *entry; -+ char *path = NULL; -+ char *tmppath = NULL; -+ virNodeDevCapMdevTypePtr type = NULL; -+ virNodeDevCapMdevTypePtr *types = NULL; -+ size_t ntypes = 0; -+ size_t i; -+ -+ if (virAsprintf(&path, "%s/mdev_supported_types", -+ udev_device_get_syspath(device)) < 0) -+ return -1; -+ -+ if ((dirret = virDirOpenIfExists(&dir, path)) < 0) -+ goto cleanup; -+ -+ if (dirret == 0) { -+ ret = 0; -+ goto cleanup; -+ } -+ -+ if (VIR_ALLOC(types) < 0) -+ goto cleanup; -+ -+ /* UDEV doesn't report attributes under subdirectories by default but is -+ * able to query them if the path to the attribute is relative to the -+ * device's base path, e.g. /sys/devices/../0000:00:01.0/ is the device's -+ * base path as udev reports it, but we're interested in attributes under -+ * /sys/devices/../0000:00:01.0/mdev_supported_types//. So, we need to -+ * scan the subdirectories ourselves. -+ */ -+ while ((dirret = virDirRead(dir, &entry, path)) > 0) { -+ if (VIR_ALLOC(type) < 0) -+ goto cleanup; -+ -+ /* construct the relative mdev type path bit for udev */ -+ if (virAsprintf(&tmppath, "mdev_supported_types/%s", entry->d_name) < 0) -+ goto cleanup; -+ -+ if (udevFillMdevType(device, tmppath, type) < 0) -+ goto cleanup; -+ -+ if (VIR_APPEND_ELEMENT(types, ntypes, type) < 0) -+ goto cleanup; -+ -+ VIR_FREE(tmppath); -+ } -+ -+ if (dirret < 0) -+ goto cleanup; -+ -+ VIR_STEAL_PTR(pcidata->mdev_types, types); -+ pcidata->nmdev_types = ntypes; -+ pcidata->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_MDEV; -+ ntypes = 0; -+ ret = 0; -+ cleanup: -+ virNodeDevCapMdevTypeFree(type); -+ for (i = 0; i < ntypes; i++) -+ virNodeDevCapMdevTypeFree(types[i]); -+ VIR_FREE(types); -+ VIR_FREE(path); -+ VIR_FREE(tmppath); -+ VIR_DIR_CLOSE(dir); -+ return ret; -+} -+ -+ - static int udevProcessPCI(struct udev_device *device, - virNodeDeviceDefPtr def) - { -@@ -404,6 +517,12 @@ static int udevProcessPCI(struct udev_device *device, - } - } - -+ /* check whether the device is mediated devices framework capable, if so, -+ * process it -+ */ -+ if (udevPCIGetMdevTypesCap(device, pci_dev) < 0) -+ goto cleanup; -+ - ret = 0; - - cleanup: -diff --git a/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml b/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml -new file mode 100644 -index 000000000..a2d57569a ---- /dev/null -+++ b/tests/nodedevschemadata/pci_0000_02_10_7_mdev_types.xml -@@ -0,0 +1,32 @@ -+ -+ pci_0000_02_10_7 -+ pci_0000_00_04_0 -+ -+ 0 -+ 2 -+ 16 -+ 7 -+ 82576 Virtual Function -+ Intel Corporation -+ -+ -+ bar1 -+ vfio-pci -+ 1 -+ -+ -+ bar2 -+ vfio-pci -+ 2 -+ -+ -+ -+

      -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c -index 5e1ae170c..eb5c50b86 100644 ---- a/tests/nodedevxml2xmltest.c -+++ b/tests/nodedevxml2xmltest.c -@@ -101,6 +101,7 @@ mymain(void) - DO_TEST("pci_0000_02_10_7_sriov_pf_vfs_all"); - DO_TEST("pci_0000_02_10_7_sriov_pf_vfs_all_header_type"); - DO_TEST("drm_renderD129"); -+ DO_TEST("pci_0000_02_10_7_mdev_types"); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; - } --- -2.13.0 - diff --git a/SOURCES/libvirt-nodedev-Make-use-of-the-compile-time-missing-enum-in-switch-error.patch b/SOURCES/libvirt-nodedev-Make-use-of-the-compile-time-missing-enum-in-switch-error.patch deleted file mode 100644 index 36c618b..0000000 --- a/SOURCES/libvirt-nodedev-Make-use-of-the-compile-time-missing-enum-in-switch-error.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 403371cc06cd9ac36bbe7e7a2e046de82c09e762 Mon Sep 17 00:00:00 2001 -Message-Id: <403371cc06cd9ac36bbe7e7a2e046de82c09e762@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:47 +0200 -Subject: [PATCH] nodedev: Make use of the compile-time missing enum in switch - error - -So udevGetDeviceDetails was one those functions using an enum in a -switch, but since it had a 'default' case, compiler didn't warn about an -unhandled enum. Moreover, the error about an unsupported device type -reported in the default case is unnecessary, since by the time we get -there, udevGetDeviceType (which was called before) already made sure -that any unrecognized device types had been handled properly. - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit 364c912cf384d2fb7575ba2f71a041297210e0e2) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/node_device/node_device_udev.c | 45 +++++++++++++------------------------- - 1 file changed, 15 insertions(+), 30 deletions(-) - -diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c -index bcae444d8..591da8db2 100644 ---- a/src/node_device/node_device_udev.c -+++ b/src/node_device/node_device_udev.c -@@ -1043,50 +1043,35 @@ udevGetDeviceType(struct udev_device *device, - static int udevGetDeviceDetails(struct udev_device *device, - virNodeDeviceDefPtr def) - { -- int ret = 0; -- - switch (def->caps->data.type) { -- case VIR_NODE_DEV_CAP_SYSTEM: -- /* There's no libudev equivalent of system, so ignore it. */ -- break; - case VIR_NODE_DEV_CAP_PCI_DEV: -- ret = udevProcessPCI(device, def); -- break; -+ return udevProcessPCI(device, def); - case VIR_NODE_DEV_CAP_USB_DEV: -- ret = udevProcessUSBDevice(device, def); -- break; -+ return udevProcessUSBDevice(device, def); - case VIR_NODE_DEV_CAP_USB_INTERFACE: -- ret = udevProcessUSBInterface(device, def); -- break; -+ return udevProcessUSBInterface(device, def); - case VIR_NODE_DEV_CAP_NET: -- ret = udevProcessNetworkInterface(device, def); -- break; -+ return udevProcessNetworkInterface(device, def); - case VIR_NODE_DEV_CAP_SCSI_HOST: -- ret = udevProcessSCSIHost(device, def); -- break; -+ return udevProcessSCSIHost(device, def); - case VIR_NODE_DEV_CAP_SCSI_TARGET: -- ret = udevProcessSCSITarget(device, def); -- break; -+ return udevProcessSCSITarget(device, def); - case VIR_NODE_DEV_CAP_SCSI: -- ret = udevProcessSCSIDevice(device, def); -- break; -+ return udevProcessSCSIDevice(device, def); - case VIR_NODE_DEV_CAP_STORAGE: -- ret = udevProcessStorage(device, def); -- break; -+ return udevProcessStorage(device, def); - case VIR_NODE_DEV_CAP_SCSI_GENERIC: -- ret = udevProcessSCSIGeneric(device, def); -- break; -+ return udevProcessSCSIGeneric(device, def); - case VIR_NODE_DEV_CAP_DRM: -- ret = udevProcessDRMDevice(device, def); -- break; -- default: -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Unknown device type %d"), def->caps->data.type); -- ret = -1; -+ return udevProcessDRMDevice(device, def); -+ case VIR_NODE_DEV_CAP_SYSTEM: -+ case VIR_NODE_DEV_CAP_FC_HOST: -+ case VIR_NODE_DEV_CAP_VPORTS: -+ case VIR_NODE_DEV_CAP_LAST: - break; - } - -- return ret; -+ return 0; - } - - --- -2.13.0 - diff --git a/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch b/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch new file mode 100644 index 0000000..94e6ada --- /dev/null +++ b/SOURCES/libvirt-nodedev-Restore-setting-of-privileged.patch @@ -0,0 +1,36 @@ +From be8c0df9c361446003821c35af1531187d0080b9 Mon Sep 17 00:00:00 2001 +Message-Id: +From: John Ferlan +Date: Fri, 24 Nov 2017 12:13:52 -0500 +Subject: [PATCH] nodedev: Restore setting of privileged + +https://bugzilla.redhat.com/show_bug.cgi?id=1517372 + +Commit id '36555364' removed the setting of the driver->privileged, +which the udevProcessPCI would need in order to read the PCI device +configs. + +Signed-off-by: John Ferlan +(cherry picked from commit 9bfcf3ccdd2a0bb599dff27f97d5c1524cba1b79) +Reviewed-by: Erik Skultety +Signed-off-by: Jiri Denemark +--- + src/node_device/node_device_udev.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c +index d48334b857..ed012200f5 100644 +--- a/src/node_device/node_device_udev.c ++++ b/src/node_device/node_device_udev.c +@@ -1933,6 +1933,8 @@ nodeStateInitialize(bool privileged, + return -1; + } + ++ driver->privileged = privileged; ++ + if (!(driver->devs = virNodeDeviceObjListNew()) || + !(priv = udevEventDataNew())) + goto cleanup; +-- +2.15.1 + diff --git a/SOURCES/libvirt-nodedev-conf-Split-PCI-sub-capability-parsing-to-separate-methods.patch b/SOURCES/libvirt-nodedev-conf-Split-PCI-sub-capability-parsing-to-separate-methods.patch deleted file mode 100644 index 9a5e2d4..0000000 --- a/SOURCES/libvirt-nodedev-conf-Split-PCI-sub-capability-parsing-to-separate-methods.patch +++ /dev/null @@ -1,198 +0,0 @@ -From 309e27ed960e7ac34177aa1fcac34cc6faf149fb Mon Sep 17 00:00:00 2001 -Message-Id: <309e27ed960e7ac34177aa1fcac34cc6faf149fb@dist-git> -From: Erik Skultety -Date: Thu, 18 May 2017 14:02:51 +0200 -Subject: [PATCH] nodedev: conf: Split PCI sub-capability parsing to separate - methods - -Since there's at least SRIOV and MDEV sub-capabilities to be parsed, -let's make the code more readable by splitting it to several logical -blocks. - -https://bugzilla.redhat.com/show_bug.cgi?id=1452072 - -Signed-off-by: Erik Skultety -(cherry picked from commit a5c1f3b7e028193e8cb9f9a420ac2fdd5f4a66fe) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/conf/node_device_conf.c | 142 ++++++++++++++++++++++++++------------------ - 1 file changed, 83 insertions(+), 59 deletions(-) - -diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c -index 02215f32d..56a26b578 100644 ---- a/src/conf/node_device_conf.c -+++ b/src/conf/node_device_conf.c -@@ -1286,76 +1286,102 @@ virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt, - - - static int -+virNodeDevPCICapSRIOVPhysicalParseXML(xmlXPathContextPtr ctxt, -+ virNodeDevCapPCIDevPtr pci_dev) -+{ -+ xmlNodePtr address = virXPathNode("./address[1]", ctxt); -+ -+ if (VIR_ALLOC(pci_dev->physical_function) < 0) -+ return -1; -+ -+ if (!address) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Missing address in 'phys_function' capability")); -+ return -1; -+ } -+ -+ if (virPCIDeviceAddressParseXML(address, -+ pci_dev->physical_function) < 0) -+ return -1; -+ -+ pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION; -+ -+ return 0; -+} -+ -+ -+static int -+virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt, -+ virNodeDevCapPCIDevPtr pci_dev) -+{ -+ int ret = -1; -+ xmlNodePtr *addresses = NULL; -+ int naddresses = virXPathNodeSet("./address", ctxt, &addresses); -+ char *maxFuncsStr = virXPathString("string(./@maxCount)", ctxt); -+ size_t i; -+ -+ if (naddresses < 0) -+ goto cleanup; -+ -+ if (maxFuncsStr && -+ virStrToLong_uip(maxFuncsStr, NULL, 10, -+ &pci_dev->max_virtual_functions) < 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("Malformed 'maxCount' parameter")); -+ goto cleanup; -+ } -+ -+ if (VIR_ALLOC_N(pci_dev->virtual_functions, naddresses) < 0) -+ goto cleanup; -+ -+ for (i = 0; i < naddresses; i++) { -+ virPCIDeviceAddressPtr addr = NULL; -+ -+ if (VIR_ALLOC(addr) < 0) -+ goto cleanup; -+ -+ if (virPCIDeviceAddressParseXML(addresses[i], addr) < 0) { -+ VIR_FREE(addr); -+ goto cleanup; -+ } -+ -+ if (VIR_APPEND_ELEMENT(pci_dev->virtual_functions, -+ pci_dev->num_virtual_functions, -+ addr) < 0) -+ goto cleanup; -+ } -+ -+ pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION; -+ ret = 0; -+ cleanup: -+ VIR_FREE(addresses); -+ VIR_FREE(maxFuncsStr); -+ return ret; -+} -+ -+ -+static int - virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, - xmlNodePtr node, - virNodeDevCapPCIDevPtr pci_dev) - { -- char *maxFuncsStr = virXMLPropString(node, "maxCount"); - char *type = virXMLPropString(node, "type"); -- xmlNodePtr *addresses = NULL; - xmlNodePtr orignode = ctxt->node; - int ret = -1; -- size_t i = 0; - - ctxt->node = node; - - if (!type) { - virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing capability type")); -- goto out; -+ goto cleanup; - } - -- if (STREQ(type, "phys_function")) { -- xmlNodePtr address = virXPathNode("./address[1]", ctxt); -- -- if (VIR_ALLOC(pci_dev->physical_function) < 0) -- goto out; -- -- if (!address) { -- virReportError(VIR_ERR_XML_ERROR, "%s", -- _("Missing address in 'phys_function' capability")); -- goto out; -- } -- -- if (virPCIDeviceAddressParseXML(address, -- pci_dev->physical_function) < 0) -- goto out; -- -- pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION; -- } else if (STREQ(type, "virt_functions")) { -- int naddresses; -- -- if ((naddresses = virXPathNodeSet("./address", ctxt, &addresses)) < 0) -- goto out; -- -- if (maxFuncsStr && -- virStrToLong_uip(maxFuncsStr, NULL, 10, -- &pci_dev->max_virtual_functions) < 0) { -- virReportError(VIR_ERR_XML_ERROR, "%s", -- _("Malformed 'maxCount' parameter")); -- goto out; -- } -- -- if (VIR_ALLOC_N(pci_dev->virtual_functions, naddresses) < 0) -- goto out; -- -- for (i = 0; i < naddresses; i++) { -- virPCIDeviceAddressPtr addr = NULL; -- -- if (VIR_ALLOC(addr) < 0) -- goto out; -- -- if (virPCIDeviceAddressParseXML(addresses[i], addr) < 0) { -- VIR_FREE(addr); -- goto out; -- } -- -- if (VIR_APPEND_ELEMENT(pci_dev->virtual_functions, -- pci_dev->num_virtual_functions, -- addr) < 0) -- goto out; -- } -- -- pci_dev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION; -+ if (STREQ(type, "phys_function") && -+ virNodeDevPCICapSRIOVPhysicalParseXML(ctxt, pci_dev) < 0) { -+ goto cleanup; -+ } else if (STREQ(type, "virt_functions") && -+ virNodeDevPCICapSRIOVVirtualParseXML(ctxt, pci_dev) < 0) { -+ goto cleanup; - } else { - int hdrType = virPCIHeaderTypeFromString(type); - -@@ -1364,9 +1390,7 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, - } - - ret = 0; -- out: -- VIR_FREE(addresses); -- VIR_FREE(maxFuncsStr); -+ cleanup: - VIR_FREE(type); - ctxt->node = orignode; - return ret; --- -2.13.0 - diff --git a/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch b/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch new file mode 100644 index 0000000..ee21082 --- /dev/null +++ b/SOURCES/libvirt-numa-Introduce-virDomainNumaNodeDistanceIsUsingDefaults.patch @@ -0,0 +1,84 @@ +From 8af3d229190faed68beda2a1493badc1eb78e108 Mon Sep 17 00:00:00 2001 +Message-Id: <8af3d229190faed68beda2a1493badc1eb78e108@dist-git> +From: Michal Privoznik +Date: Mon, 4 Dec 2017 13:38:50 +0100 +Subject: [PATCH] numa: Introduce virDomainNumaNodeDistanceIsUsingDefaults + +https://bugzilla.redhat.com/show_bug.cgi?id=1454889 + +The function returns true/false depending on distance +configuration being present in the domain XML. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit ab9baab7290a4a009e4e8ddfb63a2ddd19bb8091) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/conf/numa_conf.c | 21 +++++++++++++++++++++ + src/conf/numa_conf.h | 4 ++++ + src/libvirt_private.syms | 1 + + 3 files changed, 26 insertions(+) + +diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c +index c2f0d1ca8c..8fc3b0a196 100644 +--- a/src/conf/numa_conf.c ++++ b/src/conf/numa_conf.c +@@ -1137,6 +1137,27 @@ virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes) + return numa->nmem_nodes; + } + ++ ++bool ++virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa, ++ size_t node, ++ size_t sibling) ++{ ++ if (node >= numa->nmem_nodes || ++ sibling >= numa->nmem_nodes) ++ return false; ++ ++ if (!numa->mem_nodes[node].distances) ++ return true; ++ ++ if (numa->mem_nodes[node].distances[sibling].value == LOCAL_DISTANCE || ++ numa->mem_nodes[node].distances[sibling].value == REMOTE_DISTANCE) ++ return true; ++ ++ return false; ++} ++ ++ + size_t + virDomainNumaGetNodeDistance(virDomainNumaPtr numa, + size_t node, +diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h +index 4655de3aa7..7947fdb219 100644 +--- a/src/conf/numa_conf.h ++++ b/src/conf/numa_conf.h +@@ -87,6 +87,10 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune, + + size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa); + ++bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa, ++ size_t node, ++ size_t sibling) ++ ATTRIBUTE_NONNULL(1); + size_t virDomainNumaGetNodeDistance(virDomainNumaPtr numa, + size_t node, + size_t sibling) +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 19543e06ae..0449b0185f 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -727,6 +727,7 @@ virDomainNumaGetNodeDistance; + virDomainNumaGetNodeMemoryAccessMode; + virDomainNumaGetNodeMemorySize; + virDomainNumaNew; ++virDomainNumaNodeDistanceIsUsingDefaults; + virDomainNumaSetNodeCount; + virDomainNumaSetNodeCpumask; + virDomainNumaSetNodeDistance; +-- +2.15.1 + diff --git a/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch b/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch new file mode 100644 index 0000000..5439b5d --- /dev/null +++ b/SOURCES/libvirt-numa-describe-siblings-distances-within-cells.patch @@ -0,0 +1,461 @@ +From 2ff472bc2ac9d01181c1dbd522153934de79907f Mon Sep 17 00:00:00 2001 +Message-Id: <2ff472bc2ac9d01181c1dbd522153934de79907f@dist-git> +From: Wim ten Have +Date: Mon, 4 Dec 2017 13:38:47 +0100 +Subject: [PATCH] numa: describe siblings distances within cells + +https://bugzilla.redhat.com/show_bug.cgi?id=1454889 + +Add support for describing NUMA distances in a domain's +XML description. + +Below is an example of a 4 node setup: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +A defines a NUMA node. describes the NUMA distance +from the to the other NUMA nodes (the s). For example, +in above XML description, the distance between NUMA node0 and NUMA node2 is 31. + +Valid distance values are '10 <= value <= 255'. A distance value of 10 +represents the distance to the node itself. A distance value of 20 +represents the default value for remote nodes but other values are +possible depending on the physical topology of the system. + +When distances are not fully described, any missing sibling distance +values will default to 10 for local nodes and 20 for remote nodes. + +If distance is given for A -> B, then we default B -> A to the same +value instead of 20. + +Signed-off-by: Wim ten Have +Reviewed-by: Daniel P. Berrange +Signed-off-by: Jim Fehlig +(cherry picked from commit 74119a03f184b79dcad28aa1e6f4ede6dc444998) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 64 ++++++++++++++- + docs/schemas/basictypes.rng | 7 ++ + docs/schemas/cputypes.rng | 18 +++++ + src/conf/numa_conf.c | 191 +++++++++++++++++++++++++++++++++++++++++++- + 4 files changed, 276 insertions(+), 4 deletions(-) + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index 62dd6e1ec4..a5adf5d9aa 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -1529,7 +1529,69 @@ +

      + +

      +- This guest NUMA specification is currently available only for QEMU/KVM. ++ This guest NUMA specification is currently available only for ++ QEMU/KVM and Xen. ++

      ++ ++

      ++ A NUMA hardware architecture supports the notion of distances ++ between NUMA cells. Since 3.10.0 it ++ is possible to define the distance between NUMA cells using the ++ distances element within a NUMA cell ++ description. The sibling sub-element is used to ++ specify the distance value between sibling NUMA cells. For more ++ details, see the chapter explaining the system's SLIT (System ++ Locality Information Table) within the ACPI (Advanced ++ Configuration and Power Interface) specification. ++

      ++ ++
      ++...
      ++<cpu>
      ++  ...
      ++  <numa>
      ++    <cell id='0' cpus='0,4-7' memory='512000' unit='KiB'>
      ++      <distances>
      ++        <sibling id='0' value='10'/>
      ++        <sibling id='1' value='21'/>
      ++        <sibling id='2' value='31'/>
      ++        <sibling id='3' value='41'/>
      ++      </distances>
      ++    </cell>
      ++    <cell id='1' cpus='1,8-10,12-15' memory='512000' unit='KiB' memAccess='shared'>
      ++      <distances>
      ++        <sibling id='0' value='21'/>
      ++        <sibling id='1' value='10'/>
      ++        <sibling id='2' value='21'/>
      ++        <sibling id='3' value='31'/>
      ++      </distances>
      ++    </cell>
      ++    <cell id='2' cpus='2,11' memory='512000' unit='KiB' memAccess='shared'>
      ++      <distances>
      ++        <sibling id='0' value='31'/>
      ++        <sibling id='1' value='21'/>
      ++        <sibling id='2' value='10'/>
      ++        <sibling id='3' value='21'/>
      ++      </distances>
      ++    </cell>
      ++    <cell id='3' cpus='3' memory='512000' unit='KiB'>
      ++      <distances>
      ++        <sibling id='0' value='41'/>
      ++        <sibling id='1' value='31'/>
      ++        <sibling id='2' value='21'/>
      ++        <sibling id='3' value='10'/>
      ++      </distances>
      ++    </cell>
      ++  </numa>
      ++  ...
      ++</cpu>
      ++...
      ++ ++

      ++ Describing distances between NUMA cells is currently only supported ++ by Xen. If no distances are given to describe ++ the SLIT data between different cells, it will default to a scheme ++ using 10 for local and 20 for remote distances. +

      + +

      Events configuration

      +diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng +index 1ea667cdf6..1a18cd31b1 100644 +--- a/docs/schemas/basictypes.rng ++++ b/docs/schemas/basictypes.rng +@@ -77,6 +77,13 @@ + + + ++ ++ ++ 10 ++ 255 ++ ++ ++ + + + +diff --git a/docs/schemas/cputypes.rng b/docs/schemas/cputypes.rng +index 3eef16abce..c45b6dfb28 100644 +--- a/docs/schemas/cputypes.rng ++++ b/docs/schemas/cputypes.rng +@@ -129,6 +129,24 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c +index b71dc012c5..5fbcc72041 100644 +--- a/src/conf/numa_conf.c ++++ b/src/conf/numa_conf.c +@@ -29,6 +29,15 @@ + #include "virnuma.h" + #include "virstring.h" + ++/* ++ * Distance definitions defined Conform ACPI 2.0 SLIT. ++ * See include/linux/topology.h ++ */ ++#define LOCAL_DISTANCE 10 ++#define REMOTE_DISTANCE 20 ++/* SLIT entry value is a one-byte unsigned integer. */ ++#define UNREACHABLE 255 ++ + #define VIR_FROM_THIS VIR_FROM_DOMAIN + + VIR_ENUM_IMPL(virDomainNumatuneMemMode, +@@ -48,6 +57,8 @@ VIR_ENUM_IMPL(virDomainMemoryAccess, VIR_DOMAIN_MEMORY_ACCESS_LAST, + "shared", + "private") + ++typedef struct _virDomainNumaDistance virDomainNumaDistance; ++typedef virDomainNumaDistance *virDomainNumaDistancePtr; + + typedef struct _virDomainNumaNode virDomainNumaNode; + typedef virDomainNumaNode *virDomainNumaNodePtr; +@@ -66,6 +77,12 @@ struct _virDomainNuma { + virBitmapPtr nodeset; /* host memory nodes where this guest node resides */ + virDomainNumatuneMemMode mode; /* memory mode selection */ + virDomainMemoryAccess memAccess; /* shared memory access configuration */ ++ ++ struct _virDomainNumaDistance { ++ unsigned int value; /* locality value for node i->j or j->i */ ++ unsigned int cellid; ++ } *distances; /* remote node distances */ ++ size_t ndistances; + } *mem_nodes; /* guest node configuration */ + size_t nmem_nodes; + +@@ -686,6 +703,144 @@ virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune, + } + + ++static int ++virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def, ++ xmlXPathContextPtr ctxt, ++ unsigned int cur_cell) ++{ ++ int ret = -1; ++ int sibling; ++ char *tmp = NULL; ++ xmlNodePtr *nodes = NULL; ++ size_t i, ndistances = def->nmem_nodes; ++ ++ if (!ndistances) ++ return 0; ++ ++ /* check if NUMA distances definition is present */ ++ if (!virXPathNode("./distances[1]", ctxt)) ++ return 0; ++ ++ if ((sibling = virXPathNodeSet("./distances[1]/sibling", ctxt, &nodes)) <= 0) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("NUMA distances defined without siblings")); ++ goto cleanup; ++ } ++ ++ for (i = 0; i < sibling; i++) { ++ virDomainNumaDistancePtr ldist, rdist; ++ unsigned int sibling_id, sibling_value; ++ ++ /* siblings are in order of parsing or explicitly numbered */ ++ if (!(tmp = virXMLPropString(nodes[i], "id"))) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Missing 'id' attribute in NUMA " ++ "distances under 'cell id %d'"), ++ cur_cell); ++ goto cleanup; ++ } ++ ++ /* The "id" needs to be applicable */ ++ if (virStrToLong_uip(tmp, NULL, 10, &sibling_id) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Invalid 'id' attribute in NUMA " ++ "distances for sibling: '%s'"), ++ tmp); ++ goto cleanup; ++ } ++ VIR_FREE(tmp); ++ ++ /* The "id" needs to be within numa/cell range */ ++ if (sibling_id >= ndistances) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("'sibling_id %d' does not refer to a " ++ "valid cell within NUMA 'cell id %d'"), ++ sibling_id, cur_cell); ++ goto cleanup; ++ } ++ ++ /* We need a locality value. Check and correct ++ * distance to local and distance to remote node. ++ */ ++ if (!(tmp = virXMLPropString(nodes[i], "value"))) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Missing 'value' attribute in NUMA distances " ++ "under 'cell id %d' for 'sibling id %d'"), ++ cur_cell, sibling_id); ++ goto cleanup; ++ } ++ ++ /* The "value" needs to be applicable */ ++ if (virStrToLong_uip(tmp, NULL, 10, &sibling_value) < 0) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("'value %s' is invalid for " ++ "'sibling id %d' under NUMA 'cell id %d'"), ++ tmp, sibling_id, cur_cell); ++ goto cleanup; ++ } ++ VIR_FREE(tmp); ++ ++ /* Assure LOCAL_DISTANCE <= "value" <= UNREACHABLE ++ * and correct LOCAL_DISTANCE setting if such applies. ++ */ ++ if ((sibling_value < LOCAL_DISTANCE || ++ sibling_value > UNREACHABLE) || ++ (sibling_id == cur_cell && ++ sibling_value != LOCAL_DISTANCE) || ++ (sibling_id != cur_cell && ++ sibling_value == LOCAL_DISTANCE)) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("'value %d' is invalid for " ++ "'sibling id %d' under NUMA 'cell id %d'"), ++ sibling_value, sibling_id, cur_cell); ++ goto cleanup; ++ } ++ ++ /* Apply the local / remote distance */ ++ ldist = def->mem_nodes[cur_cell].distances; ++ if (!ldist) { ++ if (VIR_ALLOC_N(ldist, ndistances) < 0) ++ goto cleanup; ++ ++ ldist[cur_cell].value = LOCAL_DISTANCE; ++ ldist[cur_cell].cellid = cur_cell; ++ def->mem_nodes[cur_cell].ndistances = ndistances; ++ } ++ ++ ldist[sibling_id].cellid = sibling_id; ++ ldist[sibling_id].value = sibling_value; ++ def->mem_nodes[cur_cell].distances = ldist; ++ ++ /* Apply symmetry if none given */ ++ rdist = def->mem_nodes[sibling_id].distances; ++ if (!rdist) { ++ if (VIR_ALLOC_N(rdist, ndistances) < 0) ++ goto cleanup; ++ ++ rdist[sibling_id].value = LOCAL_DISTANCE; ++ rdist[sibling_id].cellid = sibling_id; ++ def->mem_nodes[sibling_id].ndistances = ndistances; ++ } ++ ++ rdist[cur_cell].cellid = cur_cell; ++ if (!rdist[cur_cell].value) ++ rdist[cur_cell].value = sibling_value; ++ def->mem_nodes[sibling_id].distances = rdist; ++ } ++ ++ ret = 0; ++ ++ cleanup: ++ if (ret) { ++ for (i = 0; i < ndistances; i++) ++ VIR_FREE(def->mem_nodes[i].distances); ++ } ++ VIR_FREE(nodes); ++ VIR_FREE(tmp); ++ ++ return ret; ++} ++ + int + virDomainNumaDefCPUParseXML(virDomainNumaPtr def, + xmlXPathContextPtr ctxt) +@@ -694,7 +849,7 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def, + xmlNodePtr oldNode = ctxt->node; + char *tmp = NULL; + int n; +- size_t i; ++ size_t i, j; + int ret = -1; + + /* check if NUMA definition is present */ +@@ -712,7 +867,6 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def, + def->nmem_nodes = n; + + for (i = 0; i < n; i++) { +- size_t j; + int rc; + unsigned int cur_cell = i; + +@@ -788,6 +942,10 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def, + def->mem_nodes[cur_cell].memAccess = rc; + VIR_FREE(tmp); + } ++ ++ /* Parse NUMA distances info */ ++ if (virDomainNumaDefNodeDistanceParseXML(def, ctxt, cur_cell) < 0) ++ goto cleanup; + } + + ret = 0; +@@ -815,6 +973,8 @@ virDomainNumaDefCPUFormatXML(virBufferPtr buf, + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + for (i = 0; i < ncells; i++) { ++ int ndistances; ++ + memAccess = virDomainNumaGetNodeMemoryAccessMode(def, i); + + if (!(cpustr = virBitmapFormat(virDomainNumaGetNodeCpumask(def, i)))) +@@ -829,7 +989,32 @@ virDomainNumaDefCPUFormatXML(virBufferPtr buf, + if (memAccess) + virBufferAsprintf(buf, " memAccess='%s'", + virDomainMemoryAccessTypeToString(memAccess)); +- virBufferAddLit(buf, "/>\n"); ++ ++ ndistances = def->mem_nodes[i].ndistances; ++ if (!ndistances) { ++ virBufferAddLit(buf, "/>\n"); ++ } else { ++ size_t j; ++ virDomainNumaDistancePtr distances = def->mem_nodes[i].distances; ++ ++ virBufferAddLit(buf, ">\n"); ++ virBufferAdjustIndent(buf, 2); ++ virBufferAddLit(buf, "\n"); ++ virBufferAdjustIndent(buf, 2); ++ for (j = 0; j < ndistances; j++) { ++ if (distances[j].value) { ++ virBufferAddLit(buf, "\n"); ++ } ++ } ++ virBufferAdjustIndent(buf, -2); ++ virBufferAddLit(buf, "\n"); ++ virBufferAdjustIndent(buf, -2); ++ virBufferAddLit(buf, "
      \n"); ++ } ++ + VIR_FREE(cpustr); + } + virBufferAdjustIndent(buf, -2); +-- +2.15.1 + diff --git a/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch b/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch new file mode 100644 index 0000000..a41ed00 --- /dev/null +++ b/SOURCES/libvirt-nwfilter-don-t-crash-listing-filters-in-unprivileged-daemon.patch @@ -0,0 +1,75 @@ +From 5bb56c9849bdef1f7108895a20a9f348107dbfb2 Mon Sep 17 00:00:00 2001 +Message-Id: <5bb56c9849bdef1f7108895a20a9f348107dbfb2@dist-git> +From: "Daniel P. Berrange" +Date: Wed, 6 Dec 2017 12:11:17 -0500 +Subject: [PATCH] nwfilter: don't crash listing filters in unprivileged daemon + +https://bugzilla.redhat.com/show_bug.cgi?id=1522879 + +The unprivileged libvirtd does not support nwfilter config, by leaves the +driver active. It is supposed to result in all APIs being an effective +no-op, but several APIs rely on driver->nwfilters being non-NULL, or they +will reference a NULL pointer. Rather than adding checks for NULL in many +places, just make sure driver->nwfilters is always initialized. + +Reviewed-by: John Ferlan +Signed-off-by: Daniel P. Berrange +(cherry picked from commit 7993554f70fd8d512dfde484490bcd1601b60b33) +Signed-off-by: John Ferlan +Reviewed-by: Daniel P. Berrange +Signed-off-by: Jiri Denemark +--- + src/nwfilter/nwfilter_driver.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c +index 2f9a51c405..885dbcc282 100644 +--- a/src/nwfilter/nwfilter_driver.c ++++ b/src/nwfilter/nwfilter_driver.c +@@ -189,6 +189,8 @@ nwfilterStateInitialize(bool privileged, + /* remember that we are going to use firewalld */ + driver->watchingFirewallD = (sysbus != NULL); + driver->privileged = privileged; ++ if (!(driver->nwfilters = virNWFilterObjListNew())) ++ goto error; + + if (!privileged) + return 0; +@@ -244,9 +246,6 @@ nwfilterStateInitialize(bool privileged, + goto error; + } + +- if (!(driver->nwfilters = virNWFilterObjListNew())) +- goto error; +- + if (virNWFilterObjListLoadAllConfigs(driver->nwfilters, driver->configDir) < 0) + goto error; + +@@ -271,6 +270,7 @@ nwfilterStateInitialize(bool privileged, + virNWFilterIPAddrMapShutdown(); + + err_free_driverstate: ++ virNWFilterObjListFree(driver->nwfilters); + VIR_FREE(driver); + + return -1; +@@ -349,13 +349,13 @@ nwfilterStateCleanup(void) + + nwfilterDriverRemoveDBusMatches(); + +- /* free inactive nwfilters */ +- virNWFilterObjListFree(driver->nwfilters); +- + VIR_FREE(driver->configDir); + nwfilterDriverUnlock(); + } + ++ /* free inactive nwfilters */ ++ virNWFilterObjListFree(driver->nwfilters); ++ + virMutexDestroy(&driver->lock); + VIR_FREE(driver); + +-- +2.15.1 + diff --git a/SOURCES/libvirt-pci-fix-link-maximum-speed-detection.patch b/SOURCES/libvirt-pci-fix-link-maximum-speed-detection.patch deleted file mode 100644 index 928b70b..0000000 --- a/SOURCES/libvirt-pci-fix-link-maximum-speed-detection.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e971b5b913bc215ffb82419ae3db24a17ea094e8 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= - -Date: Wed, 24 May 2017 12:56:09 -0400 -Subject: [PATCH] pci: fix link maximum speed detection -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit 8e09663 "pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link -speed" introduced another speed into enum, but mistakenly also altered -field width, so one bit of link width was included there. - -Resolves: https://bugzilla.redhat.com/1455017 - -Signed-off-by: Marek Marczykowski-Górecki -(cherry picked from commit 1128769f9ee50bb250333a5a5d276afbe74711ea) -Signed-off-by: Jiri Denemark ---- - src/util/virpci.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/util/virpci.c b/src/util/virpci.c -index c89b94b5f..a2db65d7d 100644 ---- a/src/util/virpci.c -+++ b/src/util/virpci.c -@@ -147,7 +147,7 @@ struct _virPCIDeviceList { - #define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ - #define PCI_EXP_DEVCAP_FLR (1<<28) /* Function Level Reset */ - #define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ --#define PCI_EXP_LNKCAP_SPEED 0x0001f /* Maximum Link Speed */ -+#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ - #define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ - #define PCI_EXP_LNKSTA 0x12 /* Link Status */ - #define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ --- -2.13.0 - diff --git a/SOURCES/libvirt-pci-recognize-report-GEN4-PCIe-4.0-card-16GT-s-Link-speed.patch b/SOURCES/libvirt-pci-recognize-report-GEN4-PCIe-4.0-card-16GT-s-Link-speed.patch deleted file mode 100644 index 843d60c..0000000 --- a/SOURCES/libvirt-pci-recognize-report-GEN4-PCIe-4.0-card-16GT-s-Link-speed.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 7cdf18b541dfdbbbe4ed1e35179dd41c0d473648 Mon Sep 17 00:00:00 2001 -Message-Id: <7cdf18b541dfdbbbe4ed1e35179dd41c0d473648@dist-git> -From: Shivaprasad G Bhat -Date: Mon, 17 Apr 2017 17:16:44 -0400 -Subject: [PATCH] pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link speed - -Without this added enum value, nodedev-dumpxml of a GEN4 (PCIe 4.0) -card will fail (due to the unrecognized link speed), and since -nodedev-detach and nodedev-reattach internally do a dumpxml+parse, -they will also fail. With this patch, all those operations succeed. - -Resolves: https://bugzilla.redhat.com/1442831 - -Signed-off-by: Shivaprasad G Bhat -(cherry picked from commit 8e09663f7ff70b10a560746f17897d2c67c8460d) ---- - src/util/virpci.c | 4 ++-- - src/util/virpci.h | 1 + - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/util/virpci.c b/src/util/virpci.c -index 65c108f2e..c89b94b5f 100644 ---- a/src/util/virpci.c -+++ b/src/util/virpci.c -@@ -53,7 +53,7 @@ VIR_LOG_INIT("util.pci"); - #define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */ - - VIR_ENUM_IMPL(virPCIELinkSpeed, VIR_PCIE_LINK_SPEED_LAST, -- "", "2.5", "5", "8") -+ "", "2.5", "5", "8", "16") - - VIR_ENUM_IMPL(virPCIStubDriver, VIR_PCI_STUB_DRIVER_LAST, - "none", -@@ -147,7 +147,7 @@ struct _virPCIDeviceList { - #define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ - #define PCI_EXP_DEVCAP_FLR (1<<28) /* Function Level Reset */ - #define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ --#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ -+#define PCI_EXP_LNKCAP_SPEED 0x0001f /* Maximum Link Speed */ - #define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ - #define PCI_EXP_LNKSTA 0x12 /* Link Status */ - #define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ -diff --git a/src/util/virpci.h b/src/util/virpci.h -index 8637c2c68..570684e75 100644 ---- a/src/util/virpci.h -+++ b/src/util/virpci.h -@@ -58,6 +58,7 @@ typedef enum { - VIR_PCIE_LINK_SPEED_25, - VIR_PCIE_LINK_SPEED_5, - VIR_PCIE_LINK_SPEED_8, -+ VIR_PCIE_LINK_SPEED_16, - VIR_PCIE_LINK_SPEED_LAST - } virPCIELinkSpeed; - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch new file mode 100644 index 0000000..30a9a3f --- /dev/null +++ b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_ISA_SERIAL.patch @@ -0,0 +1,361 @@ +From 62fe4cb859c0e86460879bcf676f1107ccd93129 Mon Sep 17 00:00:00 2001 +Message-Id: <62fe4cb859c0e86460879bcf676f1107ccd93129@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:17 +0100 +Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_ISA_SERIAL + +All serial devices shoule have an associated capability. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit b0f1c291a0d3cbf2881a308a39f3f390f1cabcf5) + + Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml + + Insert the new capability in the right place, both in the + declaration and in the caps. + +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 3 +++ + src/qemu/qemu_capabilities.h | 2 ++ + tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + + tests/qemuhelptest.c | 5 +++++ + 22 files changed, 29 insertions(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 322e0423d6..08c6653424 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -451,6 +451,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "sclplmconsole", + + "disk-share-rw", ++ ++ "isa-serial", + ); + + +@@ -1681,6 +1683,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, + { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, + { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, ++ { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index c3a15948cf..f0bd88f897 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -438,6 +438,8 @@ typedef enum { + + QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */ + ++ QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */ ++ + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; + +diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +index 956284d5d3..d560811ab7 100644 +--- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +@@ -109,6 +109,7 @@ + + + ++ + 1002002 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +index 99384ce5e6..576475f7fa 100644 +--- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +@@ -127,6 +127,7 @@ + + + ++ + 1003001 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +index aea043c57d..0c271d3e41 100644 +--- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +@@ -128,6 +128,7 @@ + + + ++ + 1004002 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +index 6f860e4f25..5c667975bf 100644 +--- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +@@ -140,6 +140,7 @@ + + + ++ + 1005003 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +index e5dc8360de..8ae07a91db 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +@@ -145,6 +145,7 @@ + + + ++ + 1006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +index 86d87eaf0c..34bd6be1cd 100644 +--- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +@@ -147,6 +147,7 @@ + + + ++ + 1007000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +index 2fa551b1a0..0d7c144ff7 100644 +--- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +@@ -163,6 +163,7 @@ + + + ++ + 2001001 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index c95025b41f..23356f4092 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -180,6 +180,7 @@ + + + ++ + 2010000 + 0 + (v2.10.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +index 33db3e6674..e04e530b95 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +@@ -225,6 +225,7 @@ + + + ++ + 2010000 + 0 + (v2.10.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +index f97e4cb813..5007523c1f 100644 +--- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +@@ -188,6 +188,7 @@ + + + ++ + 2004000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +index 2ba40fc494..a9ad292d01 100644 +--- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +@@ -194,6 +194,7 @@ + + + ++ + 2005000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +index 0b34fa30d4..e699bdbafd 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +@@ -172,6 +172,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +index d41d578c7e..f4c1de7e1d 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +@@ -172,6 +172,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +index 5ff8598fc8..27d99bd937 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +@@ -168,6 +168,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +index bdf006f6be..97621612ab 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +@@ -204,6 +204,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +index 59adff6c97..e4ea9452c5 100644 +--- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +@@ -208,6 +208,7 @@ + + + ++ + 2007000 + 0 + (v2.7.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +index 3165b2dee3..c6d3e21d5c 100644 +--- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +@@ -210,6 +210,7 @@ + + + ++ + 2008000 + 0 + (v2.8.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +index 3b70b1a407..f5cf0ba932 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +@@ -175,6 +175,7 @@ + + + ++ + 2009000 + 0 + (v2.9.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +index 0ea9a2fce3..82cc4e79f4 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +@@ -222,6 +222,7 @@ + + + ++ + 2009000 + 0 + (v2.9.0) +diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c +index 1a6e7092fd..0e05aa9d8a 100644 +--- a/tests/qemuhelptest.c ++++ b/tests/qemuhelptest.c +@@ -174,6 +174,7 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_RTL8139, + QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0, + QEMU_CAPS_DRIVE_BOOT, +@@ -210,6 +211,7 @@ mymain(void) + QEMU_CAPS_DEVICE_USB_KBD, + QEMU_CAPS_DEVICE_RTL8139, + QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-kvm-0.13.0", 13000, 1, 0, + QEMU_CAPS_DRIVE_BOOT, +@@ -258,6 +260,7 @@ mymain(void) + QEMU_CAPS_DEVICE_IVSHMEM, + QEMU_CAPS_DEVICE_RTL8139, + QEMU_CAPS_DEVICE_E1000, ++ QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DEVICE_VIRTIO_NET); + DO_TEST("qemu-1.0", 1000000, 0, 0, + QEMU_CAPS_DRIVE_CACHE_UNSAFE, +@@ -328,6 +331,7 @@ mymain(void) + QEMU_CAPS_DEVICE_RTL8139, + QEMU_CAPS_DEVICE_E1000, + QEMU_CAPS_DEVICE_VIRTIO_NET, ++ QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DISPLAY); + DO_TEST("qemu-1.1.0", 1001000, 0, 0, + QEMU_CAPS_DRIVE_CACHE_UNSAFE, +@@ -411,6 +415,7 @@ mymain(void) + QEMU_CAPS_DEVICE_RTL8139, + QEMU_CAPS_DEVICE_E1000, + QEMU_CAPS_DEVICE_VIRTIO_NET, ++ QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_DISPLAY); + DO_TEST_FULL("qemu-1.2.0", 1002000, 0, 0, VIR_ERR_CONFIG_UNSUPPORTED, + QEMU_CAPS_LAST); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch new file mode 100644 index 0000000..df40ba1 --- /dev/null +++ b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_PL011.patch @@ -0,0 +1,90 @@ +From 5b5832decc253ce95535c9a6cf1eee6b5ed475fc Mon Sep 17 00:00:00 2001 +Message-Id: <5b5832decc253ce95535c9a6cf1eee6b5ed475fc@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:19 +0100 +Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_PL011 + +All serial devices shoule have an associated capability. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit a45ecb7bf6b43a863ef0980156e822d414975994) + + Conflicts: + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml + + These caps do not exists in the current version. + +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 4 ++++ + src/qemu/qemu_capabilities.h | 3 +++ + tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml | 1 + + 4 files changed, 9 insertions(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 08c6653424..ae5448eaaa 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -453,6 +453,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "disk-share-rw", + + "isa-serial", ++ ++ /* 280 */ ++ "pl011", + ); + + +@@ -1684,6 +1687,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, + { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, + { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL }, ++ { "pl011", QEMU_CAPS_DEVICE_PL011 }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index f0bd88f897..c809f83404 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -440,6 +440,9 @@ typedef enum { + + QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */ + ++ /* 280 */ ++ QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */ ++ + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +index e699bdbafd..d3e2e18faa 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +@@ -173,6 +173,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +index f4c1de7e1d..bc86d03537 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +@@ -173,6 +173,7 @@ + + + ++ + 2006000 + 0 + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch new file mode 100644 index 0000000..7599fd4 --- /dev/null +++ b/SOURCES/libvirt-qemu-Add-QEMU_CAPS_DEVICE_SPAPR_VTY.patch @@ -0,0 +1,195 @@ +From a8befcda79640ae13c9787cb3be54ca2ee861077 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:51 +0100 +Subject: [PATCH] qemu: Add QEMU_CAPS_DEVICE_SPAPR_VTY + +Up until now we assumed the spapr-vty device would always be +present, which is not very nice. Check for its availability before +using it instead. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 87eabeb17d637b753dbb1e63e417e25bbd0f7d61) + + Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml + + Insert the new capability in the right place, in both + declarations and caps. + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 3 ++- + src/qemu/qemu_capabilities.h | 2 +- + src/qemu/qemu_command.c | 6 ++++++ + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 + + tests/qemuxml2argvtest.c | 12 ++++++++++++ + 7 files changed, 24 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 2f41e076cb..0defa9a3e4 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -445,7 +445,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "virtio-blk.num-queues", + "machine.pseries.resize-hpt", + +- ++ "spapr-vty", + + /* 275 */ + +@@ -1679,6 +1679,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, + { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, + { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, ++ { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 60818daa1c..65b969a0ea 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -431,7 +431,7 @@ typedef enum { + QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */ + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */ + +- ++ QEMU_CAPS_DEVICE_SPAPR_VTY, /* -device spapr-vty */ + + /* 275 */ + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index fc7f54e81e..65b6a59d3f 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -10308,6 +10308,12 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + if (qemuDomainIsPSeries(def)) { + if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_VTY)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("spapr-vty not supported in this QEMU binary")); ++ goto error; ++ } ++ + virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", + serial->info.alias); + } +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index c01777a5a3..c95025b41f 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -178,6 +178,7 @@ + + + ++ + + 2010000 + 0 +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +index f1c9fc98a4..5ff8598fc8 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +@@ -167,6 +167,7 @@ + + + ++ + 2006000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +index e912211f40..3b70b1a407 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +@@ -173,6 +173,7 @@ + + + ++ + + 2009000 + 0 +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 4e981c9fab..70c72e4e64 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1756,50 +1756,62 @@ mymain(void) + DO_TEST_PARSE_ERROR("seclabel-device-duplicates", NONE); + + DO_TEST("pseries-basic", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-vio", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-usb-default", + QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_PIIX3_USB_UHCI, + QEMU_CAPS_PCI_OHCI, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pseries-usb-multi", + QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_PIIX3_USB_UHCI, + QEMU_CAPS_PCI_OHCI, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pseries-vio-user-assigned", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST_PARSE_ERROR("pseries-vio-address-clash", + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM); + DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI, + QEMU_CAPS_DEVICE_USB_KBD, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-cpu-exact", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST_PARSE_ERROR("pseries-no-parallel", + QEMU_CAPS_NODEFCONFIG); + + qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64); + DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST_FAILURE("pseries-cpu-compat-power9", QEMU_CAPS_KVM); + + qemuTestSetHostCPU(driver.caps, cpuPower9); + DO_TEST("pseries-cpu-compat-power9", + QEMU_CAPS_KVM, ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + qemuTestSetHostCPU(driver.caps, NULL); + + qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); + + DO_TEST("pseries-panic-missing", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST("pseries-panic-no-address", ++ QEMU_CAPS_DEVICE_SPAPR_VTY, + QEMU_CAPS_NODEFCONFIG); + DO_TEST_FAILURE("pseries-panic-address", + QEMU_CAPS_NODEFCONFIG); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Add-device-id-for-mediated-devices-on-qemu-command-line.patch b/SOURCES/libvirt-qemu-Add-device-id-for-mediated-devices-on-qemu-command-line.patch deleted file mode 100644 index 939482a..0000000 --- a/SOURCES/libvirt-qemu-Add-device-id-for-mediated-devices-on-qemu-command-line.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 23a4263e7611fa3f1e69f5bab7056a85e48d6b23 Mon Sep 17 00:00:00 2001 -Message-Id: <23a4263e7611fa3f1e69f5bab7056a85e48d6b23@dist-git> -From: Erik Skultety -Date: Tue, 4 Apr 2017 08:54:51 +0200 -Subject: [PATCH] qemu: Add device id for mediated devices on qemu command line - -Like all devices, add the 'id' option for mdevs as well. Patch also -adjusts the test accordingly. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438431 - -(cherry picked from commit c3272e5e12e0bfd43b8101b73ae13d264c13337f) -Signed-off-by: Erik Skultety ---- - src/qemu/qemu_command.c | 3 ++- - tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 1a2984e56..59fedaaaf 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -5231,7 +5231,8 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def, - char *ret = NULL; - - virBufferAddLit(&buf, "vfio-pci"); -- virBufferAsprintf(&buf, ",sysfsdev=%s", -+ virBufferAsprintf(&buf, ",id=%s,sysfsdev=%s", -+ dev->info->alias, - virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr)); - - if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -index fdefeb610..76e77707b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -@@ -20,6 +20,6 @@ QEMU_AUDIO_DRV=none \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \ - -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ ---device vfio-pci,\ -+-device vfio-pci,id=hostdev0,\ - sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,bus=pci.0,\ - addr=0x3 --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Add-migratable-parameter-to-virQEMUCapsInitCPUModel.patch b/SOURCES/libvirt-qemu-Add-migratable-parameter-to-virQEMUCapsInitCPUModel.patch deleted file mode 100644 index 48e7c6e..0000000 --- a/SOURCES/libvirt-qemu-Add-migratable-parameter-to-virQEMUCapsInitCPUModel.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 241d9b0d3945072ad74f9a0a5dcdb541cc2ad50b Mon Sep 17 00:00:00 2001 -Message-Id: <241d9b0d3945072ad74f9a0a5dcdb541cc2ad50b@dist-git> -From: Jiri Denemark -Date: Wed, 29 Mar 2017 13:33:50 +0200 -Subject: [PATCH] qemu: Add migratable parameter to virQEMUCapsInitCPUModel - -The caller can ask for a migratable CPU model by passing true for the -new parameter. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 00e0cbcb567a57c7b5a145d7fd3fb662779f6bec) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 36 +++++++++++++++++++++++++----------- - src/qemu/qemu_capspriv.h | 3 ++- - tests/cputest.c | 2 +- - 3 files changed, 28 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index b71de9633..eb6b674b4 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3118,7 +3118,8 @@ virQEMUCapsCPUFilterFeatures(const char *name, - static int - virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, - qemuMonitorCPUModelInfoPtr modelInfo, -- virCPUDefPtr cpu) -+ virCPUDefPtr cpu, -+ bool migratable) - { - size_t i; - -@@ -3146,8 +3147,12 @@ virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, - - if (VIR_STRDUP(feature->name, prop->name) < 0) - return -1; -- feature->policy = prop->value.boolean ? VIR_CPU_FEATURE_REQUIRE -- : VIR_CPU_FEATURE_DISABLE; -+ -+ if (!prop->value.boolean || -+ (migratable && prop->migratable == VIR_TRISTATE_BOOL_NO)) -+ feature->policy = VIR_CPU_FEATURE_DISABLE; -+ else -+ feature->policy = VIR_CPU_FEATURE_REQUIRE; - cpu->nfeatures++; - } - -@@ -3164,7 +3169,8 @@ static int - virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - qemuMonitorCPUModelInfoPtr model, -- virCPUDefPtr cpu) -+ virCPUDefPtr cpu, -+ bool migratable) - { - virCPUDataPtr data = NULL; - unsigned long long sigFamily = 0; -@@ -3185,9 +3191,13 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, - - switch (prop->type) { - case QEMU_MONITOR_CPU_PROPERTY_BOOLEAN: -- if (prop->value.boolean && -- virCPUx86DataAddFeature(data, prop->name) < 0) -+ if (!prop->value.boolean || -+ (migratable && prop->migratable == VIR_TRISTATE_BOOL_NO)) -+ continue; -+ -+ if (virCPUx86DataAddFeature(data, prop->name) < 0) - goto cleanup; -+ - break; - - case QEMU_MONITOR_CPU_PROPERTY_STRING: -@@ -3226,13 +3236,14 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, - - /** - * Returns 0 when host CPU model provided by QEMU was filled in qemuCaps, -- * 1 when the caller should fall back to using virCapsPtr->host.cpu, -+ * 1 when the caller should fall back to other methods - * -1 on error. - */ - int - virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, -- virCPUDefPtr cpu) -+ virCPUDefPtr cpu, -+ bool migratable) - { - qemuMonitorCPUModelInfoPtr model; - int ret = 1; -@@ -3242,10 +3253,13 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - else - model = qemuCaps->tcgCPUModelInfo; - -+ if (migratable && model && !model->migratability) -+ return 1; -+ - if (ARCH_IS_S390(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelS390(qemuCaps, model, cpu); -+ ret = virQEMUCapsInitCPUModelS390(qemuCaps, model, cpu, migratable); - else if (ARCH_IS_X86(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, model, cpu); -+ ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, model, cpu, migratable); - - if (ret == 0) - cpu->fallback = VIR_CPU_FALLBACK_FORBID; -@@ -3274,7 +3288,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - cpu->match = VIR_CPU_MATCH_EXACT; - cpu->fallback = VIR_CPU_FALLBACK_ALLOW; - -- if ((rc = virQEMUCapsInitCPUModel(qemuCaps, type, cpu)) < 0) { -+ if ((rc = virQEMUCapsInitCPUModel(qemuCaps, type, cpu, false)) < 0) { - goto error; - } else if (rc == 1) { - VIR_DEBUG("No host CPU model info from QEMU; probing host CPU directly"); -diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h -index 61ccd4517..1baaaf334 100644 ---- a/src/qemu/qemu_capspriv.h -+++ b/src/qemu/qemu_capspriv.h -@@ -81,7 +81,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - int - virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, -- virCPUDefPtr cpu); -+ virCPUDefPtr cpu, -+ bool migratable); - - void - virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, -diff --git a/tests/cputest.c b/tests/cputest.c -index 3d3e43f16..8c07cf4f6 100644 ---- a/tests/cputest.c -+++ b/tests/cputest.c -@@ -709,7 +709,7 @@ cpuTestJSONCPUID(const void *arg) - cpu->match = VIR_CPU_MATCH_EXACT; - cpu->fallback = VIR_CPU_FALLBACK_FORBID; - -- if (virQEMUCapsInitCPUModel(qemuCaps, VIR_DOMAIN_VIRT_KVM, cpu) != 0) -+ if (virQEMUCapsInitCPUModel(qemuCaps, VIR_DOMAIN_VIRT_KVM, cpu, false) != 0) - goto cleanup; - - ret = cpuTestCompareXML(data->arch, cpu, result, false); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Add-qemuDomainCheckABIStability.patch b/SOURCES/libvirt-qemu-Add-qemuDomainCheckABIStability.patch deleted file mode 100644 index 581dc7c..0000000 --- a/SOURCES/libvirt-qemu-Add-qemuDomainCheckABIStability.patch +++ /dev/null @@ -1,110 +0,0 @@ -From bf20b6cf07e5462c892b5e3c3d76a3c354606ea4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Wed, 14 Jun 2017 13:43:37 +0200 -Subject: [PATCH] qemu: Add qemuDomainCheckABIStability - -When making ABI stability checks for an active domain, we need to make -sure we use the same migratable definition which virDomainGetXMLDesc -with the MIGRATABLE flag provides, otherwise the ABI check will fail. -This is implemented in the new qemuDomainCheckABIStability which takes a -domain object and generates the right migratable definition from it. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 063b2b8788db204d0ac2e1d367fd0c5eb9b81451) - -https://bugzilla.redhat.com/show_bug.cgi?id=1460952 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 41 ++++++++++++++++++++++++++++++++++++----- - src/qemu/qemu_domain.h | 4 ++++ - 2 files changed, 40 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index b3dc2bc3ac..1528c6a137 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -5909,6 +5909,10 @@ qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver, - } - - -+#define COPY_FLAGS (VIR_DOMAIN_XML_SECURE | \ -+ VIR_DOMAIN_XML_UPDATE_CPU | \ -+ VIR_DOMAIN_XML_MIGRATABLE) -+ - bool - qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - virDomainDefPtr src, -@@ -5916,13 +5920,10 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - { - virDomainDefPtr migratableDefSrc = NULL; - virDomainDefPtr migratableDefDst = NULL; -- const unsigned int flags = VIR_DOMAIN_XML_SECURE | -- VIR_DOMAIN_XML_UPDATE_CPU | -- VIR_DOMAIN_XML_MIGRATABLE; - bool ret = false; - -- if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) || -- !(migratableDefDst = qemuDomainDefCopy(driver, dst, flags))) -+ if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, COPY_FLAGS)) || -+ !(migratableDefDst = qemuDomainDefCopy(driver, dst, COPY_FLAGS))) - goto cleanup; - - ret = qemuDomainMigratableDefCheckABIStability(driver, -@@ -5935,6 +5936,36 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - return ret; - } - -+ -+bool -+qemuDomainCheckABIStability(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ virDomainDefPtr dst) -+{ -+ virDomainDefPtr migratableSrc = NULL; -+ virDomainDefPtr migratableDst = NULL; -+ char *xml = NULL; -+ bool ret = false; -+ -+ if (!(xml = qemuDomainFormatXML(driver, vm, COPY_FLAGS)) || -+ !(migratableSrc = qemuDomainDefFromXML(driver, xml)) || -+ !(migratableDst = qemuDomainDefCopy(driver, dst, COPY_FLAGS))) -+ goto cleanup; -+ -+ ret = qemuDomainMigratableDefCheckABIStability(driver, -+ vm->def, migratableSrc, -+ dst, migratableDst); -+ -+ cleanup: -+ VIR_FREE(xml); -+ virDomainDefFree(migratableSrc); -+ virDomainDefFree(migratableDst); -+ return ret; -+} -+ -+#undef COPY_FLAGS -+ -+ - bool - qemuDomainAgentAvailable(virDomainObjPtr vm, - bool reportError) -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index d635d2995f..7ad34e563e 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -668,6 +668,10 @@ bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - virDomainDefPtr src, - virDomainDefPtr dst); - -+bool qemuDomainCheckABIStability(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ virDomainDefPtr dst); -+ - bool qemuDomainAgentAvailable(virDomainObjPtr vm, - bool reportError); - --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Add-qemuDomainMigratableDefCheckABIStability.patch b/SOURCES/libvirt-qemu-Add-qemuDomainMigratableDefCheckABIStability.patch deleted file mode 100644 index 4bd3edf..0000000 --- a/SOURCES/libvirt-qemu-Add-qemuDomainMigratableDefCheckABIStability.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 2e728d3be5792685c38adbd61e80318e51985897 Mon Sep 17 00:00:00 2001 -Message-Id: <2e728d3be5792685c38adbd61e80318e51985897@dist-git> -From: Jiri Denemark -Date: Wed, 14 Jun 2017 13:43:12 +0200 -Subject: [PATCH] qemu: Add qemuDomainMigratableDefCheckABIStability - -This patch separates the actual ABI checks from getting migratable defs -in qemuDomainDefCheckABIStability so that we can create another wrapper -which will use different methods to get the migratable defs. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit a0912df3faac8b58725f45b8cf928990999585a3) - -https://bugzilla.redhat.com/show_bug.cgi?id=1460952 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 34 +++++++++++++++++++++++----------- - 1 file changed, 23 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index ce75105afa..b3dc2bc3ac 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -5889,6 +5889,26 @@ virDomainABIStability virQEMUDriverDomainABIStability = { - }; - - -+static bool -+qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver, -+ virDomainDefPtr src, -+ virDomainDefPtr migratableSrc, -+ virDomainDefPtr dst, -+ virDomainDefPtr migratableDst) -+{ -+ if (!virDomainDefCheckABIStabilityFlags(migratableSrc, -+ migratableDst, -+ driver->xmlopt, -+ VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE)) -+ return false; -+ -+ /* Force update any skipped values from the volatile flag */ -+ dst->mem.cur_balloon = src->mem.cur_balloon; -+ -+ return true; -+} -+ -+ - bool - qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - virDomainDefPtr src, -@@ -5899,23 +5919,15 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - const unsigned int flags = VIR_DOMAIN_XML_SECURE | - VIR_DOMAIN_XML_UPDATE_CPU | - VIR_DOMAIN_XML_MIGRATABLE; -- const unsigned int check_flags = VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE; - bool ret = false; - - if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) || - !(migratableDefDst = qemuDomainDefCopy(driver, dst, flags))) - goto cleanup; - -- if (!virDomainDefCheckABIStabilityFlags(migratableDefSrc, -- migratableDefDst, -- driver->xmlopt, -- check_flags)) -- goto cleanup; -- -- /* Force update any skipped values from the volatile flag */ -- dst->mem.cur_balloon = src->mem.cur_balloon; -- -- ret = true; -+ ret = qemuDomainMigratableDefCheckABIStability(driver, -+ src, migratableDefSrc, -+ dst, migratableDefDst); - - cleanup: - virDomainDefFree(migratableDefSrc); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Add-support-for-guest-CPU-cache.patch b/SOURCES/libvirt-qemu-Add-support-for-guest-CPU-cache.patch deleted file mode 100644 index e9c0308..0000000 --- a/SOURCES/libvirt-qemu-Add-support-for-guest-CPU-cache.patch +++ /dev/null @@ -1,667 +0,0 @@ -From b34dc87751a8667f22ea78730a5b678f5bd469a4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 25 Apr 2017 19:07:19 +0200 -Subject: [PATCH] qemu: Add support for guest CPU cache - -This patch maps /domain/cpu/cache element into -cpu parameters: - -- is translated to host-cache-info=on -- is transformed into l3-cache=on -- is turned in host-cache-info=off,l3-cache=off - -Any other element is forbidden. - -The tricky part is detecting whether QEMU supports the CPU properties. - -The 'host-cache-info' property is introduced in v2.4.0-1389-ge265e3e480, -earlier QEMU releases enabled host-cache-info by default and had no way -to disable it. If the property is present, it defaults to 'off' for any -QEMU until at least 2.9.0. - -The 'l3-cache' property was introduced later by v2.7.0-200-g14c985cffa. -Earlier versions worked as if l3-cache=off was passed. For any QEMU -until at least 2.9.0 l3-cache is 'off' by default. - -QEMU 2.9.0 was the first release which supports probing both properties -by running device-list-properties with typename=host-x86_64-cpu. Older -QEMU releases did not support device-list-properties command for CPU -devices. Thus we can't really rely on probing them and we can just use -query-cpu-model-expansion QMP command as a witness. - -Because the cache property probing is only reliable for QEMU >= 2.9.0 -when both are already supported for quite a few releases, we let QEMU -report an error if a specific cache mode is explicitly requested. The -other mode (or both if a user requested CPU cache to be disabled) is -explicitly turned off for QEMU >= 2.9.0 to avoid any surprises in case -the QEMU defaults change. Any older QEMU already turns them off so not -doing so explicitly does not make any harm. - -Signed-off-by: Jiri Denemark -(cherry picked from commit df13c0b477ffda460eed259c3b8aab7255f11199) - -https://bugzilla.redhat.com/show_bug.cgi?id=1428952 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 5 ++ - src/qemu/qemu_capabilities.h | 1 + - src/qemu/qemu_command.c | 39 ++++++++++++++++ - src/qemu/qemu_domain.c | 54 ++++++++++++++++++++++ - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - .../qemuxml2argv-cpu-cache-disable.args | 21 +++++++++ - .../qemuxml2argv-cpu-cache-disable.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-disable2.args | 21 +++++++++ - .../qemuxml2argv-cpu-cache-disable2.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-disable3.args | 22 +++++++++ - .../qemuxml2argv-cpu-cache-disable3.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-emulate-l2.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-emulate-l3.args | 21 +++++++++ - .../qemuxml2argv-cpu-cache-emulate-l3.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-passthrough-l3.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-passthrough.args | 21 +++++++++ - .../qemuxml2argv-cpu-cache-passthrough.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-passthrough2.args | 21 +++++++++ - .../qemuxml2argv-cpu-cache-passthrough2.xml | 20 ++++++++ - .../qemuxml2argv-cpu-cache-passthrough3.xml | 20 ++++++++ - tests/qemuxml2argvtest.c | 10 ++++ - 21 files changed, 417 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l2.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough-l3.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough3.xml - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 950a42bae..2c845853a 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -364,6 +364,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "query-cpu-definitions", /* 250 */ - "block-write-threshold", - "query-named-block-nodes", -+ "cpu-cache", - ); - - -@@ -4648,6 +4649,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM)) - virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM); - -+ if (ARCH_IS_X86(qemuCaps->arch) && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) -+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_CACHE); -+ - ret = 0; - cleanup: - return ret; -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 24e2f38ee..c466a63e7 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -401,6 +401,7 @@ typedef enum { - QEMU_CAPS_QUERY_CPU_DEFINITIONS, /* qmp query-cpu-definitions */ - QEMU_CAPS_BLOCK_WRITE_THRESHOLD, /* BLOCK_WRITE_THRESHOLD event */ - QEMU_CAPS_QUERY_NAMED_BLOCK_NODES, /* qmp query-named-block-nodes */ -+ QEMU_CAPS_CPU_CACHE, /* -cpu supports host-cache-info and l3-cache properties */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index ff7f47e06..2105cde58 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7071,6 +7071,45 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, - have_cpu = true; - } - -+ if (def->cpu && def->cpu->cache) { -+ virCPUCacheDefPtr cache = def->cpu->cache; -+ bool hostOff = false; -+ bool l3Off = false; -+ -+ if (!have_cpu) { -+ virBufferAdd(&buf, default_model, -1); -+ have_cpu = true; -+ } -+ -+ switch (cache->mode) { -+ case VIR_CPU_CACHE_MODE_EMULATE: -+ virBufferAddLit(&buf, ",l3-cache=on"); -+ hostOff = true; -+ break; -+ -+ case VIR_CPU_CACHE_MODE_PASSTHROUGH: -+ virBufferAddLit(&buf, ",host-cache-info=on"); -+ l3Off = true; -+ break; -+ -+ case VIR_CPU_CACHE_MODE_DISABLE: -+ hostOff = l3Off = true; -+ break; -+ -+ case VIR_CPU_CACHE_MODE_LAST: -+ break; -+ } -+ -+ if (hostOff && -+ def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_CACHE)) -+ virBufferAddLit(&buf, ",host-cache-info=off"); -+ -+ if (l3Off && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_CACHE)) -+ virBufferAddLit(&buf, ",l3-cache=off"); -+ } -+ - if (virBufferCheckError(&buf) < 0) - goto cleanup; - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 9c09ced0c..d31645fd1 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2688,6 +2688,60 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) - if (!def->cpu) - return 0; - -+ if (def->cpu->cache) { -+ virCPUCacheDefPtr cache = def->cpu->cache; -+ -+ if (!ARCH_IS_X86(def->os.arch)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("CPU cache specification is not supported " -+ "for '%s' architecture"), -+ virArchToString(def->os.arch)); -+ return -1; -+ } -+ -+ switch (cache->mode) { -+ case VIR_CPU_CACHE_MODE_EMULATE: -+ if (cache->level != 3) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("CPU cache mode '%s' can only be used with " -+ "level='3'"), -+ virCPUCacheModeTypeToString(cache->mode)); -+ return -1; -+ } -+ break; -+ -+ case VIR_CPU_CACHE_MODE_PASSTHROUGH: -+ if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("CPU cache mode '%s' can only be used with " -+ "'%s' CPUs"), -+ virCPUCacheModeTypeToString(cache->mode), -+ virCPUModeTypeToString(VIR_CPU_MODE_HOST_PASSTHROUGH)); -+ return -1; -+ } -+ -+ if (cache->level != -1) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unsupported CPU cache level for mode '%s'"), -+ virCPUCacheModeTypeToString(cache->mode)); -+ return -1; -+ } -+ break; -+ -+ case VIR_CPU_CACHE_MODE_DISABLE: -+ if (cache->level != -1) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("unsupported CPU cache level for mode '%s'"), -+ virCPUCacheModeTypeToString(cache->mode)); -+ return -1; -+ } -+ break; -+ -+ case VIR_CPU_CACHE_MODE_LAST: -+ break; -+ } -+ } -+ - /* Nothing to be done if only CPU topology is specified. */ - if (def->cpu->mode == VIR_CPU_MODE_CUSTOM && - !def->cpu->model) -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 6386c4ed0..496c9ceb8 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -207,6 +207,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args -new file mode 100644 -index 000000000..386e38d37 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args -@@ -0,0 +1,21 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu host,host-cache-info=off,l3-cache=off \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.xml -new file mode 100644 -index 000000000..e6f39951c ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args -new file mode 100644 -index 000000000..9348e01f8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args -@@ -0,0 +1,21 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu host \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.xml -new file mode 100644 -index 000000000..e6f39951c ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args -new file mode 100644 -index 000000000..b882710c1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args -@@ -0,0 +1,22 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu core2duo,+ds,+acpi,+ss,+ht,+tm,+pbe,+ds_cpl,+vmx,+est,+tm2,+cx16,+xtpr,\ -++lahf_lm,l3-cache=off \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.xml -new file mode 100644 -index 000000000..17078a1e8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l2.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l2.xml -new file mode 100644 -index 000000000..4757e85ea ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l2.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args -new file mode 100644 -index 000000000..c2f5d19e1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args -@@ -0,0 +1,21 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu host,l3-cache=on,host-cache-info=off \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.xml -new file mode 100644 -index 000000000..17019c673 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough-l3.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough-l3.xml -new file mode 100644 -index 000000000..3471115ea ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough-l3.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args -new file mode 100644 -index 000000000..1d824f6dd ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args -@@ -0,0 +1,21 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu host,host-cache-info=on,l3-cache=off \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.xml -new file mode 100644 -index 000000000..74846fdd3 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args -new file mode 100644 -index 000000000..d7863ba2e ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args -@@ -0,0 +1,21 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/kvm \ -+-name foo \ -+-S \ -+-M pc \ -+-cpu host,host-cache-info=on \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.xml -new file mode 100644 -index 000000000..74846fdd3 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough3.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough3.xml -new file mode 100644 -index 000000000..6ad65700b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough3.xml -@@ -0,0 +1,20 @@ -+ -+ foo -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 94be771d3..81cd2a6ec 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2521,6 +2521,16 @@ mymain(void) - DO_TEST("cpu-check-default-partial", QEMU_CAPS_KVM); - DO_TEST("cpu-check-default-partial2", QEMU_CAPS_KVM); - -+ DO_TEST("cpu-cache-disable", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); -+ DO_TEST("cpu-cache-disable2", QEMU_CAPS_KVM); -+ DO_TEST("cpu-cache-disable3", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); -+ DO_TEST("cpu-cache-passthrough", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); -+ DO_TEST("cpu-cache-passthrough2", QEMU_CAPS_KVM); -+ DO_TEST("cpu-cache-emulate-l3", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE); -+ DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM); -+ DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM); -+ DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM); -+ - qemuTestDriverFree(&driver); - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch b/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch new file mode 100644 index 0000000..7ba1797 --- /dev/null +++ b/SOURCES/libvirt-qemu-Add-support-for-resctrl.patch @@ -0,0 +1,120 @@ +From 72285626fa7b899ceb9c8d4358b4b1b3fa7081a4 Mon Sep 17 00:00:00 2001 +Message-Id: <72285626fa7b899ceb9c8d4358b4b1b3fa7081a4@dist-git> +From: Martin Kletzander +Date: Wed, 31 Jan 2018 16:32:32 +0100 +Subject: [PATCH] qemu: Add support for resctrl + +We've been building up to this. This adds support for cputune/cachetune +settings for domains in the QEMU driver. The addition into +qemuProcessSetupVcpu() automatically adds support for hotplug. For hot-unplug +we need to remove the allocation only if all the vCPUs were unplugged. But +since the threads are left running, we can't really do much about it now. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1289368 + +Signed-off-by: Martin Kletzander +(cherry picked from commit 9a2fc2db8fe18da41c274d52b6e52316a4bbe52d) +Signed-off-by: Martin Kletzander + +https://bugzilla.redhat.com/show_bug.cgi?id=1289368 +Signed-off-by: Martin Kletzander +--- + src/qemu/qemu_process.c | 60 ++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 55 insertions(+), 5 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index c64088e4ca..57faf9cd79 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -2504,6 +2504,32 @@ qemuProcessSetupEmulator(virDomainObjPtr vm) + } + + ++static int ++qemuProcessResctrlCreate(virQEMUDriverPtr driver, ++ virDomainObjPtr vm) ++{ ++ int ret = -1; ++ size_t i = 0; ++ virCapsPtr caps = virQEMUDriverGetCapabilities(driver, false); ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ ++ if (!caps) ++ return -1; ++ ++ for (i = 0; i < vm->def->ncachetunes; i++) { ++ if (virResctrlAllocCreate(caps->host.resctrl, ++ vm->def->cachetunes[i]->alloc, ++ priv->machineName) < 0) ++ goto cleanup; ++ } ++ ++ ret = 0; ++ cleanup: ++ virObjectUnref(caps); ++ return ret; ++} ++ ++ + static int + qemuProcessInitPasswords(virConnectPtr conn, + virQEMUDriverPtr driver, +@@ -5015,12 +5041,26 @@ qemuProcessSetupVcpu(virDomainObjPtr vm, + { + pid_t vcpupid = qemuDomainGetVcpuPid(vm, vcpuid); + virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, vcpuid); ++ size_t i = 0; + +- return qemuProcessSetupPid(vm, vcpupid, VIR_CGROUP_THREAD_VCPU, +- vcpuid, vcpu->cpumask, +- vm->def->cputune.period, +- vm->def->cputune.quota, +- &vcpu->sched); ++ if (qemuProcessSetupPid(vm, vcpupid, VIR_CGROUP_THREAD_VCPU, ++ vcpuid, vcpu->cpumask, ++ vm->def->cputune.period, ++ vm->def->cputune.quota, ++ &vcpu->sched) < 0) ++ return -1; ++ ++ for (i = 0; i < vm->def->ncachetunes; i++) { ++ virDomainCachetuneDefPtr ct = vm->def->cachetunes[i]; ++ ++ if (virBitmapIsBitSet(ct->vcpus, vcpuid)) { ++ if (virResctrlAllocAddPID(ct->alloc, vcpupid) < 0) ++ return -1; ++ break; ++ } ++ } ++ ++ return 0; + } + + +@@ -5892,6 +5932,10 @@ qemuProcessLaunch(virConnectPtr conn, + if (qemuProcessSetupEmulator(vm) < 0) + goto cleanup; + ++ VIR_DEBUG("Setting up resctrlfs"); ++ if (qemuProcessResctrlCreate(driver, vm) < 0) ++ goto cleanup; ++ + VIR_DEBUG("Setting domain security labels"); + if (qemuSecuritySetAllLabel(driver, + vm, +@@ -6540,6 +6584,12 @@ void qemuProcessStop(virQEMUDriverPtr driver, + vm->def->name); + } + ++ /* Remove resctrl allocation after cgroups are cleaned up which makes it ++ * kind of safer (although removing the allocation should work even with ++ * pids in tasks file */ ++ for (i = 0; i < vm->def->ncachetunes; i++) ++ virResctrlAllocRemove(vm->def->cachetunes[i]->alloc); ++ + qemuProcessRemoveDomainStatus(driver, vm); + + /* Remove VNC and Spice ports from port reservation bitmap, but only if +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-Advertise-ACPI-support-for-aarch64-guests.patch b/SOURCES/libvirt-qemu-Advertise-ACPI-support-for-aarch64-guests.patch deleted file mode 100644 index 7abbd4f..0000000 --- a/SOURCES/libvirt-qemu-Advertise-ACPI-support-for-aarch64-guests.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 2106b821cd1eef809853f7424edf8660732b1303 Mon Sep 17 00:00:00 2001 -Message-Id: <2106b821cd1eef809853f7424edf8660732b1303@dist-git> -From: Andrea Bolognani -Date: Tue, 4 Apr 2017 14:59:30 +0200 -Subject: [PATCH] qemu: Advertise ACPI support for aarch64 guests - -So far, libvirt has assumed that only x86 supports ACPI, -but that's inaccurate since aarch64 supports it too. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1429509 - -(cherry picked from commit 560335c35c830344329c16cb1f25f887344bdfd8) -Signed-off-by: Andrea Bolognani ---- - src/qemu/qemu_capabilities.c | 28 ++++++++++++++++------ - .../caps_2.6.0-gicv2.aarch64.xml | 1 + - .../caps_2.6.0-gicv3.aarch64.xml | 1 + - .../qemuxml2argv-aarch64-gic-host.args | 1 + - .../qemuxml2argv-aarch64-gic-v2.args | 1 + - .../qemuxml2argv-aarch64-gic-v3.args | 1 + - 6 files changed, 26 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 9d0a29732..a8125102c 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -1043,13 +1043,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, - - machines = NULL; - nmachines = 0; -+ } - -+ if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) && -+ virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL) { -+ goto cleanup; - } - - if (ARCH_IS_X86(guestarch) && -- (virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL || -- virCapabilitiesAddGuestFeature(guest, "apic", true, false) == NULL)) -+ virCapabilitiesAddGuestFeature(guest, "apic", true, false) == NULL) { - goto cleanup; -+ } - - if ((guestarch == VIR_ARCH_I686) && - (virCapabilitiesAddGuestFeature(guest, "pae", true, false) == NULL || -@@ -4181,10 +4185,15 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid, const c - qmperr) < 0) - goto cleanup; - -- /* -no-acpi is not supported on non-x86 -- * even if qemu reports it in -help */ -- if (!ARCH_IS_X86(qemuCaps->arch)) -+ /* Older QEMU versions reported -no-acpi in the output of -help even -+ * though it was not supported by the architecture. The issue has since -+ * been fixed, but to maintain compatibility with all release we still -+ * need to filter out the capability for architectures that we know -+ * don't support the feature, eg. anything but x86 and aarch64 */ -+ if (!ARCH_IS_X86(qemuCaps->arch) && -+ qemuCaps->arch != VIR_ARCH_AARCH64) { - virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_ACPI); -+ } - - /* virQEMUCapsExtractDeviceStr will only set additional caps if qemu - * understands the 0.13.0+ notion of "-device driver,". */ -@@ -4305,9 +4314,14 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, - void - virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) - { -- /* ACPI/HPET/KVM PIT are x86 specific */ -- if (ARCH_IS_X86(qemuCaps->arch)) { -+ /* ACPI only works on x86 and aarch64 */ -+ if (ARCH_IS_X86(qemuCaps->arch) || -+ qemuCaps->arch == VIR_ARCH_AARCH64) { - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); -+ } -+ -+ /* HPET and KVM PIT are x86 specific */ -+ if (ARCH_IS_X86(qemuCaps->arch)) { - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_HPET); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT); - } -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -index c1e46794a..af3a8e7cb 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -@@ -40,6 +40,7 @@ - - - -+ - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -index 20dfda216..4402ffa6f 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -@@ -40,6 +40,7 @@ - - - -+ - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -index 5fdaa08ef..23276ad71 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -index 2caf1b92c..f79c1c60e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -index 3ae8e5f86..fce9308b0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Allow-live-updates-of-coalesce-settings.patch b/SOURCES/libvirt-qemu-Allow-live-updates-of-coalesce-settings.patch deleted file mode 100644 index 10ba09c..0000000 --- a/SOURCES/libvirt-qemu-Allow-live-updates-of-coalesce-settings.patch +++ /dev/null @@ -1,220 +0,0 @@ -From ec733f7eb1f88d9d030952c764c1ee635ab9060b Mon Sep 17 00:00:00 2001 -Message-Id: -From: Martin Kletzander -Date: Fri, 16 Jun 2017 13:45:30 +0200 -Subject: [PATCH] qemu: Allow live-updates of coalesce settings - -Change the settings from qemuDomainUpdateDeviceLive() as otherwise the -call would succeed even though nothing has changed. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627 - -Signed-off-by: Martin Kletzander -(cherry picked from commit 307a205e25ad7db7c895c42ab2e8f59f3839c058) -Signed-off-by: Martin Kletzander - - Conflicts: - src/util/virnetdev.c - non-Linux stubs -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 13 +++++++ - src/util/virnetdev.c | 93 ++++++++++++++++++++++++++++++++----------------- - src/util/virnetdev.h | 3 +- - src/util/virnetdevtap.c | 2 +- - 4 files changed, 77 insertions(+), 34 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index ab23a575d8..fbc9177669 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3005,6 +3005,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, - bool needLinkStateChange = false; - bool needReplaceDevDef = false; - bool needBandwidthSet = false; -+ bool needCoalesceChange = false; - int ret = -1; - int changeidx = -1; - -@@ -3293,6 +3294,12 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, - virDomainNetGetActualBandwidth(newdev))) - needBandwidthSet = true; - -+ if (!!olddev->coalesce != !!newdev->coalesce || -+ (olddev->coalesce && newdev->coalesce && -+ !memcmp(olddev->coalesce, newdev->coalesce, -+ sizeof(*olddev->coalesce)))) -+ needCoalesceChange = true; -+ - /* FINALLY - actually perform the required actions */ - - if (needReconnect) { -@@ -3328,6 +3335,12 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, - needReplaceDevDef = true; - } - -+ if (needCoalesceChange) { -+ if (virNetDevSetCoalesce(newdev->ifname, newdev->coalesce, true) < 0) -+ goto cleanup; -+ needReplaceDevDef = true; -+ } -+ - if (needLinkStateChange && - qemuDomainChangeNetLinkState(driver, vm, olddev, newdev->linkstate) < 0) { - goto cleanup; -diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c -index eb97b705e2..2beb39bb60 100644 ---- a/src/util/virnetdev.c -+++ b/src/util/virnetdev.c -@@ -3093,7 +3093,8 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED, - /** - * virNetDevSetCoalesce: - * @ifname: interface name to modify -- * @coalesce: Coalesce settings to set and update -+ * @coalesce: Coalesce settings to set or update -+ * @update: Whether this is an update for existing settings or not - * - * This function sets the various coalesce settings for a given interface - * @ifname and updates them back into @coalesce. -@@ -3101,40 +3102,44 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED, - * Returns 0 in case of success or -1 on failure - */ - int virNetDevSetCoalesce(const char *ifname, -- virNetDevCoalescePtr coalesce) -+ virNetDevCoalescePtr coalesce, -+ bool update) - { - int fd = -1; - int ret = -1; - struct ifreq ifr; - struct ethtool_coalesce coal = {0}; - -- if (!coalesce) -+ if (!coalesce && !update) - return 0; - -- coal = (struct ethtool_coalesce) { -- .cmd = ETHTOOL_SCOALESCE, -- .rx_max_coalesced_frames = coalesce->rx_max_coalesced_frames, -- .rx_coalesce_usecs_irq = coalesce->rx_coalesce_usecs_irq, -- .rx_max_coalesced_frames_irq = coalesce->rx_max_coalesced_frames_irq, -- .tx_coalesce_usecs = coalesce->tx_coalesce_usecs, -- .tx_max_coalesced_frames = coalesce->tx_max_coalesced_frames, -- .tx_coalesce_usecs_irq = coalesce->tx_coalesce_usecs_irq, -- .tx_max_coalesced_frames_irq = coalesce->tx_max_coalesced_frames_irq, -- .stats_block_coalesce_usecs = coalesce->stats_block_coalesce_usecs, -- .use_adaptive_rx_coalesce = coalesce->use_adaptive_rx_coalesce, -- .use_adaptive_tx_coalesce = coalesce->use_adaptive_tx_coalesce, -- .pkt_rate_low = coalesce->pkt_rate_low, -- .rx_coalesce_usecs_low = coalesce->rx_coalesce_usecs_low, -- .rx_max_coalesced_frames_low = coalesce->rx_max_coalesced_frames_low, -- .tx_coalesce_usecs_low = coalesce->tx_coalesce_usecs_low, -- .tx_max_coalesced_frames_low = coalesce->tx_max_coalesced_frames_low, -- .pkt_rate_high = coalesce->pkt_rate_high, -- .rx_coalesce_usecs_high = coalesce->rx_coalesce_usecs_high, -- .rx_max_coalesced_frames_high = coalesce->rx_max_coalesced_frames_high, -- .tx_coalesce_usecs_high = coalesce->tx_coalesce_usecs_high, -- .tx_max_coalesced_frames_high = coalesce->tx_max_coalesced_frames_high, -- .rate_sample_interval = coalesce->rate_sample_interval, -- }; -+ if (coalesce) { -+ coal = (struct ethtool_coalesce) { -+ .rx_max_coalesced_frames = coalesce->rx_max_coalesced_frames, -+ .rx_coalesce_usecs_irq = coalesce->rx_coalesce_usecs_irq, -+ .rx_max_coalesced_frames_irq = coalesce->rx_max_coalesced_frames_irq, -+ .tx_coalesce_usecs = coalesce->tx_coalesce_usecs, -+ .tx_max_coalesced_frames = coalesce->tx_max_coalesced_frames, -+ .tx_coalesce_usecs_irq = coalesce->tx_coalesce_usecs_irq, -+ .tx_max_coalesced_frames_irq = coalesce->tx_max_coalesced_frames_irq, -+ .stats_block_coalesce_usecs = coalesce->stats_block_coalesce_usecs, -+ .use_adaptive_rx_coalesce = coalesce->use_adaptive_rx_coalesce, -+ .use_adaptive_tx_coalesce = coalesce->use_adaptive_tx_coalesce, -+ .pkt_rate_low = coalesce->pkt_rate_low, -+ .rx_coalesce_usecs_low = coalesce->rx_coalesce_usecs_low, -+ .rx_max_coalesced_frames_low = coalesce->rx_max_coalesced_frames_low, -+ .tx_coalesce_usecs_low = coalesce->tx_coalesce_usecs_low, -+ .tx_max_coalesced_frames_low = coalesce->tx_max_coalesced_frames_low, -+ .pkt_rate_high = coalesce->pkt_rate_high, -+ .rx_coalesce_usecs_high = coalesce->rx_coalesce_usecs_high, -+ .rx_max_coalesced_frames_high = coalesce->rx_max_coalesced_frames_high, -+ .tx_coalesce_usecs_high = coalesce->tx_coalesce_usecs_high, -+ .tx_max_coalesced_frames_high = coalesce->tx_max_coalesced_frames_high, -+ .rate_sample_interval = coalesce->rate_sample_interval, -+ }; -+ } -+ -+ coal.cmd = ETHTOOL_SCOALESCE; - - if ((fd = virNetDevSetupControl(ifname, &ifr)) < 0) - return -1; -@@ -3148,12 +3153,36 @@ int virNetDevSetCoalesce(const char *ifname, - goto cleanup; - } - -- coal = (struct ethtool_coalesce) { -- .cmd = ETHTOOL_GCOALESCE, -- }; -+ if (coalesce) { -+ coal = (struct ethtool_coalesce) { -+ .cmd = ETHTOOL_GCOALESCE, -+ }; - -- /* Don't fail if the update itself fails */ -- virNetDevSendEthtoolIoctl(fd, &ifr); -+ /* Don't fail if the update itself fails */ -+ if (virNetDevSendEthtoolIoctl(fd, &ifr) == 0) { -+ coalesce->rx_max_coalesced_frames = coal.rx_max_coalesced_frames; -+ coalesce->rx_coalesce_usecs_irq = coal.rx_coalesce_usecs_irq; -+ coalesce->rx_max_coalesced_frames_irq = coal.rx_max_coalesced_frames_irq; -+ coalesce->tx_coalesce_usecs = coal.tx_coalesce_usecs; -+ coalesce->tx_max_coalesced_frames = coal.tx_max_coalesced_frames; -+ coalesce->tx_coalesce_usecs_irq = coal.tx_coalesce_usecs_irq; -+ coalesce->tx_max_coalesced_frames_irq = coal.tx_max_coalesced_frames_irq; -+ coalesce->stats_block_coalesce_usecs = coal.stats_block_coalesce_usecs; -+ coalesce->use_adaptive_rx_coalesce = coal.use_adaptive_rx_coalesce; -+ coalesce->use_adaptive_tx_coalesce = coal.use_adaptive_tx_coalesce; -+ coalesce->pkt_rate_low = coal.pkt_rate_low; -+ coalesce->rx_coalesce_usecs_low = coal.rx_coalesce_usecs_low; -+ coalesce->rx_max_coalesced_frames_low = coal.rx_max_coalesced_frames_low; -+ coalesce->tx_coalesce_usecs_low = coal.tx_coalesce_usecs_low; -+ coalesce->tx_max_coalesced_frames_low = coal.tx_max_coalesced_frames_low; -+ coalesce->pkt_rate_high = coal.pkt_rate_high; -+ coalesce->rx_coalesce_usecs_high = coal.rx_coalesce_usecs_high; -+ coalesce->rx_max_coalesced_frames_high = coal.rx_max_coalesced_frames_high; -+ coalesce->tx_coalesce_usecs_high = coal.tx_coalesce_usecs_high; -+ coalesce->tx_max_coalesced_frames_high = coal.tx_max_coalesced_frames_high; -+ coalesce->rate_sample_interval = coal.rate_sample_interval; -+ } -+ } - - ret = 0; - cleanup: -diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h -index 97236c170d..c2c09af636 100644 ---- a/src/util/virnetdev.h -+++ b/src/util/virnetdev.h -@@ -180,7 +180,8 @@ int virNetDevRestoreMacAddress(const char *linkdev, - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; - - int virNetDevSetCoalesce(const char *ifname, -- virNetDevCoalescePtr coalesce) -+ virNetDevCoalescePtr coalesce, -+ bool update) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - - int virNetDevSetMTU(const char *ifname, -diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c -index c8dacfe27b..175dc2bfaa 100644 ---- a/src/util/virnetdevtap.c -+++ b/src/util/virnetdevtap.c -@@ -663,7 +663,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, - if (virNetDevSetOnline(*ifname, !!(flags & VIR_NETDEV_TAP_CREATE_IFUP)) < 0) - goto error; - -- if (virNetDevSetCoalesce(*ifname, coalesce) < 0) -+ if (virNetDevSetCoalesce(*ifname, coalesce, false) < 0) - goto error; - - return 0; --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Allow-memAccess-for-hugepages-again.patch b/SOURCES/libvirt-qemu-Allow-memAccess-for-hugepages-again.patch deleted file mode 100644 index cc85976..0000000 --- a/SOURCES/libvirt-qemu-Allow-memAccess-for-hugepages-again.patch +++ /dev/null @@ -1,243 +0,0 @@ -From 7c4ee4b1708fcd1b9fbfcb9de1be66c8294e6bbb Mon Sep 17 00:00:00 2001 -Message-Id: <7c4ee4b1708fcd1b9fbfcb9de1be66c8294e6bbb@dist-git> -From: Michal Privoznik -Date: Tue, 13 Jun 2017 18:12:13 +0200 -Subject: [PATCH] qemu: Allow memAccess for hugepages again - -https://bugzilla.redhat.com/show_bug.cgi?id=1214369 -https://bugzilla.redhat.com/show_bug.cgi?id=1458638 - -Historically, we've always supported memAccess for domains backed -by hugepages. However, somewhere along the way we've regressed -and stopped allowing such configuration. Fix it. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 671d18594f42f24f7cb3f1b2c574ff4ddba0b183) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 18 ++----- - .../qemuxml2argv-fd-memory-numa-topology2.args | 2 +- - .../qemuxml2argv-hugepages-memaccess.args | 42 +++++++++++++++ - .../qemuxml2argv-hugepages-memaccess.xml | 62 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 3 ++ - .../qemuxml2xmlout-hugepages-memaccess.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 7 files changed, 114 insertions(+), 15 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-hugepages-memaccess.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index e220bf5ba0..c791214528 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3345,6 +3345,9 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, - memAccess = virDomainNumaGetNodeMemoryAccessMode(def->numa, mem->targetNode); - } - -+ if (memAccess == VIR_DOMAIN_MEMORY_ACCESS_DEFAULT) -+ memAccess = def->mem.access; -+ - if (virDomainNumatuneGetMode(def->numa, mem->targetNode, &mode) < 0 && - virDomainNumatuneGetMode(def->numa, -1, &mode) < 0) - mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT; -@@ -3402,7 +3405,7 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, - if (!(props = virJSONValueNewObject())) - return -1; - -- if (pagesize || mem->nvdimmPath || -+ if (pagesize || mem->nvdimmPath || memAccess || - def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) { - *backendType = "memory-backend-file"; - -@@ -3439,23 +3442,10 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, - break; - - case VIR_DOMAIN_MEMORY_ACCESS_DEFAULT: -- if (def->mem.access == VIR_DOMAIN_MEMORY_ACCESS_SHARED) { -- if (virJSONValueObjectAdd(props, "b:share", true, NULL) < 0) -- goto cleanup; -- } -- break; -- - case VIR_DOMAIN_MEMORY_ACCESS_LAST: - break; - } - } else { -- if (memAccess) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("Shared memory mapping is supported " -- "only with hugepages")); -- goto cleanup; -- } -- - *backendType = "memory-backend-ram"; - } - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -index 4420b9ab22..e36f98b907 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -@@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=none \ - -mem-prealloc \ - -smp 20,sockets=1,cores=8,threads=1 \ - -object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ --size=15032385536 \ -+share=no,size=15032385536 \ - -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ - -object memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,\ - share=yes,size=15032385536 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args -new file mode 100644 -index 0000000000..d584d465b5 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args -@@ -0,0 +1,42 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-i686 \ -+-name QEMUGuest1 \ -+-S \ -+-M pc \ -+-m size=4194304k,slots=16,maxmem=8388608k \ -+-smp 4,sockets=4,cores=1,threads=1 \ -+-object memory-backend-file,id=ram-node0,prealloc=yes,\ -+mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,share=no,size=1073741824,\ -+host-nodes=0-3,policy=bind \ -+-numa node,nodeid=0,cpus=0,memdev=ram-node0 \ -+-object memory-backend-file,id=ram-node1,prealloc=yes,\ -+mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=yes,size=1073741824,\ -+host-nodes=0-3,policy=bind \ -+-numa node,nodeid=1,cpus=1,memdev=ram-node1 \ -+-object memory-backend-file,id=ram-node2,prealloc=yes,\ -+mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,share=no,size=1073741824,\ -+host-nodes=0-3,policy=bind \ -+-numa node,nodeid=2,cpus=2,memdev=ram-node2 \ -+-object memory-backend-file,id=ram-node3,prealloc=yes,\ -+mem-path=/dev/hugepages1G/libvirt/qemu/-1-QEMUGuest1,share=no,size=1073741824,\ -+host-nodes=3,policy=bind \ -+-numa node,nodeid=3,cpus=3,memdev=ram-node3 \ -+-object memory-backend-file,id=memdimm0,prealloc=yes,\ -+mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=yes,size=536870912,\ -+host-nodes=0-3,policy=bind \ -+-device pc-dimm,node=1,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml -new file mode 100644 -index 0000000000..db9b9430e1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml -@@ -0,0 +1,62 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 8388608 -+ 4194304 -+ 4194304 -+ -+ -+ -+ -+ -+ -+ -+ 4 -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+ -+ -+ -+
      -+ -+ -+ -+ 524288 -+ 1 -+ -+
      -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 175037bf96..77e52bd33b 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -827,6 +827,9 @@ mymain(void) - QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("hugepages-pages5", QEMU_CAPS_MEM_PATH); - DO_TEST("hugepages-pages6", NONE); -+ DO_TEST("hugepages-memaccess", QEMU_CAPS_OBJECT_MEMORY_FILE, -+ QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_DEVICE_PC_DIMM, -+ QEMU_CAPS_NUMA); - DO_TEST("nosharepages", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MEM_MERGE); - DO_TEST("disk-cdrom", NONE); - DO_TEST("disk-iscsi", NONE); -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hugepages-memaccess.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hugepages-memaccess.xml -new file mode 120000 -index 0000000000..23cef8e67d ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hugepages-memaccess.xml -@@ -0,0 +1 @@ -+../qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml -\ No newline at end of file -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 72eac5e716..511d1b3fb9 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -420,6 +420,7 @@ mymain(void) - DO_TEST("hugepages-pages2", NONE); - DO_TEST("hugepages-pages3", NONE); - DO_TEST("hugepages-shared", NONE); -+ DO_TEST("hugepages-memaccess", NONE); - DO_TEST("nosharepages", NONE); - DO_TEST("restore-v2", NONE); - DO_TEST("migrate", NONE); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Allow-qemuBuildControllerDevStr-to-return-NULL.patch b/SOURCES/libvirt-qemu-Allow-qemuBuildControllerDevStr-to-return-NULL.patch deleted file mode 100644 index a64567b..0000000 --- a/SOURCES/libvirt-qemu-Allow-qemuBuildControllerDevStr-to-return-NULL.patch +++ /dev/null @@ -1,183 +0,0 @@ -From 1da246305bff2d60828a08024cb9db5873fef49a Mon Sep 17 00:00:00 2001 -Message-Id: <1da246305bff2d60828a08024cb9db5873fef49a@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:04 +0200 -Subject: [PATCH] qemu: Allow qemuBuildControllerDevStr() to return NULL - -We will soon need to be able to return a NULL pointer -without the caller considering that an error: to make -it possible, change the return type to int and use -an out parameter for the string instead. - -Add some documentation for the function as well. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 0e943cec9e0ce10565fa4d94b06eae4e46a2925d) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 55 ++++++++++++++++++++++++++++++++++++------------- - src/qemu/qemu_command.h | 9 ++++---- - src/qemu/qemu_hotplug.c | 5 ++++- - 3 files changed, 50 insertions(+), 19 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 7ad3d16ea8..9e075e14d2 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -2702,23 +2702,46 @@ qemuCheckSCSIControllerIOThreads(const virDomainDef *domainDef, - } - - --char * -+/** -+ * qemuBuildControllerDevStr: -+ * @domainDef: domain definition -+ * @def: controller definition -+ * @qemuCaps: QEMU binary capabilities -+ * @devstr: device string -+ * @nusbcontroller: number of USB controllers -+ * -+ * Turn @def into a description of the controller that QEMU will understand, -+ * to be used either on the command line or through the monitor. -+ * -+ * The description will be returned in @devstr and can be NULL, eg. when -+ * passing in one of the built-in controllers. The returned string must be -+ * freed by the caller. -+ * -+ * The number pointed to by @nusbcontroller will be increased by one every -+ * time the description for a USB controller has been generated successfully. -+ * -+ * Returns: 0 on success, <0 on failure -+ */ -+int - qemuBuildControllerDevStr(const virDomainDef *domainDef, - virDomainControllerDefPtr def, - virQEMUCapsPtr qemuCaps, -+ char **devstr, - int *nusbcontroller) - { - virBuffer buf = VIR_BUFFER_INITIALIZER; - int model = def->model; - const char *modelName = NULL; - -+ *devstr = NULL; -+ - if (!qemuCheckCCWS390AddressSupport(domainDef, def->info, qemuCaps, - "controller")) -- return NULL; -+ return -1; - - if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { - if ((qemuDomainSetSCSIControllerModel(domainDef, qemuCaps, &model)) < 0) -- return NULL; -+ return -1; - } - - if (!(def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI && -@@ -2726,22 +2749,22 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - if (def->queues) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'queues' is only supported by virtio-scsi controller")); -- return NULL; -+ return -1; - } - if (def->cmd_per_lun) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'cmd_per_lun' is only supported by virtio-scsi controller")); -- return NULL; -+ return -1; - } - if (def->max_sectors) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'max_sectors' is only supported by virtio-scsi controller")); -- return NULL; -+ return -1; - } - if (def->ioeventfd) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'ioeventfd' is only supported by virtio-scsi controller")); -- return NULL; -+ return -1; - } - } - -@@ -3156,11 +3179,12 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - if (virBufferCheckError(&buf) < 0) - goto error; - -- return virBufferContentAndReset(&buf); -+ *devstr = virBufferContentAndReset(&buf); -+ return 0; - - error: - virBufferFreeAndReset(&buf); -- return NULL; -+ return -1; - } - - -@@ -3255,12 +3279,15 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, - continue; - } - -- virCommandAddArg(cmd, "-device"); -- if (!(devstr = qemuBuildControllerDevStr(def, cont, qemuCaps, -- &usbcontroller))) -+ if (qemuBuildControllerDevStr(def, cont, qemuCaps, -+ &devstr, &usbcontroller) < 0) - return -1; -- virCommandAddArg(cmd, devstr); -- VIR_FREE(devstr); -+ -+ if (devstr) { -+ virCommandAddArg(cmd, "-device"); -+ virCommandAddArg(cmd, devstr); -+ VIR_FREE(devstr); -+ } - } - } - -diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h -index 09cb00ee9b..9a2ab29e9a 100644 ---- a/src/qemu/qemu_command.h -+++ b/src/qemu/qemu_command.h -@@ -118,10 +118,11 @@ char *qemuBuildDriveDevStr(const virDomainDef *def, - virQEMUCapsPtr qemuCaps); - - /* Current, best practice */ --char *qemuBuildControllerDevStr(const virDomainDef *domainDef, -- virDomainControllerDefPtr def, -- virQEMUCapsPtr qemuCaps, -- int *nusbcontroller); -+int qemuBuildControllerDevStr(const virDomainDef *domainDef, -+ virDomainControllerDefPtr def, -+ virQEMUCapsPtr qemuCaps, -+ char **devstr, -+ int *nusbcontroller); - - int qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, - const char **backendType, -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 316bc7d41e..476e2b81a3 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -523,7 +523,10 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, - if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, controller) < 0) - goto cleanup; - -- if (!(devstr = qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, NULL))) -+ if (qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, &devstr, NULL) < 0) -+ goto cleanup; -+ -+ if (!devstr) - goto cleanup; - - if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0) --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Always-reset-TLS-in-qemuProcessRecoverMigrationOut.patch b/SOURCES/libvirt-qemu-Always-reset-TLS-in-qemuProcessRecoverMigrationOut.patch deleted file mode 100644 index 98ee89c..0000000 --- a/SOURCES/libvirt-qemu-Always-reset-TLS-in-qemuProcessRecoverMigrationOut.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 4b3819d67eaf7c9ed31a2d306968d24fecae68ea Mon Sep 17 00:00:00 2001 -Message-Id: <4b3819d67eaf7c9ed31a2d306968d24fecae68ea@dist-git> -From: Jiri Denemark -Date: Wed, 5 Apr 2017 12:04:09 +0200 -Subject: [PATCH] qemu: Always reset TLS in qemuProcessRecoverMigrationOut - -qemuProcessRecoverMigrationOut doesn't explicitly call -qemuMigrationResetTLS relying on two things: - - - qemuMigrationCancel resets TLS parameters - - our migration code resets TLS before entering - QEMU_MIGRATION_PHASE_PERFORM3_DONE phase - -But this is not obvious and the assumptions will be broken soon. Let's -explicitly reset TLS parameters on all paths which do not kill the -domain. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 9d677e6a6ba075f489f791b6922a5dadf0e0c79f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1425003 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 70b06a28f..2e0f859ce 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3077,6 +3077,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - } - } - -+ qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_NONE, NULL, NULL); - return 0; - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Always-send-persistent-XML-during-migration.patch b/SOURCES/libvirt-qemu-Always-send-persistent-XML-during-migration.patch deleted file mode 100644 index cc3fa9d..0000000 --- a/SOURCES/libvirt-qemu-Always-send-persistent-XML-during-migration.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d3df2456cfc82cba6afdb2f44dca91f6f553ac76 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Wed, 7 Jun 2017 09:35:25 +0200 -Subject: [PATCH] qemu: Always send persistent XML during migration - -When persistent migration of a transient domain is requested but no -custom XML is passed to the migration API we would just let the -destination daemon make a persistent definition from the live definition -itself. This is not a problem now, but once the destination daemon -starts replacing the original CPU definition with the one from migration -cookie before starting a domain, it would need to add more ugly hacks to -reverse the operation. Let's just always send the persistent definition -in the cookie to make things a bit cleaner. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit b0a16641fa648de23d1fd05a3e89987799550c44) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index ec5af7a612..a7c90a09e8 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3613,8 +3613,9 @@ qemuMigrationRun(virQEMUDriverPtr driver, - if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml, - NULL, NULL))) - goto cleanup; -- } else if (vm->newDef) { -- if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef, -+ } else { -+ virDomainDefPtr def = vm->newDef ? vm->newDef : vm->def; -+ if (!(persistDef = qemuDomainDefCopy(driver, def, - VIR_DOMAIN_XML_SECURE | - VIR_DOMAIN_XML_MIGRATABLE))) - goto cleanup; --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Automatically-pick-target-index-and-model-for-pci-root-controllers.patch b/SOURCES/libvirt-qemu-Automatically-pick-target-index-and-model-for-pci-root-controllers.patch deleted file mode 100644 index 6e5945a..0000000 --- a/SOURCES/libvirt-qemu-Automatically-pick-target-index-and-model-for-pci-root-controllers.patch +++ /dev/null @@ -1,358 +0,0 @@ -From a9c2a00aa4d4160f1057e2ce409558d244ec65f2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:10 +0200 -Subject: [PATCH] qemu: Automatically pick target index and model for pci-root - controllers - -pSeries guests will soon need the new information; luckily, -we can figure it out automatically most of the time, so -users won't have to worry about it. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 6e42d83f7ca2d2a481dde7d4cda85c5632759ee0) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_conf.c | 31 +++++++++ - src/conf/domain_conf.h | 6 +- - src/libvirt_private.syms | 1 + - src/qemu/qemu_domain_address.c | 79 +++++++++++++++++++++- - .../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 5 +- - .../qemuargv2xml-pseries-nvram.xml | 5 +- - .../qemuxml2xmlout-panic-pseries.xml | 5 +- - .../qemuxml2xmlout-ppc64-usb-controller-legacy.xml | 5 +- - .../qemuxml2xmlout-ppc64-usb-controller.xml | 5 +- - .../qemuxml2xmlout-pseries-nvram.xml | 5 +- - .../qemuxml2xmlout-pseries-panic-missing.xml | 5 +- - .../qemuxml2xmlout-pseries-panic-no-address.xml | 5 +- - 12 files changed, 145 insertions(+), 12 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 599db5cafe..86415964dc 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -1881,6 +1881,37 @@ void virDomainControllerDefFree(virDomainControllerDefPtr def) - VIR_FREE(def); - } - -+ -+/** -+ * virDomainControllerIsPCIHostBridge: -+ * @cont: controller -+ * -+ * Checks whether @cont is a PCI Host Bridge (PHB), a specific type -+ * of PCI controller used by pSeries guests. -+ * -+ * Returns: true if @cont is a PHB, false otherwise. -+ */ -+bool -+virDomainControllerIsPCIHostBridge(const virDomainControllerDef *cont) -+{ -+ virDomainControllerPCIModelName name; -+ -+ /* PHBs are pci-root controllers */ -+ if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI || -+ cont->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { -+ return false; -+ } -+ -+ name = cont->opts.pciopts.modelName; -+ -+ /* The actual device used for PHBs is spapr-pci-host-bridge */ -+ if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE) -+ return false; -+ -+ return true; -+} -+ -+ - virDomainFSDefPtr - virDomainFSDefNew(void) - { -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 50fdc6e2a6..f00c52c282 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -2649,10 +2649,12 @@ int virDomainDeviceFindControllerModel(const virDomainDef *def, - virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def, - int bus, - char *dst); -+ -+virDomainControllerDefPtr virDomainControllerDefNew(virDomainControllerType type); - void virDomainControllerDefFree(virDomainControllerDefPtr def); -+bool virDomainControllerIsPCIHostBridge(const virDomainControllerDef *cont); -+ - virDomainFSDefPtr virDomainFSDefNew(void); --virDomainControllerDefPtr --virDomainControllerDefNew(virDomainControllerType type); - void virDomainFSDefFree(virDomainFSDefPtr def); - void virDomainActualNetDefFree(virDomainActualNetDefPtr def); - void virDomainNetDefClear(virDomainNetDefPtr def); -diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms -index 7876ffb208..04c9ff6120 100644 ---- a/src/libvirt_private.syms -+++ b/src/libvirt_private.syms -@@ -226,6 +226,7 @@ virDomainControllerFindByType; - virDomainControllerFindUnusedIndex; - virDomainControllerInsert; - virDomainControllerInsertPreAlloced; -+virDomainControllerIsPCIHostBridge; - virDomainControllerModelPCITypeToString; - virDomainControllerModelSCSITypeFromString; - virDomainControllerModelSCSITypeToString; -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index ff57edb564..626d30d477 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -1843,6 +1843,7 @@ qemuDomainSupportsPCI(virDomainDefPtr def, - - static void - qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, -+ virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) - { - int *modelName = &cont->opts.pciopts.modelName; -@@ -1879,6 +1880,9 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, - *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE; - break; - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: -+ if (qemuDomainIsPSeries(def)) -+ *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE; -+ break; - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: - break; -@@ -1886,6 +1890,54 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, - } - - -+/** -+ * qemuDomainAddressFindNewTargetIndex: -+ * @def: domain definition -+ * -+ * Find a target index that can be used for a PCI controller. -+ * -+ * Returns: an unused target index, or -1 if all available target -+ * indexes are already taken. -+ */ -+static int -+qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def) -+{ -+ int targetIndex; -+ int ret = -1; -+ -+ /* Try all indexes between 1 and 31 - QEMU only supports 32 -+ * PHBs, and 0 is reserved for the default, implicit one */ -+ for (targetIndex = 1; targetIndex <= 31; targetIndex++) { -+ bool found = false; -+ size_t i; -+ -+ for (i = 0; i < def->ncontrollers; i++) { -+ virDomainControllerDefPtr cont = def->controllers[i]; -+ -+ /* Skip everything but PHBs */ -+ if (!virDomainControllerIsPCIHostBridge(cont)) -+ continue; -+ -+ /* Stop looking as soon as we find a PHB that's -+ * already using this specific target index */ -+ if (cont->opts.pciopts.targetIndex == targetIndex) { -+ found = true; -+ break; -+ } -+ } -+ -+ /* If no existing PCI controller uses this index, great, -+ * it means it's free and we can return it to the caller */ -+ if (!found) { -+ ret = targetIndex; -+ break; -+ } -+ } -+ -+ return ret; -+} -+ -+ - static int - qemuDomainAddressFindNewBusNr(virDomainDefPtr def) - { -@@ -2146,7 +2198,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - * device in qemu) for any controller that doesn't yet - * have it set. - */ -- qemuDomainPCIControllerSetDefaultModelName(cont, qemuCaps); -+ qemuDomainPCIControllerSetDefaultModelName(cont, def, qemuCaps); - - /* set defaults for any other auto-generated config - * options for this controller that haven't been -@@ -2183,9 +2235,32 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - goto cleanup; - } - break; -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: -+ if (!qemuDomainIsPSeries(def)) -+ break; -+ if (options->targetIndex == -1) { -+ if (cont->idx == 0) { -+ /* The pci-root controller with controller index 0 -+ * must always be assigned target index 0, because -+ * it represents the implicit PHB which is treated -+ * differently than all other PHBs */ -+ options->targetIndex = 0; -+ } else { -+ /* For all other PHBs the target index doesn't need -+ * to match the controller index or have any -+ * particular value, really */ -+ options->targetIndex = qemuDomainAddressFindNewTargetIndex(def); -+ } -+ } -+ if (options->targetIndex == -1) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("No usable target index found for %d"), -+ addr->bus); -+ goto cleanup; -+ } -+ break; - case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: -- case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: - break; -diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml b/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml -index 1bad8ee4c1..601d0f7f62 100644 ---- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml -+++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml -@@ -30,7 +30,10 @@ - -
      - -- -+ -+ -+ -+ - -
      - -diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml b/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml -index 7e9f8644fb..7787847a90 100644 ---- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml -+++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml -@@ -17,7 +17,10 @@ - -
      - -- -+ -+ -+ -+ - - -
      -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -index 1ed11ce12d..7fb49feb0f 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml -@@ -17,7 +17,10 @@ - -
      - -- -+ -+ -+ -+ - - -
      -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.xml -index 33e7810072..6d3d51e7ee 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.xml -@@ -22,7 +22,10 @@ - -
      - -- -+ -+ -+ -+ - -
      - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml -index 30932e5afd..659cabe327 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml -@@ -22,7 +22,10 @@ - -
      - -- -+ -+ -+ -+ - -
      - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml -index 713f31c0e9..f89b23b338 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml -@@ -17,7 +17,10 @@ - -
      - -- -+ -+ -+ -+ - - -
      -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -index 1ed11ce12d..7fb49feb0f 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml -@@ -17,7 +17,10 @@ - -
      - -- -+ -+ -+ -+ - - -
      -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -index 1ed11ce12d..7fb49feb0f 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml -@@ -17,7 +17,10 @@ - -
      - -- -+ -+ -+ -+ - - -
      --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch b/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch new file mode 100644 index 0000000..057aa65 --- /dev/null +++ b/SOURCES/libvirt-qemu-Avoid-comparing-size_t-with-1.patch @@ -0,0 +1,36 @@ +From a29ee6823d600aaf40c06c67e954233c36624774 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Mon, 11 Dec 2017 14:34:20 +0100 +Subject: [PATCH] qemu: Avoid comparing size_t with -1 + +ncpus would be -1 on error and the cleanup for loop would not be skipped +in this case. + +Signed-off-by: Jiri Denemark +Reviewed-by: John Ferlan +(cherry picked from commit fd754cb69cb073d370d73b9eab65db8ce1400096) + +https://bugzilla.redhat.com/show_bug.cgi?id=1521202 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 4af1b6c662..165fdbc5ea 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon) + size_t i; + + if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0) +- goto error; ++ return NULL; + + if (!(models = virDomainCapsCPUModelsNew(ncpus))) + goto error; +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Break-endless-loop-if-qemuMigrationResetTLS-fails.patch b/SOURCES/libvirt-qemu-Break-endless-loop-if-qemuMigrationResetTLS-fails.patch deleted file mode 100644 index 315f05c..0000000 --- a/SOURCES/libvirt-qemu-Break-endless-loop-if-qemuMigrationResetTLS-fails.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e2f2737b6f9aa4ba8399e87e2eecbfbc77f9b2a4 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 4 Apr 2017 12:46:37 +0200 -Subject: [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails - -Jumping to "endjob" label from a code after this label is not a very -good idea. - -Signed-off-by: Jiri Denemark -(cherry picked from commit d658c8594e05d286de6af22ea88689d1d5e2a82b) - -https://bugzilla.redhat.com/show_bug.cgi?id=1300769 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index fcd3a38a1..992b6bd4a 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -5356,9 +5356,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - QEMU_ASYNC_JOB_MIGRATION_IN); - } - -- if (qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, -- NULL, NULL) < 0) -- goto endjob; -+ qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, NULL, NULL); - - qemuMigrationJobFinish(driver, vm); - if (!virDomainObjIsActive(vm)) --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Change-coalesce-settings-on-hotplug-when-they-are-different.patch b/SOURCES/libvirt-qemu-Change-coalesce-settings-on-hotplug-when-they-are-different.patch deleted file mode 100644 index 713189e..0000000 --- a/SOURCES/libvirt-qemu-Change-coalesce-settings-on-hotplug-when-they-are-different.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 1ed2c3a16d7a4eaffafa07edf66a5148230726bf Mon Sep 17 00:00:00 2001 -Message-Id: <1ed2c3a16d7a4eaffafa07edf66a5148230726bf@dist-git> -From: Martin Kletzander -Date: Wed, 21 Jun 2017 09:46:25 +0200 -Subject: [PATCH] qemu: Change coalesce settings on hotplug when they are - different - -Part of the condition was reverted so no value update was propagated -through. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414627 - -Signed-off-by: Martin Kletzander -(cherry picked from commit ff7bae6e4fb74a52239d53af3672900c69801508) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index fbc9177669..a6274273dd 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -3296,8 +3296,8 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, - - if (!!olddev->coalesce != !!newdev->coalesce || - (olddev->coalesce && newdev->coalesce && -- !memcmp(olddev->coalesce, newdev->coalesce, -- sizeof(*olddev->coalesce)))) -+ memcmp(olddev->coalesce, newdev->coalesce, -+ sizeof(*olddev->coalesce)))) - needCoalesceChange = true; - - /* FINALLY - actually perform the required actions */ --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Clean-up-qemuDomainAttachHostPCIDevice.patch b/SOURCES/libvirt-qemu-Clean-up-qemuDomainAttachHostPCIDevice.patch deleted file mode 100644 index c9e52c1..0000000 --- a/SOURCES/libvirt-qemu-Clean-up-qemuDomainAttachHostPCIDevice.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 5886eacea292e39271f42f067132fa9265e093dd Mon Sep 17 00:00:00 2001 -Message-Id: <5886eacea292e39271f42f067132fa9265e093dd@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:00 +0200 -Subject: [PATCH] qemu: Clean up qemuDomainAttachHostPCIDevice() - -We use hostdev->info frequently enough that having -a shorter name for it makes the code more readable. -We will also be adding even more uses later on. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 765421723237aa93441b404ac8b0e67e6d2f636e) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index a6274273dd..316bc7d41e 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1390,6 +1390,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV, - { .hostdev = hostdev } }; -+ virDomainDeviceInfoPtr info = hostdev->info; - int ret; - char *devstr = NULL; - int configfd = -1; -@@ -1462,7 +1463,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - if (backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) - teardownlabel = true; - -- if (qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1) < 0) -+ if (qemuAssignDeviceHostdevAlias(vm->def, &info->alias, -1) < 0) - goto error; - if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) - goto error; -@@ -1471,8 +1472,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) { - configfd = qemuOpenPCIConfig(hostdev); - if (configfd >= 0) { -- if (virAsprintf(&configfd_name, "fd-%s", -- hostdev->info->alias) < 0) -+ if (virAsprintf(&configfd_name, "fd-%s", info->alias) < 0) - goto error; - } - } -@@ -1517,7 +1517,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - VIR_WARN("Unable to remove host device from /dev"); - - if (releaseaddr) -- qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL); -+ qemuDomainReleaseDeviceAddress(vm, info, NULL); - - qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1); - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Conditionally-allow-block-copy-for-persistent-domains.patch b/SOURCES/libvirt-qemu-Conditionally-allow-block-copy-for-persistent-domains.patch deleted file mode 100644 index 1a784c0..0000000 --- a/SOURCES/libvirt-qemu-Conditionally-allow-block-copy-for-persistent-domains.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e88d64a75a55dcd0173ba35b6f100d2ec5fcf312 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Wed, 7 Jun 2017 13:31:21 +0200 -Subject: [PATCH] qemu: Conditionally allow block-copy for persistent domains - -Allow starting the block-copy job for a persistent domain if a user -declares by using a flag that the job will not be recovered if the VM is -switched off while the job is active. - -This allows to use the block-copy job with persistent VMs under the same -conditions as would apply to transient domains. - -(cherry picked from commit b7e534c651bfa28c65f7b11661b478613c96598c) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1459113 - -Signed-off-by: Jiri Denemark ---- - include/libvirt/libvirt-domain.h | 3 +++ - src/libvirt-domain.c | 4 ++++ - src/qemu/qemu_driver.c | 9 ++++++--- - 3 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h -index 720db32f76..45f939a8cc 100644 ---- a/include/libvirt/libvirt-domain.h -+++ b/include/libvirt/libvirt-domain.h -@@ -2428,6 +2428,9 @@ typedef enum { - backing chain */ - VIR_DOMAIN_BLOCK_COPY_REUSE_EXT = 1 << 1, /* Reuse existing external - file for a copy */ -+ VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB = 1 << 2, /* Don't force usage of -+ recoverable job for the -+ copy operation */ - } virDomainBlockCopyFlags; - - /** -diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c -index 4670c54e5e..0adc9e8cbe 100644 ---- a/src/libvirt-domain.c -+++ b/src/libvirt-domain.c -@@ -10026,6 +10026,10 @@ virDomainBlockRebase(virDomainPtr dom, const char *disk, - * or virDomainDetachDevice(), while a copy job is active; they may - * also restrict a copy job to transient domains. - * -+ * If @flags contains VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB the job will not be -+ * recoverable if the VM is turned off while job is active. This flag will -+ * remove the restriction of copy jobs to transient domains. -+ * - * The @disk parameter is either an unambiguous source name of the - * block device (the sub-element, such as - * "/path/to/image"), or the device target shorthand (the -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a9ac06a63c..354329fe64 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16509,7 +16509,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, - - /* Preliminaries: find the disk we are editing, sanity checks */ - virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW | -- VIR_DOMAIN_BLOCK_COPY_REUSE_EXT, -1); -+ VIR_DOMAIN_BLOCK_COPY_REUSE_EXT | -+ VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB, -1); - - priv = vm->privateData; - cfg = virQEMUDriverGetConfig(driver); -@@ -16548,7 +16549,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, - _("block copy is not supported with this QEMU binary")); - goto endjob; - } -- if (vm->persistent) { -+ if (!(flags & VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB) && -+ vm->persistent) { - /* XXX if qemu ever lets us start a new domain with mirroring - * already active, we can relax this; but for now, the risk of - * 'managedsave' due to libvirt-guests means we can't risk -@@ -16775,7 +16777,8 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml, - size_t i; - - virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW | -- VIR_DOMAIN_BLOCK_COPY_REUSE_EXT, -1); -+ VIR_DOMAIN_BLOCK_COPY_REUSE_EXT | -+ VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB, -1); - if (virTypedParamsValidate(params, nparams, - VIR_DOMAIN_BLOCK_COPY_BANDWIDTH, - VIR_TYPED_PARAM_ULLONG, --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Deal-with-PHB-naming-conventions.patch b/SOURCES/libvirt-qemu-Deal-with-PHB-naming-conventions.patch deleted file mode 100644 index 693ec75..0000000 --- a/SOURCES/libvirt-qemu-Deal-with-PHB-naming-conventions.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f55694fe90cc25e228bd2f779c600d739aec508e Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:12 +0200 -Subject: [PATCH] qemu: Deal with PHB naming conventions - -Usually, a controller with alias 'x' will create a bus with the -same name; however, the bus created by a PHBs with alias 'x' will -be named 'x.0' instead, so we need to account for that. - -As an exception to the exception, the implicit PHB that's added -automatically to every pSeries guest creates the 'pci.0' bus. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 32f23b8d30f13c154fba6673b1b42b164c162f8a) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index a067aaeb17..0176f0d63f 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -301,6 +301,8 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, - int ret = -1; - char *devStr = NULL; - const char *contAlias = NULL; -+ bool contIsPHB = false; -+ int contTargetIndex = 0; - - if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - size_t i; -@@ -313,6 +315,8 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && - cont->idx == info->addr.pci.bus) { - contAlias = cont->info.alias; -+ contIsPHB = virDomainControllerIsPCIHostBridge(cont); -+ contTargetIndex = cont->opts.pciopts.targetIndex; - if (!contAlias) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device alias was not set for PCI " -@@ -348,7 +352,17 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, - } - } - -- virBufferAsprintf(buf, ",bus=%s", contAlias); -+ if (contIsPHB && contTargetIndex > 0) { -+ /* The PCI bus created by a spapr-pci-host-bridge device with -+ * alias 'x' will be called 'x.0' rather than 'x'; however, -+ * this does not apply to the implicit PHB in a pSeries guest, -+ * which always has the hardcoded name 'pci.0' */ -+ virBufferAsprintf(buf, ",bus=%s.0", contAlias); -+ } else { -+ /* For all other controllers, the bus name matches the alias -+ * of the corresponding controller */ -+ virBufferAsprintf(buf, ",bus=%s", contAlias); -+ } - - if (info->addr.pci.multi == VIR_TRISTATE_SWITCH_ON) - virBufferAddLit(buf, ",multifunction=on"); --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch b/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch new file mode 100644 index 0000000..2e55cb3 --- /dev/null +++ b/SOURCES/libvirt-qemu-Destroy-whole-memory-tree.patch @@ -0,0 +1,42 @@ +From 7207faf95b38811cbf0d19df02066cc06a138822 Mon Sep 17 00:00:00 2001 +Message-Id: <7207faf95b38811cbf0d19df02066cc06a138822@dist-git> +From: Michal Privoznik +Date: Thu, 9 Nov 2017 16:06:46 +0100 +Subject: [PATCH] qemu: Destroy whole memory tree + +https://bugzilla.redhat.com/show_bug.cgi?id=1461214 + +When removing path where huge pages are call virFileDeleteTree +instead of plain rmdir(). The reason is that in the near future +there's going to be more in the path than just files - some +subdirs. Therefore plain rmdir() is not going to be enough. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit bb3de478a66edafd130ecca9a45a4d506ca727a0) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 605f280d0c..3324cc61f1 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -3348,10 +3348,8 @@ qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver, + return -1; + } + } else { +- if (rmdir(path) < 0 && +- errno != ENOENT) +- VIR_WARN("Unable to remove hugepage path: %s (errno=%d)", +- path, errno); ++ if (virFileDeleteTree(path) < 0) ++ return -1; + } + + return 0; +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch b/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch new file mode 100644 index 0000000..c6a2dfd --- /dev/null +++ b/SOURCES/libvirt-qemu-Disallow-pivot-of-shared-disks-to-unsupported-storage.patch @@ -0,0 +1,40 @@ +From 9911807f7cf94ab328916fd9f00f20cc09a6455a Mon Sep 17 00:00:00 2001 +Message-Id: <9911807f7cf94ab328916fd9f00f20cc09a6455a@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:21 +0100 +Subject: [PATCH] qemu: Disallow pivot of shared disks to unsupported storage + +Pivoting to a unsupported storage type might break the assumption that +shared disks will not corrupt metadata. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +(cherry picked from commit 2b41c86294786c07f53afa633fe3dce703debc3c) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 620028fe07..d0d29747cf 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -16509,6 +16509,16 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, + goto cleanup; + } + ++ /* When pivoting to a shareable disk we need to make sure that the disk can ++ * be safely shared, since block copy might have changed the format. */ ++ if (disk->src->shared && !disk->src->readonly && ++ !qemuBlockStorageSourceSupportsConcurrentAccess(disk->mirror)) { ++ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", ++ _("can't pivot a shared disk to a storage volume not " ++ "supporting sharing")); ++ goto cleanup; ++ } ++ + /* For active commit, the mirror is part of the already labeled + * chain. For blockcopy, we previously labeled only the top-level + * image; but if the user is reusing an external image that +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Do-not-skip-virCPUUpdateLive-if-priv-origCPU-is-set.patch b/SOURCES/libvirt-qemu-Do-not-skip-virCPUUpdateLive-if-priv-origCPU-is-set.patch deleted file mode 100644 index 8e78a3c..0000000 --- a/SOURCES/libvirt-qemu-Do-not-skip-virCPUUpdateLive-if-priv-origCPU-is-set.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 6d2400987412f61857070407a43dc88705cf34f6 Mon Sep 17 00:00:00 2001 -Message-Id: <6d2400987412f61857070407a43dc88705cf34f6@dist-git> -From: Jiri Denemark -Date: Wed, 21 Jun 2017 15:31:38 +0200 -Subject: [PATCH] qemu: Do not skip virCPUUpdateLive if priv->origCPU is set - -Even though we got both the original CPU (used for starting a domain) -and the updated version (the CPU really provided by QEMU) during -incoming migration, restore, or snapshot revert, we still need to update -the CPU according to the data we got from the freshly started QEMU. -Otherwise we don't know whether the CPU we got from QEMU matches the one -before migration. We just need to keep the original CPU in -priv->origCPU. - -Messed up by me in v3.4.0-58-g8e34f4781. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit eabb0002ca0bba3c5a94d16fb385783de7b144a5) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina ---- - src/qemu/qemu_process.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index a7abfc720e..4d7c8d8e40 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3946,20 +3946,16 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driver, - if (qemuProcessVerifyCPUFeatures(def, cpu) < 0) - goto cleanup; - -- /* Don't update the CPU if we already did so when starting a domain -- * during migration, restore or snapshot revert. */ -- if (priv->origCPU) { -- ret = 0; -- goto cleanup; -- } -- - if (!(orig = virCPUDefCopy(def->cpu))) - goto cleanup; - - if ((rc = virCPUUpdateLive(def->os.arch, def->cpu, cpu, disabled)) < 0) { - goto cleanup; - } else if (rc == 0) { -- if (!virCPUDefIsEqual(def->cpu, orig, false)) -+ /* Store the original CPU in priv if QEMU changed it and we didn't -+ * get the original CPU via migration, restore, or snapshot revert. -+ */ -+ if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false)) - VIR_STEAL_PTR(priv->origCPU, orig); - - def->cpu->check = VIR_CPU_CHECK_FULL; --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Don-t-error-out-if-allocation-info-can-t-be-queried.patch b/SOURCES/libvirt-qemu-Don-t-error-out-if-allocation-info-can-t-be-queried.patch deleted file mode 100644 index 10f0c04..0000000 --- a/SOURCES/libvirt-qemu-Don-t-error-out-if-allocation-info-can-t-be-queried.patch +++ /dev/null @@ -1,42 +0,0 @@ -From bd25ad4689524e4212a72c7d40a18e91071cfa35 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Fri, 2 Jun 2017 12:52:56 +0200 -Subject: [PATCH] qemu: Don't error out if allocation info can't be queried - -qemuDomainGetBlockInfo would error out if qemu did not report -'wr_highest_offset'. This usually does not happen, but can happen -briefly during active layer block commit. There's no need to report the -error, we can simply report that the disk is fully alocated at that -point. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452045 -(cherry picked from commit c245f558369de5eb404e54728bf69ad27942e912) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index b741c1b5a6..fdfa4a50e1 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -11555,14 +11555,6 @@ qemuDomainGetBlockInfo(virDomainPtr dom, - } - - if (!entry->wr_highest_offset_valid) { -- if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_BLOCK && -- disk->src->format != VIR_STORAGE_FILE_RAW) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("failed to query the maximum written offset of " -- "block device '%s'"), disk->dst); -- goto endjob; -- } -- - info->allocation = entry->physical; - } else { - if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_FILE && --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Don-t-fail-if-physical-size-can-t-be-updated-in-qemuDomainGetBlockInfo.patch b/SOURCES/libvirt-qemu-Don-t-fail-if-physical-size-can-t-be-updated-in-qemuDomainGetBlockInfo.patch deleted file mode 100644 index 50a2865..0000000 --- a/SOURCES/libvirt-qemu-Don-t-fail-if-physical-size-can-t-be-updated-in-qemuDomainGetBlockInfo.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 19acba61eef5c5caf17e5b75b4e2ea30458a18b3 Mon Sep 17 00:00:00 2001 -Message-Id: <19acba61eef5c5caf17e5b75b4e2ea30458a18b3@dist-git> -From: Peter Krempa -Date: Fri, 28 Apr 2017 10:37:00 +0200 -Subject: [PATCH] qemu: Don't fail if physical size can't be updated in - qemuDomainGetBlockInfo - -Since commit c5f6151390 qemuDomainBlockInfo tries to update the -"physical" storage size for all network storage and not only block -devices. - -Since the storage driver APIs to do this are not implemented for certain -storage types (RBD, iSCSI, ...) the code would fail to retrieve any data -since the failure of qemuDomainStorageUpdatePhysical is fatal. - -Since it's desired to return data even if the total size can't be -updated we need to ignore errors from that function and return plausible -data. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442344 -(cherry picked from commit 9f16bb7386939c400a7522d2489245f1e6831bae) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3f3eca440..2fcf4612e 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -11567,10 +11567,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom, - if (info->allocation == 0) - info->allocation = entry->physical; - -- if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) < 0) -- goto endjob; -- -- info->physical = disk->src->physical; -+ if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) == 0) { -+ info->physical = disk->src->physical; -+ } else { -+ virResetLastError(); -+ info->physical = entry->physical; -+ } - } else { - info->physical = entry->physical; - } --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch b/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch new file mode 100644 index 0000000..5ed49ef --- /dev/null +++ b/SOURCES/libvirt-qemu-Don-t-initialize-struct-utsname.patch @@ -0,0 +1,34 @@ +From 27e59af45b7e283b94617330e3327eff4bd91bdb Mon Sep 17 00:00:00 2001 +Message-Id: <27e59af45b7e283b94617330e3327eff4bd91bdb@dist-git> +From: Jiri Denemark +Date: Mon, 22 Jan 2018 14:51:11 +0100 +Subject: [PATCH] qemu: Don't initialize struct utsname + +It breaks the build and it is not really useful for anything. + +Signed-off-by: Jiri Denemark +(cherry picked from commit ba9ea2ad7dd15d9a2e9c7a5b9a8a3e7066351015) + +https://bugzilla.redhat.com/show_bug.cgi?id=1525182 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index af4875f82e..bd80edc978 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -5416,7 +5416,7 @@ virQEMUCapsCacheNew(const char *libDir, + char *capsCacheDir = NULL; + virFileCachePtr cache = NULL; + virQEMUCapsCachePrivPtr priv = NULL; +- struct utsname uts = { 0 }; ++ struct utsname uts; + + if (virAsprintf(&capsCacheDir, "%s/capabilities", cacheDir) < 0) + goto error; +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-Don-t-overwrite-existing-error-in-qemuMigrationReset.patch b/SOURCES/libvirt-qemu-Don-t-overwrite-existing-error-in-qemuMigrationReset.patch deleted file mode 100644 index 9e86a07..0000000 --- a/SOURCES/libvirt-qemu-Don-t-overwrite-existing-error-in-qemuMigrationReset.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 28079e51b504ad2e5849d38dc994c41d319bf133 Mon Sep 17 00:00:00 2001 -Message-Id: <28079e51b504ad2e5849d38dc994c41d319bf133@dist-git> -From: Jiri Denemark -Date: Thu, 6 Apr 2017 09:23:18 +0200 -Subject: [PATCH] qemu: Don't overwrite existing error in qemuMigrationReset - -https://bugzilla.redhat.com/show_bug.cgi?id=1439130 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 45b639bdbabe59056a6fc89ee4189fe695d6fae2) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index ae0ab368d..8c6d1385e 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -5871,15 +5871,22 @@ qemuMigrationReset(virQEMUDriverPtr driver, - qemuDomainAsyncJob job) - { - qemuMonitorMigrationCaps cap; -+ virErrorPtr err = virSaveLastError(); - - if (!virDomainObjIsActive(vm)) -- return; -+ goto cleanup; - - if (qemuMigrationResetTLS(driver, vm, job) < 0) -- return; -+ goto cleanup; - - for (cap = 0; cap < QEMU_MONITOR_MIGRATION_CAPS_LAST; cap++) { - if (qemuMigrationSetOption(driver, vm, cap, false, job) < 0) -- return; -+ goto cleanup; -+ } -+ -+ cleanup: -+ if (err) { -+ virSetError(err); -+ virFreeError(err); - } - } --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationCancel.patch b/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationCancel.patch deleted file mode 100644 index 187a2c4..0000000 --- a/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationCancel.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 4060e79aee023bf56323ad6daf82c4aa1bde308b Mon Sep 17 00:00:00 2001 -Message-Id: <4060e79aee023bf56323ad6daf82c4aa1bde308b@dist-git> -From: Jiri Denemark -Date: Wed, 5 Apr 2017 14:44:26 +0200 -Subject: [PATCH] qemu: Don't reset TLS in qemuMigrationCancel - -Migration parameters are either reset by the main migration code path or -from qemuProcessRecoverMigration* in case libvirtd is restarted during -migration. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 133c73e75f278c4943cbe03333bb9a7ee897c23f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1425003 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index d8d89b011..6c9f14245 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -5560,9 +5560,6 @@ qemuMigrationCancel(virQEMUDriverPtr driver, - if (qemuDomainObjExitMonitor(driver, vm) < 0 || (storage && !blockJobs)) - goto endsyncjob; - -- ignore_value(qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_NONE, -- NULL, NULL)); -- - if (!storage) { - ret = 0; - goto cleanup; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationRun.patch b/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationRun.patch deleted file mode 100644 index 546f10f..0000000 --- a/SOURCES/libvirt-qemu-Don-t-reset-TLS-in-qemuMigrationRun.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0811efa2bcaae69e59fe09432083224e77eafa1d Mon Sep 17 00:00:00 2001 -Message-Id: <0811efa2bcaae69e59fe09432083224e77eafa1d@dist-git> -From: Jiri Denemark -Date: Wed, 5 Apr 2017 10:24:47 +0200 -Subject: [PATCH] qemu: Don't reset TLS in qemuMigrationRun - -Finished qemuMigrationRun does not mean the migration itself finished -(it might have just switched to post-copy mode). While resetting TLS -parameters is probably OK at this point even if migration is still -running, we want to consolidate the code which resets various migration -parameters. Thus qemuMigrationResetTLS will be called from the Confirm -phase (or at the end of the Perform phase in case of v2 protocol), when -migration is either canceled or finished. - -Signed-off-by: Jiri Denemark -(cherry picked from commit a88c250d8693ae198d42cf26e2b7b1e190e94637) - -https://bugzilla.redhat.com/show_bug.cgi?id=1425003 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 992b6bd4a..d8d89b011 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3216,6 +3216,9 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver, - qemuDomainEventQueue(driver, event); - } - -+ qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, -+ NULL, NULL); -+ - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) - VIR_WARN("Failed to save status on vm %s", vm->def->name); - } -@@ -3848,10 +3851,6 @@ qemuMigrationRun(virQEMUDriverPtr driver, - ret = -1; - } - -- if (qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, -- tlsAlias, secAlias) < 0) -- ret = -1; -- - VIR_FREE(tlsAlias); - VIR_FREE(secAlias); - virObjectUnref(cfg); -@@ -4827,6 +4826,13 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver, - if (ret < 0) - orig_err = virSaveLastError(); - -+ /* v2 proto has no confirm phase so we need to reset migration parameters -+ * here -+ */ -+ if (!v3proto && ret < 0) -+ qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, -+ NULL, NULL); -+ - if (qemuMigrationRestoreDomainState(conn, vm)) { - event = virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_RESUMED, --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Don-t-reset-events-migration-capability.patch b/SOURCES/libvirt-qemu-Don-t-reset-events-migration-capability.patch deleted file mode 100644 index 32c4544..0000000 --- a/SOURCES/libvirt-qemu-Don-t-reset-events-migration-capability.patch +++ /dev/null @@ -1,42 +0,0 @@ -From e94894df02d97bac7169433fdcf595bd526eafd1 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Fri, 28 Apr 2017 15:56:44 +0200 -Subject: [PATCH] qemu: Don't reset "events" migration capability - -When creating v3.2.0-77-g8be3ccd04 commit, I completely forgot that one -migration capability is very special. It's the "events" capability which -tells QEMU to report "MIGRATION" events. Since libvirt always wants the -events, it is enabled in qemuConnectMonitor and the rest of the code -should not touch it. - -https://bugzilla.redhat.com/show_bug.cgi?id=1439841 -https://bugzilla.redhat.com/show_bug.cgi?id=1441165 - -Messed-up-by: Jiri Denemark -Signed-off-by: Jiri Denemark -(cherry picked from commit fc48fc7930f560c4341f4afe1285848dfdb60278) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index cadbf9b97..ac7e27319 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -5888,6 +5888,11 @@ qemuMigrationReset(virQEMUDriverPtr driver, - goto cleanup; - - for (cap = 0; cap < QEMU_MONITOR_MIGRATION_CAPS_LAST; cap++) { -+ /* "events" capability is set (when supported) in qemuConnectMonitor -+ * and should never be cleared */ -+ if (cap == QEMU_MONITOR_MIGRATION_CAPS_EVENTS) -+ continue; -+ - if (qemuMigrationSetOption(driver, vm, cap, false, job) < 0) - goto cleanup; - } --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Don-t-try-to-use-hugepages-if-not-enabled.patch b/SOURCES/libvirt-qemu-Don-t-try-to-use-hugepages-if-not-enabled.patch deleted file mode 100644 index 3c17996..0000000 --- a/SOURCES/libvirt-qemu-Don-t-try-to-use-hugepages-if-not-enabled.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 893ebcda06c14d25dd195f53a1467fb243b43838 Mon Sep 17 00:00:00 2001 -Message-Id: <893ebcda06c14d25dd195f53a1467fb243b43838@dist-git> -From: Michal Privoznik -Date: Wed, 14 Jun 2017 16:58:13 +0200 -Subject: [PATCH] qemu: Don't try to use hugepages if not enabled - -https://bugzilla.redhat.com/show_bug.cgi?id=1214369 - -My fix 671d18594f4 was incomplete. If domain doesn't have -hugepages enabled, because of missing condition we would still be -putting hugepages path onto qemu cmd line. Clean up the -conditions so that it's more visible next time. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 1e8d6c6ef07a33ab338c2bf38fa017d4f2123335) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 12 +++++----- - .../qemuxml2argv-cpu-numa-memshared.args | 26 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 1 + - 3 files changed, 33 insertions(+), 6 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 5013d3149d..88223babeb 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3409,19 +3409,19 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, - def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) { - *backendType = "memory-backend-file"; - -- if (mem->nvdimmPath) { -+ if (pagesize) { -+ if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &memPath) < 0) -+ goto cleanup; -+ prealloc = true; -+ } else if (mem->nvdimmPath) { - if (VIR_STRDUP(memPath, mem->nvdimmPath) < 0) - goto cleanup; - prealloc = true; -- } else if (!pagesize && def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) { -+ } else { - /* We can have both pagesize and mem source. If that's the case, - * prefer hugepages as those are more specific. */ - if (VIR_STRDUP(memPath, cfg->memoryBackingDir) < 0) - goto cleanup; -- } else { -- if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &memPath) < 0) -- goto cleanup; -- prealloc = true; - } - - if (virJSONValueObjectAdd(props, -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args -new file mode 100644 -index 0000000000..677e17e7df ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args -@@ -0,0 +1,26 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu \ -+-name QEMUGuest1 \ -+-S \ -+-M pc \ -+-m 214 \ -+-smp 16,sockets=2,cores=4,threads=2 \ -+-object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ -+share=yes,size=112197632 \ -+-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ -+-object memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,\ -+share=no,size=112197632 \ -+-numa node,nodeid=1,cpus=8-15,memdev=ram-node1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot n \ -+-usb \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 98e70033ec..0745d3807a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1549,6 +1549,7 @@ mymain(void) - DO_TEST("cpu-numa-disjoint", QEMU_CAPS_NUMA); - DO_TEST_FAILURE("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_RAM); - DO_TEST_FAILURE("cpu-numa-memshared", NONE); -+ DO_TEST("cpu-numa-memshared", QEMU_CAPS_OBJECT_MEMORY_FILE); - DO_TEST("cpu-host-model", NONE); - DO_TEST("cpu-host-model-vendor", NONE); - skipLegacyCPUs = true; --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Drop-resume-label-in-qemuProcessRecoverMigrationOut.patch b/SOURCES/libvirt-qemu-Drop-resume-label-in-qemuProcessRecoverMigrationOut.patch deleted file mode 100644 index 65cb35b..0000000 --- a/SOURCES/libvirt-qemu-Drop-resume-label-in-qemuProcessRecoverMigrationOut.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 7e2bb20a6318c5e7a42b0fe417b6e12862c65d64 Mon Sep 17 00:00:00 2001 -Message-Id: <7e2bb20a6318c5e7a42b0fe417b6e12862c65d64@dist-git> -From: Jiri Denemark -Date: Tue, 4 Apr 2017 20:54:57 +0200 -Subject: [PATCH] qemu: Drop resume label in qemuProcessRecoverMigrationOut - -Let's use a bool variable to create a single shared path returning 0. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 3e803176a3d9242f6833687e305aebd7353ffaa3) - -https://bugzilla.redhat.com/show_bug.cgi?id=1425003 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 31 ++++++++++++++++--------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 0b9b4f76a..70b06a28f 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2998,6 +2998,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - bool postcopy = state == VIR_DOMAIN_PAUSED && - (reason == VIR_DOMAIN_PAUSED_POSTCOPY || - reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED); -+ bool resume = false; - - switch (phase) { - case QEMU_MIGRATION_PHASE_NONE: -@@ -3028,7 +3029,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - VIR_WARN("Could not cancel ongoing migration of domain %s", - vm->def->name); - } -- goto resume; -+ resume = true; - } - break; - -@@ -3051,7 +3052,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - } else { - VIR_DEBUG("Resuming domain %s after failed migration", - vm->def->name); -- goto resume; -+ resume = true; - } - break; - -@@ -3061,21 +3062,21 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - return -1; - } - -- return 0; -- -- resume: -- /* resume the domain but only if it was paused as a result of -- * migration -- */ -- if (state == VIR_DOMAIN_PAUSED && -- (reason == VIR_DOMAIN_PAUSED_MIGRATION || -- reason == VIR_DOMAIN_PAUSED_UNKNOWN)) { -- if (qemuProcessStartCPUs(driver, vm, conn, -- VIR_DOMAIN_RUNNING_UNPAUSED, -- QEMU_ASYNC_JOB_NONE) < 0) { -- VIR_WARN("Could not resume domain %s", vm->def->name); -+ if (resume) { -+ /* resume the domain but only if it was paused as a result of -+ * migration -+ */ -+ if (state == VIR_DOMAIN_PAUSED && -+ (reason == VIR_DOMAIN_PAUSED_MIGRATION || -+ reason == VIR_DOMAIN_PAUSED_UNKNOWN)) { -+ if (qemuProcessStartCPUs(driver, vm, conn, -+ VIR_DOMAIN_RUNNING_UNPAUSED, -+ QEMU_ASYNC_JOB_NONE) < 0) { -+ VIR_WARN("Could not resume domain %s", vm->def->name); -+ } - } - } -+ - return 0; - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Enable-NUMA-node-tag-in-pci-root-for-PPC64.patch b/SOURCES/libvirt-qemu-Enable-NUMA-node-tag-in-pci-root-for-PPC64.patch deleted file mode 100644 index b487bb8..0000000 --- a/SOURCES/libvirt-qemu-Enable-NUMA-node-tag-in-pci-root-for-PPC64.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 5832f82195c2b4144841645f90467cfb11d8d2a4 Mon Sep 17 00:00:00 2001 -Message-Id: <5832f82195c2b4144841645f90467cfb11d8d2a4@dist-git> -From: Shivaprasad G Bhat -Date: Thu, 3 Aug 2017 10:11:48 +0200 -Subject: [PATCH] qemu: Enable NUMA node tag in pci-root for PPC64 - -This patch addresses the same aspects on PPC the bug 1103314 addressed -on x86. - -PCI expander bus creates multiple primary PCI busses, where each of these -busses can be assigned a specific NUMA affinity, which, on x86 is -advertised through ACPI on a per-bus basis. - -For SPAPR, a PHB's NUMA affinities are assigned on a per-PHB basis, and -there is no mechanism for advertising NUMA affinities to a guest on a -per-bus basis. So, even if qemu-ppc manages to get some sort of multi-bus -topology working using PXB, there is no way to expose the affinities -of these busses to the guest. It can only be exposed on a per-PHB/per-domain -basis. - -So patch enables NUMA node tag in pci-root controller on PPC. - -The way to set the NUMA node is through the numa_node option of -spapr-pci-host-bridge device. However for the implicit PHB, the only way -to set the numa_node is from the -global option. The -global option applies -to all the PHBs unless explicitly specified with the option on the -respective PHB of CLI. The default PHB has the emulated devices only, so -the patch prevents setting the NUMA node for the default PHB. - -Signed-off-by: Shivaprasad G Bhat -Reviewed-by: Andrea Bolognani -(cherry picked from commit e5a0579996b96e74d12dd348cb73b6a0947f9a20) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1474327 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 5 ++- - src/conf/domain_conf.c | 9 +++- - src/qemu/qemu_command.c | 10 +++++ - src/qemu/qemu_domain.c | 13 +++--- - .../qemuxml2argv-pseries-default-phb-numa-node.xml | 29 ++++++++++++ - .../qemuxml2argv-pseries-phb-numa-node.args | 28 ++++++++++++ - .../qemuxml2argv-pseries-phb-numa-node.xml | 41 +++++++++++++++++ - tests/qemuxml2argvtest.c | 6 +++ - .../qemuxml2xmlout-pseries-phb-numa-node.xml | 52 ++++++++++++++++++++++ - tests/qemuxml2xmltest.c | 4 ++ - 10 files changed, 188 insertions(+), 9 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-default-phb-numa-node.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-numa-node.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index bc67a53408..5e747542fc 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3751,7 +3751,10 @@ - -
      node
      -
      -- pci-expander-bus controllers can have an -+ Some PCI controllers (pci-expander-bus for the pc -+ machine type, pcie-expander-bus for the q35 machine -+ type and, since 3.6.0, -+ pci-root for the pseries machine type) can have an - optional <node> subelement within - the <target> subelement, which is used to - set the NUMA node reported to the guest OS for that bus - the -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 5941a3a4c4..7ba2bc01ca 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -9314,8 +9314,15 @@ virDomainControllerDefParseXML(xmlNodePtr node, - goto error; - } - } -- if (numaNode >= 0) -+ if (numaNode >= 0) { -+ if (def->idx == 0) { -+ virReportError(VIR_ERR_XML_ERROR, "%s", -+ _("The PCI controller with index=0 can't " -+ "be associated with a NUMA node")); -+ goto error; -+ } - def->opts.pciopts.numaNode = numaNode; -+ } - break; - - default: -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index cb0eac4668..0437db0ba2 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3191,6 +3191,16 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - virBufferAsprintf(&buf, "%s,index=%d,id=%s", - modelName, def->opts.pciopts.targetIndex, - def->info.alias); -+ -+ if (def->opts.pciopts.numaNode != -1) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("the spapr-pci-host-bridge controller " -+ "doesn't support numa_node on this QEMU binary")); -+ goto error; -+ } -+ virBufferAsprintf(&buf, ",numa_node=%d", def->opts.pciopts.numaNode); -+ } - break; - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 916358ea1e..ff7efa609e 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3406,15 +3406,14 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - return -1; - } - -- /* if a PCI expander bus has a NUMA node set, make sure -- * that NUMA node is configured in the guest -- * array. NUMA cell id's in this array are numbered -+ /* if a PCI expander bus or pci-root on Pseries has a NUMA node -+ * set, make sure that NUMA node is configured in the guest -+ * array. NUMA cell id's in this array are numbered - * from 0 .. size-1. - */ -- if ((cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS || -- cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS) && -- (int) virDomainNumaGetNodeCount(def->numa) -- <= cont->opts.pciopts.numaNode) { -+ if (cont->opts.pciopts.numaNode >= 0 && -+ cont->opts.pciopts.numaNode >= -+ (int) virDomainNumaGetNodeCount(def->numa)) { - virReportError(VIR_ERR_XML_ERROR, - _("%s with index %d is " - "configured for a NUMA node (%d) " -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-default-phb-numa-node.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-default-phb-numa-node.xml -new file mode 100644 -index 0000000000..12d277aaf8 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-default-phb-numa-node.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 -+ 1048576 -+ 24 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-ppc64 -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.args -new file mode 100644 -index 0000000000..e69ff16d0e ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.args -@@ -0,0 +1,28 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-ppc64 \ -+-name QEMUGuest1 \ -+-S \ -+-M pseries \ -+-m 2048 \ -+-smp 8,sockets=2,cores=1,threads=4 \ -+-object memory-backend-ram,id=ram-node0,size=1073741824,host-nodes=1,\ -+policy=bind \ -+-numa node,nodeid=0,cpus=0-3,memdev=ram-node0 \ -+-object memory-backend-ram,id=ram-node1,size=1073741824,host-nodes=2,\ -+policy=bind \ -+-numa node,nodeid=1,cpus=4-7,memdev=ram-node1 \ -+-uuid 87eedafe-eedc-4336-8130-ed9fe5dc90c8 \ -+-nographic \ -+-nodefaults \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ -+-boot c \ -+-device spapr-pci-host-bridge,index=1,id=pci.1,numa_node=1 \ -+-device spapr-pci-host-bridge,index=2,id=pci.2 \ -+-device spapr-pci-host-bridge,index=3,id=pci.3,numa_node=0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.xml -new file mode 100644 -index 0000000000..aeccb14dfb ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-numa-node.xml -@@ -0,0 +1,41 @@ -+ -+ QEMUGuest1 -+ 87eedafe-eedc-4336-8130-ed9fe5dc90c8 -+ 2097152 -+ 8 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-ppc64 -+ -+ -+ -+ -+ -+ -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 2b9421cb7a..ee62e26309 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1761,6 +1761,12 @@ mymain(void) - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); - DO_TEST_PARSE_ERROR("pseries-phb-wrong-target-index", NONE); -+ DO_TEST("pseries-phb-numa-node", -+ QEMU_CAPS_NUMA, -+ QEMU_CAPS_OBJECT_MEMORY_RAM, -+ QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -+ QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE); -+ DO_TEST_PARSE_ERROR("pseries-default-phb-numa-node", NONE); - - DO_TEST("pseries-many-devices", - QEMU_CAPS_NODEFCONFIG, -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-numa-node.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-numa-node.xml -new file mode 100644 -index 0000000000..80b771e89d ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-numa-node.xml -@@ -0,0 +1,52 @@ -+ -+ QEMUGuest1 -+ 87eedafe-eedc-4336-8130-ed9fe5dc90c8 -+ 2097152 -+ 2097152 -+ 8 -+ -+ -+ -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-ppc64 -+ -+ -+ -+ -+ -+ -+ -+ -+ 1 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 6762145470..564da08707 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -672,6 +672,10 @@ mymain(void) - DO_TEST("pseries-phb-default-missing", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); -+ DO_TEST("pseries-phb-numa-node", -+ QEMU_CAPS_NUMA, -+ QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -+ QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE); - - DO_TEST("pseries-many-devices", - QEMU_CAPS_NODEFCONFIG, --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch b/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch new file mode 100644 index 0000000..e5a971b --- /dev/null +++ b/SOURCES/libvirt-qemu-Enable-configuration-of-HPT-resizing-for-pSeries-guests.patch @@ -0,0 +1,299 @@ +From 6d24efd64d6de00d29f8bf2329940c427f5cc6f9 Mon Sep 17 00:00:00 2001 +Message-Id: <6d24efd64d6de00d29f8bf2329940c427f5cc6f9@dist-git> +From: Andrea Bolognani +Date: Wed, 15 Nov 2017 10:28:54 +0100 +Subject: [PATCH] qemu: Enable configuration of HPT resizing for pSeries guests + +Most of the time it's okay to leave this up to negotiation between +the guest and the host, but in some situations it can be useful to +manually decide the behavior, especially to enforce its availability. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1308743 + +Signed-off-by: Andrea Bolognani +Reviewed-by: John Ferlan +(cherry picked from commit 85b2ae96dfcf7dc324d6782f64c848fa412443e4) +Signed-off-by: Andrea Bolognani +Signed-off-by: Jiri Denemark +--- + docs/schemas/domaincommon.rng | 15 ++++++++ + src/conf/domain_conf.c | 46 +++++++++++++++++++++++- + src/conf/domain_conf.h | 12 +++++++ + src/libvirt_private.syms | 1 + + src/qemu/qemu_capabilities.c | 8 +++++ + src/qemu/qemu_capabilities.h | 1 + + src/qemu/qemu_command.c | 20 +++++++++++ + src/qemu/qemu_domain.c | 8 +++++ + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + 9 files changed, 111 insertions(+), 1 deletion(-) + +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 710b3af7f7..367861c1ea 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -4722,6 +4722,9 @@ + + + ++ ++ ++ + + + +@@ -4910,6 +4913,18 @@ + + + ++ ++ ++ ++ ++ enabled ++ disabled ++ required ++ ++ ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index ca5d0bcc54..641a978f07 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -148,7 +148,9 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, + "vmport", + "gic", + "smm", +- "ioapic") ++ "ioapic", ++ "hpt", ++); + + VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, + "default", +@@ -877,6 +879,13 @@ VIR_ENUM_IMPL(virDomainIOAPIC, + "qemu", + "kvm") + ++VIR_ENUM_IMPL(virDomainHPTResizing, ++ VIR_DOMAIN_HPT_RESIZING_LAST, ++ "enabled", ++ "disabled", ++ "required", ++); ++ + /* Internal mapping: subset of block job types that can be present in + * XML (remaining types are not two-phase). */ + VIR_ENUM_DECL(virDomainBlockJob) +@@ -18765,6 +18774,22 @@ virDomainDefParseXML(xmlDocPtr xml, + } + break; + ++ case VIR_DOMAIN_FEATURE_HPT: ++ tmp = virXMLPropString(nodes[i], "resizing"); ++ if (tmp) { ++ int value = virDomainHPTResizingTypeFromString(tmp); ++ if (value < 0) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Unknown HPT resizing setting: %s"), ++ tmp); ++ goto error; ++ } ++ def->hpt_resizing = value; ++ def->features[val] = VIR_TRISTATE_SWITCH_ON; ++ VIR_FREE(tmp); ++ } ++ break; ++ + /* coverity[dead_error_begin] */ + case VIR_DOMAIN_FEATURE_LAST: + break; +@@ -20955,6 +20980,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, + return false; + } + ++ /* HPT resizing */ ++ if (src->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON) { ++ if (src->hpt_resizing != dst->hpt_resizing) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("HPT resizing configuration differs: " ++ "source: '%s', destination: '%s'"), ++ virDomainHPTResizingTypeToString(src->hpt_resizing), ++ virDomainHPTResizingTypeToString(dst->hpt_resizing)); ++ return false; ++ } ++ } ++ + return true; + } + +@@ -26204,6 +26241,13 @@ virDomainDefFormatInternal(virDomainDefPtr def, + } + break; + ++ case VIR_DOMAIN_FEATURE_HPT: ++ if (def->features[i] == VIR_TRISTATE_SWITCH_ON) { ++ virBufferAsprintf(buf, "\n", ++ virDomainHPTResizingTypeToString(def->hpt_resizing)); ++ } ++ break; ++ + /* coverity[dead_error_begin] */ + case VIR_DOMAIN_FEATURE_LAST: + break; +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 388fa92dda..f967e603d1 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1715,6 +1715,7 @@ typedef enum { + VIR_DOMAIN_FEATURE_GIC, + VIR_DOMAIN_FEATURE_SMM, + VIR_DOMAIN_FEATURE_IOAPIC, ++ VIR_DOMAIN_FEATURE_HPT, + + VIR_DOMAIN_FEATURE_LAST + } virDomainFeature; +@@ -1843,6 +1844,16 @@ typedef enum { + + VIR_ENUM_DECL(virDomainIOAPIC); + ++typedef enum { ++ VIR_DOMAIN_HPT_RESIZING_ENABLED = 0, ++ VIR_DOMAIN_HPT_RESIZING_DISABLED, ++ VIR_DOMAIN_HPT_RESIZING_REQUIRED, ++ ++ VIR_DOMAIN_HPT_RESIZING_LAST ++} virDomainHPTResizing; ++ ++VIR_ENUM_DECL(virDomainHPTResizing); ++ + /* Operating system configuration data & machine / arch */ + typedef struct _virDomainOSEnv virDomainOSEnv; + typedef virDomainOSEnv *virDomainOSEnvPtr; +@@ -2315,6 +2326,7 @@ struct _virDomainDef { + virGICVersion gic_version; + char *hyperv_vendor_id; + virDomainIOAPIC ioapic; ++ virDomainHPTResizing hpt_resizing; + + /* These options are of type virTristateSwitch: ON = keep, OFF = drop */ + int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST]; +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 6653f95722..8d1d4a896b 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -385,6 +385,7 @@ virDomainHostdevModeTypeToString; + virDomainHostdevRemove; + virDomainHostdevSubsysPCIBackendTypeToString; + virDomainHostdevSubsysTypeToString; ++virDomainHPTResizingTypeToString; + virDomainHubTypeFromString; + virDomainHubTypeToString; + virDomainHypervTypeFromString; +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 37a58b3640..3793f16590 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -443,6 +443,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + /* 270 */ + "vxhs", + "virtio-blk.num-queues", ++ "machine.pseries.resize-hpt", + ); + + +@@ -4780,6 +4781,13 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, + if (qemuCaps->version >= 2006000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); + ++ /* HPT resizing is supported since QEMU 2.10 on ppc64; unfortunately ++ * there's no sane way to probe for it */ ++ if (qemuCaps->version >= 2010000 && ++ ARCH_IS_PPC64(qemuCaps->arch)) { ++ virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); ++ } ++ + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) + goto cleanup; + +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index cacc2b77ed..f0e2e9016f 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -429,6 +429,7 @@ typedef enum { + /* 270 */ + QEMU_CAPS_VXHS, /* -drive file.driver=vxhs via query-qmp-schema */ + QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */ ++ QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */ + + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index e60f93083f..aa7079229f 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7566,6 +7566,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, + } + } + ++ if (def->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON) { ++ const char *str; ++ ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("HTP resizing is not supported by this " ++ "QEMU binary")); ++ goto cleanup; ++ } ++ ++ str = virDomainHPTResizingTypeToString(def->hpt_resizing); ++ if (!str) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Invalid setting for HPT resizing")); ++ goto cleanup; ++ } ++ ++ virBufferAsprintf(&buf, ",resize-hpt=%s", str); ++ } ++ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_LOADPARM)) + qemuAppendLoadparmMachineParm(&buf, def); +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 81f45516af..485e085cea 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3109,6 +3109,14 @@ qemuDomainDefVerifyFeatures(const virDomainDef *def) + return -1; + } + ++ if (def->features[VIR_DOMAIN_FEATURE_HPT] == VIR_TRISTATE_SWITCH_ON && ++ !qemuDomainIsPSeries(def)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ "%s", ++ _("HPT tuning is only supported for pSeries guests")); ++ return -1; ++ } ++ + return 0; + } + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index 0dfa20726c..b0ee3f1523 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -177,6 +177,7 @@ + + + ++ + 2010000 + 0 + (v2.10.0) +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Enforce-ACPI-UEFI-requirements.patch b/SOURCES/libvirt-qemu-Enforce-ACPI-UEFI-requirements.patch deleted file mode 100644 index ea7dca6..0000000 --- a/SOURCES/libvirt-qemu-Enforce-ACPI-UEFI-requirements.patch +++ /dev/null @@ -1,411 +0,0 @@ -From 00e9313798b4e830b372d0069fc211019d67f978 Mon Sep 17 00:00:00 2001 -Message-Id: <00e9313798b4e830b372d0069fc211019d67f978@dist-git> -From: Andrea Bolognani -Date: Tue, 4 Apr 2017 14:59:31 +0200 -Subject: [PATCH] qemu: Enforce ACPI, UEFI requirements - -Depending on the architecture, requirements for ACPI and UEFI can -be different; more specifically, while on x86 UEFI requires ACPI, -on aarch64 it's the other way around. - -Enforce these requirements when validating the domain, and make -the error message more accurate by mentioning that they're not -necessarily applicable to all architectures. - -Several aarch64 test cases had to be tweaked because they would -have failed the validation step otherwise. - -(cherry picked from commit 396ca36cb0be87bdf6c337bbc8098920eddea065) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1429509 - -Signed-off-by: Andrea Bolognani ---- - src/qemu/qemu_command.c | 20 ++++---------------- - src/qemu/qemu_domain.c | 20 ++++++++++++++++++++ - .../qemuxml2argv-aarch64-aavmf-virtio-mmio.args | 1 + - .../qemuxml2argv-aarch64-aavmf-virtio-mmio.xml | 1 - - .../qemuxml2argv-aarch64-cpu-passthrough.args | 1 + - .../qemuxml2argv-aarch64-cpu-passthrough.xml | 1 - - .../qemuxml2argv-aarch64-video-virtio-gpu-pci.args | 1 + - .../qemuxml2argv-aarch64-video-virtio-gpu-pci.xml | 3 --- - ...xml2argv-aarch64-virt-2.6-virtio-pci-default.args | 1 + - ...uxml2argv-aarch64-virt-2.6-virtio-pci-default.xml | 1 - - .../qemuxml2argv-aarch64-virt-default-nic.args | 1 + - .../qemuxml2argv-aarch64-virt-default-nic.xml | 3 --- - .../qemuxml2argv-aarch64-virt-virtio.args | 1 + - .../qemuxml2argv-aarch64-virt-virtio.xml | 1 - - .../qemuxml2argv-aarch64-virtio-pci-default.args | 1 + - .../qemuxml2argv-aarch64-virtio-pci-default.xml | 1 - - ...xml2argv-aarch64-virtio-pci-manual-addresses.args | 1 + - ...uxml2argv-aarch64-virtio-pci-manual-addresses.xml | 1 - - .../qemuxml2argv-balloon-mmio-deflate.args | 1 + - .../qemuxml2argv-balloon-mmio-deflate.xml | 1 - - .../qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml | 1 - - .../qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml | 1 - - .../qemuxml2xmlout-aarch64-virtio-pci-default.xml | 1 - - ...ml2xmlout-aarch64-virtio-pci-manual-addresses.xml | 1 - - 24 files changed, 33 insertions(+), 33 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 59fedaaaf..8ec4ec3a6 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9346,18 +9346,16 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager, - } - - --static int -+static void - qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, -- virDomainDefPtr def, -- virQEMUCapsPtr qemuCaps) -+ virDomainDefPtr def) - { -- int ret = -1; - virDomainLoaderDefPtr loader = def->os.loader; - virBuffer buf = VIR_BUFFER_INITIALIZER; - int unit = 0; - - if (!loader) -- return 0; -+ return; - - switch ((virDomainLoader) loader->type) { - case VIR_DOMAIN_LOADER_TYPE_ROM: -@@ -9366,12 +9364,6 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, - break; - - case VIR_DOMAIN_LOADER_TYPE_PFLASH: -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI) && -- def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("ACPI must be enabled in order to use UEFI")); -- goto cleanup; -- } - - if (loader->secure == VIR_TRISTATE_BOOL_YES) { - virCommandAddArgList(cmd, -@@ -9409,10 +9401,7 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, - break; - } - -- ret = 0; -- cleanup: - virBufferFreeAndReset(&buf); -- return ret; - } - - -@@ -9849,8 +9838,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, - if (qemuBuildCpuCommandLine(cmd, driver, def, qemuCaps) < 0) - goto error; - -- if (qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps) < 0) -- goto error; -+ qemuBuildDomainLoaderCommandLine(cmd, def); - - if (!migrateURI && !snapshot && qemuDomainAlignMemorySizes(def) < 0) - goto error; -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 9f165c1da..f383a6cf2 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2884,6 +2884,26 @@ qemuDomainDefValidate(const virDomainDef *def, - goto cleanup; - } - -+ /* On x86, UEFI requires ACPI */ -+ if (def->os.loader && -+ def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH && -+ ARCH_IS_X86(def->os.arch) && -+ def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("UEFI requires ACPI on this architecture")); -+ goto cleanup; -+ } -+ -+ /* On aarch64, ACPI requires UEFI */ -+ if (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON && -+ def->os.arch == VIR_ARCH_AARCH64 && -+ (!def->os.loader || -+ def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("ACPI requires UEFI on this architecture")); -+ goto cleanup; -+ } -+ - if (def->os.loader && - def->os.loader->secure == VIR_TRISTATE_BOOL_YES) { - /* These are the QEMU implementation limitations. But we -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -index bf4b2f793..68fb61b1e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml -index 8c7428cf8..5d7217307 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml -@@ -13,7 +13,6 @@ - - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -index 52d2112b8..9c8c001f1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml -index 4cdf387f3..0dda09504 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml -@@ -8,7 +8,6 @@ - hvm - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -index 76ee977a3..2f8c51610 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \ -+-no-acpi \ - -device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ - addr=0x1 \ - -device ioh3420,port=0x9,chassis=2,id=pci.2,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml -index 4b52a731b..d9a012893 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml -@@ -7,9 +7,6 @@ - - hvm - -- -- -- - - cortex-a57 - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -index df03c6e02..e99d412a7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml -index e745101f1..43bc0089c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml -@@ -12,7 +12,6 @@ - earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -index 29f65f6b9..47d77618b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -@@ -17,6 +17,7 @@ QEMU_AUDIO_DRV=none \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64-virt-default/monitor.sock,server,\ - nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml -index 3a6f098d0..17ddc9096 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml -@@ -4,9 +4,6 @@ - 1048576 - 1048576 - 1 -- -- -- - - cortex-a53 - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -index b5b010ca4..5fef3b488 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml -index ad3461512..2692e61c4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml -@@ -12,7 +12,6 @@ - earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -index 46ac51d50..23a5fffd0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml -index 2a84a9669..72bf0c95c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml -@@ -12,7 +12,6 @@ - earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -index 06403996e..54244fdcf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml -index 5e1b494ed..fee32588f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml -@@ -13,7 +13,6 @@ - - - -- - - - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -index 10d136258..e568e3c39 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \ - -nodefconfig \ - -nodefaults \ - -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ - -initrd /aarch64.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml -index 1b5b48c42..49b7d2c60 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml -@@ -12,7 +12,6 @@ - earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait - - -- - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml -index bea65990e..9e728300e 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml -@@ -13,7 +13,6 @@ - - - -- - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml -index 2c765e7c3..8590f485e 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml -@@ -8,7 +8,6 @@ - hvm - - -- - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -index 88a6a6a0c..e5496424b 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml -@@ -13,7 +13,6 @@ - - - -- - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml -index 83cf0d1f5..83d8dcc4a 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml -@@ -13,7 +13,6 @@ - - - -- - - - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch b/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch new file mode 100644 index 0000000..d2997ea --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-crash-in-offline-migration.patch @@ -0,0 +1,42 @@ +From e41b2f83ca98fe352e9901d99b5cb9bf62d79845 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Fri, 19 Jan 2018 14:33:16 +0100 +Subject: [PATCH] qemu: Fix crash in offline migration + +When migrating a shutoff domain (i.e., offline migration), we have no +statistics to report and thus jobInfo will be NULL in +qemuMigrationFinish. + +Broken by me in v3.10.0-183-ge8784e7868. + +https://bugzilla.redhat.com/show_bug.cgi?id=1536351 + +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +(cherry picked from commit bcc5710708ec90146b71bdb00d8705cb4a9e0088) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index b814cc6608..a50bb7206c 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5459,8 +5459,10 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + } + + if (dom) { +- VIR_STEAL_PTR(priv->job.completed, jobInfo); +- priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED; ++ if (jobInfo) { ++ VIR_STEAL_PTR(priv->job.completed, jobInfo); ++ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED; ++ } + + if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen, + QEMU_MIGRATION_COOKIE_STATS) < 0) +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-Fix-mdev-checking-for-VFIO-support.patch b/SOURCES/libvirt-qemu-Fix-mdev-checking-for-VFIO-support.patch deleted file mode 100644 index 535da81..0000000 --- a/SOURCES/libvirt-qemu-Fix-mdev-checking-for-VFIO-support.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0642cb0d5040df1e483752e15ba724fe04b3afca Mon Sep 17 00:00:00 2001 -Message-Id: <0642cb0d5040df1e483752e15ba724fe04b3afca@dist-git> -From: Erik Skultety -Date: Wed, 12 Apr 2017 13:07:14 +0200 -Subject: [PATCH] qemu: Fix mdev checking for VFIO support - -Commit a4a39d90 added a check that checks for VFIO support with mediated -devices. The problem is that the hostdev preparing functions behave like -a fallthrough if device of that specific type doesn't exist. However, -the check for VFIO support was independent of the existence of a mdev -device which caused the guest to fail to start with any device to be -directly assigned if VFIO was disabled/unavailable in the kernel. -The proposed change first ensures that it makes sense to check for VFIO -support in the first place, and only then performs the VFIO support check -itself. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1441291 - -(cherry picked from commit b4c2ac8d56124428d9329643a68625465094c5a7) -Signed-off-by: Erik Skultety ---- - src/qemu/qemu_hostdev.c | 17 +++++++++++++---- - 1 file changed, 13 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c -index 685bf5b59..73d26f4c6 100644 ---- a/src/qemu/qemu_hostdev.c -+++ b/src/qemu/qemu_hostdev.c -@@ -330,11 +330,20 @@ qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver, - int nhostdevs) - { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; -+ bool supportsVFIO = qemuHostdevHostSupportsPassthroughVFIO(); -+ size_t i; - -- if (!qemuHostdevHostSupportsPassthroughVFIO()) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("host doesn't support VFIO PCI interface")); -- return -1; -+ for (i = 0; i < nhostdevs; i++) { -+ if (hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && -+ hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) { -+ if (!supportsVFIO) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("Mediated host device assignment requires " -+ "VFIO support")); -+ return -1; -+ } -+ break; -+ } - } - - return virHostdevPrepareMediatedDevices(hostdev_mgr, QEMU_DRIVER_NAME, --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Fix-memory-leaks-in-qemuDomainSaveImageOpen.patch b/SOURCES/libvirt-qemu-Fix-memory-leaks-in-qemuDomainSaveImageOpen.patch deleted file mode 100644 index f9384ea..0000000 --- a/SOURCES/libvirt-qemu-Fix-memory-leaks-in-qemuDomainSaveImageOpen.patch +++ /dev/null @@ -1,55 +0,0 @@ -From a72554edcb64726b27ea51b4983ec8d9aaec4eaa Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 6 Jun 2017 22:27:57 +0200 -Subject: [PATCH] qemu: Fix memory leaks in qemuDomainSaveImageOpen - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit ac793bd7195ab99445cf6c6d6053439c56cef922) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c8a84503c1..5db92b04a1 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -6229,12 +6229,13 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - virReportSystemError(errno, - _("cannot remove corrupt file: %s"), - path); -- goto error; -+ } else { -+ fd = -3; - } -- return -3; -+ } else { -+ virReportError(VIR_ERR_OPERATION_FAILED, -+ "%s", _("failed to read qemu header")); - } -- virReportError(VIR_ERR_OPERATION_FAILED, -- "%s", _("failed to read qemu header")); - goto error; - } - -@@ -6249,9 +6250,10 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - virReportSystemError(errno, - _("cannot remove corrupt file: %s"), - path); -- goto error; -+ } else { -+ fd = -3; - } -- return -3; -+ goto error; - } - } - virReportError(VIR_ERR_OPERATION_FAILED, "%s", msg); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Fix-persistent-migration-of-transient-domains.patch b/SOURCES/libvirt-qemu-Fix-persistent-migration-of-transient-domains.patch deleted file mode 100644 index 2aa645f..0000000 --- a/SOURCES/libvirt-qemu-Fix-persistent-migration-of-transient-domains.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 82a4218a06697ee5beaa6ba76704b0156b1a806c Mon Sep 17 00:00:00 2001 -Message-Id: <82a4218a06697ee5beaa6ba76704b0156b1a806c@dist-git> -From: Jiri Denemark -Date: Tue, 2 May 2017 18:56:06 +0200 -Subject: [PATCH] qemu: Fix persistent migration of transient domains - -While fixing a bug with incorrectly freed memory in commit -v3.1.0-399-g5498aa29a, I accidentally broke persistent migration of -transient domains. Before adding qemuDomainDefCopy in the path, the code -just took NULL from vm->newDef and used it as the persistent def, which -resulted in no persistent XML being sent in the migration cookie. This -scenario is perfectly valid and the destination correctly handles it by -using the incoming live definition and storing it as the persistent one. - -After the mentioned commit libvirtd would just segfault in the described -scenario. - -https://bugzilla.redhat.com/show_bug.cgi?id=1446205 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 59307fade86fb74db1f8f572433962233f7ac123) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index ac7e27319..5bf9bd10f 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -3609,15 +3609,15 @@ qemuMigrationRun(virQEMUDriverPtr driver, - - if (flags & VIR_MIGRATE_PERSIST_DEST) { - if (persist_xml) { -- persistDef = qemuMigrationPrepareDef(driver, persist_xml, -- NULL, NULL); -- } else { -- persistDef = qemuDomainDefCopy(driver, vm->newDef, -- VIR_DOMAIN_XML_SECURE | -- VIR_DOMAIN_XML_MIGRATABLE); -+ if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml, -+ NULL, NULL))) -+ goto cleanup; -+ } else if (vm->newDef) { -+ if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef, -+ VIR_DOMAIN_XML_SECURE | -+ VIR_DOMAIN_XML_MIGRATABLE))) -+ goto cleanup; - } -- if (!persistDef) -- goto cleanup; - } - - mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Fix-qemuDomainGetBlockInfo-allocation-value-setting.patch b/SOURCES/libvirt-qemu-Fix-qemuDomainGetBlockInfo-allocation-value-setting.patch deleted file mode 100644 index 992be48..0000000 --- a/SOURCES/libvirt-qemu-Fix-qemuDomainGetBlockInfo-allocation-value-setting.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4370d50dff22e172b84e543018d0858b5a169880 Mon Sep 17 00:00:00 2001 -Message-Id: <4370d50dff22e172b84e543018d0858b5a169880@dist-git> -From: John Ferlan -Date: Wed, 12 Jul 2017 16:31:10 +0200 -Subject: [PATCH] qemu: Fix qemuDomainGetBlockInfo allocation value setting - -https://bugzilla.redhat.com/show_bug.cgi?id=1467826 - -Commit id 'b9b1aa639' was supposed to add logic to set the allocation -for sparse files when wr_highest_offset was zero; however, an unconditional -setting was done just prior. For block devices, this means allocation is -always returning 0 since 'actual-size' will be zero. - -Remove the unconditional setting and add the note about it being possible -to still be zero for block devices. As soon as the guest starts writing to -the volume, the allocation value will then be obtainable from qemu via -the wr_highest_offset. - -(cherry picked from commit fde654be5307a570b7b0f31537e18e70a274cd50) - -https://bugzilla.redhat.com/show_bug.cgi?id=1470127 [7.4.z - 0day] - -Signed-off-by: Jiri Denemark -(cherry picked from commit 0220b2fed9ab4b07f32e8ebe4ab048d64a27e948) - -https://bugzilla.redhat.com/show_bug.cgi?id=1473706 ---- - src/qemu/qemu_driver.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index a2fb41b91a..b6d72303ca 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -11715,10 +11715,9 @@ qemuDomainGetBlockInfo(virDomainPtr dom, - * Additionally, if qemu hasn't written to the file yet, then set the - * allocation to whatever qemu returned for physical (e.g. the "actual- - * size" from the json query) as that will match the expected allocation -- * value for this API. */ -+ * value for this API. NB: May still be 0 for block. */ - if (entry->physical == 0 || info->allocation == 0 || - info->allocation == entry->physical) { -- info->allocation = entry->physical; - if (info->allocation == 0) - info->allocation = entry->physical; - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Fix-regression-when-hyperv-vendor_id-feature-is-used.patch b/SOURCES/libvirt-qemu-Fix-regression-when-hyperv-vendor_id-feature-is-used.patch deleted file mode 100644 index 488fc3d..0000000 --- a/SOURCES/libvirt-qemu-Fix-regression-when-hyperv-vendor_id-feature-is-used.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 552fbd4c0707d08e4b67b64a462f0d1609a5ac38 Mon Sep 17 00:00:00 2001 -Message-Id: <552fbd4c0707d08e4b67b64a462f0d1609a5ac38@dist-git> -From: Jiri Denemark -Date: Thu, 6 Apr 2017 13:52:30 +0200 -Subject: [PATCH] qemu: Fix regression when hyperv/vendor_id feature is used - -qemuProcessVerifyHypervFeatures is supposed to check whether all -requested hyperv features were actually honored by QEMU/KVM. This is -done by checking the corresponding CPUID bits reported by the virtual -CPU. In other words, it doesn't work for string properties, such as -VIR_DOMAIN_HYPERV_VENDOR_ID (there is no CPUID bit we could check). We -could theoretically check all 96 bits corresponding to the vendor -string, but luckily we don't have to check the feature at all. If QEMU -is too old to support hyperv features, the domain won't even start. -Otherwise, it is always supported. - -Without this patch, libvirt refuses to start a domain which contains - - - - - - - -reporting internal error: "unknown CPU feature __kvm_hv_vendor_id. - -This regression was introduced by commit v3.1.0-186-ge9dbe7011, which -(by fixing the virCPUDataCheckFeature condition in -qemuProcessVerifyHypervFeatures) revealed an old bug in the feature -verification code. It's been there ever since the verification was -implemented by commit v1.3.3-rc1-5-g95bbe4bf5, which effectively did not -check VIR_DOMAIN_HYPERV_VENDOR_ID at all. - -https://bugzilla.redhat.com/show_bug.cgi?id=1439424 - -Signed-off-by: Jiri Denemark -(cherry picked from commit ae102b5d7bccd29bc6015a3e0acefeaa90d097ac) - -https://bugzilla.redhat.com/show_bug.cgi?id=1439736 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index a20beb13c..039b3911c 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3793,6 +3793,10 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, - int rc; - - for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { -+ /* always supported string property */ -+ if (i == VIR_DOMAIN_HYPERV_VENDOR_ID) -+ continue; -+ - if (def->hyperv_features[i] != VIR_TRISTATE_SWITCH_ON) - continue; - -@@ -3821,13 +3825,13 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, - case VIR_DOMAIN_HYPERV_SYNIC: - case VIR_DOMAIN_HYPERV_STIMER: - case VIR_DOMAIN_HYPERV_RESET: -- case VIR_DOMAIN_HYPERV_VENDOR_ID: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("host doesn't support hyperv '%s' feature"), - virDomainHypervTypeToString(i)); - return -1; - - /* coverity[dead_error_begin] */ -+ case VIR_DOMAIN_HYPERV_VENDOR_ID: - case VIR_DOMAIN_HYPERV_LAST: - break; - } --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Fix-resource-leak-in-qemuDomainAddChardevTLSObjects-error-path.patch b/SOURCES/libvirt-qemu-Fix-resource-leak-in-qemuDomainAddChardevTLSObjects-error-path.patch deleted file mode 100644 index aa7ab0d..0000000 --- a/SOURCES/libvirt-qemu-Fix-resource-leak-in-qemuDomainAddChardevTLSObjects-error-path.patch +++ /dev/null @@ -1,55 +0,0 @@ -From f032a2a22052128bd0b3d41d2b5574ce27259eef Mon Sep 17 00:00:00 2001 -Message-Id: -From: John Ferlan -Date: Mon, 3 Apr 2017 12:53:33 -0400 -Subject: [PATCH] qemu: Fix resource leak in qemuDomainAddChardevTLSObjects - error path - -On any failure, call virJSONValueFree for the *Props. - -Signed-off-by: John Ferlan -(cherry picked from commit 2e8c60958ac32624296eee263bf34bb21a32360c) - -https://bugzilla.redhat.com/show_bug.cgi?id=1300769 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index dabfe10c0..fcd3a38a1 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -213,7 +213,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver, - cfg->migrateTLSx509verify, - QEMU_MIGRATION_TLS_ALIAS_BASE, - &tlsProps, tlsAlias, &secProps, secAlias) < 0) -- return -1; -+ goto error; - - /* Ensure the domain doesn't already have the TLS objects defined... - * This should prevent any issues just in case some cleanup wasn't -@@ -223,12 +223,17 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver, - - if (qemuDomainAddTLSObjects(driver, vm, asyncJob, *secAlias, &secProps, - *tlsAlias, &tlsProps) < 0) -- return -1; -+ goto error; - - if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0) -- return -1; -+ goto error; - - return 0; -+ -+ error: -+ virJSONValueFree(tlsProps); -+ virJSONValueFree(secProps); -+ return -1; - } - - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Fix-serial-stub-console-allocation.patch b/SOURCES/libvirt-qemu-Fix-serial-stub-console-allocation.patch deleted file mode 100644 index 1cd4a56..0000000 --- a/SOURCES/libvirt-qemu-Fix-serial-stub-console-allocation.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 096f83e7910c2c8553044d27918955b278e5ab8d Mon Sep 17 00:00:00 2001 -Message-Id: <096f83e7910c2c8553044d27918955b278e5ab8d@dist-git> -From: Erik Skultety -Date: Wed, 7 Jun 2017 14:29:29 +0200 -Subject: [PATCH] qemu: Fix serial stub console allocation - -When adding the aliased serial stub console, the structure wasn't -properly allocated (VIR_ALLOC instead of virDomainChrDefNew) which then -resulted in SIGSEGV in virDomainChrSourceIsEqual during a serial device -coldplug. - -https://bugzilla.redhat.com/show_bug.cgi?id=1434278 - -Signed-off-by: Erik Skultety -(cherry picked from commit ff6e94de60b081ae7e9d304e38c63346828c5dbe) -Signed-off-by: Erik Skultety -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_hotplug.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index cdeb0617a7..094a5644e0 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1802,15 +1802,17 @@ qemuDomainChrPreInsert(virDomainDefPtr vmdef, - if (virDomainChrPreAlloc(vmdef, chr) < 0) - return -1; - -- /* Due to some crazy backcompat stuff, the first serial device is an alias -- * to the first console too. If this is the case, the definition must be -- * duplicated as first console device. */ -+ /* Due to historical reasons, the first console is an alias to the -+ * first serial device (if such exists). If this is the case, we need to -+ * create an object for the first console as well. -+ */ - if (vmdef->nserials == 0 && vmdef->nconsoles == 0 && - chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { - if (!vmdef->consoles && VIR_ALLOC(vmdef->consoles) < 0) - return -1; - -- if (VIR_ALLOC(vmdef->consoles[0]) < 0) { -+ /* We'll be dealing with serials[0] directly, so NULL is fine here. */ -+ if (!(vmdef->consoles[0] = virDomainChrDefNew(NULL))) { - VIR_FREE(vmdef->consoles); - return -1; - } -@@ -1841,7 +1843,7 @@ qemuDomainChrInsertPreAllocCleanup(virDomainDefPtr vmdef, - /* Remove the stub console added by qemuDomainChrPreInsert */ - if (vmdef->nserials == 0 && vmdef->nconsoles == 1 && - chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { -- VIR_FREE(vmdef->consoles[0]); -+ virDomainChrDefFree(vmdef->consoles[0]); - VIR_FREE(vmdef->consoles); - vmdef->nconsoles = 0; - } --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch b/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch new file mode 100644 index 0000000..e473be6 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-type-of-a-completed-job.patch @@ -0,0 +1,58 @@ +From 92867e9b9ff1d9a163c6c166e710ba7c444be520 Mon Sep 17 00:00:00 2001 +Message-Id: <92867e9b9ff1d9a163c6c166e710ba7c444be520@dist-git> +From: Jiri Denemark +Date: Thu, 11 Jan 2018 20:47:50 +0100 +Subject: [PATCH] qemu: Fix type of a completed job + +Libvirt 3.7.0 and earlier libvirt reported a migration job as completed +immediately after QEMU finished sending migration data at which point +migration was not really complete yet. Commit v3.7.0-29-g3f2d6d829e +fixed this, but caused a regression in reporting statistics for +completed jobs which started reporting the job as still running. This +happened because the completed job statistics including the job status +are copied from the running job before we finally mark it as completed. + +Let's make sure QEMU_DOMAIN_JOB_STATUS_COMPLETED is always set in the +completed job info even when the job has not finished yet. + +https://bugzilla.redhat.com/show_bug.cgi?id=1523036 + +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +(cherry picked from commit e8784e7868d44a2ce796b376cf78f0f6c61c114a) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_migration.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index af744661f4..b814cc6608 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -1623,8 +1623,10 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, + qemuDomainJobInfoUpdateTime(jobInfo); + qemuDomainJobInfoUpdateDowntime(jobInfo); + VIR_FREE(priv->job.completed); +- if (VIR_ALLOC(priv->job.completed) == 0) ++ if (VIR_ALLOC(priv->job.completed) == 0) { + *priv->job.completed = *jobInfo; ++ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED; ++ } + + if (asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT && + jobInfo->status == QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED) +@@ -5457,8 +5459,9 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + } + + if (dom) { +- priv->job.completed = jobInfo; +- jobInfo = NULL; ++ VIR_STEAL_PTR(priv->job.completed, jobInfo); ++ priv->job.completed->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED; ++ + if (qemuMigrationBakeCookie(mig, driver, vm, cookieout, cookieoutlen, + QEMU_MIGRATION_COOKIE_STATS) < 0) + VIR_WARN("Unable to encode migration cookie"); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Format-additional-PHBs-on-the-command-line.patch b/SOURCES/libvirt-qemu-Format-additional-PHBs-on-the-command-line.patch deleted file mode 100644 index a580cb2..0000000 --- a/SOURCES/libvirt-qemu-Format-additional-PHBs-on-the-command-line.patch +++ /dev/null @@ -1,104 +0,0 @@ -From c7a41d3b282e1d2c0ea498f1e72e89a78178243c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:13 +0200 -Subject: [PATCH] qemu: Format additional PHBs on the command line - -Additional PHBs (pci-root controllers) will be created for -the guest using the spapr-pci-host-bridge QEMU device, if -available; the implicit default PHB, while present in the -guest configuration, will be skipped. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit d54bc07820a12eb6ac9268c547c34690406a3667) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 46 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 0176f0d63f..cb0eac4668 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -3158,6 +3158,40 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - def->opts.pciopts.numaNode); - break; - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: -+ if (def->opts.pciopts.modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE || -+ def->opts.pciopts.targetIndex == -1) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -+ _("autogenerated pci-root options not set")); -+ goto error; -+ } -+ -+ /* Skip the implicit one */ -+ if (def->opts.pciopts.targetIndex == 0) -+ goto done; -+ -+ modelName = virDomainControllerPCIModelNameTypeToString(def->opts.pciopts.modelName); -+ if (!modelName) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("unknown pci-root model name value %d"), -+ def->opts.pciopts.modelName); -+ goto error; -+ } -+ if (def->opts.pciopts.modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("PCI controller model name '%s' is not valid for a pci-root"), -+ modelName); -+ goto error; -+ } -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("the spapr-pci-host-bridge controller " -+ "is not supported in this QEMU binary")); -+ goto error; -+ } -+ virBufferAsprintf(&buf, "%s,index=%d,id=%s", -+ modelName, def->opts.pciopts.targetIndex, -+ def->info.alias); -+ break; - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", -@@ -3207,6 +3241,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - if (virBufferCheckError(&buf) < 0) - goto error; - -+ done: - *devstr = virBufferContentAndReset(&buf); - return 0; - -@@ -3264,11 +3299,19 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, - continue; - } - -- /* skip pci-root/pcie-root */ -+ /* skip pcie-root */ - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && -- (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || -- cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT)) -+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { - continue; -+ } -+ -+ /* Skip pci-root, except for pSeries guests (which actually -+ * support more than one PCI Host Bridge per guest) */ -+ if (!qemuDomainIsPSeries(def) && -+ cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && -+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { -+ continue; -+ } - - /* first SATA controller on Q35 machines is implicit */ - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA && --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch b/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch new file mode 100644 index 0000000..4e3fa17 --- /dev/null +++ b/SOURCES/libvirt-qemu-Format-targetModel-for-serial-devices.patch @@ -0,0 +1,78 @@ +From 506c50ee610cae51d09bf7e26af850a395da0e1f Mon Sep 17 00:00:00 2001 +Message-Id: <506c50ee610cae51d09bf7e26af850a395da0e1f@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:10 +0100 +Subject: [PATCH] qemu: Format targetModel for serial devices + +Now that we've created a distinction between target type and target +model, with the latter being the concrete device name, it's time to +switch to formatting the model instead of the type. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 7c76c30465ff6038df3b7aa27b40a3348ec599c9) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 8142834afd..7fd2afb1e0 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -10346,8 +10346,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + serial->info.alias); + } + } else { +- switch ((virDomainChrSerialTargetType) serial->targetType) { +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ switch ((virDomainChrSerialTargetModel) serial->targetModel) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("usb-serial is not supported in this QEMU binary")); +@@ -10355,10 +10355,10 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + } + break; + +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: + break; + +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_SERIAL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("pci-serial is not supported with this QEMU binary")); +@@ -10366,19 +10366,19 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + } + break; + +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: + /* Except from _LAST, which is just a guard value and will never + * be used, all of the above are platform devices, which means + * qemuBuildSerialCommandLine() will have taken the appropriate + * branch and we will not have ended up here. */ + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", +- _("Invalid target type for serial device")); ++ _("Invalid target model for serial device")); + goto error; + } + + virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s", +- virDomainChrSerialTargetTypeToString(serial->targetType), ++ virDomainChrSerialTargetModelTypeToString(serial->targetModel), + serial->info.alias, serial->info.alias); + } + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Handle-host-devices-not-being-available-better.patch b/SOURCES/libvirt-qemu-Handle-host-devices-not-being-available-better.patch deleted file mode 100644 index 29cd4d8..0000000 --- a/SOURCES/libvirt-qemu-Handle-host-devices-not-being-available-better.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 819c3b24c77321202d820bbe08963f313035cb3c Mon Sep 17 00:00:00 2001 -Message-Id: <819c3b24c77321202d820bbe08963f313035cb3c@dist-git> -From: Andrea Bolognani -Date: Mon, 28 Aug 2017 16:59:14 +0200 -Subject: [PATCH] qemu: Handle host devices not being available better - -We can't retrieve the isolation group of a device that's not present -in the system. However, it's very common for VFs to be created late -in the boot, so they might not be present yet when libvirtd starts, -which would cause the guests using them to disappear. - -Moreover, for other architectures and even ppc64 before isolation -groups were introduced, it's considered perfectly fine to configure a -guest to use a device that's not yet (or no longer) available to the -host, with the obvious caveat that such a guest won't be able to -start before the device is available. - -In order to be consistent, when a device's isolation group can't be -determined fall back to not isolating it rather than erroring out or, -worse, making the guest disappear. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1484254 - -Signed-off-by: Andrea Bolognani -(cherry picked from commit 1f43393283ff04d1a3905abb3669cdd5665610b4) - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain_address.c | 29 +++++++++++------------------ - 1 file changed, 11 insertions(+), 18 deletions(-) - -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 3d5e7cc442..4fa17c76b5 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -977,8 +977,6 @@ int - qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - virDomainDeviceDefPtr dev) - { -- int ret = -1; -- - /* Only host devices need their isolation group to be different from - * the default. Interfaces of type hostdev are just host devices in - * disguise, but we don't need to handle them separately because for -@@ -1007,12 +1005,11 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - tmp = virPCIDeviceAddressGetIOMMUGroupNum(hostAddr); - - if (tmp < 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Can't look up isolation group for host device " -- "%04x:%02x:%02x.%x"), -- hostAddr->domain, hostAddr->bus, -- hostAddr->slot, hostAddr->function); -- goto cleanup; -+ VIR_WARN("Can't look up isolation group for host device " -+ "%04x:%02x:%02x.%x, device won't be isolated", -+ hostAddr->domain, hostAddr->bus, -+ hostAddr->slot, hostAddr->function); -+ goto skip; - } - - /* The isolation group for a host device is its IOMMU group, -@@ -1052,12 +1049,11 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - tmp = qemuDomainFindUnusedIsolationGroup(def); - - if (tmp == 0) { -- virReportError(VIR_ERR_INTERNAL_ERROR, -- _("Can't obtain usable isolation group for " -- "interface configured to use hostdev-backed " -- "network '%s'"), -- iface->data.network.name); -- goto cleanup; -+ VIR_WARN("Can't obtain usable isolation group for interface " -+ "configured to use hostdev-backed network '%s', " -+ "device won't be isolated", -+ iface->data.network.name); -+ goto skip; - } - - info->isolationGroup = tmp; -@@ -1068,10 +1064,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - } - - skip: -- ret = 0; -- -- cleanup: -- return ret; -+ return 0; - } - - --- -2.14.1 - diff --git a/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch b/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch new file mode 100644 index 0000000..650b157 --- /dev/null +++ b/SOURCES/libvirt-qemu-Ignore-fallback-CPU-attribute-on-reconnect.patch @@ -0,0 +1,40 @@ +From 267d4074f4c6a543643e1fe8cd726953273a5bc6 Mon Sep 17 00:00:00 2001 +Message-Id: <267d4074f4c6a543643e1fe8cd726953273a5bc6@dist-git> +From: Jiri Denemark +Date: Wed, 10 Jan 2018 15:56:21 +0100 +Subject: [PATCH] qemu: Ignore fallback CPU attribute on reconnect + +When reconnecting to a running domain with host-model CPU started by old +libvirt which did not store the actual CPU in the status XML, we need to +ignore the fallback attribute to make sure we can translate the detected +host CPU model to a model which is supported by the running QEMU. + +https://bugzilla.redhat.com/show_bug.cgi?id=1532980 + +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +(cherry picked from commit 237f045d9a9d84a52e645b490d14ad0b66e5b8ed) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 701528c42c..c64088e4ca 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -3884,6 +3884,11 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver, + virDomainCapsCPUModelsPtr models = NULL; + int ret = -1; + ++ /* The host CPU model comes from host caps rather than QEMU caps so ++ * fallback must be allowed no matter what the user specified in the XML. ++ */ ++ vm->def->cpu->fallback = VIR_CPU_FALLBACK_ALLOW; ++ + if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0) + goto cleanup; + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Ignore-missing-query-migrate-parameters.patch b/SOURCES/libvirt-qemu-Ignore-missing-query-migrate-parameters.patch deleted file mode 100644 index f178208..0000000 --- a/SOURCES/libvirt-qemu-Ignore-missing-query-migrate-parameters.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 2d8e0d2cc979534be0149841e8bed07c0a4ba048 Mon Sep 17 00:00:00 2001 -Message-Id: <2d8e0d2cc979534be0149841e8bed07c0a4ba048@dist-git> -From: Jiri Denemark -Date: Thu, 27 Apr 2017 10:38:41 +0200 -Subject: [PATCH] qemu: Ignore missing query-migrate-parameters - -Migration with old QEMU which does not support query-migrate-parameters -would fail because the QMP command is called unconditionally since the -introduction of TLS migration. Previously it was only called if the user -explicitly requested a feature which uses QEMU migration parameters. And -even then the situation was not ideal, instead of reporting an -unsupported feature we'd just complain about missing QMP command. - -Trivially no migration parameters are supported when -query-migrate-parameters QMP command is missing. There's no need to -report an error if it is missing, the callers will report better error -if needed. - -https://bugzilla.redhat.com/show_bug.cgi?id=1441934 - -Signed-off-by: Jiri Denemark -(cherry picked from commit ac58c036065ff1d53bc05b796093287c27c71762) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index 405f79fec..601aa3e74 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -2666,6 +2666,11 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - -+ if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { -+ ret = 0; -+ goto cleanup; -+ } -+ - if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Implement-virSaveCookie-object-and-callbacks.patch b/SOURCES/libvirt-qemu-Implement-virSaveCookie-object-and-callbacks.patch deleted file mode 100644 index fa0ffbe..0000000 --- a/SOURCES/libvirt-qemu-Implement-virSaveCookie-object-and-callbacks.patch +++ /dev/null @@ -1,166 +0,0 @@ -From e43851128b407dea2a55a813bdbefc5a639f1914 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Fri, 2 Jun 2017 22:50:18 +0200 -Subject: [PATCH] qemu: Implement virSaveCookie object and callbacks - -This patch implements a new save cookie object and callbacks for qemu -driver. The actual useful content will be added in the object later. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 215476b64226275ac090ca0e957bfca76ba1549e) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Conflicts: - src/qemu/qemu_domain.c - no qemuDomainLogContextClass in 7.4 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_conf.c | 2 +- - src/qemu/qemu_domain.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_domain.h | 9 ++++++ - 3 files changed, 93 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c -index 96956b7779..51a42883dc 100644 ---- a/src/qemu/qemu_conf.c -+++ b/src/qemu/qemu_conf.c -@@ -909,7 +909,7 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver) - &virQEMUDriverPrivateDataCallbacks, - &virQEMUDriverDomainXMLNamespace, - &virQEMUDriverDomainABIStability, -- NULL); -+ &virQEMUDriverDomainSaveCookie); - } - - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 09903bdd5f..63fcde8024 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -120,6 +120,24 @@ struct _qemuDomainLogContext { - virLogManagerPtr manager; - }; - -+static virClassPtr qemuDomainSaveCookieClass; -+ -+static void qemuDomainSaveCookieDispose(void *obj); -+ -+static int -+qemuDomainOnceInit(void) -+{ -+ if (!(qemuDomainSaveCookieClass = virClassNew(virClassForObject(), -+ "qemuDomainSaveCookie", -+ sizeof(qemuDomainSaveCookie), -+ qemuDomainSaveCookieDispose))) -+ return -1; -+ -+ return 0; -+} -+ -+VIR_ONCE_GLOBAL_INIT(qemuDomain) -+ - const char * - qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, - int phase ATTRIBUTE_UNUSED) -@@ -9080,3 +9098,68 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr, - VIR_FREE(target); - return src; - } -+ -+ -+static void -+qemuDomainSaveCookieDispose(void *obj) -+{ -+ qemuDomainSaveCookiePtr cookie = obj; -+ -+ VIR_DEBUG("cookie=%p", cookie); -+} -+ -+ -+qemuDomainSaveCookiePtr -+qemuDomainSaveCookieNew(virDomainObjPtr vm ATTRIBUTE_UNUSED) -+{ -+ qemuDomainSaveCookiePtr cookie = NULL; -+ -+ if (qemuDomainInitialize() < 0) -+ goto error; -+ -+ if (!(cookie = virObjectNew(qemuDomainSaveCookieClass))) -+ goto error; -+ -+ VIR_DEBUG("Save cookie %p", cookie); -+ -+ return cookie; -+ -+ error: -+ virObjectUnref(cookie); -+ return NULL; -+} -+ -+ -+static int -+qemuDomainSaveCookieParse(xmlXPathContextPtr ctxt ATTRIBUTE_UNUSED, -+ virObjectPtr *obj) -+{ -+ qemuDomainSaveCookiePtr cookie = NULL; -+ -+ if (qemuDomainInitialize() < 0) -+ goto error; -+ -+ if (!(cookie = virObjectNew(qemuDomainSaveCookieClass))) -+ goto error; -+ -+ *obj = (virObjectPtr) cookie; -+ return 0; -+ -+ error: -+ virObjectUnref(cookie); -+ return -1; -+} -+ -+ -+static int -+qemuDomainSaveCookieFormat(virBufferPtr buf ATTRIBUTE_UNUSED, -+ virObjectPtr obj ATTRIBUTE_UNUSED) -+{ -+ return 0; -+} -+ -+ -+virSaveCookieCallbacks virQEMUDriverDomainSaveCookie = { -+ .parse = qemuDomainSaveCookieParse, -+ .format = qemuDomainSaveCookieFormat, -+}; -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 4db92fac8a..80d80e4554 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -416,6 +416,14 @@ struct qemuProcessEvent { - typedef struct _qemuDomainLogContext qemuDomainLogContext; - typedef qemuDomainLogContext *qemuDomainLogContextPtr; - -+typedef struct _qemuDomainSaveCookie qemuDomainSaveCookie; -+typedef qemuDomainSaveCookie *qemuDomainSaveCookiePtr; -+struct _qemuDomainSaveCookie { -+ virObject parent; -+}; -+ -+qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm); -+ - const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, - int phase); - int qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job, -@@ -640,6 +648,7 @@ extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks; - extern virDomainXMLNamespace virQEMUDriverDomainXMLNamespace; - extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig; - extern virDomainABIStability virQEMUDriverDomainABIStability; -+extern virSaveCookieCallbacks virQEMUDriverDomainSaveCookie; - - int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, - virDomainObjPtr vm, int asyncJob); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch b/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch new file mode 100644 index 0000000..f14a292 --- /dev/null +++ b/SOURCES/libvirt-qemu-Improve-qemuDomainChrTargetDefValidate.patch @@ -0,0 +1,104 @@ +From 04e24e8cb39c0a3b3d3203985fa0ec824195d1ab Mon Sep 17 00:00:00 2001 +Message-Id: <04e24e8cb39c0a3b3d3203985fa0ec824195d1ab@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:06 +0100 +Subject: [PATCH] qemu: Improve qemuDomainChrTargetDefValidate() + +Instead of validating each target type / address type combination +separately, create a small helper to perform the matching and +collapse all existing checks into a single one. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 9ae116eadf7578282d284635fa23a4265b8db734) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 50 ++++++++++++++++++++++++++++++-------------------- + 1 file changed, 30 insertions(+), 20 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 35eb19ca32..bb25255b94 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3456,43 +3456,53 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def) + } + + ++static int ++qemuDomainChrSerialTargetTypeToAddressType(int targetType) ++{ ++ switch ((virDomainChrSerialTargetType) targetType) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: ++ break; ++ } ++ ++ return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; ++} ++ ++ + static int + qemuDomainChrTargetDefValidate(const virDomainDef *def, + const virDomainChrDef *chr) + { ++ int expected; ++ + switch ((virDomainChrDeviceType) chr->deviceType) { + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + + /* Validate target type */ + switch ((virDomainChrSerialTargetType) chr->targetType) { + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ + /* Hack required until we have a proper type for pSeries + * serial consoles */ + if (qemuDomainIsPSeries(def)) + return 0; + +- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("isa-serial requires address of isa type")); +- return -1; +- } +- break; ++ expected = qemuDomainChrSerialTargetTypeToAddressType(chr->targetType); + +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("usb-serial requires address of usb type")); +- return -1; +- } +- break; +- +- case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: +- if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("pci-serial requires address of pci type")); ++ chr->info.type != expected) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Target type '%s' requires address type '%s'"), ++ virDomainChrSerialTargetTypeToString(chr->targetType), ++ virDomainDeviceAddressTypeToString(expected)); + return -1; + } + break; +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE.patch b/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE.patch deleted file mode 100644 index 3fc7eed..0000000 --- a/SOURCES/libvirt-qemu-Introduce-QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 98d79ca81f46f411730849700e80b0468f847242 Mon Sep 17 00:00:00 2001 -Message-Id: <98d79ca81f46f411730849700e80b0468f847242@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:11 +0200 -Subject: [PATCH] qemu: Introduce QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE - -This new capability can be used to detect whether a QEMU -binary supports the spapr-pci-host-bridge controller. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 2e7d49169670a172197f86318a839eee54ddcb72) - -Conflicts: - - * src/qemu/qemu_capabilities.c, - src/qemu/qemu_capabilities.h: - - caused by 04b1d5d192055267c0e8fb826864bd92c7726495 not - being in the tree, and QEMU_CAPS_LOADPARM being missing - as a consequence of that. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 ++ - src/qemu/qemu_capabilities.h | 1 + - tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 60281373f0..daf0c42c9a 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -376,6 +376,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "intel-iommu.device-iotlb", /* 260 */ - "virtio.iommu_platform", - "virtio.ats", -+ "spapr-pci-host-bridge", - ); - - -@@ -1620,6 +1621,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { - { "nvdimm", QEMU_CAPS_DEVICE_NVDIMM }, - { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, - { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, -+ { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, - }; - - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 5b8e654d10..f0739117d2 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -415,6 +415,7 @@ typedef enum { - QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, /* intel-iommu.device-iotlb */ - QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */ - QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */ -+ QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, /* -device spapr-pci-host-bridge */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -index 6d031f6f70..cd3c0b5aa6 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -@@ -163,6 +163,7 @@ - - - -+ - 2006000 - 0 - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Introduce-functions-for-input-device-cgroup-manipulation.patch b/SOURCES/libvirt-qemu-Introduce-functions-for-input-device-cgroup-manipulation.patch new file mode 100644 index 0000000..47d5789 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-functions-for-input-device-cgroup-manipulation.patch @@ -0,0 +1,85 @@ +From 0a7264a2f791329f1c041594dfc17328040b8299 Mon Sep 17 00:00:00 2001 +Message-Id: <0a7264a2f791329f1c041594dfc17328040b8299@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Mon, 27 Nov 2017 14:21:00 +0100 +Subject: [PATCH] qemu: Introduce functions for input device cgroup + manipulation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Export qemuSetupInputCgroup and introduce qemuTeardownInputCgroup +for hotunplug. + +(cherry picked from commit f29612fd353db074a0b963ed53ef9c29c562bb36) + +https://bugzilla.redhat.com/show_bug.cgi?id=1509866 + +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_cgroup.c | 25 ++++++++++++++++++++++++- + src/qemu/qemu_cgroup.h | 4 ++++ + 2 files changed, 28 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c +index 0f75e22f98..19252ea239 100644 +--- a/src/qemu/qemu_cgroup.c ++++ b/src/qemu/qemu_cgroup.c +@@ -246,7 +246,7 @@ qemuSetupTPMCgroup(virDomainObjPtr vm) + } + + +-static int ++int + qemuSetupInputCgroup(virDomainObjPtr vm, + virDomainInputDefPtr dev) + { +@@ -269,6 +269,29 @@ qemuSetupInputCgroup(virDomainObjPtr vm, + } + + ++int ++qemuTeardownInputCgroup(virDomainObjPtr vm, ++ virDomainInputDefPtr dev) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ int ret = 0; ++ ++ if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) ++ return 0; ++ ++ switch (dev->type) { ++ case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: ++ VIR_DEBUG("Process path '%s' for input device", dev->source.evdev); ++ ret = virCgroupDenyDevicePath(priv->cgroup, dev->source.evdev, ++ VIR_CGROUP_DEVICE_RWM, false); ++ virDomainAuditCgroupPath(vm, priv->cgroup, "deny", dev->source.evdev, "rwm", ret == 0); ++ break; ++ } ++ ++ return ret; ++} ++ ++ + int + qemuSetupHostdevCgroup(virDomainObjPtr vm, + virDomainHostdevDefPtr dev) +diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h +index 3fc1583612..3b8ff6055d 100644 +--- a/src/qemu/qemu_cgroup.h ++++ b/src/qemu/qemu_cgroup.h +@@ -37,6 +37,10 @@ int qemuSetupDiskCgroup(virDomainObjPtr vm, + virDomainDiskDefPtr disk); + int qemuTeardownDiskCgroup(virDomainObjPtr vm, + virDomainDiskDefPtr disk); ++int qemuSetupInputCgroup(virDomainObjPtr vm, ++ virDomainInputDefPtr dev); ++int qemuTeardownInputCgroup(virDomainObjPtr vm, ++ virDomainInputDefPtr dev); + int qemuSetupHostdevCgroup(virDomainObjPtr vm, + virDomainHostdevDefPtr dev) + ATTRIBUTE_RETURN_CHECK; +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuDomainChrDefPostParse.patch b/SOURCES/libvirt-qemu-Introduce-qemuDomainChrDefPostParse.patch new file mode 100644 index 0000000..966ace4 --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-qemuDomainChrDefPostParse.patch @@ -0,0 +1,108 @@ +From 06cb6ae1254842377d0b17f9fdd52e0d2b6b23eb Mon Sep 17 00:00:00 2001 +Message-Id: <06cb6ae1254842377d0b17f9fdd52e0d2b6b23eb@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:22:56 +0100 +Subject: [PATCH] qemu: Introduce qemuDomainChrDefPostParse() + +Having a separate function for char device handling is better than +adding even more code to qemuDomainDeviceDefPostParse(). + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +Reviewed-by: Marc Hartmayer +(cherry picked from commit f4b50cc1b994e44c793f4dea59489ba51e2d1fe0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 57 ++++++++++++++++++++++++++++++-------------------- + 1 file changed, 34 insertions(+), 23 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 138f773c22..b15d994774 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -4082,6 +4082,35 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, + return 0; + } + ++static int ++qemuDomainChrDefPostParse(virDomainChrDefPtr chr, ++ const virDomainDef *def, ++ virQEMUDriverPtr driver, ++ unsigned int parseFlags) ++{ ++ /* set the default console type for S390 arches */ ++ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && ++ chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE && ++ ARCH_IS_S390(def->os.arch)) { ++ chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; ++ } ++ ++ /* clear auto generated unix socket path for inactive definitions */ ++ if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { ++ if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) ++ return -1; ++ ++ /* For UNIX chardev if no path is provided we generate one. ++ * This also implies that the mode is 'bind'. */ ++ if (chr->source && ++ chr->source->type == VIR_DOMAIN_CHR_TYPE_UNIX && ++ !chr->source->data.nix.path) { ++ chr->source->data.nix.listen = true; ++ } ++ } ++ ++ return 0; ++} + + static int + qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +@@ -4142,29 +4171,6 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + } + } + +- /* set the default console type for S390 arches */ +- if (dev->type == VIR_DOMAIN_DEVICE_CHR && +- dev->data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && +- dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE && +- ARCH_IS_S390(def->os.arch)) +- dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; +- +- /* clear auto generated unix socket path for inactive definitions */ +- if ((parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && +- dev->type == VIR_DOMAIN_DEVICE_CHR) { +- virDomainChrDefPtr chr = dev->data.chr; +- if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) +- goto cleanup; +- +- /* For UNIX chardev if no path is provided we generate one. +- * This also implies that the mode is 'bind'. */ +- if (chr->source && +- chr->source->type == VIR_DOMAIN_CHR_TYPE_UNIX && +- !chr->source->data.nix.path) { +- chr->source->data.nix.listen = true; +- } +- } +- + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { + if ARCH_IS_PPC64(def->os.arch) +@@ -4200,6 +4206,11 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + qemuDomainShmemDefPostParse(dev->data.shmem) < 0) + goto cleanup; + ++ if (dev->type == VIR_DOMAIN_DEVICE_CHR && ++ qemuDomainChrDefPostParse(dev->data.chr, def, driver, parseFlags) < 0) { ++ goto cleanup; ++ } ++ + ret = 0; + + cleanup: +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuDomainChrTargetDefValidate.patch b/SOURCES/libvirt-qemu-Introduce-qemuDomainChrTargetDefValidate.patch new file mode 100644 index 0000000..b5555be --- /dev/null +++ b/SOURCES/libvirt-qemu-Introduce-qemuDomainChrTargetDefValidate.patch @@ -0,0 +1,151 @@ +From 9ec1516a227445872bf5bcb8a535c1a71f644739 Mon Sep 17 00:00:00 2001 +Message-Id: <9ec1516a227445872bf5bcb8a535c1a71f644739@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:05 +0100 +Subject: [PATCH] qemu: Introduce qemuDomainChrTargetDefValidate() + +Instead of waiting until we get to command line generation, we can +validate the target for a char device much earlier. + +Move all the checks out of qemuBuildSerialChrDeviceStr() and into +the new fuction. This will later allow us to validate the target +for platform devices. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit 81e14caf60ac28acf9b7147617ef26bb99955757) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 20 ---------------- + src/qemu/qemu_domain.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 62 insertions(+), 20 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index d593e60198..8142834afd 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -10353,22 +10353,9 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + _("usb-serial is not supported in this QEMU binary")); + goto error; + } +- +- if (serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("usb-serial requires address of usb type")); +- goto error; +- } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: +- if (serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("isa-serial requires address of isa type")); +- goto error; +- } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: +@@ -10377,13 +10364,6 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, + _("pci-serial is not supported with this QEMU binary")); + goto error; + } +- +- if (serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && +- serial->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("pci-serial requires address of pci type")); +- goto error; +- } + break; + + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index e43f7496c2..35eb19ca32 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3456,6 +3456,65 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def) + } + + ++static int ++qemuDomainChrTargetDefValidate(const virDomainDef *def, ++ const virDomainChrDef *chr) ++{ ++ switch ((virDomainChrDeviceType) chr->deviceType) { ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: ++ ++ /* Validate target type */ ++ switch ((virDomainChrSerialTargetType) chr->targetType) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: ++ /* Hack required until we have a proper type for pSeries ++ * serial consoles */ ++ if (qemuDomainIsPSeries(def)) ++ return 0; ++ ++ if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && ++ chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("isa-serial requires address of isa type")); ++ return -1; ++ } ++ break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: ++ if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && ++ chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("usb-serial requires address of usb type")); ++ return -1; ++ } ++ break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: ++ if (chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && ++ chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("pci-serial requires address of pci type")); ++ return -1; ++ } ++ break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: ++ break; ++ } ++ break; ++ ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: ++ case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: ++ /* Nothing to do */ ++ break; ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainChrDefValidate(const virDomainChrDef *dev, + const virDomainDef *def) +@@ -3463,6 +3522,9 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev, + if (qemuDomainChrSourceDefValidate(dev->source) < 0) + return -1; + ++ if (qemuDomainChrTargetDefValidate(def, dev) < 0) ++ return -1; ++ + if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL && + (ARCH_IS_S390(def->os.arch) || qemuDomainIsPSeries(def))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Introduce-qemuDomainDefFromXML-helper.patch b/SOURCES/libvirt-qemu-Introduce-qemuDomainDefFromXML-helper.patch deleted file mode 100644 index c7692ca..0000000 --- a/SOURCES/libvirt-qemu-Introduce-qemuDomainDefFromXML-helper.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 0085fabfc81c097d0307b307ac0441c2448fbb16 Mon Sep 17 00:00:00 2001 -Message-Id: <0085fabfc81c097d0307b307ac0441c2448fbb16@dist-git> -From: Jiri Denemark -Date: Wed, 14 Jun 2017 13:42:16 +0200 -Subject: [PATCH] qemu: Introduce qemuDomainDefFromXML helper - -The main goal of this function is to enable reusing the parsing code -from qemuDomainDefCopy. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 0810d4f5e0d77354cdf7ad56e1e8b7748bdb1501) - -https://bugzilla.redhat.com/show_bug.cgi?id=1460952 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 33 +++++++++++++++++++++------------ - 1 file changed, 21 insertions(+), 12 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 82dacb3c9c..ce75105afa 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -4146,6 +4146,25 @@ void qemuDomainObjExitRemote(virDomainObjPtr obj) - } - - -+static virDomainDefPtr -+qemuDomainDefFromXML(virQEMUDriverPtr driver, -+ const char *xml) -+{ -+ virCapsPtr caps; -+ virDomainDefPtr def; -+ -+ if (!(caps = virQEMUDriverGetCapabilities(driver, false))) -+ return NULL; -+ -+ def = virDomainDefParseString(xml, caps, driver->xmlopt, NULL, -+ VIR_DOMAIN_DEF_PARSE_INACTIVE | -+ VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE); -+ -+ virObjectUnref(caps); -+ return def; -+} -+ -+ - virDomainDefPtr - qemuDomainDefCopy(virQEMUDriverPtr driver, - virDomainDefPtr src, -@@ -4153,25 +4172,15 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, - { - virBuffer buf = VIR_BUFFER_INITIALIZER; - virDomainDefPtr ret = NULL; -- virCapsPtr caps = NULL; - char *xml = NULL; - - if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0) -- goto cleanup; -+ return NULL; - - xml = virBufferContentAndReset(&buf); -+ ret = qemuDomainDefFromXML(driver, xml); - -- if (!(caps = virQEMUDriverGetCapabilities(driver, false))) -- goto cleanup; -- -- if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL, -- VIR_DOMAIN_DEF_PARSE_INACTIVE | -- VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) -- goto cleanup; -- -- cleanup: - VIR_FREE(xml); -- virObjectUnref(caps); - return ret; - } - --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Introduce-qemuMigrationReset.patch b/SOURCES/libvirt-qemu-Introduce-qemuMigrationReset.patch deleted file mode 100644 index 8a73a17..0000000 --- a/SOURCES/libvirt-qemu-Introduce-qemuMigrationReset.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 0c3a8fd16a2081ba0a07bf8c8bfdf26e4922da31 Mon Sep 17 00:00:00 2001 -Message-Id: <0c3a8fd16a2081ba0a07bf8c8bfdf26e4922da31@dist-git> -From: Jiri Denemark -Date: Wed, 5 Apr 2017 14:48:43 +0200 -Subject: [PATCH] qemu: Introduce qemuMigrationReset - -This new API is supposed to reset all migration parameters to make sure -future migrations won't accidentally use them. This patch makes the -first step and moves qemuMigrationResetTLS call inside -qemuMigrationReset. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 439a1795fd3dc8a47ad794bf10a4c86a3ee14e61) - -https://bugzilla.redhat.com/show_bug.cgi?id=1425003 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_migration.c | 31 +++++++++++++++++++++++-------- - src/qemu/qemu_migration.h | 5 +++++ - src/qemu/qemu_process.c | 4 ++-- - 3 files changed, 30 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 6c9f14245..27156cc78 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2836,9 +2836,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - return ret; - - stopjob: -- ignore_value(qemuMigrationResetTLS(driver, vm, -- QEMU_ASYNC_JOB_MIGRATION_IN, -- tlsAlias, secAlias)); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN); - - if (stopProcess) { - unsigned int stopFlags = VIR_QEMU_PROCESS_STOP_MIGRATED; -@@ -3216,8 +3214,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver, - qemuDomainEventQueue(driver, event); - } - -- qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, -- NULL, NULL); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT); - - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) - VIR_WARN("Failed to save status on vm %s", vm->def->name); -@@ -4830,8 +4827,7 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver, - * here - */ - if (!v3proto && ret < 0) -- qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, -- NULL, NULL); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT); - - if (qemuMigrationRestoreDomainState(conn, vm)) { - event = virDomainEventLifecycleNewFromObj(vm, -@@ -5362,7 +5358,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver, - QEMU_ASYNC_JOB_MIGRATION_IN); - } - -- qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, NULL, NULL); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN); - - qemuMigrationJobFinish(driver, vm); - if (!virDomainObjIsActive(vm)) -@@ -5875,3 +5871,22 @@ qemuMigrationCompressionDump(qemuMigrationCompressionPtr compression, - - return 0; - } -+ -+ -+/* -+ * qemuMigrationReset: -+ * -+ * Reset all migration parameters so that the next job which internally uses -+ * migration (save, managedsave, snapshots, dump) will not try to use them. -+ */ -+void -+qemuMigrationReset(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ qemuDomainAsyncJob job) -+{ -+ if (!virDomainObjIsActive(vm)) -+ return; -+ -+ if (qemuMigrationResetTLS(driver, vm, job, NULL, NULL) < 0) -+ return; -+} -diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h -index 5248f399d..28eb55056 100644 ---- a/src/qemu/qemu_migration.h -+++ b/src/qemu/qemu_migration.h -@@ -285,4 +285,9 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver, - char *in_tlsAlias, - char *in_secAlias); - -+void -+qemuMigrationReset(virQEMUDriverPtr driver, -+ virDomainObjPtr vm, -+ qemuDomainAsyncJob job); -+ - #endif /* __QEMU_MIGRATION_H__ */ -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 2e0f859ce..027c831e6 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2982,7 +2982,7 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver, - break; - } - -- qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_NONE, NULL, NULL); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_NONE); - return 0; - } - -@@ -3077,7 +3077,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - } - } - -- qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_NONE, NULL, NULL); -+ qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_NONE); - return 0; - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Introduce-virQEMUCapsHostCPUDataClear.patch b/SOURCES/libvirt-qemu-Introduce-virQEMUCapsHostCPUDataClear.patch deleted file mode 100644 index 5afde71..0000000 --- a/SOURCES/libvirt-qemu-Introduce-virQEMUCapsHostCPUDataClear.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 393675b4e08f2ff8a685d9bd02a83079d32e6eee Mon Sep 17 00:00:00 2001 -Message-Id: <393675b4e08f2ff8a685d9bd02a83079d32e6eee@dist-git> -From: Jiri Denemark -Date: Fri, 7 Apr 2017 17:43:59 +0200 -Subject: [PATCH] qemu: Introduce virQEMUCapsHostCPUDataClear - -To keep freeing of host CPU data in one place. - -Signed-off-by: Jiri Denemark -(cherry picked from commit b0605e848724c5dc478382398b734398abff674c) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 30 +++++++++++++++++------------- - 1 file changed, 17 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 98a9a0f1d..8e7cbb590 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2112,6 +2112,21 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst, - } - - -+static void -+virQEMUCapsHostCPUDataClear(virQEMUCapsPtr qemuCaps) -+{ -+ qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo); -+ qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo); -+ qemuCaps->kvmCPUModelInfo = NULL; -+ qemuCaps->tcgCPUModelInfo = NULL; -+ -+ virCPUDefFree(qemuCaps->kvmCPUModel); -+ virCPUDefFree(qemuCaps->tcgCPUModel); -+ qemuCaps->kvmCPUModel = NULL; -+ qemuCaps->tcgCPUModel = NULL; -+} -+ -+ - virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) - { - virQEMUCapsPtr ret = virQEMUCapsNew(); -@@ -2198,10 +2213,7 @@ void virQEMUCapsDispose(void *obj) - - VIR_FREE(qemuCaps->gicCapabilities); - -- qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo); -- qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo); -- virCPUDefFree(qemuCaps->kvmCPUModel); -- virCPUDefFree(qemuCaps->tcgCPUModel); -+ virQEMUCapsHostCPUDataClear(qemuCaps); - } - - void -@@ -4074,15 +4086,7 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps) - VIR_FREE(qemuCaps->gicCapabilities); - qemuCaps->ngicCapabilities = 0; - -- qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo); -- qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo); -- qemuCaps->kvmCPUModelInfo = NULL; -- qemuCaps->tcgCPUModelInfo = NULL; -- -- virCPUDefFree(qemuCaps->kvmCPUModel); -- virCPUDefFree(qemuCaps->tcgCPUModel); -- qemuCaps->kvmCPUModel = NULL; -- qemuCaps->tcgCPUModel = NULL; -+ virQEMUCapsHostCPUDataClear(qemuCaps); - } - - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Introduce-virQEMUCapsSetHostModel.patch b/SOURCES/libvirt-qemu-Introduce-virQEMUCapsSetHostModel.patch deleted file mode 100644 index b25cf96..0000000 --- a/SOURCES/libvirt-qemu-Introduce-virQEMUCapsSetHostModel.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 08d9d5f63f03898772fd8c636d217d2d00e14919 Mon Sep 17 00:00:00 2001 -Message-Id: <08d9d5f63f03898772fd8c636d217d2d00e14919@dist-git> -From: Jiri Denemark -Date: Fri, 7 Apr 2017 17:03:38 +0200 -Subject: [PATCH] qemu: Introduce virQEMUCapsSetHostModel - -A simple helper as a complement to virQEMUCapsGetHostModel. - -Signed-off-by: Jiri Denemark -(cherry picked from commit bffc3b9fe501ff122ad81ddf42ecdb69f70ff70a) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 17 +++++++++++++---- - 1 file changed, 13 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index eb6b674b4..2bbc9253a 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2425,6 +2425,18 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, - } - - -+static void -+virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, -+ virDomainVirtType type, -+ virCPUDefPtr cpu) -+{ -+ if (type == VIR_DOMAIN_VIRT_KVM) -+ qemuCaps->kvmCPUModel = cpu; -+ else -+ qemuCaps->tcgCPUModel = cpu; -+} -+ -+ - bool - virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, - virCapsPtr caps, -@@ -3301,10 +3313,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - goto error; - } - -- if (type == VIR_DOMAIN_VIRT_KVM) -- qemuCaps->kvmCPUModel = cpu; -- else -- qemuCaps->tcgCPUModel = cpu; -+ virQEMUCapsSetHostModel(qemuCaps, type, cpu); - - cleanup: - virCPUDefFree(hostCPU); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-New-Free.patch b/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-New-Free.patch deleted file mode 100644 index 6356951..0000000 --- a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-New-Free.patch +++ /dev/null @@ -1,405 +0,0 @@ -From d37bad5cb5da2804d51cd6c45903f538d9ec85c5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 6 Jun 2017 22:29:24 +0200 -Subject: [PATCH] qemu: Introduce virQEMUSaveData{New,Free} - -This is a preparation for creating a new virQEMUSaveData structure which -will encapsulate all save image header data. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit a2d2aae148980f00dd83093d61b1aa06c54fbe96) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 128 ++++++++++++++++++++++++++++++++----------------- - 1 file changed, 83 insertions(+), 45 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 5db92b04a1..4a05793339 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2826,6 +2826,36 @@ bswap_header(virQEMUSaveHeaderPtr hdr) - } - - -+static void -+virQEMUSaveDataFree(virQEMUSaveHeaderPtr header) -+{ -+ if (!header) -+ return; -+ -+ VIR_FREE(header); -+} -+ -+ -+static virQEMUSaveHeaderPtr -+virQEMUSaveDataNew(char *domXML, -+ bool running, -+ int compressed) -+{ -+ virQEMUSaveHeaderPtr header = NULL; -+ -+ if (VIR_ALLOC(header) < 0) -+ return NULL; -+ -+ memcpy(header->magic, QEMU_SAVE_PARTIAL, sizeof(header->magic)); -+ header->version = QEMU_SAVE_VERSION; -+ header->was_running = running ? 1 : 0; -+ header->compressed = compressed; -+ header->data_len = strlen(domXML) + 1; -+ -+ return header; -+} -+ -+ - /* return -errno on failure, or 0 on success */ - static int - qemuDomainSaveHeader(int fd, const char *path, const char *xml, -@@ -3048,13 +3078,11 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - const char *path, - const char *domXML, -- int compressed, -+ virQEMUSaveHeaderPtr header, - const char *compressedpath, -- bool was_running, - unsigned int flags, - qemuDomainAsyncJob asyncJob) - { -- virQEMUSaveHeader header; - bool bypassSecurityDriver = false; - bool needUnlink = false; - int ret = -1; -@@ -3063,13 +3091,6 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - virFileWrapperFdPtr wrapperFd = NULL; - unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING; - -- memset(&header, 0, sizeof(header)); -- memcpy(header.magic, QEMU_SAVE_PARTIAL, sizeof(header.magic)); -- header.version = QEMU_SAVE_VERSION; -- header.was_running = was_running ? 1 : 0; -- header.compressed = compressed; -- header.data_len = strlen(domXML) + 1; -- - /* Obtain the file handle. */ - if ((flags & VIR_DOMAIN_SAVE_BYPASS_CACHE)) { - wrapperFlags |= VIR_FILE_WRAPPER_BYPASS_CACHE; -@@ -3093,7 +3114,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - goto cleanup; - - /* Write header to file, followed by XML */ -- if (qemuDomainSaveHeader(fd, path, domXML, &header) < 0) -+ if (qemuDomainSaveHeader(fd, path, domXML, header) < 0) - goto cleanup; - - /* Perform the migration */ -@@ -3117,7 +3138,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL, NULL)) < 0) - goto cleanup; - -- memcpy(header.magic, QEMU_SAVE_MAGIC, sizeof(header.magic)); -+ memcpy(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)); - - if (safewrite(fd, &header, sizeof(header)) != sizeof(header)) { - virReportSystemError(errno, _("unable to write %s"), path); -@@ -3158,6 +3179,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - virObjectEventPtr event = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - virCapsPtr caps; -+ virQEMUSaveHeaderPtr header = NULL; - - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; -@@ -3223,9 +3245,11 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - goto endjob; - } - -- ret = qemuDomainSaveMemory(driver, vm, path, xml, compressed, -- compressedpath, was_running, flags, -- QEMU_ASYNC_JOB_SAVE); -+ if (!(header = virQEMUSaveDataNew(xml, was_running, compressed))) -+ goto endjob; -+ -+ ret = qemuDomainSaveMemory(driver, vm, path, xml, header, compressedpath, -+ flags, QEMU_ASYNC_JOB_SAVE); - if (ret < 0) - goto endjob; - -@@ -3258,6 +3282,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - - cleanup: - VIR_FREE(xml); -+ virQEMUSaveDataFree(header); - qemuDomainEventQueue(driver, event); - virObjectUnref(caps); - return ret; -@@ -6189,7 +6214,7 @@ static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - const char *path, - virDomainDefPtr *ret_def, -- virQEMUSaveHeaderPtr ret_header, -+ virQEMUSaveHeaderPtr *ret_header, - char **xmlout, - bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, -@@ -6197,8 +6222,8 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - bool unlink_corrupt) - { - int fd = -1; -- virQEMUSaveHeader header; - char *xml = NULL; -+ virQEMUSaveHeaderPtr header = NULL; - virDomainDefPtr def = NULL; - int oflags = open_write ? O_RDWR : O_RDONLY; - virCapsPtr caps = NULL; -@@ -6223,7 +6248,10 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - VIR_FILE_WRAPPER_BYPASS_CACHE))) - goto error; - -- if (saferead(fd, &header, sizeof(header)) != sizeof(header)) { -+ if (VIR_ALLOC(header) < 0) -+ goto error; -+ -+ if (saferead(fd, header, sizeof(*header)) != sizeof(*header)) { - if (unlink_corrupt) { - if (VIR_CLOSE(fd) < 0 || unlink(path) < 0) { - virReportSystemError(errno, -@@ -6239,11 +6267,11 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - goto error; - } - -- if (memcmp(header.magic, QEMU_SAVE_MAGIC, sizeof(header.magic)) != 0) { -+ if (memcmp(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)) != 0) { - const char *msg = _("image magic is incorrect"); - -- if (memcmp(header.magic, QEMU_SAVE_PARTIAL, -- sizeof(header.magic)) == 0) { -+ if (memcmp(header->magic, QEMU_SAVE_PARTIAL, -+ sizeof(header->magic)) == 0) { - msg = _("save image is incomplete"); - if (unlink_corrupt) { - if (VIR_CLOSE(fd) < 0 || unlink(path) < 0) { -@@ -6260,28 +6288,28 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - goto error; - } - -- if (header.version > QEMU_SAVE_VERSION) { -+ if (header->version > QEMU_SAVE_VERSION) { - /* convert endianess and try again */ -- bswap_header(&header); -+ bswap_header(header); - } - -- if (header.version > QEMU_SAVE_VERSION) { -+ if (header->version > QEMU_SAVE_VERSION) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("image version is not supported (%d > %d)"), -- header.version, QEMU_SAVE_VERSION); -+ header->version, QEMU_SAVE_VERSION); - goto error; - } - -- if (header.data_len <= 0) { -+ if (header->data_len <= 0) { - virReportError(VIR_ERR_OPERATION_FAILED, -- _("invalid XML length: %d"), header.data_len); -+ _("invalid XML length: %d"), header->data_len); - goto error; - } - -- if (VIR_ALLOC_N(xml, header.data_len) < 0) -+ if (VIR_ALLOC_N(xml, header->data_len) < 0) - goto error; - -- if (saferead(fd, xml, header.data_len) != header.data_len) { -+ if (saferead(fd, xml, header->data_len) != header->data_len) { - virReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to read XML")); - goto error; -@@ -6308,6 +6336,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - error: - virDomainDefFree(def); - VIR_FREE(xml); -+ virQEMUSaveDataFree(header); - VIR_FORCE_CLOSE(fd); - virObjectUnref(caps); - -@@ -6319,7 +6348,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - int *fd, -- const virQEMUSaveHeader *header, -+ virQEMUSaveHeaderPtr header, - const char *path, - bool start_paused, - qemuDomainAsyncJob asyncJob) -@@ -6445,7 +6474,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - const char *newxml = dxml; - int fd = -1; - int ret = -1; -- virQEMUSaveHeader header; -+ virQEMUSaveHeaderPtr header = NULL; - virFileWrapperFdPtr wrapperFd = NULL; - bool hook_taint = false; - -@@ -6502,9 +6531,9 @@ qemuDomainRestoreFlags(virConnectPtr conn, - def = NULL; - - if (flags & VIR_DOMAIN_SAVE_RUNNING) -- header.was_running = 1; -+ header->was_running = 1; - else if (flags & VIR_DOMAIN_SAVE_PAUSED) -- header.was_running = 0; -+ header->was_running = 0; - - if (hook_taint) { - priv = vm->privateData; -@@ -6514,7 +6543,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - if (qemuProcessBeginJob(driver, vm, VIR_DOMAIN_JOB_OPERATION_RESTORE) < 0) - goto cleanup; - -- ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, &header, path, -+ ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, header, path, - false, QEMU_ASYNC_JOB_START); - if (virFileWrapperFdClose(wrapperFd) < 0) - VIR_WARN("Failed to close %s", path); -@@ -6525,6 +6554,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); - VIR_FREE(xml); -+ virQEMUSaveDataFree(header); - VIR_FREE(xmlout); - virFileWrapperFdFree(wrapperFd); - if (vm && ret < 0) -@@ -6549,7 +6579,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - char *ret = NULL; - virDomainDefPtr def = NULL; - int fd = -1; -- virQEMUSaveHeader header; -+ virQEMUSaveHeaderPtr header = NULL; - - /* We only take subset of virDomainDefFormat flags. */ - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); -@@ -6566,6 +6596,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - ret = qemuDomainDefFormatXML(driver, def, flags); - - cleanup: -+ virQEMUSaveDataFree(header); - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); - return ret; -@@ -6580,9 +6611,9 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - virDomainDefPtr def = NULL; - virDomainDefPtr newdef = NULL; - int fd = -1; -- virQEMUSaveHeader header; - char *xml = NULL; - size_t len; -+ virQEMUSaveHeaderPtr header = NULL; - int state = -1; - - virCheckFlags(VIR_DOMAIN_SAVE_RUNNING | -@@ -6603,14 +6634,14 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - goto cleanup; - - if (STREQ(xml, dxml) && -- (state < 0 || state == header.was_running)) { -+ (state < 0 || state == header->was_running)) { - /* no change to the XML */ - ret = 0; - goto cleanup; - } - - if (state >= 0) -- header.was_running = state; -+ header->was_running = state; - - if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) - goto cleanup; -@@ -6625,12 +6656,12 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - goto cleanup; - len = strlen(xml) + 1; - -- if (len > header.data_len) { -+ if (len > header->data_len) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("new xml too large to fit in file")); - goto cleanup; - } -- if (VIR_EXPAND_N(xml, len, header.data_len - len) < 0) -+ if (VIR_EXPAND_N(xml, len, header->data_len - len) < 0) - goto cleanup; - - if (lseek(fd, 0, SEEK_SET) != 0) { -@@ -6651,6 +6682,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - virDomainDefFree(newdef); - VIR_FORCE_CLOSE(fd); - VIR_FREE(xml); -+ virQEMUSaveDataFree(header); - return ret; - } - -@@ -6671,7 +6703,7 @@ qemuDomainObjRestore(virConnectPtr conn, - int ret = -1; - char *xml = NULL; - char *xmlout = NULL; -- virQEMUSaveHeader header; -+ virQEMUSaveHeaderPtr header = NULL; - virFileWrapperFdPtr wrapperFd = NULL; - - fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, -@@ -6722,13 +6754,14 @@ qemuDomainObjRestore(virConnectPtr conn, - virDomainObjAssignDef(vm, def, true, NULL); - def = NULL; - -- ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, &header, path, -+ ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, header, path, - start_paused, asyncJob); - if (virFileWrapperFdClose(wrapperFd) < 0) - VIR_WARN("Failed to close %s", path); - - cleanup: - VIR_FREE(xml); -+ virQEMUSaveDataFree(header); - VIR_FREE(xmlout); - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); -@@ -14301,6 +14334,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - virQEMUDriverConfigPtr cfg = NULL; - int compressed; - char *compressedpath = NULL; -+ virQEMUSaveHeaderPtr header = NULL; - - /* If quiesce was requested, then issue a freeze command, and a - * counterpart thaw command when it is actually sent to agent. -@@ -14372,9 +14406,12 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true))) - goto cleanup; - -- if ((ret = qemuDomainSaveMemory(driver, vm, snap->def->file, xml, -- compressed, compressedpath, resume, -- 0, QEMU_ASYNC_JOB_SNAPSHOT)) < 0) -+ if (!(header = virQEMUSaveDataNew(xml, resume, compressed))) -+ goto cleanup; -+ -+ if ((ret = qemuDomainSaveMemory(driver, vm, snap->def->file, xml, header, -+ compressedpath, 0, -+ QEMU_ASYNC_JOB_SNAPSHOT)) < 0) - goto cleanup; - - /* the memory image was created, remove it on errors */ -@@ -14442,6 +14479,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - ret = -1; - } - -+ virQEMUSaveDataFree(header); - VIR_FREE(xml); - VIR_FREE(compressedpath); - virObjectUnref(cfg); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-structure.patch b/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-structure.patch deleted file mode 100644 index 59b0e46..0000000 --- a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveData-structure.patch +++ /dev/null @@ -1,534 +0,0 @@ -From 56a60bd1b230c86195778e4fda2f44052faae10c Mon Sep 17 00:00:00 2001 -Message-Id: <56a60bd1b230c86195778e4fda2f44052faae10c@dist-git> -From: Jiri Denemark -Date: Wed, 7 Jun 2017 00:08:25 +0200 -Subject: [PATCH] qemu: Introduce virQEMUSaveData structure - -The new structure encapsulates save image header and associated data -(domain XML). - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 47e60ac306273559b8c14527ea15a92c6ac6dd91) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 165 ++++++++++++++++++++++++++----------------------- - 1 file changed, 86 insertions(+), 79 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 1629f27470..7ce0f01f70 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2816,6 +2816,14 @@ struct _virQEMUSaveHeader { - uint32_t unused[15]; - }; - -+typedef struct _virQEMUSaveData virQEMUSaveData; -+typedef virQEMUSaveData *virQEMUSaveDataPtr; -+struct _virQEMUSaveData { -+ virQEMUSaveHeader header; -+ char *xml; -+}; -+ -+ - static inline void - bswap_header(virQEMUSaveHeaderPtr hdr) - { -@@ -2827,31 +2835,39 @@ bswap_header(virQEMUSaveHeaderPtr hdr) - - - static void --virQEMUSaveDataFree(virQEMUSaveHeaderPtr header) -+virQEMUSaveDataFree(virQEMUSaveDataPtr data) - { -- if (!header) -+ if (!data) - return; - -- VIR_FREE(header); -+ VIR_FREE(data->xml); -+ VIR_FREE(data); - } - - --static virQEMUSaveHeaderPtr --virQEMUSaveDataNew(char *domXML ATTRIBUTE_UNUSED, -+/** -+ * This function steals @domXML on success. -+ */ -+static virQEMUSaveDataPtr -+virQEMUSaveDataNew(char *domXML, - bool running, - int compressed) - { -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; -+ virQEMUSaveHeaderPtr header; - -- if (VIR_ALLOC(header) < 0) -+ if (VIR_ALLOC(data) < 0) - return NULL; - -+ VIR_STEAL_PTR(data->xml, domXML); -+ -+ header = &data->header; - memcpy(header->magic, QEMU_SAVE_PARTIAL, sizeof(header->magic)); - header->version = QEMU_SAVE_VERSION; - header->was_running = running ? 1 : 0; - header->compressed = compressed; - -- return header; -+ return data; - } - - -@@ -2865,17 +2881,17 @@ virQEMUSaveDataNew(char *domXML ATTRIBUTE_UNUSED, - * Returns -1 on failure, or 0 on success. - */ - static int --virQEMUSaveDataWrite(virQEMUSaveHeaderPtr header, -- const char *xml, -+virQEMUSaveDataWrite(virQEMUSaveDataPtr data, - int fd, - const char *path) - { -+ virQEMUSaveHeaderPtr header = &data->header; - size_t len; - int ret = -1; - size_t zerosLen = 0; - char *zeros = NULL; - -- len = strlen(xml) + 1; -+ len = strlen(data->xml) + 1; - - if (header->data_len > 0) { - if (len > header->data_len) { -@@ -2898,7 +2914,7 @@ virQEMUSaveDataWrite(virQEMUSaveHeaderPtr header, - goto cleanup; - } - -- if (safewrite(fd, xml, header->data_len) != header->data_len || -+ if (safewrite(fd, data->xml, header->data_len) != header->data_len || - safewrite(fd, zeros, zerosLen) != zerosLen) { - virReportSystemError(errno, - _("failed to write domain xml to '%s'"), -@@ -2915,10 +2931,12 @@ virQEMUSaveDataWrite(virQEMUSaveHeaderPtr header, - - - static int --virQEMUSaveDataFinish(virQEMUSaveHeaderPtr header, -+virQEMUSaveDataFinish(virQEMUSaveDataPtr data, - int *fd, - const char *path) - { -+ virQEMUSaveHeaderPtr header = &data->header; -+ - memcpy(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)); - - if (safewrite(*fd, header, sizeof(*header)) != sizeof(*header) || -@@ -3128,8 +3146,7 @@ static int - qemuDomainSaveMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - const char *path, -- const char *domXML, -- virQEMUSaveHeaderPtr header, -+ virQEMUSaveDataPtr data, - const char *compressedpath, - unsigned int flags, - qemuDomainAsyncJob asyncJob) -@@ -3164,7 +3181,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - if (!(wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags))) - goto cleanup; - -- if (virQEMUSaveDataWrite(header, domXML, fd, path) < 0) -+ if (virQEMUSaveDataWrite(data, fd, path) < 0) - goto cleanup; - - /* Perform the migration */ -@@ -3186,7 +3203,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - goto cleanup; - - if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL, NULL)) < 0 || -- virQEMUSaveDataFinish(header, &fd, path) < 0) -+ virQEMUSaveDataFinish(data, &fd, path) < 0) - goto cleanup; - - ret = 0; -@@ -3218,7 +3235,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - virObjectEventPtr event = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - virCapsPtr caps; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; -@@ -3284,10 +3301,11 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - goto endjob; - } - -- if (!(header = virQEMUSaveDataNew(xml, was_running, compressed))) -+ if (!(data = virQEMUSaveDataNew(xml, was_running, compressed))) - goto endjob; -+ xml = NULL; - -- ret = qemuDomainSaveMemory(driver, vm, path, xml, header, compressedpath, -+ ret = qemuDomainSaveMemory(driver, vm, path, data, compressedpath, - flags, QEMU_ASYNC_JOB_SAVE); - if (ret < 0) - goto endjob; -@@ -3321,7 +3339,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - - cleanup: - VIR_FREE(xml); -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - qemuDomainEventQueue(driver, event); - virObjectUnref(caps); - return ret; -@@ -6238,8 +6256,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, - * @driver: qemu driver data - * @path: path of the save image - * @ret_def: returns domain definition created from the XML stored in the image -- * @ret_header: returns structure filled with data from the image header -- * @xmlout: returns the XML from the image file (may be NULL) -+ * @ret_data: returns structure filled with data from the image header - * @bypass_cache: bypass cache when opening the file - * @wrapperFd: returns the file wrapper structure - * @open_write: open the file for writing (for updates) -@@ -6253,16 +6270,15 @@ static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) - qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - const char *path, - virDomainDefPtr *ret_def, -- virQEMUSaveHeaderPtr *ret_header, -- char **xmlout, -+ virQEMUSaveDataPtr *ret_data, - bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, - bool open_write, - bool unlink_corrupt) - { - int fd = -1; -- char *xml = NULL; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; -+ virQEMUSaveHeaderPtr header; - virDomainDefPtr def = NULL; - int oflags = open_write ? O_RDWR : O_RDONLY; - virCapsPtr caps = NULL; -@@ -6287,9 +6303,10 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - VIR_FILE_WRAPPER_BYPASS_CACHE))) - goto error; - -- if (VIR_ALLOC(header) < 0) -+ if (VIR_ALLOC(data) < 0) - goto error; - -+ header = &data->header; - if (saferead(fd, header, sizeof(*header)) != sizeof(*header)) { - if (unlink_corrupt) { - if (VIR_CLOSE(fd) < 0 || unlink(path) < 0) { -@@ -6341,32 +6358,27 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - - if (header->data_len <= 0) { - virReportError(VIR_ERR_OPERATION_FAILED, -- _("invalid XML length: %d"), header->data_len); -+ _("invalid header data length: %d"), header->data_len); - goto error; - } - -- if (VIR_ALLOC_N(xml, header->data_len) < 0) -+ if (VIR_ALLOC_N(data->xml, header->data_len) < 0) - goto error; - -- if (saferead(fd, xml, header->data_len) != header->data_len) { -+ if (saferead(fd, data->xml, header->data_len) != header->data_len) { - virReportError(VIR_ERR_OPERATION_FAILED, -- "%s", _("failed to read XML")); -+ "%s", _("failed to read domain XML")); - goto error; - } - - /* Create a domain from this XML */ -- if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt, NULL, -+ if (!(def = virDomainDefParseString(data->xml, caps, driver->xmlopt, NULL, - VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) - goto error; - -- if (xmlout) -- *xmlout = xml; -- else -- VIR_FREE(xml); -- - *ret_def = def; -- *ret_header = header; -+ *ret_data = data; - - virObjectUnref(caps); - -@@ -6374,8 +6386,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - - error: - virDomainDefFree(def); -- VIR_FREE(xml); -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - VIR_FORCE_CLOSE(fd); - virObjectUnref(caps); - -@@ -6387,7 +6398,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - int *fd, -- virQEMUSaveHeaderPtr header, -+ virQEMUSaveDataPtr data, - const char *path, - bool start_paused, - qemuDomainAsyncJob asyncJob) -@@ -6399,6 +6410,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - virCommandPtr cmd = NULL; - char *errbuf = NULL; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ virQEMUSaveHeaderPtr header = &data->header; - - if ((header->version == 2) && - (header->compressed != QEMU_SAVE_FORMAT_RAW)) { -@@ -6508,12 +6520,11 @@ qemuDomainRestoreFlags(virConnectPtr conn, - qemuDomainObjPrivatePtr priv = NULL; - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; -- char *xml = NULL; - char *xmlout = NULL; - const char *newxml = dxml; - int fd = -1; - int ret = -1; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - virFileWrapperFdPtr wrapperFd = NULL; - bool hook_taint = false; - -@@ -6524,7 +6535,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - - virNWFilterReadLockFilterUpdates(); - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &data, - (flags & VIR_DOMAIN_SAVE_BYPASS_CACHE) != 0, - &wrapperFd, false, false); - if (fd < 0) -@@ -6540,7 +6551,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - VIR_HOOK_QEMU_OP_RESTORE, - VIR_HOOK_SUBOP_BEGIN, - NULL, -- dxml ? dxml : xml, -+ dxml ? dxml : data->xml, - &xmlout)) < 0) - goto cleanup; - -@@ -6570,9 +6581,9 @@ qemuDomainRestoreFlags(virConnectPtr conn, - def = NULL; - - if (flags & VIR_DOMAIN_SAVE_RUNNING) -- header->was_running = 1; -+ data->header.was_running = 1; - else if (flags & VIR_DOMAIN_SAVE_PAUSED) -- header->was_running = 0; -+ data->header.was_running = 0; - - if (hook_taint) { - priv = vm->privateData; -@@ -6582,7 +6593,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - if (qemuProcessBeginJob(driver, vm, VIR_DOMAIN_JOB_OPERATION_RESTORE) < 0) - goto cleanup; - -- ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, header, path, -+ ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, data, path, - false, QEMU_ASYNC_JOB_START); - if (virFileWrapperFdClose(wrapperFd) < 0) - VIR_WARN("Failed to close %s", path); -@@ -6592,8 +6603,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, - cleanup: - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); -- VIR_FREE(xml); -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - VIR_FREE(xmlout); - virFileWrapperFdFree(wrapperFd); - if (vm && ret < 0) -@@ -6618,12 +6628,12 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - char *ret = NULL; - virDomainDefPtr def = NULL; - int fd = -1; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - - /* We only take subset of virDomainDefFormat flags. */ - virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL); - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, NULL, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &data, - false, NULL, false, false); - - if (fd < 0) -@@ -6635,7 +6645,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, - ret = qemuDomainDefFormatXML(driver, def, flags); - - cleanup: -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); - return ret; -@@ -6650,8 +6660,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - virDomainDefPtr def = NULL; - virDomainDefPtr newdef = NULL; - int fd = -1; -- char *xml = NULL; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - int state = -1; - - virCheckFlags(VIR_DOMAIN_SAVE_RUNNING | -@@ -6662,7 +6671,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - else if (flags & VIR_DOMAIN_SAVE_PAUSED) - state = 0; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &data, - false, NULL, true, false); - - if (fd < 0) -@@ -6671,25 +6680,25 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - if (virDomainSaveImageDefineXMLEnsureACL(conn, def) < 0) - goto cleanup; - -- if (STREQ(xml, dxml) && -- (state < 0 || state == header->was_running)) { -+ if (STREQ(data->xml, dxml) && -+ (state < 0 || state == data->header.was_running)) { - /* no change to the XML */ - ret = 0; - goto cleanup; - } - - if (state >= 0) -- header->was_running = state; -+ data->header.was_running = state; - - if (!(newdef = qemuDomainSaveImageUpdateDef(driver, def, dxml))) - goto cleanup; - -- VIR_FREE(xml); -+ VIR_FREE(data->xml); - -- if (!(xml = qemuDomainDefFormatXML(driver, newdef, -- VIR_DOMAIN_XML_INACTIVE | -- VIR_DOMAIN_XML_SECURE | -- VIR_DOMAIN_XML_MIGRATABLE))) -+ if (!(data->xml = qemuDomainDefFormatXML(driver, newdef, -+ VIR_DOMAIN_XML_INACTIVE | -+ VIR_DOMAIN_XML_SECURE | -+ VIR_DOMAIN_XML_MIGRATABLE))) - goto cleanup; - - if (lseek(fd, 0, SEEK_SET) != 0) { -@@ -6697,7 +6706,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - goto cleanup; - } - -- if (virQEMUSaveDataWrite(header, xml, fd, path) < 0) -+ if (virQEMUSaveDataWrite(data, fd, path) < 0) - goto cleanup; - - if (VIR_CLOSE(fd) < 0) { -@@ -6711,8 +6720,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, - virDomainDefFree(def); - virDomainDefFree(newdef); - VIR_FORCE_CLOSE(fd); -- VIR_FREE(xml); -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - return ret; - } - -@@ -6731,12 +6739,11 @@ qemuDomainObjRestore(virConnectPtr conn, - qemuDomainObjPrivatePtr priv = vm->privateData; - int fd = -1; - int ret = -1; -- char *xml = NULL; - char *xmlout = NULL; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - virFileWrapperFdPtr wrapperFd = NULL; - -- fd = qemuDomainSaveImageOpen(driver, path, &def, &header, &xml, -+ fd = qemuDomainSaveImageOpen(driver, path, &def, &data, - bypass_cache, &wrapperFd, false, true); - if (fd < 0) { - if (fd == -3) -@@ -6750,7 +6757,7 @@ qemuDomainObjRestore(virConnectPtr conn, - if ((hookret = virHookCall(VIR_HOOK_DRIVER_QEMU, def->name, - VIR_HOOK_QEMU_OP_RESTORE, - VIR_HOOK_SUBOP_BEGIN, -- NULL, xml, &xmlout)) < 0) -+ NULL, data->xml, &xmlout)) < 0) - goto cleanup; - - if (hookret == 0 && !virStringIsEmpty(xmlout)) { -@@ -6784,14 +6791,13 @@ qemuDomainObjRestore(virConnectPtr conn, - virDomainObjAssignDef(vm, def, true, NULL); - def = NULL; - -- ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, header, path, -+ ret = qemuDomainSaveImageStartVM(conn, driver, vm, &fd, data, path, - start_paused, asyncJob); - if (virFileWrapperFdClose(wrapperFd) < 0) - VIR_WARN("Failed to close %s", path); - - cleanup: -- VIR_FREE(xml); -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - VIR_FREE(xmlout); - virDomainDefFree(def); - VIR_FORCE_CLOSE(fd); -@@ -14364,7 +14370,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - virQEMUDriverConfigPtr cfg = NULL; - int compressed; - char *compressedpath = NULL; -- virQEMUSaveHeaderPtr header = NULL; -+ virQEMUSaveDataPtr data = NULL; - - /* If quiesce was requested, then issue a freeze command, and a - * counterpart thaw command when it is actually sent to agent. -@@ -14436,10 +14442,11 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true))) - goto cleanup; - -- if (!(header = virQEMUSaveDataNew(xml, resume, compressed))) -+ if (!(data = virQEMUSaveDataNew(xml, resume, compressed))) - goto cleanup; -+ xml = NULL; - -- if ((ret = qemuDomainSaveMemory(driver, vm, snap->def->file, xml, header, -+ if ((ret = qemuDomainSaveMemory(driver, vm, snap->def->file, data, - compressedpath, 0, - QEMU_ASYNC_JOB_SNAPSHOT)) < 0) - goto cleanup; -@@ -14509,7 +14516,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - ret = -1; - } - -- virQEMUSaveDataFree(header); -+ virQEMUSaveDataFree(data); - VIR_FREE(xml); - VIR_FREE(compressedpath); - virObjectUnref(cfg); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveDataFinish.patch b/SOURCES/libvirt-qemu-Introduce-virQEMUSaveDataFinish.patch deleted file mode 100644 index 507c98d..0000000 --- a/SOURCES/libvirt-qemu-Introduce-virQEMUSaveDataFinish.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 81bbd5e5673d2ed1b10b3a54876ed7945cd5f97c Mon Sep 17 00:00:00 2001 -Message-Id: <81bbd5e5673d2ed1b10b3a54876ed7945cd5f97c@dist-git> -From: Jiri Denemark -Date: Tue, 6 Jun 2017 22:49:11 +0200 -Subject: [PATCH] qemu: Introduce virQEMUSaveDataFinish - -The function is supposed to update the save image header after a -successful migration to the save image file. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit ec986bc5727b88b0631236ad0cdecb0a8568d5cd) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 34 +++++++++++++++++++++------------- - 1 file changed, 21 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 4a05793339..a0b607b419 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2882,6 +2882,25 @@ qemuDomainSaveHeader(int fd, const char *path, const char *xml, - } - - -+static int -+virQEMUSaveDataFinish(virQEMUSaveHeaderPtr header, -+ int *fd, -+ const char *path) -+{ -+ memcpy(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)); -+ -+ if (safewrite(*fd, header, sizeof(*header)) != sizeof(*header) || -+ VIR_CLOSE(*fd) < 0) { -+ virReportSystemError(errno, -+ _("failed to write header to domain save file '%s'"), -+ path); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ - static virCommandPtr - qemuCompressGetCommand(virQEMUSaveFormat compression) - { -@@ -3135,21 +3154,10 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, - if (virFileWrapperFdClose(wrapperFd) < 0) - goto cleanup; - -- if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL, NULL)) < 0) -+ if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL, NULL)) < 0 || -+ virQEMUSaveDataFinish(header, &fd, path) < 0) - goto cleanup; - -- memcpy(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)); -- -- if (safewrite(fd, &header, sizeof(header)) != sizeof(header)) { -- virReportSystemError(errno, _("unable to write %s"), path); -- goto cleanup; -- } -- -- if (VIR_CLOSE(fd) < 0) { -- virReportSystemError(errno, _("unable to close %s"), path); -- goto cleanup; -- } -- - ret = 0; - - cleanup: --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Isolate-hostdevs-on-pSeries-guests.patch b/SOURCES/libvirt-qemu-Isolate-hostdevs-on-pSeries-guests.patch deleted file mode 100644 index f010ea3..0000000 --- a/SOURCES/libvirt-qemu-Isolate-hostdevs-on-pSeries-guests.patch +++ /dev/null @@ -1,468 +0,0 @@ -From a5f055c8eb5c761473088866022167d4a9442673 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Tue, 18 Jul 2017 12:10:07 +0200 -Subject: [PATCH] qemu: Isolate hostdevs on pSeries guests - -All the pieces are now in place, so we can finally start -using isolation groups to achieve our initial goal, which is -separating hostdevs from emulated PCI devices while keeping -hostdevs that belong to the same host IOMMU group together. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit b84b6ab5027c386d19299771387b4c4cf5e844cd) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain_address.c | 241 +++++++++++++++++++++ - src/qemu/qemu_domain_address.h | 4 + - src/qemu/qemu_hotplug.c | 7 + - tests/qemumemlocktest.c | 2 +- - .../qemuxml2argv-pseries-hostdevs-1.args | 8 +- - .../qemuxml2argv-pseries-hostdevs-2.args | 3 +- - .../qemuxml2argv-pseries-hostdevs-3.args | 2 +- - .../qemuxml2xmlout-pseries-hostdevs-1.xml | 14 +- - .../qemuxml2xmlout-pseries-hostdevs-2.xml | 6 +- - .../qemuxml2xmlout-pseries-hostdevs-3.xml | 2 +- - 10 files changed, 278 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 02e214b8dd..756cd97970 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -25,6 +25,7 @@ - - #include "qemu_domain_address.h" - #include "qemu_domain.h" -+#include "network/bridge_driver.h" - #include "viralloc.h" - #include "virerror.h" - #include "virlog.h" -@@ -901,6 +902,243 @@ qemuDomainFillAllPCIConnectFlags(virDomainDefPtr def, - - - /** -+ * qemuDomainFindUnusedIsolationGroupIter: -+ * @def: domain definition -+ * @dev: device definition -+ * @info: device information -+ * @opaque: user data -+ * -+ * Used to implement qemuDomainFindUnusedIsolationGroup(). You probably -+ * don't want to call this directly. -+ * -+ * Return: 0 if the isolation group is not used by the device, <1 otherwise. -+ */ -+static int -+qemuDomainFindUnusedIsolationGroupIter(virDomainDefPtr def ATTRIBUTE_UNUSED, -+ virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, -+ virDomainDeviceInfoPtr info, -+ void *opaque) -+{ -+ unsigned int *isolationGroup = opaque; -+ -+ if (info->isolationGroup == *isolationGroup) -+ return -1; -+ -+ return 0; -+} -+ -+ -+/** -+ * qemuDomainFindUnusedIsolationGroup: -+ * @def: domain definition -+ * -+ * Find an isolation group that is not used by any device in @def yet. -+ * -+ * Normally, we'd look up the device's IOMMU group and base its isolation -+ * group on that; however, when a network interface uses a network backed -+ * by SR-IOV Virtual Functions, we can't know at PCI address assignment -+ * time which host device will be used so we can't look up its IOMMU group. -+ * -+ * We still want such a device to be isolated: this function can be used -+ * to obtain a synthetic isolation group usable for the purpose. -+ * -+ * Return: unused isolation group -+ */ -+static unsigned int -+qemuDomainFindUnusedIsolationGroup(virDomainDefPtr def) -+{ -+ unsigned int isolationGroup = UINT_MAX; -+ -+ /* We start from the highest possible isolation group and work our -+ * way backwards so that we're working in a completely different range -+ * from IOMMU groups, thus avoiding clashes. We're realistically going -+ * to call this function just a few times per guest anyway */ -+ while (isolationGroup > 0 && -+ virDomainDeviceInfoIterate(def, -+ qemuDomainFindUnusedIsolationGroupIter, -+ &isolationGroup) < 0) { -+ isolationGroup--; -+ } -+ -+ return isolationGroup; -+} -+ -+ -+/** -+ * qemuDomainFillDeviceIsolationGroup: -+ * @def: domain definition -+ * @dev: device definition -+ * -+ * Fill isolation group information for a single device. -+ * -+ * Return: 0 on success, <0 on failure -+ * */ -+int -+qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, -+ virDomainDeviceDefPtr dev) -+{ -+ int ret = -1; -+ -+ /* Only host devices need their isolation group to be different from -+ * the default. Interfaces of type hostdev are just host devices in -+ * disguise, but we don't need to handle them separately because for -+ * each such interface a corresponding hostdev is also added to the -+ * guest configuration */ -+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { -+ virDomainHostdevDefPtr hostdev = dev->data.hostdev; -+ virDomainDeviceInfoPtr info = hostdev->info; -+ virPCIDeviceAddressPtr hostAddr; -+ int tmp; -+ -+ /* Only PCI host devices are subject to isolation */ -+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || -+ hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) { -+ goto skip; -+ } -+ -+ hostAddr = &hostdev->source.subsys.u.pci.addr; -+ -+ /* If a non-default isolation has already been assigned to the -+ * device, we can avoid looking up the information again */ -+ if (info->isolationGroup > 0) -+ goto skip; -+ -+ /* The isolation group depends on the IOMMU group assigned by the host */ -+ tmp = virPCIDeviceAddressGetIOMMUGroupNum(hostAddr); -+ -+ if (tmp < 0) { -+ VIR_WARN("Can't look up isolation group for host device " -+ "%04x:%02x:%02x.%x", -+ hostAddr->domain, hostAddr->bus, -+ hostAddr->slot, hostAddr->function); -+ goto cleanup; -+ } -+ -+ /* The isolation group for a host device is its IOMMU group, -+ * increased by one: this is because zero is a valid IOMMU group but -+ * that's also the default isolation group, which we want to save -+ * for emulated devices. Shifting isolation groups for host devices -+ * by one ensures there is no overlap */ -+ info->isolationGroup = tmp + 1; -+ -+ VIR_DEBUG("Isolation group for host device %04x:%02x:%02x.%x is %u", -+ hostAddr->domain, hostAddr->bus, -+ hostAddr->slot, hostAddr->function, -+ info->isolationGroup); -+ -+ } else if (dev->type == VIR_DOMAIN_DEVICE_NET) { -+ virDomainNetDefPtr iface = dev->data.net; -+ virDomainDeviceInfoPtr info = &iface->info; -+ unsigned int tmp; -+ -+ /* Network interfaces can ultimately result in the guest being -+ * assigned a host device if the libvirt network they're connected -+ * to is of type hostdev. All other kinds of network interfaces don't -+ * require us to isolate the guest device, so we can skip them */ -+ if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK || -+ networkGetActualType(iface) != VIR_DOMAIN_NET_TYPE_HOSTDEV) { -+ goto skip; -+ } -+ -+ /* If a non-default isolation has already been assigned to the -+ * device, we can avoid looking up the information again */ -+ if (info->isolationGroup > 0) -+ goto skip; -+ -+ /* Obtain a synthetic isolation group for the device, since at this -+ * point in time we don't have access to the IOMMU group of the host -+ * device that will eventually be used by the guest */ -+ tmp = qemuDomainFindUnusedIsolationGroup(def); -+ -+ if (tmp == 0) { -+ VIR_WARN("Can't obtain usable isolation group for interface " -+ "configured to use hostdev-backed network '%s'", -+ iface->data.network.name); -+ goto cleanup; -+ } -+ -+ info->isolationGroup = tmp; -+ -+ VIR_DEBUG("Isolation group for interface configured to use " -+ "hostdev-backed network '%s' is %u", -+ iface->data.network.name, info->isolationGroup); -+ } -+ -+ skip: -+ ret = 0; -+ -+ cleanup: -+ return ret; -+} -+ -+ -+/** -+ * qemuDomainFillDeviceIsolationGroupIter: -+ * @def: domain definition -+ * @dev: device definition -+ * @info: device information -+ * @opaque: user data -+ * -+ * A version of qemuDomainFillDeviceIsolationGroup() to be used -+ * with virDomainDeviceInfoIterate() -+ * -+ * Return: 0 on success, <0 on failure -+ */ -+static int -+qemuDomainFillDeviceIsolationGroupIter(virDomainDefPtr def, -+ virDomainDeviceDefPtr dev, -+ virDomainDeviceInfoPtr info ATTRIBUTE_UNUSED, -+ void *opaque ATTRIBUTE_UNUSED) -+{ -+ return qemuDomainFillDeviceIsolationGroup(def, dev); -+} -+ -+ -+/** -+ * qemuDomainSetupIsolationGroups: -+ * @def: domain definition -+ * -+ * High-level function to set up isolation groups for all devices -+ * and controllers in @def. Isolation groups will only be set up if -+ * the guest architecture and machine type require it, so this -+ * function can and should be called unconditionally before attempting -+ * to assign any PCI address. -+ * -+ * Return: 0 on success, <0 on failure -+ */ -+static int -+qemuDomainSetupIsolationGroups(virDomainDefPtr def) -+{ -+ int idx; -+ int ret = -1; -+ -+ /* Only pSeries guests care about isolation groups at the moment */ -+ if (!qemuDomainIsPSeries(def)) -+ return 0; -+ -+ idx = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0); -+ if (idx < 0) -+ goto cleanup; -+ -+ /* We want to prevent hostdevs from being plugged into the default PHB: -+ * we can make sure that doesn't happen by locking its isolation group */ -+ def->controllers[idx]->info.isolationGroupLocked = true; -+ -+ /* Fill in isolation groups for all other devices */ -+ if (virDomainDeviceInfoIterate(def, -+ qemuDomainFillDeviceIsolationGroupIter, -+ NULL) < 0) { -+ goto cleanup; -+ } -+ -+ ret = 0; -+ -+ cleanup: -+ return ret; -+} -+ -+ -+/** - * qemuDomainFillDevicePCIConnectFlags: - * - * @def: the entire DomainDef -@@ -2049,6 +2287,9 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - if (qemuDomainFillAllPCIConnectFlags(def, qemuCaps, driver) < 0) - goto cleanup; - -+ if (qemuDomainSetupIsolationGroups(def) < 0) -+ goto cleanup; -+ - if (nbuses > 0) { - /* 1st pass to figure out how many PCI bridges we need */ - if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses, true))) -diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h -index 067f4e7997..b5644fa9c2 100644 ---- a/src/qemu/qemu_domain_address.h -+++ b/src/qemu/qemu_domain_address.h -@@ -44,6 +44,10 @@ int qemuDomainEnsurePCIAddress(virDomainObjPtr obj, - virQEMUDriverPtr driver) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - -+int qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, -+ virDomainDeviceDefPtr dev) -+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -+ - void qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, - virDomainDeviceInfoPtr info, - const char *devstr); -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 476e2b81a3..34f1a646e9 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -1468,6 +1468,13 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - - if (qemuAssignDeviceHostdevAlias(vm->def, &info->alias, -1) < 0) - goto error; -+ -+ if (qemuDomainIsPSeries(vm->def)) { -+ /* Isolation groups are only relevant for pSeries guests */ -+ if (qemuDomainFillDeviceIsolationGroup(vm->def, &dev) < 0) -+ goto error; -+ } -+ - if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) - goto error; - releaseaddr = true; -diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c -index ea25cd9a66..42561ac19e 100644 ---- a/tests/qemumemlocktest.c -+++ b/tests/qemumemlocktest.c -@@ -131,7 +131,7 @@ mymain(void) - - DO_TEST("pseries-hardlimit", 2147483648); - DO_TEST("pseries-locked", VIR_DOMAIN_MEMORY_PARAM_UNLIMITED); -- DO_TEST("pseries-hostdev", 2168455168); -+ DO_TEST("pseries-hostdev", 4320133120); - - DO_TEST("pseries-hardlimit+locked", 2147483648); - DO_TEST("pseries-hardlimit+hostdev", 2147483648); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args -index 051ffdeb3e..8a4a4c5a63 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args -@@ -18,6 +18,8 @@ QEMU_AUDIO_DRV=none \ - server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ ---device vfio-pci,host=0005:90:01.0,id=hostdev0,bus=pci.0,addr=0x1 \ ---device vfio-pci,host=0001:01:00.0,id=hostdev1,bus=pci.0,addr=0x2 \ ---device vfio-pci,host=0001:01:00.1,id=hostdev2,bus=pci.0,addr=0x3 -+-device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device spapr-pci-host-bridge,index=2,id=pci.2 \ -+-device vfio-pci,host=0005:90:01.0,id=hostdev0,bus=pci.1.0,addr=0x1 \ -+-device vfio-pci,host=0001:01:00.0,id=hostdev1,bus=pci.2.0,addr=0x1 \ -+-device vfio-pci,host=0001:01:00.1,id=hostdev2,bus=pci.2.0,addr=0x2 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -index 83d4306036..cd5b66404e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -@@ -19,6 +19,7 @@ server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device spapr-pci-host-bridge,index=2,id=pci.2 \ - -device virtio-scsi-pci,id=scsi0,bus=pci.1.0,addr=0x1 \ - -device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.1.0,addr=0x2 \ ---device vfio-pci,host=0005:90:01.0,id=hostdev1,bus=pci.0,addr=0x1 -+-device vfio-pci,host=0005:90:01.0,id=hostdev1,bus=pci.2.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -index eda6cc73ac..66a31ba1a8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -@@ -21,4 +21,4 @@ server,nowait \ - -device spapr-pci-host-bridge,index=1,id=pci.1 \ - -device spapr-pci-host-bridge,index=2,id=pci.2 \ - -device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.2.0,addr=0x1 \ ---device vfio-pci,host=0001:01:00.1,id=hostdev1,bus=pci.0,addr=0x1 -+-device vfio-pci,host=0001:01:00.1,id=hostdev1,bus=pci.2.0,addr=0x2 -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-1.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-1.xml -index fa9e4daca5..e77a060a38 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-1.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-1.xml -@@ -19,27 +19,35 @@ - - - -+ -+ -+ -+ -+ -+ -+ -+ - - - - -
      - --
      -+
      - - - - -
      - --
      -+
      - - - - -
      - --
      -+
      - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -index 17ff4c8537..cfa395b001 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -@@ -26,6 +26,10 @@ - - - -+ -+ -+ -+ - - - -@@ -38,7 +42,7 @@ - -
      - --
      -+
      - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -index 58023ecd72..f91959b805 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -@@ -39,7 +39,7 @@ - -
      - --
      -+
      - - - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Limit-refresh-of-CPU-halted-state-to-s390.patch b/SOURCES/libvirt-qemu-Limit-refresh-of-CPU-halted-state-to-s390.patch new file mode 100644 index 0000000..1ca212e --- /dev/null +++ b/SOURCES/libvirt-qemu-Limit-refresh-of-CPU-halted-state-to-s390.patch @@ -0,0 +1,37 @@ +From bda9cc7585816a5233beba2661510ecc4d69c4e2 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Viktor Mihajlovski +Date: Wed, 7 Feb 2018 14:16:02 +0100 +Subject: [PATCH] qemu: Limit refresh of CPU halted state to s390 + +Refreshing the halted state can cause VM performance issues. Since +s390 is currently the only architecture with a known interest in +the halted state, we're avoiding to call QEMU on other platforms. + +Signed-off-by: Viktor Mihajlovski +(cherry picked from commit 818a29e0c7d6840e87e9ca6019b9f0bc1983566e) + +https://bugzilla.redhat.com/show_bug.cgi?id=1534585 +--- + src/qemu/qemu_domain.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index e87c7d030c..0f7f3b7f50 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -7989,6 +7989,11 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver, + if (vm->def->virtType == VIR_DOMAIN_VIRT_QEMU) + return 0; + ++ /* The halted state is interresting only on s390(x). On other platforms ++ * the data would be stale at the time when it would be used. */ ++ if (!ARCH_IS_S390(vm->def->os.arch)) ++ return 0; ++ + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-Make-sure-host-model-uses-CPU-model-supported-by-QEMU.patch b/SOURCES/libvirt-qemu-Make-sure-host-model-uses-CPU-model-supported-by-QEMU.patch new file mode 100644 index 0000000..2dd998d --- /dev/null +++ b/SOURCES/libvirt-qemu-Make-sure-host-model-uses-CPU-model-supported-by-QEMU.patch @@ -0,0 +1,85 @@ +From dbdc7ec536154af91ae897663d82c57d11500d23 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Thu, 7 Dec 2017 11:23:50 +0100 +Subject: [PATCH] qemu: Make sure host-model uses CPU model supported by QEMU + +When reconnecting to a running domain started by old libvirt, which did +not change host-model into a custom CPU definition, we replace the CPU +definition with a specific CPU model from host capabilities. However, +that CPU model may not be supported by the running qemu process. We need +to translate the CPU model to one of the models which libvirt could have +used when starting the domain. + +https://bugzilla.redhat.com/show_bug.cgi?id=1521202 + +Signed-off-by: Jiri Denemark +(cherry picked from commit ce73de441d35e17a29b83b8741e668a6ddc013ba) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 91426ad3c3..701528c42c 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -3850,6 +3850,30 @@ qemuProcessUpdateAndVerifyCPU(virQEMUDriverPtr driver, + } + + ++static virDomainCapsCPUModelsPtr ++qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ qemuDomainAsyncJob asyncJob) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ virDomainCapsCPUModelsPtr models = NULL; ++ ++ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) ++ goto error; ++ ++ models = virQEMUCapsFetchCPUDefinitions(priv->mon); ++ ++ if (qemuDomainObjExitMonitor(driver, vm) < 0) ++ goto error; ++ ++ return models; ++ ++ error: ++ virObjectUnref(models); ++ return NULL; ++} ++ ++ + static int + qemuProcessUpdateCPU(virQEMUDriverPtr driver, + virDomainObjPtr vm, +@@ -3857,6 +3881,7 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver, + { + virCPUDataPtr cpu = NULL; + virCPUDataPtr disabled = NULL; ++ virDomainCapsCPUModelsPtr models = NULL; + int ret = -1; + + if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0) +@@ -3865,11 +3890,16 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver, + if (qemuProcessUpdateLiveGuestCPU(vm, cpu, disabled) < 0) + goto cleanup; + ++ if (!(models = qemuProcessFetchCPUDefinitions(driver, vm, asyncJob)) || ++ virCPUTranslate(vm->def->os.arch, vm->def->cpu, models) < 0) ++ goto cleanup; ++ + ret = 0; + + cleanup: + virCPUDataFree(cpu); + virCPUDataFree(disabled); ++ virObjectUnref(models); + return ret; + } + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Move-common-code-in-virQEMUCapsInitCPUModel-one-layer-up.patch b/SOURCES/libvirt-qemu-Move-common-code-in-virQEMUCapsInitCPUModel-one-layer-up.patch deleted file mode 100644 index 540e4d9..0000000 --- a/SOURCES/libvirt-qemu-Move-common-code-in-virQEMUCapsInitCPUModel-one-layer-up.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 739fd2eac238497276f752689a7e619e298cb746 Mon Sep 17 00:00:00 2001 -Message-Id: <739fd2eac238497276f752689a7e619e298cb746@dist-git> -From: Jiri Denemark -Date: Thu, 30 Mar 2017 13:50:44 +0200 -Subject: [PATCH] qemu: Move common code in virQEMUCapsInitCPUModel one layer - up - -Signed-off-by: Jiri Denemark -(cherry picked from commit d84b93fad51b190238e18b1daac82ea6e28869e9) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 25 ++++++++++--------------- - 1 file changed, 10 insertions(+), 15 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 2c845853a..b71de9633 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -3117,17 +3117,11 @@ virQEMUCapsCPUFilterFeatures(const char *name, - */ - static int - virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, -- virDomainVirtType type, -+ qemuMonitorCPUModelInfoPtr modelInfo, - virCPUDefPtr cpu) - { -- qemuMonitorCPUModelInfoPtr modelInfo; - size_t i; - -- if (type == VIR_DOMAIN_VIRT_KVM) -- modelInfo = qemuCaps->kvmCPUModelInfo; -- else -- modelInfo = qemuCaps->tcgCPUModelInfo; -- - if (!modelInfo) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("missing host CPU model info from QEMU capabilities " -@@ -3169,9 +3163,9 @@ virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, - static int - virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, -+ qemuMonitorCPUModelInfoPtr model, - virCPUDefPtr cpu) - { -- qemuMonitorCPUModelInfoPtr model; - virCPUDataPtr data = NULL; - unsigned long long sigFamily = 0; - unsigned long long sigModel = 0; -@@ -3180,11 +3174,6 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, - int ret = -1; - size_t i; - -- if (type == VIR_DOMAIN_VIRT_KVM) -- model = qemuCaps->kvmCPUModelInfo; -- else -- model = qemuCaps->tcgCPUModelInfo; -- - if (!model) - return 1; - -@@ -3245,12 +3234,18 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - virCPUDefPtr cpu) - { -+ qemuMonitorCPUModelInfoPtr model; - int ret = 1; - -+ if (type == VIR_DOMAIN_VIRT_KVM) -+ model = qemuCaps->kvmCPUModelInfo; -+ else -+ model = qemuCaps->tcgCPUModelInfo; -+ - if (ARCH_IS_S390(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelS390(qemuCaps, type, cpu); -+ ret = virQEMUCapsInitCPUModelS390(qemuCaps, model, cpu); - else if (ARCH_IS_X86(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, cpu); -+ ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, model, cpu); - - if (ret == 0) - cpu->fallback = VIR_CPU_FALLBACK_FORBID; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Move-memPath-generation-from-memoryBackingDir-to-a-separate-function.patch b/SOURCES/libvirt-qemu-Move-memPath-generation-from-memoryBackingDir-to-a-separate-function.patch new file mode 100644 index 0000000..6b12efc --- /dev/null +++ b/SOURCES/libvirt-qemu-Move-memPath-generation-from-memoryBackingDir-to-a-separate-function.patch @@ -0,0 +1,78 @@ +From f6772178504ef0c3f02a3d18208bf7ab88402f81 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Thu, 9 Nov 2017 16:06:43 +0100 +Subject: [PATCH] qemu: Move memPath generation from memoryBackingDir to a + separate function + +https://bugzilla.redhat.com/show_bug.cgi?id=1461214 + +In near future we will need more than just a plain VIR_STRDUP(). +Better implement that in a separate function and in +qemuBuildMemoryBackendStr() which is complicated enough already. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit ae1b5d47e5f032a9a11688105e70198a0a160a50) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 2 +- + src/qemu/qemu_conf.c | 18 ++++++++++++++++++ + src/qemu/qemu_conf.h | 3 +++ + 3 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 365555ca87..9f346c3649 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3439,7 +3439,7 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, + } else { + /* We can have both pagesize and mem source. If that's the case, + * prefer hugepages as those are more specific. */ +- if (VIR_STRDUP(memPath, cfg->memoryBackingDir) < 0) ++ if (qemuGetMemoryBackingPath(cfg, &memPath) < 0) + goto cleanup; + } + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 66f9761eea..3b670a68c5 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1765,3 +1765,21 @@ qemuGetDomainHupageMemPath(const virDomainDef *def, + + return 0; + } ++ ++ ++/** ++ * qemuGetMemoryBackingPath: ++ * @cfg: the driver config ++ * @memPath: constructed path ++ * ++ * Constructs path to memory backing dir and stores it at @memPath. ++ * ++ * Returns: 0 on success, ++ * -1 otherwise (with error reported). ++ */ ++int ++qemuGetMemoryBackingPath(virQEMUDriverConfigPtr cfg, ++ char **memPath) ++{ ++ return VIR_STRDUP(*memPath, cfg->memoryBackingDir); ++} +diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h +index 13b6f818a2..9d6866816f 100644 +--- a/src/qemu/qemu_conf.h ++++ b/src/qemu/qemu_conf.h +@@ -363,4 +363,7 @@ int qemuGetDomainHupageMemPath(const virDomainDef *def, + virQEMUDriverConfigPtr cfg, + unsigned long long pagesize, + char **memPath); ++ ++int qemuGetMemoryBackingPath(virQEMUDriverConfigPtr cfg, ++ char **memPath); + #endif /* __QEMUD_CONF_H */ +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Move-qemuCaps-CPU-data-copying-into-a-separate-function.patch b/SOURCES/libvirt-qemu-Move-qemuCaps-CPU-data-copying-into-a-separate-function.patch deleted file mode 100644 index 1446740..0000000 --- a/SOURCES/libvirt-qemu-Move-qemuCaps-CPU-data-copying-into-a-separate-function.patch +++ /dev/null @@ -1,79 +0,0 @@ -From e10845824c98d0996ced6a8eac5d62ac99ceedd3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Fri, 7 Apr 2017 17:40:31 +0200 -Subject: [PATCH] qemu: Move qemuCaps CPU data copying into a separate function - -This introduces virQEMUCapsHostCPUDataCopy which will later be -refactored a bit and called twice from virQEMUCapsNewCopy. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 8be4346ca5ae4b568b3e8ce3de9cf46f2e94b416) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 39 +++++++++++++++++++++++++-------------- - 1 file changed, 25 insertions(+), 14 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 2bbc9253a..98a9a0f1d 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2088,6 +2088,30 @@ virQEMUCapsNew(void) - } - - -+static int -+virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst, -+ virQEMUCapsPtr src) -+{ -+ if (src->kvmCPUModel && -+ !(dst->kvmCPUModel = virCPUDefCopy(src->kvmCPUModel))) -+ return -1; -+ -+ if (src->tcgCPUModel && -+ !(dst->tcgCPUModel = virCPUDefCopy(src->tcgCPUModel))) -+ return -1; -+ -+ if (src->kvmCPUModelInfo && -+ !(dst->kvmCPUModelInfo = qemuMonitorCPUModelInfoCopy(src->kvmCPUModelInfo))) -+ return -1; -+ -+ if (src->tcgCPUModelInfo && -+ !(dst->tcgCPUModelInfo = qemuMonitorCPUModelInfoCopy(src->tcgCPUModelInfo))) -+ return -1; -+ -+ return 0; -+} -+ -+ - virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) - { - virQEMUCapsPtr ret = virQEMUCapsNew(); -@@ -2125,20 +2149,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) - goto error; - } - -- if (qemuCaps->kvmCPUModel && -- !(ret->kvmCPUModel = virCPUDefCopy(qemuCaps->kvmCPUModel))) -- goto error; -- -- if (qemuCaps->tcgCPUModel && -- !(ret->tcgCPUModel = virCPUDefCopy(qemuCaps->tcgCPUModel))) -- goto error; -- -- if (qemuCaps->kvmCPUModelInfo && -- !(ret->kvmCPUModelInfo = qemuMonitorCPUModelInfoCopy(qemuCaps->kvmCPUModelInfo))) -- goto error; -- -- if (qemuCaps->tcgCPUModelInfo && -- !(ret->tcgCPUModelInfo = qemuMonitorCPUModelInfoCopy(qemuCaps->tcgCPUModelInfo))) -+ if (virQEMUCapsHostCPUDataCopy(ret, qemuCaps) < 0) - goto error; - - if (VIR_ALLOC_N(ret->machineTypes, qemuCaps->nmachineTypes) < 0) --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Move-qemuCaps-host-CPU-data-in-a-struct.patch b/SOURCES/libvirt-qemu-Move-qemuCaps-host-CPU-data-in-a-struct.patch deleted file mode 100644 index 23e4e06..0000000 --- a/SOURCES/libvirt-qemu-Move-qemuCaps-host-CPU-data-in-a-struct.patch +++ /dev/null @@ -1,350 +0,0 @@ -From 988e2340fa307179fc6f896af33c4376187b90f8 Mon Sep 17 00:00:00 2001 -Message-Id: <988e2340fa307179fc6f896af33c4376187b90f8@dist-git> -From: Jiri Denemark -Date: Fri, 7 Apr 2017 18:15:26 +0200 -Subject: [PATCH] qemu: Move qemuCaps host CPU data in a struct - -We need to store several CPU related data structure for both KVM and -TCG. So instead of keeping two different copies of everything let's -make a virQEMUCapsHostCPUData struct and use it twice. - -Signed-off-by: Jiri Denemark -(cherry picked from commit b0a84ffb7f38f990120c231cfb74956a0ed10d95) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 166 +++++++++++++++++++++---------------------- - 1 file changed, 81 insertions(+), 85 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 8e7cbb590..0db149018 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -374,6 +374,19 @@ struct virQEMUCapsMachineType { - unsigned int maxCpus; - bool hotplugCpus; - }; -+ -+typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData; -+typedef virQEMUCapsHostCPUData *virQEMUCapsHostCPUDataPtr; -+struct _virQEMUCapsHostCPUData { -+ /* Only the "info" part is stored in the capabilities cache, the rest is -+ * re-computed from other fields and external data sources everytime we -+ * probe QEMU or load the cache. -+ */ -+ qemuMonitorCPUModelInfoPtr info; -+ /* Host CPU definition reported in domain capabilities. */ -+ virCPUDefPtr reported; -+}; -+ - /* - * Update the XML parser/formatter when adding more - * information to this struct so that it gets cached -@@ -408,15 +421,8 @@ struct _virQEMUCaps { - size_t ngicCapabilities; - virGICCapability *gicCapabilities; - -- qemuMonitorCPUModelInfoPtr kvmCPUModelInfo; -- qemuMonitorCPUModelInfoPtr tcgCPUModelInfo; -- -- /* Anything below is not stored in the cache since the values are -- * re-computed from the other fields or external data sources every -- * time we probe QEMU or load the results from the cache. -- */ -- virCPUDefPtr kvmCPUModel; -- virCPUDefPtr tcgCPUModel; -+ virQEMUCapsHostCPUData kvmCPU; -+ virQEMUCapsHostCPUData tcgCPU; - }; - - struct virQEMUCapsSearchData { -@@ -2089,23 +2095,15 @@ virQEMUCapsNew(void) - - - static int --virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst, -- virQEMUCapsPtr src) -+virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, -+ virQEMUCapsHostCPUDataPtr src) - { -- if (src->kvmCPUModel && -- !(dst->kvmCPUModel = virCPUDefCopy(src->kvmCPUModel))) -+ if (src->info && -+ !(dst->info = qemuMonitorCPUModelInfoCopy(src->info))) - return -1; - -- if (src->tcgCPUModel && -- !(dst->tcgCPUModel = virCPUDefCopy(src->tcgCPUModel))) -- return -1; -- -- if (src->kvmCPUModelInfo && -- !(dst->kvmCPUModelInfo = qemuMonitorCPUModelInfoCopy(src->kvmCPUModelInfo))) -- return -1; -- -- if (src->tcgCPUModelInfo && -- !(dst->tcgCPUModelInfo = qemuMonitorCPUModelInfoCopy(src->tcgCPUModelInfo))) -+ if (src->reported && -+ !(dst->reported = virCPUDefCopy(src->reported))) - return -1; - - return 0; -@@ -2113,17 +2111,12 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsPtr dst, - - - static void --virQEMUCapsHostCPUDataClear(virQEMUCapsPtr qemuCaps) -+virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData) - { -- qemuMonitorCPUModelInfoFree(qemuCaps->kvmCPUModelInfo); -- qemuMonitorCPUModelInfoFree(qemuCaps->tcgCPUModelInfo); -- qemuCaps->kvmCPUModelInfo = NULL; -- qemuCaps->tcgCPUModelInfo = NULL; -+ qemuMonitorCPUModelInfoFree(cpuData->info); -+ virCPUDefFree(cpuData->reported); - -- virCPUDefFree(qemuCaps->kvmCPUModel); -- virCPUDefFree(qemuCaps->tcgCPUModel); -- qemuCaps->kvmCPUModel = NULL; -- qemuCaps->tcgCPUModel = NULL; -+ memset(cpuData, 0, sizeof(*cpuData)); - } - - -@@ -2164,7 +2157,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) - goto error; - } - -- if (virQEMUCapsHostCPUDataCopy(ret, qemuCaps) < 0) -+ if (virQEMUCapsHostCPUDataCopy(&ret->kvmCPU, &qemuCaps->kvmCPU) < 0 || -+ virQEMUCapsHostCPUDataCopy(&ret->tcgCPU, &qemuCaps->tcgCPU) < 0) - goto error; - - if (VIR_ALLOC_N(ret->machineTypes, qemuCaps->nmachineTypes) < 0) -@@ -2213,7 +2207,8 @@ void virQEMUCapsDispose(void *obj) - - VIR_FREE(qemuCaps->gicCapabilities); - -- virQEMUCapsHostCPUDataClear(qemuCaps); -+ virQEMUCapsHostCPUDataClear(&qemuCaps->kvmCPU); -+ virQEMUCapsHostCPUDataClear(&qemuCaps->tcgCPU); - } - - void -@@ -2437,14 +2432,24 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - } - - -+static virQEMUCapsHostCPUDataPtr -+virQEMUCapsGetHostCPUData(virQEMUCapsPtr qemuCaps, -+ virDomainVirtType type) -+{ -+ if (type == VIR_DOMAIN_VIRT_KVM) -+ return &qemuCaps->kvmCPU; -+ else -+ return &qemuCaps->tcgCPU; -+} -+ -+ - virCPUDefPtr - virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type) - { -- if (type == VIR_DOMAIN_VIRT_KVM) -- return qemuCaps->kvmCPUModel; -- else -- return qemuCaps->tcgCPUModel; -+ virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); -+ -+ return cpuData->reported; - } - - -@@ -2453,10 +2458,9 @@ virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - virCPUDefPtr cpu) - { -- if (type == VIR_DOMAIN_VIRT_KVM) -- qemuCaps->kvmCPUModel = cpu; -- else -- qemuCaps->tcgCPUModel = cpu; -+ virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); -+ -+ cpuData->reported = cpu; - } - - -@@ -2847,24 +2851,28 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon, - bool tcg) - { -- qemuMonitorCPUModelInfoPtr *modelInfo; -+ qemuMonitorCPUModelInfoPtr modelInfo = NULL; - qemuMonitorCPUModelInfoPtr nonMigratable = NULL; - virHashTablePtr hash = NULL; - const char *model; - qemuMonitorCPUModelExpansionType type; -+ virDomainVirtType virtType; -+ virQEMUCapsHostCPUDataPtr cpuData; - int ret = -1; - - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) - return 0; - - if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { -- modelInfo = &qemuCaps->tcgCPUModelInfo; -+ virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; - } else { -- modelInfo = &qemuCaps->kvmCPUModelInfo; -+ virtType = VIR_DOMAIN_VIRT_KVM; - model = "host"; - } - -+ cpuData = virQEMUCapsGetHostCPUData(qemuCaps, virtType); -+ - /* Some x86_64 features defined in cpu_map.xml use spelling which differ - * from the one preferred by QEMU. Static expansion would give us only the - * preferred spelling, thus we need to do a full expansion on the result of -@@ -2875,14 +2883,14 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, - else - type = QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC; - -- if (qemuMonitorGetCPUModelExpansion(mon, type, model, true, modelInfo) < 0) -- return -1; -+ if (qemuMonitorGetCPUModelExpansion(mon, type, model, true, &modelInfo) < 0) -+ goto cleanup; - - /* Try to check migratability of each feature. */ -- if (*modelInfo && -+ if (modelInfo && - qemuMonitorGetCPUModelExpansion(mon, type, model, false, - &nonMigratable) < 0) -- goto error; -+ goto cleanup; - - if (nonMigratable) { - qemuMonitorCPUPropertyPtr prop; -@@ -2890,12 +2898,12 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, - size_t i; - - if (!(hash = virHashCreate(0, NULL))) -- goto error; -+ goto cleanup; - -- for (i = 0; i < (*modelInfo)->nprops; i++) { -- prop = (*modelInfo)->props + i; -+ for (i = 0; i < modelInfo->nprops; i++) { -+ prop = modelInfo->props + i; - if (virHashAddEntry(hash, prop->name, prop) < 0) -- goto error; -+ goto cleanup; - } - - for (i = 0; i < nonMigratable->nprops; i++) { -@@ -2913,21 +2921,18 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, - } - } - -- (*modelInfo)->migratability = true; -+ modelInfo->migratability = true; - } - -+ VIR_STEAL_PTR(cpuData->info, modelInfo); - ret = 0; - - cleanup: - virHashFree(hash); - qemuMonitorCPUModelInfoFree(nonMigratable); -+ qemuMonitorCPUModelInfoFree(modelInfo); - - return ret; -- -- error: -- qemuMonitorCPUModelInfoFree(*modelInfo); -- *modelInfo = NULL; -- goto cleanup; - } - - struct tpmTypeToCaps { -@@ -3280,21 +3285,19 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - virCPUDefPtr cpu, - bool migratable) - { -- qemuMonitorCPUModelInfoPtr model; -+ virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); - int ret = 1; - -- if (type == VIR_DOMAIN_VIRT_KVM) -- model = qemuCaps->kvmCPUModelInfo; -- else -- model = qemuCaps->tcgCPUModelInfo; -- -- if (migratable && model && !model->migratability) -+ if (migratable && cpuData->info && !cpuData->info->migratability) - return 1; - -- if (ARCH_IS_S390(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelS390(qemuCaps, model, cpu, migratable); -- else if (ARCH_IS_X86(qemuCaps->arch)) -- ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, model, cpu, migratable); -+ if (ARCH_IS_S390(qemuCaps->arch)) { -+ ret = virQEMUCapsInitCPUModelS390(qemuCaps, cpuData->info, -+ cpu, migratable); -+ } else if (ARCH_IS_X86(qemuCaps->arch)) { -+ ret = virQEMUCapsInitCPUModelX86(qemuCaps, type, cpuData->info, -+ cpu, migratable); -+ } - - if (ret == 0) - cpu->fallback = VIR_CPU_FALLBACK_FORBID; -@@ -3354,10 +3357,9 @@ virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - qemuMonitorCPUModelInfoPtr modelInfo) - { -- if (type == VIR_DOMAIN_VIRT_KVM) -- qemuCaps->kvmCPUModelInfo = modelInfo; -- else -- qemuCaps->tcgCPUModelInfo = modelInfo; -+ virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); -+ -+ cpuData->info = modelInfo; - } - - -@@ -3816,18 +3818,11 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsPtr qemuCaps, - virBufferPtr buf, - virDomainVirtType type) - { -- qemuMonitorCPUModelInfoPtr model; -- const char *typeStr; -+ virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); -+ qemuMonitorCPUModelInfoPtr model = cpuData->info; -+ const char *typeStr = type == VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg"; - size_t i; - -- if (type == VIR_DOMAIN_VIRT_KVM) { -- typeStr = "kvm"; -- model = qemuCaps->kvmCPUModelInfo; -- } else { -- typeStr = "tcg"; -- model = qemuCaps->tcgCPUModelInfo; -- } -- - if (!model) - return; - -@@ -4086,7 +4081,8 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps) - VIR_FREE(qemuCaps->gicCapabilities); - qemuCaps->ngicCapabilities = 0; - -- virQEMUCapsHostCPUDataClear(qemuCaps); -+ virQEMUCapsHostCPUDataClear(&qemuCaps->kvmCPU); -+ virQEMUCapsHostCPUDataClear(&qemuCaps->tcgCPU); - } - - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Move-snapshot-disk-validation-functions-into-one.patch b/SOURCES/libvirt-qemu-Move-snapshot-disk-validation-functions-into-one.patch new file mode 100644 index 0000000..6a163ae --- /dev/null +++ b/SOURCES/libvirt-qemu-Move-snapshot-disk-validation-functions-into-one.patch @@ -0,0 +1,185 @@ +From 53d9458b2d6095e376f2b5cacf30da7b2227f69d Mon Sep 17 00:00:00 2001 +Message-Id: <53d9458b2d6095e376f2b5cacf30da7b2227f69d@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:13 +0100 +Subject: [PATCH] qemu: Move snapshot disk validation functions into one + +Move the code so that both the new image and old image can be verified +in the same function. + +(cherry picked from commit 8ffdeed455650557df531aafc66c20b31bd4e0c4) + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 91 ++++++++++++++++++++------------------------------ + 1 file changed, 36 insertions(+), 55 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index b35ab6d30e..aa6a326bb4 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -13953,17 +13953,19 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, + + + static int +-qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) ++qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdisk, ++ virDomainDiskDefPtr domdisk) + { +- int actualType = virStorageSourceGetActualType(disk->src); ++ int domDiskType = virStorageSourceGetActualType(domdisk->src); ++ int snapDiskType = virStorageSourceGetActualType(snapdisk->src); + +- switch ((virStorageType) actualType) { ++ switch ((virStorageType) domDiskType) { + case VIR_STORAGE_TYPE_BLOCK: + case VIR_STORAGE_TYPE_FILE: +- return 0; ++ break; + + case VIR_STORAGE_TYPE_NETWORK: +- switch ((virStorageNetProtocol) disk->src->protocol) { ++ switch ((virStorageNetProtocol) domdisk->src->protocol) { + case VIR_STORAGE_NET_PROTOCOL_NONE: + case VIR_STORAGE_NET_PROTOCOL_NBD: + case VIR_STORAGE_NET_PROTOCOL_RBD: +@@ -13981,7 +13983,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) + virReportError(VIR_ERR_INTERNAL_ERROR, + _("external inactive snapshots are not supported on " + "'network' disks using '%s' protocol"), +- virStorageNetProtocolTypeToString(disk->src->protocol)); ++ virStorageNetProtocolTypeToString(domdisk->src->protocol)); + return -1; + } + break; +@@ -13992,7 +13994,23 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) + case VIR_STORAGE_TYPE_LAST: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("external inactive snapshots are not supported on " +- "'%s' disks"), virStorageTypeToString(actualType)); ++ "'%s' disks"), virStorageTypeToString(domDiskType)); ++ return -1; ++ } ++ ++ switch ((virStorageType) snapDiskType) { ++ case VIR_STORAGE_TYPE_BLOCK: ++ case VIR_STORAGE_TYPE_FILE: ++ break; ++ ++ case VIR_STORAGE_TYPE_NETWORK: ++ case VIR_STORAGE_TYPE_DIR: ++ case VIR_STORAGE_TYPE_VOLUME: ++ case VIR_STORAGE_TYPE_NONE: ++ case VIR_STORAGE_TYPE_LAST: ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("external inactive snapshots are not supported on " ++ "'%s' disks"), virStorageTypeToString(snapDiskType)); + return -1; + } + +@@ -14001,33 +14019,27 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk) + + + static int +-qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk) ++qemuDomainSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDefPtr snapdisk, ++ virDomainDiskDefPtr domdisk) + { +- if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { ++ int actualType = virStorageSourceGetActualType(snapdisk->src); ++ ++ if (domdisk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("external active snapshots are not supported on scsi " + "passthrough devices")); + return -1; + } + +- return 0; +-} +- +- +-static int +-qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk) +-{ +- int actualType = virStorageSourceGetActualType(disk->src); +- + switch ((virStorageType) actualType) { + case VIR_STORAGE_TYPE_BLOCK: + case VIR_STORAGE_TYPE_FILE: +- return 0; ++ break; + + case VIR_STORAGE_TYPE_NETWORK: +- switch ((virStorageNetProtocol) disk->src->protocol) { ++ switch ((virStorageNetProtocol) snapdisk->src->protocol) { + case VIR_STORAGE_NET_PROTOCOL_GLUSTER: +- return 0; ++ break; + + case VIR_STORAGE_NET_PROTOCOL_NONE: + case VIR_STORAGE_NET_PROTOCOL_NBD: +@@ -14045,7 +14057,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d + virReportError(VIR_ERR_INTERNAL_ERROR, + _("external active snapshots are not supported on " + "'network' disks using '%s' protocol"), +- virStorageNetProtocolTypeToString(disk->src->protocol)); ++ virStorageNetProtocolTypeToString(snapdisk->src->protocol)); + return -1; + + } +@@ -14065,31 +14077,6 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d + } + + +-static int +-qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk) +-{ +- int actualType = virStorageSourceGetActualType(disk->src); +- +- switch ((virStorageType) actualType) { +- case VIR_STORAGE_TYPE_BLOCK: +- case VIR_STORAGE_TYPE_FILE: +- return 0; +- +- case VIR_STORAGE_TYPE_NETWORK: +- case VIR_STORAGE_TYPE_DIR: +- case VIR_STORAGE_TYPE_VOLUME: +- case VIR_STORAGE_TYPE_NONE: +- case VIR_STORAGE_TYPE_LAST: +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("external inactive snapshots are not supported on " +- "'%s' disks"), virStorageTypeToString(actualType)); +- return -1; +- } +- +- return 0; +-} +- +- + static int + qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn, + virDomainDiskDefPtr disk, +@@ -14107,16 +14094,10 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn, + if (virStorageTranslateDiskSourcePool(conn, disk) < 0) + return -1; + +- if (qemuDomainSnapshotPrepareDiskExternalBackingInactive(disk) < 0) +- return -1; +- +- if (qemuDomainSnapshotPrepareDiskExternalOverlayInactive(snapdisk) < 0) ++ if (qemuDomainSnapshotPrepareDiskExternalInactive(snapdisk, disk) < 0) + return -1; + } else { +- if (qemuDomainSnapshotPrepareDiskExternalBackingActive(disk) < 0) +- return -1; +- +- if (qemuDomainSnapshotPrepareDiskExternalOverlayActive(snapdisk) < 0) ++ if (qemuDomainSnapshotPrepareDiskExternalActive(snapdisk, disk) < 0) + return -1; + } + +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Pass-migratable-host-CPU-model-to-virCPUUpdate.patch b/SOURCES/libvirt-qemu-Pass-migratable-host-CPU-model-to-virCPUUpdate.patch deleted file mode 100644 index 2ce3f7e..0000000 --- a/SOURCES/libvirt-qemu-Pass-migratable-host-CPU-model-to-virCPUUpdate.patch +++ /dev/null @@ -1,219 +0,0 @@ -From ea1a18cc0a5722b64c37c79bee7b9ed3c220ca01 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Wed, 29 Mar 2017 15:31:17 +0200 -Subject: [PATCH] qemu: Pass migratable host CPU model to virCPUUpdate - -We already know from QEMU which CPU features will block migration. Let's -use this information to make a migratable copy of the host CPU model and -use it for updating guest CPU specification. This will allow us to drop -feature filtering from virCPUUpdate where it was just a hack. - -Signed-off-by: Jiri Denemark -(cherry picked from commit 56bd7edcb5dc878beffb80d4e6a9cfb812378ded) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 57 +++++++++++++++++++++++++++++++++++++------- - src/qemu/qemu_capabilities.h | 2 ++ - src/qemu/qemu_process.c | 2 +- - tests/cputest.c | 7 +++++- - 4 files changed, 57 insertions(+), 11 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index e84de9f5b..ec773971e 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -385,6 +385,8 @@ struct _virQEMUCapsHostCPUData { - qemuMonitorCPUModelInfoPtr info; - /* Host CPU definition reported in domain capabilities. */ - virCPUDefPtr reported; -+ /* Migratable host CPU definition used for updating guest CPU. */ -+ virCPUDefPtr migratable; - }; - - /* -@@ -2106,6 +2108,10 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, - !(dst->reported = virCPUDefCopy(src->reported))) - return -1; - -+ if (src->migratable && -+ !(dst->migratable = virCPUDefCopy(src->migratable))) -+ return -1; -+ - return 0; - } - -@@ -2115,6 +2121,7 @@ virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData) - { - qemuMonitorCPUModelInfoFree(cpuData->info); - virCPUDefFree(cpuData->reported); -+ virCPUDefFree(cpuData->migratable); - - memset(cpuData, 0, sizeof(*cpuData)); - } -@@ -2453,6 +2460,9 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, - switch (cpuType) { - case VIR_QEMU_CAPS_HOST_CPU_REPORTED: - return cpuData->reported; -+ -+ case VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE: -+ return cpuData->migratable; - } - - return NULL; -@@ -2462,11 +2472,13 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, - static void - virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, -- virCPUDefPtr cpu) -+ virCPUDefPtr reported, -+ virCPUDefPtr migratable) - { - virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); - -- cpuData->reported = cpu; -+ cpuData->reported = reported; -+ cpuData->migratable = migratable; - } - - -@@ -3313,26 +3325,39 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, - } - - -+static virCPUDefPtr -+virQEMUCapsNewHostCPUModel(void) -+{ -+ virCPUDefPtr cpu; -+ -+ if (VIR_ALLOC(cpu) < 0) -+ return NULL; -+ -+ cpu->type = VIR_CPU_TYPE_GUEST; -+ cpu->mode = VIR_CPU_MODE_CUSTOM; -+ cpu->match = VIR_CPU_MATCH_EXACT; -+ cpu->fallback = VIR_CPU_FALLBACK_ALLOW; -+ -+ return cpu; -+} -+ -+ - void - virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - virCapsPtr caps, - virDomainVirtType type) - { - virCPUDefPtr cpu = NULL; -+ virCPUDefPtr migCPU = NULL; - virCPUDefPtr hostCPU = NULL; - int rc; - - if (!caps || !virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch)) - return; - -- if (VIR_ALLOC(cpu) < 0) -+ if (!(cpu = virQEMUCapsNewHostCPUModel())) - goto error; - -- cpu->type = VIR_CPU_TYPE_GUEST; -- cpu->mode = VIR_CPU_MODE_CUSTOM; -- cpu->match = VIR_CPU_MATCH_EXACT; -- cpu->fallback = VIR_CPU_FALLBACK_ALLOW; -- - if ((rc = virQEMUCapsInitCPUModel(qemuCaps, type, cpu, false)) < 0) { - goto error; - } else if (rc == 1) { -@@ -3346,7 +3371,20 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - goto error; - } - -- virQEMUCapsSetHostModel(qemuCaps, type, cpu); -+ if (!(migCPU = virQEMUCapsNewHostCPUModel())) -+ goto error; -+ -+ if ((rc = virQEMUCapsInitCPUModel(qemuCaps, type, migCPU, true)) < 0) { -+ goto error; -+ } else if (rc == 1) { -+ VIR_DEBUG("CPU migratability not provided by QEMU"); -+ -+ virCPUDefFree(migCPU); -+ if (!(migCPU = virCPUCopyMigratable(qemuCaps->arch, cpu))) -+ goto error; -+ } -+ -+ virQEMUCapsSetHostModel(qemuCaps, type, cpu, migCPU); - - cleanup: - virCPUDefFree(hostCPU); -@@ -3354,6 +3392,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - - error: - virCPUDefFree(cpu); -+ virCPUDefFree(migCPU); - virResetLastError(); - goto cleanup; - } -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 50333fc26..16fe044cc 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -454,6 +454,8 @@ int virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - typedef enum { - /* Host CPU definition reported in domain capabilities. */ - VIR_QEMU_CAPS_HOST_CPU_REPORTED, -+ /* Migratable host CPU definition used for updating guest CPU. */ -+ VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE, - } virQEMUCapsHostCPUType; - - virCPUDefPtr virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index dc073891a..c81389ef2 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -5313,7 +5313,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, - - if (virCPUUpdate(def->os.arch, def->cpu, - virQEMUCapsGetHostModel(qemuCaps, def->virtType, -- VIR_QEMU_CAPS_HOST_CPU_REPORTED)) < 0) -+ VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE)) < 0) - goto cleanup; - - if (virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType, -diff --git a/tests/cputest.c b/tests/cputest.c -index 8c07cf4f6..efa891dc1 100644 ---- a/tests/cputest.c -+++ b/tests/cputest.c -@@ -393,6 +393,7 @@ cpuTestUpdate(const void *arg) - const struct data *data = arg; - int ret = -1; - virCPUDefPtr host = NULL; -+ virCPUDefPtr migHost = NULL; - virCPUDefPtr cpu = NULL; - char *result = NULL; - -@@ -400,7 +401,10 @@ cpuTestUpdate(const void *arg) - !(cpu = cpuTestLoadXML(data->arch, data->name))) - goto cleanup; - -- if (virCPUUpdate(host->arch, cpu, host) < 0) -+ if (!(migHost = virCPUCopyMigratable(data->arch, host))) -+ goto cleanup; -+ -+ if (virCPUUpdate(host->arch, cpu, migHost) < 0) - goto cleanup; - - if (virAsprintf(&result, "%s+%s", data->host, data->name) < 0) -@@ -411,6 +415,7 @@ cpuTestUpdate(const void *arg) - cleanup: - virCPUDefFree(host); - virCPUDefFree(cpu); -+ virCPUDefFree(migHost); - VIR_FREE(result); - return ret; - } --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Pass-the-number-of-heads-even-with-vga-qxl.patch b/SOURCES/libvirt-qemu-Pass-the-number-of-heads-even-with-vga-qxl.patch deleted file mode 100644 index 1d7743f..0000000 --- a/SOURCES/libvirt-qemu-Pass-the-number-of-heads-even-with-vga-qxl.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 7f85f27f9f14683fb784ffd9aecb545d7d39194d Mon Sep 17 00:00:00 2001 -Message-Id: <7f85f27f9f14683fb784ffd9aecb545d7d39194d@dist-git> -From: Martin Kletzander -Date: Mon, 19 Jun 2017 15:40:17 +0200 -Subject: [PATCH] qemu: Pass the number of heads even with -vga qxl - -When added in multiple previous commits, it was used only with -device -qxl(-vga), but for some QEMUs (< 1.6) we need to add this -functionality when using -vga qxl as well. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1283207 - -Signed-off-by: Martin Kletzander -(cherry picked from commit d23410449fc9f91ceeeacb19d915a6db2f17f3be) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina ---- - src/qemu/qemu_command.c | 7 ++++ - .../qemuxml2argv-video-vga-qxl-heads.args | 30 ++++++++++++++ - .../qemuxml2argv-video-vga-qxl-heads.xml | 47 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 3 ++ - 4 files changed, 87 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 88223babeb..a4184b7378 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -4585,6 +4585,7 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, - unsigned int vram = video->vram; - unsigned int vram64 = video->vram64; - unsigned int vgamem = video->vgamem; -+ unsigned int heads = video->heads; - - if (ram) { - virCommandAddArg(cmd, "-global"); -@@ -4608,6 +4609,12 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vgamem / 1024); - } -+ if (heads && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) { -+ virCommandAddArg(cmd, "-global"); -+ virCommandAddArgFormat(cmd, "%s.max_outputs=%u", -+ dev, heads); -+ } - } - - if (video->vram && -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args -new file mode 100644 -index 0000000000..411a2eedbc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args -@@ -0,0 +1,30 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-i686 \ -+-name QEMUGuest1 \ -+-S \ -+-M pc \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-usb \ -+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ -+-vga qxl \ -+-global qxl-vga.ram_size=67108864 \ -+-global qxl-vga.vram_size=67108864 \ -+-global qxl-vga.max_outputs=1 \ -+-device qxl,id=video1,ram_size=67108864,vram_size=33554432,max_outputs=3,\ -+bus=pci.0,addr=0x4 \ -+-device qxl,id=video2,ram_size=67108864,vram_size=67108864,max_outputs=7,\ -+bus=pci.0,addr=0x5 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml -new file mode 100644 -index 0000000000..d878ddcd6d ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.xml -@@ -0,0 +1,47 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+ -+ -+
      -+
      cookie
      -+
      Save image cookie containing additional data libvirt may need to -+ properly restore a domain from an active snapshot when such data -+ cannot be stored directly in the domain to maintain -+ compatibility with older libvirt or hypervisor. Readonly. -+
      - - -

      Examples

      -diff --git a/docs/schemas/domainsnapshot.rng b/docs/schemas/domainsnapshot.rng -index 4ab1b828f2..2680887095 100644 ---- a/docs/schemas/domainsnapshot.rng -+++ b/docs/schemas/domainsnapshot.rng -@@ -90,6 +90,13 @@ - - - -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 7ce0f01f70..dbb1ea9475 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2813,7 +2813,8 @@ struct _virQEMUSaveHeader { - uint32_t data_len; - uint32_t was_running; - uint32_t compressed; -- uint32_t unused[15]; -+ uint32_t cookieOffset; -+ uint32_t unused[14]; - }; - - typedef struct _virQEMUSaveData virQEMUSaveData; -@@ -2821,6 +2822,7 @@ typedef virQEMUSaveData *virQEMUSaveDataPtr; - struct _virQEMUSaveData { - virQEMUSaveHeader header; - char *xml; -+ char *cookie; - }; - - -@@ -2831,6 +2833,7 @@ bswap_header(virQEMUSaveHeaderPtr hdr) - hdr->data_len = bswap_32(hdr->data_len); - hdr->was_running = bswap_32(hdr->was_running); - hdr->compressed = bswap_32(hdr->compressed); -+ hdr->cookieOffset = bswap_32(hdr->cookieOffset); - } - - -@@ -2841,6 +2844,7 @@ virQEMUSaveDataFree(virQEMUSaveDataPtr data) - return; - - VIR_FREE(data->xml); -+ VIR_FREE(data->cookie); - VIR_FREE(data); - } - -@@ -2850,8 +2854,10 @@ virQEMUSaveDataFree(virQEMUSaveDataPtr data) - */ - static virQEMUSaveDataPtr - virQEMUSaveDataNew(char *domXML, -+ qemuDomainSaveCookiePtr cookieObj, - bool running, -- int compressed) -+ int compressed, -+ virDomainXMLOptionPtr xmlopt) - { - virQEMUSaveDataPtr data = NULL; - virQEMUSaveHeaderPtr header; -@@ -2861,6 +2867,11 @@ virQEMUSaveDataNew(char *domXML, - - VIR_STEAL_PTR(data->xml, domXML); - -+ if (cookieObj && -+ !(data->cookie = virSaveCookieFormat((virObjectPtr) cookieObj, -+ virDomainXMLOptionGetSaveCookie(xmlopt)))) -+ goto error; -+ - header = &data->header; - memcpy(header->magic, QEMU_SAVE_PARTIAL, sizeof(header->magic)); - header->version = QEMU_SAVE_VERSION; -@@ -2868,6 +2879,10 @@ virQEMUSaveDataNew(char *domXML, - header->compressed = compressed; - - return data; -+ -+ error: -+ virQEMUSaveDataFree(data); -+ return NULL; - } - - -@@ -2887,11 +2902,17 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data, - { - virQEMUSaveHeaderPtr header = &data->header; - size_t len; -+ size_t xml_len; -+ size_t cookie_len = 0; - int ret = -1; - size_t zerosLen = 0; - char *zeros = NULL; - -- len = strlen(data->xml) + 1; -+ xml_len = strlen(data->xml) + 1; -+ if (data->cookie) -+ cookie_len = strlen(data->cookie) + 1; -+ -+ len = xml_len + cookie_len; - - if (header->data_len > 0) { - if (len > header->data_len) { -@@ -2907,6 +2928,9 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data, - header->data_len = len; - } - -+ if (data->cookie) -+ header->cookieOffset = xml_len; -+ - if (safewrite(fd, header, sizeof(*header)) != sizeof(*header)) { - virReportSystemError(errno, - _("failed to write header to domain save file '%s'"), -@@ -2914,14 +2938,28 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data, - goto cleanup; - } - -- if (safewrite(fd, data->xml, header->data_len) != header->data_len || -- safewrite(fd, zeros, zerosLen) != zerosLen) { -+ if (safewrite(fd, data->xml, xml_len) != xml_len) { - virReportSystemError(errno, - _("failed to write domain xml to '%s'"), - path); - goto cleanup; - } - -+ if (data->cookie && -+ safewrite(fd, data->cookie, cookie_len) != cookie_len) { -+ virReportSystemError(errno, -+ _("failed to write cookie to '%s'"), -+ path); -+ goto cleanup; -+ } -+ -+ if (safewrite(fd, zeros, zerosLen) != zerosLen) { -+ virReportSystemError(errno, -+ _("failed to write padding to '%s'"), -+ path); -+ goto cleanup; -+ } -+ - ret = 0; - - cleanup: -@@ -3236,6 +3274,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - qemuDomainObjPrivatePtr priv = vm->privateData; - virCapsPtr caps; - virQEMUSaveDataPtr data = NULL; -+ qemuDomainSaveCookiePtr cookie = NULL; - - if (!(caps = virQEMUDriverGetCapabilities(driver, false))) - goto cleanup; -@@ -3301,7 +3340,11 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - goto endjob; - } - -- if (!(data = virQEMUSaveDataNew(xml, was_running, compressed))) -+ if (!(cookie = qemuDomainSaveCookieNew(vm))) -+ goto endjob; -+ -+ if (!(data = virQEMUSaveDataNew(xml, cookie, was_running, compressed, -+ driver->xmlopt))) - goto endjob; - xml = NULL; - -@@ -3338,6 +3381,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - qemuDomainRemoveInactive(driver, vm); - - cleanup: -+ virObjectUnref(cookie); - VIR_FREE(xml); - virQEMUSaveDataFree(data); - qemuDomainEventQueue(driver, event); -@@ -6282,6 +6326,8 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - virDomainDefPtr def = NULL; - int oflags = open_write ? O_RDWR : O_RDONLY; - virCapsPtr caps = NULL; -+ size_t xml_len; -+ size_t cookie_len; - - if (bypass_cache) { - int directFlag = virFileDirectFdFlag(); -@@ -6362,15 +6408,33 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, - goto error; - } - -- if (VIR_ALLOC_N(data->xml, header->data_len) < 0) -+ if (header->cookieOffset) -+ xml_len = header->cookieOffset; -+ else -+ xml_len = header->data_len; -+ -+ cookie_len = header->data_len - xml_len; -+ -+ if (VIR_ALLOC_N(data->xml, xml_len) < 0) - goto error; - -- if (saferead(fd, data->xml, header->data_len) != header->data_len) { -+ if (saferead(fd, data->xml, xml_len) != xml_len) { - virReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to read domain XML")); - goto error; - } - -+ if (cookie_len > 0) { -+ if (VIR_ALLOC_N(data->cookie, cookie_len) < 0) -+ goto error; -+ -+ if (saferead(fd, data->cookie, cookie_len) != cookie_len) { -+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", -+ _("failed to read cookie")); -+ goto error; -+ } -+ } -+ - /* Create a domain from this XML */ - if (!(def = virDomainDefParseString(data->xml, caps, driver->xmlopt, NULL, - VIR_DOMAIN_DEF_PARSE_INACTIVE | -@@ -6411,6 +6475,11 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - char *errbuf = NULL; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); - virQEMUSaveHeaderPtr header = &data->header; -+ qemuDomainSaveCookiePtr cookie = NULL; -+ -+ if (virSaveCookieParseString(data->cookie, (virObjectPtr *) &cookie, -+ virDomainXMLOptionGetSaveCookie(driver->xmlopt)) < 0) -+ goto cleanup; - - if ((header->version == 2) && - (header->compressed != QEMU_SAVE_FORMAT_RAW)) { -@@ -6501,6 +6570,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - ret = 0; - - cleanup: -+ virObjectUnref(cookie); - virCommandFree(cmd); - VIR_FREE(errbuf); - if (qemuSecurityRestoreSavedStateLabel(driver->securityManager, -@@ -13561,6 +13631,9 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, - if (ret < 0) - goto cleanup; - -+ if (!(snap->def->cookie = (virObjectPtr) qemuDomainSaveCookieNew(vm))) -+ goto cleanup; -+ - if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { - event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT); -@@ -14439,10 +14512,13 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, - "snapshot", false)) < 0) - goto cleanup; - -- if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true))) -+ if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true)) || -+ !(snap->def->cookie = (virObjectPtr) qemuDomainSaveCookieNew(vm))) - goto cleanup; - -- if (!(data = virQEMUSaveDataNew(xml, resume, compressed))) -+ if (!(data = virQEMUSaveDataNew(xml, -+ (qemuDomainSaveCookiePtr) snap->def->cookie, -+ resume, compressed, driver->xmlopt))) - goto cleanup; - xml = NULL; - --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Store-updated-CPU-in-save-cookie.patch b/SOURCES/libvirt-qemu-Store-updated-CPU-in-save-cookie.patch deleted file mode 100644 index 6ba177a..0000000 --- a/SOURCES/libvirt-qemu-Store-updated-CPU-in-save-cookie.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 910db8ca0b1a92d8d7ed9763b2ced958142dcaa4 Mon Sep 17 00:00:00 2001 -Message-Id: <910db8ca0b1a92d8d7ed9763b2ced958142dcaa4@dist-git> -From: Jiri Denemark -Date: Fri, 2 Jun 2017 22:52:03 +0200 -Subject: [PATCH] qemu: Store updated CPU in save cookie - -Since the domain XML saved in a snapshot or saved image uses the -original guest CPU definition but we still want to enforce ABI when -restoring the domain if libvirt and QEMU are new enough, we save the -live updated CPU definition in a save cookie. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 8c19fbf452372c7c1becf987497525ee8b61abbf) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 22 +++++++++++++++++++--- - src/qemu/qemu_domain.h | 2 ++ - 2 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 514b56b33c..7897a44634 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -9152,12 +9152,15 @@ qemuDomainSaveCookieDispose(void *obj) - qemuDomainSaveCookiePtr cookie = obj; - - VIR_DEBUG("cookie=%p", cookie); -+ -+ virCPUDefFree(cookie->cpu); - } - - - qemuDomainSaveCookiePtr - qemuDomainSaveCookieNew(virDomainObjPtr vm ATTRIBUTE_UNUSED) - { -+ qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainSaveCookiePtr cookie = NULL; - - if (qemuDomainInitialize() < 0) -@@ -9166,7 +9169,10 @@ qemuDomainSaveCookieNew(virDomainObjPtr vm ATTRIBUTE_UNUSED) - if (!(cookie = virObjectNew(qemuDomainSaveCookieClass))) - goto error; - -- VIR_DEBUG("Save cookie %p", cookie); -+ if (priv->origCPU && !(cookie->cpu = virCPUDefCopy(vm->def->cpu))) -+ goto error; -+ -+ VIR_DEBUG("Save cookie %p, cpu=%p", cookie, cookie->cpu); - - return cookie; - -@@ -9188,6 +9194,10 @@ qemuDomainSaveCookieParse(xmlXPathContextPtr ctxt ATTRIBUTE_UNUSED, - if (!(cookie = virObjectNew(qemuDomainSaveCookieClass))) - goto error; - -+ if (virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, -+ &cookie->cpu) < 0) -+ goto error; -+ - *obj = (virObjectPtr) cookie; - return 0; - -@@ -9198,9 +9208,15 @@ qemuDomainSaveCookieParse(xmlXPathContextPtr ctxt ATTRIBUTE_UNUSED, - - - static int --qemuDomainSaveCookieFormat(virBufferPtr buf ATTRIBUTE_UNUSED, -- virObjectPtr obj ATTRIBUTE_UNUSED) -+qemuDomainSaveCookieFormat(virBufferPtr buf, -+ virObjectPtr obj) - { -+ qemuDomainSaveCookiePtr cookie = (qemuDomainSaveCookiePtr) obj; -+ -+ if (cookie->cpu && -+ virCPUDefFormatBufFull(buf, cookie->cpu, NULL, false) < 0) -+ return -1; -+ - return 0; - } - -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 9567458849..2eea7924fb 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -424,6 +424,8 @@ typedef struct _qemuDomainSaveCookie qemuDomainSaveCookie; - typedef qemuDomainSaveCookie *qemuDomainSaveCookiePtr; - struct _qemuDomainSaveCookie { - virObject parent; -+ -+ virCPUDefPtr cpu; - }; - - qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Support-setting-NUMA-distances.patch b/SOURCES/libvirt-qemu-Support-setting-NUMA-distances.patch new file mode 100644 index 0000000..bf556dc --- /dev/null +++ b/SOURCES/libvirt-qemu-Support-setting-NUMA-distances.patch @@ -0,0 +1,259 @@ +From da9b2f15ee80396d542057340a576cf65828191a Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michal Privoznik +Date: Mon, 4 Dec 2017 13:38:52 +0100 +Subject: [PATCH] qemu: Support setting NUMA distances + +https://bugzilla.redhat.com/show_bug.cgi?id=1454889 + +Since we already have such support for libxl all we need is qemu +driver adjustment. And a test case. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit 97a051f0f80ec076f3ff48ef830236675f128ade) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 2 +- + src/qemu/qemu_command.c | 39 ++++++++++++- + .../qemuxml2argv-numatune-distances.args | 63 +++++++++++++++++++++ + .../qemuxml2argv-numatune-distances.xml | 65 ++++++++++++++++++++++ + tests/qemuxml2argvtest.c | 2 + + 5 files changed, 169 insertions(+), 2 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index a5adf5d9aa..cc1c5577cd 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -1589,7 +1589,7 @@ + +

      + Describing distances between NUMA cells is currently only supported +- by Xen. If no distances are given to describe ++ by Xen and QEMU. If no distances are given to describe + the SLIT data between different cells, it will default to a scheme + using 10 for local and 20 for remote distances. +

      +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 18977480d9..624a50d0b3 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7807,7 +7807,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, + virCommandPtr cmd, + qemuDomainObjPrivatePtr priv) + { +- size_t i; ++ size_t i, j; + virQEMUCapsPtr qemuCaps = priv->qemuCaps; + virBuffer buf = VIR_BUFFER_INITIALIZER; + char *cpumask = NULL, *tmpmask = NULL, *next = NULL; +@@ -7817,6 +7817,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, + int ret = -1; + size_t ncells = virDomainNumaGetNodeCount(def->numa); + const long system_page_size = virGetSystemPageSizeKB(); ++ bool numa_distances = false; + + if (virDomainNumatuneHasPerNodeBinding(def->numa) && + !(virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || +@@ -7925,6 +7926,42 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg, + + virCommandAddArgBuffer(cmd, &buf); + } ++ ++ /* If NUMA node distance is specified for at least one pair ++ * of nodes, we have to specify all the distances. Even ++ * though they might be the default ones. */ ++ for (i = 0; i < ncells; i++) { ++ for (j = 0; j < ncells; j++) { ++ if (virDomainNumaNodeDistanceIsUsingDefaults(def->numa, i, j)) ++ continue; ++ ++ numa_distances = true; ++ break; ++ } ++ if (numa_distances) ++ break; ++ } ++ ++ if (numa_distances) { ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_NUMA_DIST)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("setting NUMA distances is not " ++ "supported with this qemu")); ++ goto cleanup; ++ } ++ ++ for (i = 0; i < ncells; i++) { ++ for (j = 0; j < ncells; j++) { ++ size_t distance = virDomainNumaGetNodeDistance(def->numa, i, j); ++ ++ virCommandAddArg(cmd, "-numa"); ++ virBufferAsprintf(&buf, "dist,src=%zu,dst=%zu,val=%zu", i, j, distance); ++ ++ virCommandAddArgBuffer(cmd, &buf); ++ } ++ } ++ } ++ + ret = 0; + + cleanup: +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.args +new file mode 100644 +index 0000000000..23b66246c7 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.args +@@ -0,0 +1,63 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-x86_64 \ ++-name QEMUGuest \ ++-S \ ++-M xenfv \ ++-m 12288 \ ++-smp 12,sockets=12,cores=1,threads=1 \ ++-numa node,nodeid=0,cpus=0,cpus=11,mem=2048 \ ++-numa node,nodeid=1,cpus=1,cpus=10,mem=2048 \ ++-numa node,nodeid=2,cpus=2,cpus=9,mem=2048 \ ++-numa node,nodeid=3,cpus=3,cpus=8,mem=2048 \ ++-numa node,nodeid=4,cpus=4,cpus=7,mem=2048 \ ++-numa node,nodeid=5,cpus=5-6,mem=2048 \ ++-numa dist,src=0,dst=0,val=10 \ ++-numa dist,src=0,dst=1,val=21 \ ++-numa dist,src=0,dst=2,val=31 \ ++-numa dist,src=0,dst=3,val=41 \ ++-numa dist,src=0,dst=4,val=51 \ ++-numa dist,src=0,dst=5,val=61 \ ++-numa dist,src=1,dst=0,val=21 \ ++-numa dist,src=1,dst=1,val=10 \ ++-numa dist,src=1,dst=2,val=21 \ ++-numa dist,src=1,dst=3,val=31 \ ++-numa dist,src=1,dst=4,val=41 \ ++-numa dist,src=1,dst=5,val=51 \ ++-numa dist,src=2,dst=0,val=31 \ ++-numa dist,src=2,dst=1,val=21 \ ++-numa dist,src=2,dst=2,val=10 \ ++-numa dist,src=2,dst=3,val=21 \ ++-numa dist,src=2,dst=4,val=31 \ ++-numa dist,src=2,dst=5,val=41 \ ++-numa dist,src=3,dst=0,val=41 \ ++-numa dist,src=3,dst=1,val=31 \ ++-numa dist,src=3,dst=2,val=21 \ ++-numa dist,src=3,dst=3,val=10 \ ++-numa dist,src=3,dst=4,val=21 \ ++-numa dist,src=3,dst=5,val=31 \ ++-numa dist,src=4,dst=0,val=51 \ ++-numa dist,src=4,dst=1,val=41 \ ++-numa dist,src=4,dst=2,val=31 \ ++-numa dist,src=4,dst=3,val=21 \ ++-numa dist,src=4,dst=4,val=10 \ ++-numa dist,src=4,dst=5,val=21 \ ++-numa dist,src=5,dst=0,val=61 \ ++-numa dist,src=5,dst=1,val=51 \ ++-numa dist,src=5,dst=2,val=41 \ ++-numa dist,src=5,dst=3,val=31 \ ++-numa dist,src=5,dst=4,val=21 \ ++-numa dist,src=5,dst=5,val=10 \ ++-uuid c7a5fdb2-cdaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-usb \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.xml b/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.xml +new file mode 100644 +index 0000000000..0f33526b46 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-distances.xml +@@ -0,0 +1,65 @@ ++ ++ QEMUGuest ++ c7a5fdb2-cdaf-9455-926a-d65c16db1809 ++ 8388608 ++ 8388608 ++ 12 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ restart ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 77c9783929..72cefe4906 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1726,6 +1726,8 @@ mymain(void) + QEMU_CAPS_OBJECT_MEMORY_RAM); + DO_TEST_FAILURE("numatune-memnode-no-memory", NONE); + ++ DO_TEST("numatune-distances", QEMU_CAPS_NUMA, QEMU_CAPS_NUMA_DIST); ++ + DO_TEST("numatune-auto-nodeset-invalid", NONE); + DO_TEST("numatune-auto-prefer", QEMU_CAPS_OBJECT_MEMORY_RAM, + QEMU_CAPS_OBJECT_MEMORY_FILE); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Support-usb-serial-and-pci-serial-on-pSeries.patch b/SOURCES/libvirt-qemu-Support-usb-serial-and-pci-serial-on-pSeries.patch new file mode 100644 index 0000000..7905ad5 --- /dev/null +++ b/SOURCES/libvirt-qemu-Support-usb-serial-and-pci-serial-on-pSeries.patch @@ -0,0 +1,293 @@ +From 6c6f469f08a2fd5d61d91bf0488ade5ef0033f2d Mon Sep 17 00:00:00 2001 +Message-Id: <6c6f469f08a2fd5d61d91bf0488ade5ef0033f2d@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:13 +0100 +Subject: [PATCH] qemu: Support usb-serial and pci-serial on pSeries + +The existing implementation set the address type for all serial +devices to spapr-vio, which made it impossible to use other devices +such as usb-serial and pci-serial; moreover, some decisions were +made based on the address type rather than the device type. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1512934 + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit b342e94399eee7fd519234a12ca3ea04f6564154) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 9 ------ + src/qemu/qemu_domain_address.c | 3 +- + .../qemuxml2argv-pseries-serial-pci.args | 22 +++++++++++++++ + .../qemuxml2argv-pseries-serial-pci.xml | 18 ++++++++++++ + .../qemuxml2argv-pseries-serial-usb.args | 23 ++++++++++++++++ + .../qemuxml2argv-pseries-serial-usb.xml | 21 ++++++++++++++ + tests/qemuxml2argvtest.c | 7 +++++ + .../qemuxml2xmlout-pseries-serial-pci.xml | 31 +++++++++++++++++++++ + .../qemuxml2xmlout-pseries-serial-usb.xml | 32 ++++++++++++++++++++++ + tests/qemuxml2xmltest.c | 7 +++++ + 10 files changed, 163 insertions(+), 10 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 91083dc73d..056dafea39 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9260,15 +9260,6 @@ static bool + qemuChrIsPlatformDevice(const virDomainDef *def, + virDomainChrDefPtr chr) + { +- if ((def->os.arch == VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch)) { +- if (!qemuDomainIsPSeries(def)) +- return true; +- /* only pseries need -device spapr-vty with -chardev */ +- if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +- chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) +- return true; +- } +- + if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) { + /* TARGET_TYPE_ISA here really means 'the default platform device' */ + if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c +index 2319e503eb..f62bb2f97e 100644 +--- a/src/qemu/qemu_domain_address.c ++++ b/src/qemu/qemu_domain_address.c +@@ -246,8 +246,9 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, + + for (i = 0; i < def->nserials; i++) { + if (def->serials[i]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && +- qemuDomainIsPSeries(def)) ++ def->serials[i]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO) { + def->serials[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; ++ } + if (qemuDomainAssignSpaprVIOAddress(def, &def->serials[i]->info, + VIO_ADDR_SERIAL) < 0) + goto cleanup; +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args +new file mode 100644 +index 0000000000..eb2a9bf0e0 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.args +@@ -0,0 +1,22 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-ppc64 \ ++-name guest \ ++-S \ ++-M pseries \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-chardev pty,id=charserial0 \ ++-device pci-serial,chardev=charserial0,id=serial0,bus=pci.0,addr=0x1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml +new file mode 100644 +index 0000000000..2c2534b4c2 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-pci.xml +@@ -0,0 +1,18 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args +new file mode 100644 +index 0000000000..0403985dc4 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.args +@@ -0,0 +1,23 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-ppc64 \ ++-name guest \ ++-S \ ++-M pseries \ ++-m 512 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ ++-nographic \ ++-nodefconfig \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-boot c \ ++-device qemu-xhci,id=usb,bus=pci.0,addr=0x1 \ ++-chardev pty,id=charserial0 \ ++-device usb-serial,chardev=charserial0,id=serial0,bus=usb.0,port=1 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml +new file mode 100644 +index 0000000000..734c90c66f +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-serial-usb.xml +@@ -0,0 +1,21 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 4b63dd141d..2b3bbd1b8b 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1884,6 +1884,13 @@ mymain(void) + DO_TEST("pseries-serial-compat", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial-pci", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_PCI_SERIAL); ++ DO_TEST("pseries-serial-usb", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_QEMU_XHCI, ++ QEMU_CAPS_DEVICE_USB_SERIAL); + DO_TEST("pseries-console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml +new file mode 100644 +index 0000000000..cba7ea96bb +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-pci.xml +@@ -0,0 +1,31 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-ppc64 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
      ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml +new file mode 100644 +index 0000000000..34f651308d +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-serial-usb.xml +@@ -0,0 +1,32 @@ ++ ++ guest ++ 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 ++ 524288 ++ 524288 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-ppc64 ++ ++
      ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index ad429ead4d..f76bd5a68d 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -775,6 +775,13 @@ mymain(void) + DO_TEST("pseries-serial-compat", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); ++ DO_TEST("pseries-serial-pci", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_PCI_SERIAL); ++ DO_TEST("pseries-serial-usb", ++ QEMU_CAPS_NODEFCONFIG, ++ QEMU_CAPS_DEVICE_QEMU_XHCI, ++ QEMU_CAPS_DEVICE_USB_SERIAL); + DO_TEST("pseries-console-native", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_DEVICE_SPAPR_VTY); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-Take-all-PHBs-into-account-while-calculating-memlock-limits.patch b/SOURCES/libvirt-qemu-Take-all-PHBs-into-account-while-calculating-memlock-limits.patch deleted file mode 100644 index 8d6b25b..0000000 --- a/SOURCES/libvirt-qemu-Take-all-PHBs-into-account-while-calculating-memlock-limits.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 257ea76fb477024692f6d2c81437f55124b21c59 Mon Sep 17 00:00:00 2001 -Message-Id: <257ea76fb477024692f6d2c81437f55124b21c59@dist-git> -From: Shivaprasad G Bhat -Date: Mon, 17 Jul 2017 12:09:14 +0200 -Subject: [PATCH] qemu: Take all PHBs into account while calculating memlock - limits - -Now that the multi-phb support series is in, work on the TODO at -qemuDomainGetMemLockLimitBytes() to arrive at the correct memlock limit -value. - -Signed-off-by: Shivaprasad G Bhat -Reviewed-by: Andrea Bolognani -(cherry picked from commit 210dd0c58d6f7b12fea65ce1fa42b343de4219b6) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 4c3897ba4e..916358ea1e 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -6660,12 +6660,17 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def) - unsigned long long memory; - unsigned long long baseLimit; - unsigned long long passthroughLimit; -- size_t nPCIHostBridges; -+ size_t nPCIHostBridges = 0; - bool usesVFIO = false; - -- /* TODO: Detect at runtime once we start using more than just -- * the default PCI Host Bridge */ -- nPCIHostBridges = 1; -+ for (i = 0; i < def->ncontrollers; i++) { -+ virDomainControllerDefPtr cont = def->controllers[i]; -+ -+ if (!virDomainControllerIsPCIHostBridge(cont)) -+ continue; -+ -+ nPCIHostBridges++; -+ } - - for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr dev = def->hostdevs[i]; --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Tolerate-storage-source-private-data-being-NULL.patch b/SOURCES/libvirt-qemu-Tolerate-storage-source-private-data-being-NULL.patch new file mode 100644 index 0000000..7723237 --- /dev/null +++ b/SOURCES/libvirt-qemu-Tolerate-storage-source-private-data-being-NULL.patch @@ -0,0 +1,125 @@ +From aa56a230d346174047f4d21b127bdbea52a1ce3c Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Mon, 13 Nov 2017 13:43:21 +0100 +Subject: [PATCH] qemu: Tolerate storage source private data being NULL + +In some cases it does not make sense to pursue that the private data +will be allocated (especially when we don't need to put anything in it). + +Ensure that the code works without it. + +This also fixes few crashes pointed out in +https://bugzilla.redhat.com/show_bug.cgi?id=1510323 + +(cherry picked from commit 8056721cbb75a717604a1f7971440726d9d85045) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 18 ++++++++++++++---- + src/qemu/qemu_hotplug.c | 17 ++++++++++++----- + 2 files changed, 26 insertions(+), 9 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index f8eb59884c..e60f93083f 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -1362,12 +1362,17 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk, + { + int actualType = virStorageSourceGetActualType(disk->src); + qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); +- qemuDomainSecretInfoPtr secinfo = srcpriv->secinfo; +- qemuDomainSecretInfoPtr encinfo = srcpriv->encinfo; ++ qemuDomainSecretInfoPtr secinfo = NULL; ++ qemuDomainSecretInfoPtr encinfo = NULL; + virJSONValuePtr srcprops = NULL; + char *source = NULL; + int ret = -1; + ++ if (srcpriv) { ++ secinfo = srcpriv->secinfo; ++ encinfo = srcpriv->encinfo; ++ } ++ + if (qemuDiskSourceNeedsProps(disk->src) && + !(srcprops = qemuDiskSourceGetProps(disk->src))) + goto cleanup; +@@ -2239,8 +2244,13 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd, + bool driveBoot = false; + virDomainDiskDefPtr disk = def->disks[i]; + qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); +- qemuDomainSecretInfoPtr secinfo = srcPriv->secinfo; +- qemuDomainSecretInfoPtr encinfo = srcPriv->encinfo; ++ qemuDomainSecretInfoPtr secinfo = NULL; ++ qemuDomainSecretInfoPtr encinfo = NULL; ++ ++ if (srcPriv) { ++ secinfo = srcPriv->secinfo; ++ encinfo = srcPriv->encinfo; ++ } + + if (disk->info.bootIndex) { + bootindex = disk->info.bootIndex; +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index 5701c033be..edf07d0b65 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -259,6 +259,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); ++ qemuDomainSecretInfoPtr secinfo = NULL; + const char *format = NULL; + char *sourcestr = NULL; + +@@ -268,6 +269,9 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + goto cleanup; + } + ++ if (srcPriv) ++ secinfo = srcPriv->secinfo; ++ + if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY && + disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) { + virReportError(VIR_ERR_INTERNAL_ERROR, +@@ -300,7 +304,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, + } + + if (!virStorageSourceIsEmpty(newsrc)) { +- if (qemuGetDriveSourceString(newsrc, srcPriv->secinfo, &sourcestr) < 0) ++ if (qemuGetDriveSourceString(newsrc, secinfo, &sourcestr) < 0) + goto error; + + if (virStorageSourceGetActualType(newsrc) != VIR_STORAGE_TYPE_DIR) { +@@ -371,8 +375,8 @@ qemuDomainAttachDiskGeneric(virConnectPtr conn, + virJSONValuePtr secobjProps = NULL; + virJSONValuePtr encobjProps = NULL; + qemuDomainStorageSourcePrivatePtr srcPriv; +- qemuDomainSecretInfoPtr secinfo; +- qemuDomainSecretInfoPtr encinfo; ++ qemuDomainSecretInfoPtr secinfo = NULL; ++ qemuDomainSecretInfoPtr encinfo = NULL; + + if (qemuDomainPrepareDisk(driver, vm, disk, NULL, false) < 0) + goto cleanup; +@@ -384,13 +388,16 @@ qemuDomainAttachDiskGeneric(virConnectPtr conn, + goto error; + + srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); +- secinfo = srcPriv->secinfo; ++ if (srcPriv) { ++ secinfo = srcPriv->secinfo; ++ encinfo = srcPriv->encinfo; ++ } ++ + if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) { + if (qemuBuildSecretInfoProps(secinfo, &secobjProps) < 0) + goto error; + } + +- encinfo = srcPriv->encinfo; + if (encinfo && qemuBuildSecretInfoProps(encinfo, &encobjProps) < 0) + goto error; + +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Tweak-index-number-checking.patch b/SOURCES/libvirt-qemu-Tweak-index-number-checking.patch deleted file mode 100644 index a39c349..0000000 --- a/SOURCES/libvirt-qemu-Tweak-index-number-checking.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 83986e82bcb2aef5600710eaf652858e1da51011 Mon Sep 17 00:00:00 2001 -Message-Id: <83986e82bcb2aef5600710eaf652858e1da51011@dist-git> -From: Andrea Bolognani -Date: Mon, 17 Jul 2017 12:09:05 +0200 -Subject: [PATCH] qemu: Tweak index number checking - -Moving the check and rewriting it this way doesn't alter -the current behavior, but will allow us to special-case -pci-root down the line. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit b899f3652bb4cf19f1ed2d9fc4a4891b8c909ad6) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1431193 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 26 ++++++++++++++++++++------ - 1 file changed, 20 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 9e075e14d2..a067aaeb17 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -2872,6 +2872,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - case VIR_DOMAIN_CONTROLLER_TYPE_PCI: - switch ((virDomainControllerModelPCI) def->model) { - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: -+ case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS: -+ if (def->idx == 0) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("index for pci controllers of model '%s' must be > 0"), -+ virDomainControllerModelPCITypeToString(def->model)); -+ goto error; -+ } -+ break; -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: -+ break; -+ } -+ switch ((virDomainControllerModelPCI) def->model) { -+ case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: - if (def->opts.pciopts.modelName - == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE || - def->opts.pciopts.chassisNr == -1) { -@@ -3130,12 +3150,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - _("wrong function called")); - goto error; - } -- if (def->idx == 0) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("index for pci controllers of model '%s' must be > 0"), -- virDomainControllerModelPCITypeToString(def->model)); -- goto error; -- } - break; - - case VIR_DOMAIN_CONTROLLER_TYPE_IDE: --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Use-PHBs-to-fill-holes-in-PCI-bus-numbering.patch b/SOURCES/libvirt-qemu-Use-PHBs-to-fill-holes-in-PCI-bus-numbering.patch deleted file mode 100644 index e2cb2f3..0000000 --- a/SOURCES/libvirt-qemu-Use-PHBs-to-fill-holes-in-PCI-bus-numbering.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 899d786bc8c3701e49def8e5d82080f8fc39ce1e Mon Sep 17 00:00:00 2001 -Message-Id: <899d786bc8c3701e49def8e5d82080f8fc39ce1e@dist-git> -From: Andrea Bolognani -Date: Tue, 18 Jul 2017 12:10:03 +0200 -Subject: [PATCH] qemu: Use PHBs to fill holes in PCI bus numbering - -PCI bus has to be numbered sequentially, and no index can be -missing, so libvirt will fill in the blanks automatically for -the user. - -Up until now, it has done so using either pci-bridge, for machine -types based on legacy PCI, or pcie-root-port, for machine types -based on PCI Express. Neither choice is good for pSeries guests, -where PHBs (pci-root) should be used instead. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 045515d36935e958a87745cb4723e401cb8b2cdd) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain_address.c | 16 +++++++++++++--- - .../qemuxml2argv-pseries-many-buses-2.args | 2 +- - tests/qemuxml2argvtest.c | 1 - - .../qemuxml2xmlout-pseries-many-buses-2.xml | 7 +++---- - tests/qemuxml2xmltest.c | 1 - - 5 files changed, 17 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 626d30d477..4de868abdf 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -1092,10 +1092,14 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, - * that don't yet have a corresponding controller in the domain - * config. - */ -- if (hasPCIeRoot) -+ if (qemuDomainIsPSeries(def)) { -+ /* pSeries guests should use PHBs (pci-root controllers) */ -+ defaultModel = VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT; -+ } else if (hasPCIeRoot) { - defaultModel = VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT; -- else -+ } else { - defaultModel = VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE; -+ } - - for (i = 1; i < addrs->nbuses; i++) { - -@@ -2155,7 +2159,13 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - dev.data.controller = def->controllers[contIndex]; - /* set connect flags so it will be properly addressed */ - qemuDomainFillDevicePCIConnectFlags(def, &dev, qemuCaps, driver); -- if (qemuDomainPCIAddressReserveNextAddr(addrs, -+ -+ /* Reserve an address for the controller. pci-root and pcie-root -+ * controllers don't plug into any other PCI controller, hence -+ * they should skip this step */ -+ if (bus->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && -+ bus->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT && -+ qemuDomainPCIAddressReserveNextAddr(addrs, - &dev.data.controller->info) < 0) { - goto cleanup; - } -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.args -index 1cb583132d..13fed02f80 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-2.args -@@ -19,4 +19,4 @@ server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device spapr-pci-host-bridge,index=1,id=pci.2 \ ---device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 -+-device spapr-pci-host-bridge,index=2,id=pci.1 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 52623bcd05..acbf15be91 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1775,7 +1775,6 @@ mymain(void) - DO_TEST("pseries-many-buses-2", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-hostdevs-1", - QEMU_CAPS_NODEFCONFIG, -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-2.xml -index 75dfabfcab..14f3e36244 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-2.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-2.xml -@@ -23,10 +23,9 @@ - - - -- -- -- --
      -+ -+ -+ - - - -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 060bbf2f6b..84098b7ef3 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -686,7 +686,6 @@ mymain(void) - DO_TEST("pseries-many-buses-2", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-hostdevs-1", - QEMU_CAPS_NODEFCONFIG, --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Use-PHBs-when-extending-the-guest-PCI-topology.patch b/SOURCES/libvirt-qemu-Use-PHBs-when-extending-the-guest-PCI-topology.patch deleted file mode 100644 index f302f5c..0000000 --- a/SOURCES/libvirt-qemu-Use-PHBs-when-extending-the-guest-PCI-topology.patch +++ /dev/null @@ -1,547 +0,0 @@ -From bfb6c327ab4a70d54ed03b8498030d4467b00cd2 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Andrea Bolognani -Date: Tue, 18 Jul 2017 12:10:04 +0200 -Subject: [PATCH] qemu: Use PHBs when extending the guest PCI topology - -When looking for slots suitable for a PCI device, libvirt -might need to add an extra PCI controller: for pSeries guests, -we want that extra controller to be a PHB (pci-root) rather -than a PCI bridge. - -Signed-off-by: Andrea Bolognani -Reviewed-by: Laine Stump -(cherry picked from commit 64645b78a4ecb728c37ae6d769c550bf3c74819d) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1280542 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/conf/domain_addr.c | 56 +++++++++-------- - src/conf/domain_addr.h | 2 + - src/qemu/qemu_domain_address.c | 4 ++ - .../qemuxml2argv-pseries-hostdevs-2.args | 8 +-- - .../qemuxml2argv-pseries-hostdevs-3.args | 8 +-- - .../qemuxml2argv-pseries-many-buses-1.args | 4 +- - .../qemuxml2argv-pseries-many-devices.args | 66 ++++++++++---------- - tests/qemuxml2argvtest.c | 4 -- - .../qemuxml2xmlout-pseries-hostdevs-2.xml | 9 ++- - .../qemuxml2xmlout-pseries-hostdevs-3.xml | 16 +++-- - .../qemuxml2xmlout-pseries-many-buses-1.xml | 7 +-- - .../qemuxml2xmlout-pseries-many-devices.xml | 71 +++++++++++----------- - tests/qemuxml2xmltest.c | 4 -- - 13 files changed, 129 insertions(+), 130 deletions(-) - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index b8e5902c07..8990372ae0 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -397,33 +397,39 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, - */ - - if (flags & VIR_PCI_CONNECT_TYPE_PCI_DEVICE) { -- model = VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE; -+ if (addrs->multipleRootsSupported) { -+ /* Use a pci-root controller to expand the guest's PCI -+ * topology if it supports having more than one */ -+ model = VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT; -+ } else { -+ model = VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE; - -- /* if there aren't yet any buses that will accept a -- * pci-bridge, and the caller is asking for one, we'll need to -- * add a dmi-to-pci-bridge first. -- */ -- needDMIToPCIBridge = true; -- for (i = 0; i < addrs->nbuses; i++) { -- if (addrs->buses[i].flags & VIR_PCI_CONNECT_TYPE_PCI_BRIDGE) { -- needDMIToPCIBridge = false; -- break; -- } -- } -- if (needDMIToPCIBridge && add == 1) { -- /* We need to add a single pci-bridge to provide the bus -- * our legacy PCI device will be plugged into; however, we -- * have also determined that there isn't yet any proper -- * place to connect that pci-bridge we're about to add (on -- * a system with pcie-root, that "proper place" would be a -- * dmi-to-pci-bridge". So, to give the pci-bridge a place -- * to connect, we increase the count of buses to add, -- * while also incrementing the bus number in the address -- * for the device (since the pci-bridge will now be at an -- * index 1 higher than the caller had anticipated). -+ /* if there aren't yet any buses that will accept a -+ * pci-bridge, and the caller is asking for one, we'll need to -+ * add a dmi-to-pci-bridge first. - */ -- add++; -- addr->bus++; -+ needDMIToPCIBridge = true; -+ for (i = 0; i < addrs->nbuses; i++) { -+ if (addrs->buses[i].flags & VIR_PCI_CONNECT_TYPE_PCI_BRIDGE) { -+ needDMIToPCIBridge = false; -+ break; -+ } -+ } -+ if (needDMIToPCIBridge && add == 1) { -+ /* We need to add a single pci-bridge to provide the bus -+ * our legacy PCI device will be plugged into; however, we -+ * have also determined that there isn't yet any proper -+ * place to connect that pci-bridge we're about to add (on -+ * a system with pcie-root, that "proper place" would be a -+ * dmi-to-pci-bridge". So, to give the pci-bridge a place -+ * to connect, we increase the count of buses to add, -+ * while also incrementing the bus number in the address -+ * for the device (since the pci-bridge will now be at an -+ * index 1 higher than the caller had anticipated). -+ */ -+ add++; -+ addr->bus++; -+ } - } - } else if (flags & VIR_PCI_CONNECT_TYPE_PCI_BRIDGE && - addrs->buses[0].model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { -diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h -index a5afefda95..49f30332f0 100644 ---- a/src/conf/domain_addr.h -+++ b/src/conf/domain_addr.h -@@ -108,6 +108,8 @@ struct _virDomainPCIAddressSet { - size_t nbuses; - bool dryRun; /* on a dry run, new buses are auto-added - and addresses aren't saved in device infos */ -+ /* If true, the guest can have multiple pci-root controllers */ -+ bool multipleRootsSupported; - }; - typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet; - typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr; -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 4de868abdf..d19ffea7c9 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -1056,6 +1056,10 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, - - addrs->dryRun = dryRun; - -+ /* pSeries domains support multiple pci-root controllers */ -+ if (qemuDomainIsPSeries(def)) -+ addrs->multipleRootsSupported = true; -+ - for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; - size_t idx = cont->idx; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -index c43e15d456..83d4306036 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args -@@ -18,7 +18,7 @@ QEMU_AUDIO_DRV=none \ - server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ ---device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 \ ---device virtio-scsi-pci,id=scsi0,bus=pci.1,addr=0x1 \ ---device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.1,addr=0x2 \ ---device vfio-pci,host=0005:90:01.0,id=hostdev1,bus=pci.0,addr=0x2 -+-device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device virtio-scsi-pci,id=scsi0,bus=pci.1.0,addr=0x1 \ -+-device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.1.0,addr=0x2 \ -+-device vfio-pci,host=0005:90:01.0,id=hostdev1,bus=pci.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -index 99df2e71c9..eda6cc73ac 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args -@@ -18,7 +18,7 @@ QEMU_AUDIO_DRV=none \ - server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ ---device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 \ ---device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.0,addr=0x2 \ ---device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.2,addr=0x1 \ ---device vfio-pci,host=0001:01:00.1,id=hostdev1,bus=pci.0,addr=0x3 -+-device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device spapr-pci-host-bridge,index=2,id=pci.2 \ -+-device vfio-pci,host=0001:01:00.0,id=hostdev0,bus=pci.2.0,addr=0x1 \ -+-device vfio-pci,host=0001:01:00.1,id=hostdev1,bus=pci.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args -index bf78fc19a4..eb5ccbd3a4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args -@@ -18,5 +18,5 @@ QEMU_AUDIO_DRV=none \ - server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ ---device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 \ ---device virtio-scsi-pci,id=scsi0,bus=pci.1,addr=0x1 -+-device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device virtio-scsi-pci,id=scsi0,bus=pci.1.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args -index 1db4533bf0..f20bc52f7c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args -@@ -18,36 +18,36 @@ QEMU_AUDIO_DRV=none \ - server,nowait \ - -mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ ---device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x1 \ ---device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x2 \ ---device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x3 \ ---device virtio-scsi-pci,id=scsi2,bus=pci.0,addr=0x4 \ ---device virtio-scsi-pci,id=scsi3,bus=pci.0,addr=0x5 \ ---device virtio-scsi-pci,id=scsi4,bus=pci.0,addr=0x6 \ ---device virtio-scsi-pci,id=scsi5,bus=pci.0,addr=0x7 \ ---device virtio-scsi-pci,id=scsi6,bus=pci.0,addr=0x8 \ ---device virtio-scsi-pci,id=scsi7,bus=pci.0,addr=0x9 \ ---device virtio-scsi-pci,id=scsi8,bus=pci.0,addr=0xa \ ---device virtio-scsi-pci,id=scsi9,bus=pci.0,addr=0xb \ ---device virtio-scsi-pci,id=scsi10,bus=pci.0,addr=0xc \ ---device virtio-scsi-pci,id=scsi11,bus=pci.0,addr=0xd \ ---device virtio-scsi-pci,id=scsi12,bus=pci.0,addr=0xe \ ---device virtio-scsi-pci,id=scsi13,bus=pci.0,addr=0xf \ ---device virtio-scsi-pci,id=scsi14,bus=pci.0,addr=0x10 \ ---device virtio-scsi-pci,id=scsi15,bus=pci.0,addr=0x11 \ ---device virtio-scsi-pci,id=scsi16,bus=pci.0,addr=0x12 \ ---device virtio-scsi-pci,id=scsi17,bus=pci.0,addr=0x13 \ ---device virtio-scsi-pci,id=scsi18,bus=pci.0,addr=0x14 \ ---device virtio-scsi-pci,id=scsi19,bus=pci.0,addr=0x15 \ ---device virtio-scsi-pci,id=scsi20,bus=pci.0,addr=0x16 \ ---device virtio-scsi-pci,id=scsi21,bus=pci.0,addr=0x17 \ ---device virtio-scsi-pci,id=scsi22,bus=pci.0,addr=0x18 \ ---device virtio-scsi-pci,id=scsi23,bus=pci.0,addr=0x19 \ ---device virtio-scsi-pci,id=scsi24,bus=pci.0,addr=0x1a \ ---device virtio-scsi-pci,id=scsi25,bus=pci.0,addr=0x1b \ ---device virtio-scsi-pci,id=scsi26,bus=pci.0,addr=0x1c \ ---device virtio-scsi-pci,id=scsi27,bus=pci.0,addr=0x1d \ ---device virtio-scsi-pci,id=scsi28,bus=pci.0,addr=0x1e \ ---device virtio-scsi-pci,id=scsi29,bus=pci.0,addr=0x1f \ ---device virtio-scsi-pci,id=scsi30,bus=pci.1,addr=0x1 \ ---device virtio-scsi-pci,id=scsi31,bus=pci.1,addr=0x2 -+-device spapr-pci-host-bridge,index=1,id=pci.1 \ -+-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x1 \ -+-device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x2 \ -+-device virtio-scsi-pci,id=scsi2,bus=pci.0,addr=0x3 \ -+-device virtio-scsi-pci,id=scsi3,bus=pci.0,addr=0x4 \ -+-device virtio-scsi-pci,id=scsi4,bus=pci.0,addr=0x5 \ -+-device virtio-scsi-pci,id=scsi5,bus=pci.0,addr=0x6 \ -+-device virtio-scsi-pci,id=scsi6,bus=pci.0,addr=0x7 \ -+-device virtio-scsi-pci,id=scsi7,bus=pci.0,addr=0x8 \ -+-device virtio-scsi-pci,id=scsi8,bus=pci.0,addr=0x9 \ -+-device virtio-scsi-pci,id=scsi9,bus=pci.0,addr=0xa \ -+-device virtio-scsi-pci,id=scsi10,bus=pci.0,addr=0xb \ -+-device virtio-scsi-pci,id=scsi11,bus=pci.0,addr=0xc \ -+-device virtio-scsi-pci,id=scsi12,bus=pci.0,addr=0xd \ -+-device virtio-scsi-pci,id=scsi13,bus=pci.0,addr=0xe \ -+-device virtio-scsi-pci,id=scsi14,bus=pci.0,addr=0xf \ -+-device virtio-scsi-pci,id=scsi15,bus=pci.0,addr=0x10 \ -+-device virtio-scsi-pci,id=scsi16,bus=pci.0,addr=0x11 \ -+-device virtio-scsi-pci,id=scsi17,bus=pci.0,addr=0x12 \ -+-device virtio-scsi-pci,id=scsi18,bus=pci.0,addr=0x13 \ -+-device virtio-scsi-pci,id=scsi19,bus=pci.0,addr=0x14 \ -+-device virtio-scsi-pci,id=scsi20,bus=pci.0,addr=0x15 \ -+-device virtio-scsi-pci,id=scsi21,bus=pci.0,addr=0x16 \ -+-device virtio-scsi-pci,id=scsi22,bus=pci.0,addr=0x17 \ -+-device virtio-scsi-pci,id=scsi23,bus=pci.0,addr=0x18 \ -+-device virtio-scsi-pci,id=scsi24,bus=pci.0,addr=0x19 \ -+-device virtio-scsi-pci,id=scsi25,bus=pci.0,addr=0x1a \ -+-device virtio-scsi-pci,id=scsi26,bus=pci.0,addr=0x1b \ -+-device virtio-scsi-pci,id=scsi27,bus=pci.0,addr=0x1c \ -+-device virtio-scsi-pci,id=scsi28,bus=pci.0,addr=0x1d \ -+-device virtio-scsi-pci,id=scsi29,bus=pci.0,addr=0x1e \ -+-device virtio-scsi-pci,id=scsi30,bus=pci.0,addr=0x1f \ -+-device virtio-scsi-pci,id=scsi31,bus=pci.1.0,addr=0x1 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index acbf15be91..2b9421cb7a 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1765,12 +1765,10 @@ mymain(void) - DO_TEST("pseries-many-devices", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-many-buses-1", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-many-buses-2", - QEMU_CAPS_NODEFCONFIG, -@@ -1786,14 +1784,12 @@ mymain(void) - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_HOST_PCI_MULTIDOMAIN, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI, - QEMU_CAPS_DEVICE_VFIO_PCI); - DO_TEST("pseries-hostdevs-3", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_HOST_PCI_MULTIDOMAIN, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI, - QEMU_CAPS_DEVICE_VFIO_PCI); - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -index 62bead5032..17ff4c8537 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-2.xml -@@ -22,10 +22,9 @@ - - - -- -- -- --
      -+ -+ -+ - - - -@@ -39,7 +38,7 @@ - -
      - --
      -+
      - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -index 77c09094ff..58023ecd72 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdevs-3.xml -@@ -19,15 +19,13 @@ - - - -- -- -- --
      -+ -+ -+ - -- -- -- --
      -+ -+ -+ - - - -@@ -41,7 +39,7 @@ - -
      - --
      -+
      - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-1.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-1.xml -index 9044936635..eb7bb80541 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-1.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-buses-1.xml -@@ -22,10 +22,9 @@ - - - -- -- -- --
      -+ -+ -+ - - - -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-devices.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-devices.xml -index b596fe6891..ff7a08fec1 100644 ---- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-devices.xml -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-devices.xml -@@ -15,110 +15,109 @@ - - /usr/bin/qemu-system-ppc64 - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - --
      -+
      - - - - - - -- -- -- --
      -+ -+ -+ - - - -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 84098b7ef3..6762145470 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -676,12 +676,10 @@ mymain(void) - DO_TEST("pseries-many-devices", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-many-buses-1", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("pseries-many-buses-2", - QEMU_CAPS_NODEFCONFIG, -@@ -697,14 +695,12 @@ mymain(void) - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_HOST_PCI_MULTIDOMAIN, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI, - QEMU_CAPS_DEVICE_VFIO_PCI); - DO_TEST("pseries-hostdevs-3", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_HOST_PCI_MULTIDOMAIN, -- QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_VIRTIO_SCSI, - QEMU_CAPS_DEVICE_VFIO_PCI); - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-Use-correct-variable-in-qemuDomainSetBlockIoTune.patch b/SOURCES/libvirt-qemu-Use-correct-variable-in-qemuDomainSetBlockIoTune.patch deleted file mode 100644 index f9a2631..0000000 --- a/SOURCES/libvirt-qemu-Use-correct-variable-in-qemuDomainSetBlockIoTune.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 71bdd999481b2feaecceb39dd3cfb7dfa61de3af Mon Sep 17 00:00:00 2001 -Message-Id: <71bdd999481b2feaecceb39dd3cfb7dfa61de3af@dist-git> -From: Peter Krempa -Date: Thu, 25 May 2017 14:33:25 +0200 -Subject: [PATCH] qemu: Use correct variable in qemuDomainSetBlockIoTune - -'param' contains the correct element from 'params'. - -If the group name would not be the first parameter libvirtd would crash. - -Introduced in c53bd25b13. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1455510 -(cherry picked from commit 0d3aff58e7ed190c97b40ee92f58cb0180cef6fe) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 3241de4cb..c31d07a65 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -17445,7 +17445,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, - - /* NB: Cannot use macro since this is a value.s not a value.ul */ - if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME)) { -- if (VIR_STRDUP(info.group_name, params->value.s) < 0) -+ if (VIR_STRDUP(info.group_name, param->value.s) < 0) - goto endjob; - set_fields |= QEMU_BLOCK_IOTUNE_SET_GROUP_NAME; - if (virTypedParamsAddString(&eventParams, &eventNparams, --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-Use-more-data-for-comparing-CPUs.patch b/SOURCES/libvirt-qemu-Use-more-data-for-comparing-CPUs.patch deleted file mode 100644 index 63c381f..0000000 --- a/SOURCES/libvirt-qemu-Use-more-data-for-comparing-CPUs.patch +++ /dev/null @@ -1,173 +0,0 @@ -From b2196db320485b642d6654279ebb6b75eeafd3e9 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Jiri Denemark -Date: Tue, 11 Apr 2017 20:46:05 +0200 -Subject: [PATCH] qemu: Use more data for comparing CPUs - -With QEMU older than 2.9.0 libvirt uses CPUID instruction to determine -what CPU features are supported on the host. This was later used when -checking compatibility of guest CPUs. Since QEMU 2.9.0 we ask QEMU for -the host CPU data. But the two methods we use usually provide disjoint -sets of CPU features because QEMU/KVM does not support all features -provided by the host CPU and on the other hand it can enable some -feature even if the host CPU does not support them. - -So if there is a domain which requires a CPU features disabled by -QEMU/KVM, libvirt will refuse to start it with QEMU > 2.9.0 as its guest -CPU is incompatible with the host CPU data we got from QEMU. But such -domain would happily start on older QEMU (of course, the features would -be missing the guest CPU). To fix this regression, we need to combine -both CPU feature sets when checking guest CPU compatibility. - -https://bugzilla.redhat.com/show_bug.cgi?id=1439933 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 5b4a6adb5ca24a6cb91cdc55c31506fb278d3a91) - -https://bugzilla.redhat.com/show_bug.cgi?id=1444421 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 35 +++++++++++++++++++++++++++++++++-- - src/qemu/qemu_capabilities.h | 4 ++++ - src/qemu/qemu_process.c | 2 +- - 3 files changed, 38 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index ec773971e..49de506ed 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -387,6 +387,10 @@ struct _virQEMUCapsHostCPUData { - virCPUDefPtr reported; - /* Migratable host CPU definition used for updating guest CPU. */ - virCPUDefPtr migratable; -+ /* CPU definition with features detected by libvirt using virCPUGetHost -+ * combined with features reported by QEMU. This is used for backward -+ * compatible comparison between a guest CPU and a host CPU. */ -+ virCPUDefPtr full; - }; - - /* -@@ -2112,6 +2116,10 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, - !(dst->migratable = virCPUDefCopy(src->migratable))) - return -1; - -+ if (src->full && -+ !(dst->full = virCPUDefCopy(src->full))) -+ return -1; -+ - return 0; - } - -@@ -2122,6 +2130,7 @@ virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData) - qemuMonitorCPUModelInfoFree(cpuData->info); - virCPUDefFree(cpuData->reported); - virCPUDefFree(cpuData->migratable); -+ virCPUDefFree(cpuData->full); - - memset(cpuData, 0, sizeof(*cpuData)); - } -@@ -2463,6 +2472,11 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, - - case VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE: - return cpuData->migratable; -+ -+ case VIR_QEMU_CAPS_HOST_CPU_FULL: -+ /* 'full' is non-NULL only if we have data from both QEMU and -+ * virCPUGetHost */ -+ return cpuData->full ? cpuData->full : cpuData->reported; - } - - return NULL; -@@ -2473,12 +2487,14 @@ static void - virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - virCPUDefPtr reported, -- virCPUDefPtr migratable) -+ virCPUDefPtr migratable, -+ virCPUDefPtr full) - { - virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type); - - cpuData->reported = reported; - cpuData->migratable = migratable; -+ cpuData->full = full; - } - - -@@ -3350,6 +3366,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - virCPUDefPtr cpu = NULL; - virCPUDefPtr migCPU = NULL; - virCPUDefPtr hostCPU = NULL; -+ virCPUDefPtr fullCPU = NULL; -+ size_t i; - int rc; - - if (!caps || !virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch)) -@@ -3369,6 +3387,18 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - virQEMUCapsCPUFilterFeatures, - qemuCaps) < 0) - goto error; -+ } else if (type == VIR_DOMAIN_VIRT_KVM && -+ virCPUGetHostIsSupported(qemuCaps->arch)) { -+ if (!(fullCPU = virCPUGetHost(qemuCaps->arch, VIR_CPU_TYPE_GUEST, -+ NULL, NULL, 0))) -+ goto error; -+ -+ for (i = 0; i < cpu->nfeatures; i++) { -+ if (cpu->features[i].policy == VIR_CPU_FEATURE_REQUIRE && -+ virCPUDefUpdateFeature(fullCPU, cpu->features[i].name, -+ VIR_CPU_FEATURE_REQUIRE) < 0) -+ goto error; -+ } - } - - if (!(migCPU = virQEMUCapsNewHostCPUModel())) -@@ -3384,7 +3414,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - goto error; - } - -- virQEMUCapsSetHostModel(qemuCaps, type, cpu, migCPU); -+ virQEMUCapsSetHostModel(qemuCaps, type, cpu, migCPU, fullCPU); - - cleanup: - virCPUDefFree(hostCPU); -@@ -3393,6 +3423,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, - error: - virCPUDefFree(cpu); - virCPUDefFree(migCPU); -+ virCPUDefFree(fullCPU); - virResetLastError(); - goto cleanup; - } -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 16fe044cc..644b8e27b 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -456,6 +456,10 @@ typedef enum { - VIR_QEMU_CAPS_HOST_CPU_REPORTED, - /* Migratable host CPU definition used for updating guest CPU. */ - VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE, -+ /* CPU definition with features detected by libvirt using virCPUGetHost -+ * combined with features reported by QEMU. This is used for backward -+ * compatible comparison between a guest CPU and a host CPU. */ -+ VIR_QEMU_CAPS_HOST_CPU_FULL, - } virQEMUCapsHostCPUType; - - virCPUDefPtr virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index c81389ef2..a33ec87e6 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -5307,7 +5307,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, - if (def->cpu->check == VIR_CPU_CHECK_PARTIAL && - virCPUCompare(caps->host.arch, - virQEMUCapsGetHostModel(qemuCaps, def->virtType, -- VIR_QEMU_CAPS_HOST_CPU_REPORTED), -+ VIR_QEMU_CAPS_HOST_CPU_FULL), - def->cpu, true) < 0) - return -1; - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-Use-predictable-file-names-for-memory-backend-file.patch b/SOURCES/libvirt-qemu-Use-predictable-file-names-for-memory-backend-file.patch new file mode 100644 index 0000000..afa7bba --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-predictable-file-names-for-memory-backend-file.patch @@ -0,0 +1,391 @@ +From 12f6ee75efb15263f62fb12c693b74b116ac4a4f Mon Sep 17 00:00:00 2001 +Message-Id: <12f6ee75efb15263f62fb12c693b74b116ac4a4f@dist-git> +From: Michal Privoznik +Date: Thu, 9 Nov 2017 16:06:47 +0100 +Subject: [PATCH] qemu: Use predictable file names for memory-backend-file + +https://bugzilla.redhat.com/show_bug.cgi?id=1461214 + +In some cases management application needs to allocate memory for +qemu upfront and then just let qemu use that. Since we don't want +to expose path for memory-backend-file anywhere in the domain +XML, we can generate predictable paths. In this case: + + $memoryBackingDir/libvirt/qemu/$shortName/$alias + +where $shortName is result of virDomainDefGetShortName(). + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit fec8f9c49afb479f6c3c8c388426945f2c1f099b) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 2 +- + src/qemu/qemu_conf.c | 55 +++++++++++++++++- + src/qemu/qemu_conf.h | 9 ++- + src/qemu/qemu_driver.c | 17 ++++++ + src/qemu/qemu_process.c | 65 ++++++++++++++++++---- + .../qemuxml2argv-cpu-numa-memshared.args | 6 +- + .../qemuxml2argv-fd-memory-numa-topology.args | 3 +- + .../qemuxml2argv-fd-memory-numa-topology2.args | 6 +- + .../qemuxml2argv-fd-memory-numa-topology3.args | 9 ++- + .../qemuxml2argv-hugepages-memaccess2.args | 9 ++- + 10 files changed, 155 insertions(+), 26 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 57c855c047..f8eb59884c 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3439,7 +3439,7 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, + } else { + /* We can have both pagesize and mem source. If that's the case, + * prefer hugepages as those are more specific. */ +- if (qemuGetMemoryBackingPath(cfg, &memPath) < 0) ++ if (qemuGetMemoryBackingPath(def, cfg, mem->info.alias, &memPath) < 0) + goto cleanup; + } + +diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c +index 3b670a68c5..e04523223d 100644 +--- a/src/qemu/qemu_conf.c ++++ b/src/qemu/qemu_conf.c +@@ -1767,9 +1767,41 @@ qemuGetDomainHupageMemPath(const virDomainDef *def, + } + + ++int ++qemuGetMemoryBackingBasePath(virQEMUDriverConfigPtr cfg, ++ char **path) ++{ ++ return virAsprintf(path, "%s/libvirt/qemu", cfg->memoryBackingDir); ++} ++ ++ ++int ++qemuGetMemoryBackingDomainPath(const virDomainDef *def, ++ virQEMUDriverConfigPtr cfg, ++ char **path) ++{ ++ char *shortName = NULL; ++ char *base = NULL; ++ int ret = -1; ++ ++ if (!(shortName = virDomainDefGetShortName(def)) || ++ qemuGetMemoryBackingBasePath(cfg, &base) < 0 || ++ virAsprintf(path, "%s/%s", base, shortName) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ VIR_FREE(base); ++ VIR_FREE(shortName); ++ return ret; ++} ++ ++ + /** + * qemuGetMemoryBackingPath: ++ * @def: domain definition + * @cfg: the driver config ++ * @alias: memory object alias + * @memPath: constructed path + * + * Constructs path to memory backing dir and stores it at @memPath. +@@ -1778,8 +1810,27 @@ qemuGetDomainHupageMemPath(const virDomainDef *def, + * -1 otherwise (with error reported). + */ + int +-qemuGetMemoryBackingPath(virQEMUDriverConfigPtr cfg, ++qemuGetMemoryBackingPath(const virDomainDef *def, ++ virQEMUDriverConfigPtr cfg, ++ const char *alias, + char **memPath) + { +- return VIR_STRDUP(*memPath, cfg->memoryBackingDir); ++ char *domainPath = NULL; ++ int ret = -1; ++ ++ if (!alias) { ++ /* This should never happen (TM) */ ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("memory device alias is not assigned")); ++ goto cleanup; ++ } ++ ++ if (qemuGetMemoryBackingDomainPath(def, cfg, &domainPath) < 0 || ++ virAsprintf(memPath, "%s/%s", domainPath, alias) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ VIR_FREE(domainPath); ++ return ret; + } +diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h +index 9d6866816f..a553e30e2e 100644 +--- a/src/qemu/qemu_conf.h ++++ b/src/qemu/qemu_conf.h +@@ -364,6 +364,13 @@ int qemuGetDomainHupageMemPath(const virDomainDef *def, + unsigned long long pagesize, + char **memPath); + +-int qemuGetMemoryBackingPath(virQEMUDriverConfigPtr cfg, ++int qemuGetMemoryBackingBasePath(virQEMUDriverConfigPtr cfg, ++ char **path); ++int qemuGetMemoryBackingDomainPath(const virDomainDef *def, ++ virQEMUDriverConfigPtr cfg, ++ char **path); ++int qemuGetMemoryBackingPath(const virDomainDef *def, ++ virQEMUDriverConfigPtr cfg, ++ const char *alias, + char **memPath); + #endif /* __QEMUD_CONF_H */ +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 5617c78997..6096e00b2a 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -631,6 +631,7 @@ qemuStateInitialize(bool privileged, + uid_t run_uid = -1; + gid_t run_gid = -1; + char *hugepagePath = NULL; ++ char *memoryBackingPath = NULL; + size_t i; + + if (VIR_ALLOC(qemu_driver) < 0) +@@ -889,6 +890,21 @@ qemuStateInitialize(bool privileged, + VIR_FREE(hugepagePath); + } + ++ if (qemuGetMemoryBackingBasePath(cfg, &memoryBackingPath) < 0) ++ goto error; ++ ++ if (virFileMakePath(memoryBackingPath) < 0) { ++ virReportSystemError(errno, ++ _("unable to create memory backing path %s"), ++ memoryBackingPath); ++ goto error; ++ } ++ ++ if (privileged && ++ virFileUpdatePerm(memoryBackingPath, ++ 0, S_IXGRP | S_IXOTH) < 0) ++ goto error; ++ + if (!(qemu_driver->closeCallbacks = virCloseCallbacksNew())) + goto error; + +@@ -946,6 +962,7 @@ qemuStateInitialize(bool privileged, + virObjectUnref(conn); + VIR_FREE(driverConf); + VIR_FREE(hugepagePath); ++ VIR_FREE(memoryBackingPath); + qemuStateCleanup(); + return -1; + } +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 3324cc61f1..86a4dee88e 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -3324,6 +3324,36 @@ qemuProcessNeedHugepagesPath(virDomainDefPtr def, + } + + ++static bool ++qemuProcessNeedMemoryBackingPath(virDomainDefPtr def, ++ virDomainMemoryDefPtr mem) ++{ ++ size_t i; ++ size_t numaNodes; ++ ++ if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE || ++ def->mem.access != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT) ++ return true; ++ ++ numaNodes = virDomainNumaGetNodeCount(def->numa); ++ for (i = 0; i < numaNodes; i++) { ++ if (virDomainNumaGetNodeMemoryAccessMode(def->numa, i) ++ != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT) ++ return true; ++ } ++ ++ if (mem && ++ mem->model == VIR_DOMAIN_MEMORY_MODEL_DIMM && ++ (mem->access != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT || ++ (mem->targetNode >= 0 && ++ virDomainNumaGetNodeMemoryAccessMode(def->numa, mem->targetNode) ++ != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT))) ++ return true; ++ ++ return false; ++} ++ ++ + static int + qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver, + virDomainDefPtr def, +@@ -3363,33 +3393,46 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, + bool build) + { + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); +- char *hugepagePath = NULL; ++ char *path = NULL; + size_t i; +- bool shouldBuild = false; ++ bool shouldBuildHP = false; ++ bool shouldBuildMB = false; + int ret = -1; + +- if (build) +- shouldBuild = qemuProcessNeedHugepagesPath(vm->def, mem); ++ if (build) { ++ shouldBuildHP = qemuProcessNeedHugepagesPath(vm->def, mem); ++ shouldBuildMB = qemuProcessNeedMemoryBackingPath(vm->def, mem); ++ } + +- if (!build || shouldBuild) { ++ if (!build || shouldBuildHP) { + for (i = 0; i < cfg->nhugetlbfs; i++) { +- VIR_FREE(hugepagePath); +- hugepagePath = qemuGetDomainHugepagePath(vm->def, &cfg->hugetlbfs[i]); ++ path = qemuGetDomainHugepagePath(vm->def, &cfg->hugetlbfs[i]); + +- if (!hugepagePath) ++ if (!path) + goto cleanup; + + if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm->def, +- hugepagePath, build) < 0) ++ path, build) < 0) + goto cleanup; + +- VIR_FREE(hugepagePath); ++ VIR_FREE(path); + } + } + ++ if (!build || shouldBuildMB) { ++ if (qemuGetMemoryBackingDomainPath(vm->def, cfg, &path) < 0) ++ goto cleanup; ++ ++ if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm->def, ++ path, build) < 0) ++ goto cleanup; ++ ++ VIR_FREE(path); ++ } ++ + ret = 0; + cleanup: +- VIR_FREE(hugepagePath); ++ VIR_FREE(path); + virObjectUnref(cfg); + return ret; + } +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args +index 5700c3413f..3528194293 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args +@@ -10,10 +10,12 @@ QEMU_AUDIO_DRV=none \ + -M pc \ + -m 214 \ + -smp 16,sockets=2,cores=4,threads=2 \ +--object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node0,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-QEMUGuest1/ram-node0,\ + share=yes,size=112197632 \ + -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ +--object memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node1,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-QEMUGuest1/ram-node1,\ + share=no,size=112197632 \ + -numa node,nodeid=1,cpus=8-15,memdev=ram-node1 \ + -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args +index 12f3d8ab8c..fa13532596 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args +@@ -11,7 +11,8 @@ QEMU_AUDIO_DRV=none \ + -m 14336 \ + -mem-prealloc \ + -smp 8,sockets=1,cores=8,threads=1 \ +--object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node0,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node0,\ + share=yes,size=15032385536 \ + -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ + -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args +index 585e4d5061..6f73a1b99b 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args +@@ -11,10 +11,12 @@ QEMU_AUDIO_DRV=none \ + -m 28672 \ + -mem-prealloc \ + -smp 20,sockets=1,cores=8,threads=1 \ +--object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node0,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node0,\ + share=no,size=15032385536 \ + -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \ +--object memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node1,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node1,\ + share=yes,size=15032385536 \ + -numa node,nodeid=1,cpus=8-15,memdev=ram-node1 \ + -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args +index e9a57a69e5..3c352fe035 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args +@@ -11,13 +11,16 @@ QEMU_AUDIO_DRV=none \ + -m 43008 \ + -mem-prealloc \ + -smp 32,sockets=1,cores=24,threads=1 \ +--object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node0,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node0,\ + share=yes,size=15032385536 \ + -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \ +--object memory-backend-file,id=ram-node1,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node1,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node1,\ + share=yes,size=15032385536 \ + -numa node,nodeid=1,cpus=2-3,memdev=ram-node1 \ +--object memory-backend-file,id=ram-node2,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node2,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-instance-00000092/ram-node2,\ + share=no,size=15032385536 \ + -numa node,nodeid=2,cpus=4-5,memdev=ram-node2 \ + -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args +index 55db491719..d8e506c19e 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args +@@ -10,17 +10,20 @@ QEMU_AUDIO_DRV=none \ + -M pc \ + -m size=4194304k,slots=16,maxmem=8388608k \ + -smp 4,sockets=4,cores=1,threads=1 \ +--object memory-backend-file,id=ram-node0,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node0,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-QEMUGuest1/ram-node0,\ + share=no,size=1073741824,host-nodes=0-3,policy=bind \ + -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ + -object memory-backend-file,id=ram-node1,prealloc=yes,\ + mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=yes,size=1073741824,\ + host-nodes=0-3,policy=bind \ + -numa node,nodeid=1,cpus=1,memdev=ram-node1 \ +--object memory-backend-file,id=ram-node2,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node2,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-QEMUGuest1/ram-node2,\ + share=no,size=1073741824,host-nodes=0-3,policy=bind \ + -numa node,nodeid=2,cpus=2,memdev=ram-node2 \ +--object memory-backend-file,id=ram-node3,mem-path=/var/lib/libvirt/qemu/ram,\ ++-object memory-backend-file,id=ram-node3,\ ++mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-QEMUGuest1/ram-node3,\ + share=no,size=1073741824,host-nodes=3,policy=bind \ + -numa node,nodeid=3,cpus=3,memdev=ram-node3 \ + -object memory-backend-file,id=memdimm0,prealloc=yes,\ +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Use-qemuDomainCheckABIStability-where-needed.patch b/SOURCES/libvirt-qemu-Use-qemuDomainCheckABIStability-where-needed.patch deleted file mode 100644 index e14cc76..0000000 --- a/SOURCES/libvirt-qemu-Use-qemuDomainCheckABIStability-where-needed.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 5a76947526023484d27b6f43853602e6e0510063 Mon Sep 17 00:00:00 2001 -Message-Id: <5a76947526023484d27b6f43853602e6e0510063@dist-git> -From: Jiri Denemark -Date: Wed, 14 Jun 2017 14:56:21 +0200 -Subject: [PATCH] qemu: Use qemuDomainCheckABIStability where needed - -Most places which want to check ABI stability for an active domain need -to call this API rather than the original -qemuDomainDefCheckABIStability. The only exception is in snapshots where -we need to decide what to do depending on the saved image data. - -https://bugzilla.redhat.com/show_bug.cgi?id=1460952 - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit f0a3fe1b0a2996272dd167501bb5de752d9d1956) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 71 +++++++++++++++++++++++++++-------------------- - src/qemu/qemu_migration.c | 2 +- - 2 files changed, 42 insertions(+), 31 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 5567103c37..c7c5e28ca3 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -3326,7 +3326,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) { - goto endjob; - } -- if (!qemuDomainDefCheckABIStability(driver, vm->def, def)) { -+ if (!qemuDomainCheckABIStability(driver, vm, def)) { - virDomainDefFree(def); - goto endjob; - } -@@ -15415,39 +15415,50 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - * to have finer control. */ - if (virDomainObjIsActive(vm)) { - /* Transitions 5, 6, 8, 9 */ -- /* Replace the CPU in config and put the original one in priv -- * once we're done. -- */ -- if (cookie && cookie->cpu && config->cpu) { -- origCPU = config->cpu; -- if (!(config->cpu = virCPUDefCopy(cookie->cpu))) -- goto endjob; -- } -- - /* Check for ABI compatibility. We need to do this check against - * the migratable XML or it will always fail otherwise */ -- if (config && -- !qemuDomainDefCheckABIStability(driver, vm->def, config)) { -- virErrorPtr err = virGetLastError(); -+ if (config) { -+ bool compatible; - -- if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { -- /* Re-spawn error using correct category. */ -- if (err->code == VIR_ERR_CONFIG_UNSUPPORTED) -- virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", -- err->str2); -- goto endjob; -+ /* Replace the CPU in config and put the original one in priv -+ * once we're done. When we have the updated CPU def in the -+ * cookie, we don't want to replace the CPU in migratable def -+ * when doing ABI checks to make sure the current CPU exactly -+ * matches the one used at the time the snapshot was taken. -+ */ -+ if (cookie && cookie->cpu && config->cpu) { -+ origCPU = config->cpu; -+ if (!(config->cpu = virCPUDefCopy(cookie->cpu))) -+ goto endjob; -+ -+ compatible = qemuDomainDefCheckABIStability(driver, vm->def, -+ config); -+ } else { -+ compatible = qemuDomainCheckABIStability(driver, vm, config); -+ } -+ -+ if (!compatible) { -+ virErrorPtr err = virGetLastError(); -+ -+ if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { -+ /* Re-spawn error using correct category. */ -+ if (err->code == VIR_ERR_CONFIG_UNSUPPORTED) -+ virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", -+ err->str2); -+ goto endjob; -+ } -+ virResetError(err); -+ qemuProcessStop(driver, vm, -+ VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, -+ QEMU_ASYNC_JOB_START, 0); -+ virDomainAuditStop(vm, "from-snapshot"); -+ detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT; -+ event = virDomainEventLifecycleNewFromObj(vm, -+ VIR_DOMAIN_EVENT_STOPPED, -+ detail); -+ qemuDomainEventQueue(driver, event); -+ goto load; - } -- virResetError(err); -- qemuProcessStop(driver, vm, -- VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, -- QEMU_ASYNC_JOB_START, 0); -- virDomainAuditStop(vm, "from-snapshot"); -- detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT; -- event = virDomainEventLifecycleNewFromObj(vm, -- VIR_DOMAIN_EVENT_STOPPED, -- detail); -- qemuDomainEventQueue(driver, event); -- goto load; - } - - priv = vm->privateData; -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index a4540ce3c4..5eed933a3c 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2028,7 +2028,7 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver, - VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) - goto cleanup; - -- if (!qemuDomainDefCheckABIStability(driver, vm->def, def)) -+ if (!qemuDomainCheckABIStability(driver, vm, def)) - goto cleanup; - - rv = qemuDomainDefFormatLive(driver, def, NULL, false, true); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Use-the-end-of-QEMU-log-for-reporting-errors.patch b/SOURCES/libvirt-qemu-Use-the-end-of-QEMU-log-for-reporting-errors.patch new file mode 100644 index 0000000..f3053bb --- /dev/null +++ b/SOURCES/libvirt-qemu-Use-the-end-of-QEMU-log-for-reporting-errors.patch @@ -0,0 +1,102 @@ +From 0b0135f00c4e17cb902ec6885648b5a4e667d56b Mon Sep 17 00:00:00 2001 +Message-Id: <0b0135f00c4e17cb902ec6885648b5a4e667d56b@dist-git> +From: Jiri Denemark +Date: Wed, 22 Nov 2017 13:12:00 +0100 +Subject: [PATCH] qemu: Use the end of QEMU log for reporting errors + +When QEMU dies, we read its output stored in a log file and use it for +reporting a hopefully useful error. However, virReportError will trim +the message to (VIR_ERROR_MAX_LENGTH - 1) characters, which means the +end of the log (which likely contains the error message we want to +report) may get lost. We should trim the beginning of the log instead. + +https://bugzilla.redhat.com/show_bug.cgi?id=1335534 + +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +(cherry picked from commit 96f7a045e93ad08eb4130be97dd6d8a8c963a952) +Signed-off-by: Jiri Denemark +Reviewed-by: Pavel Hrdina +--- + src/qemu/qemu_process.c | 34 ++++++++++++++++++++++++++++++---- + 1 file changed, 30 insertions(+), 4 deletions(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index c5fa8cb4b2..f7808227a8 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1827,17 +1827,24 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob, + * qemuProcessReadLog: Read log file of a qemu VM + * @logCtxt: the domain log context + * @msg: pointer to buffer to store the read messages in ++ * @max: maximum length of the message returned in @msg + * + * Reads log of a qemu VM. Skips messages not produced by qemu or irrelevant +- * messages. Returns returns 0 on success or -1 on error ++ * messages. If @max is not zero, @msg will contain at most @max characters ++ * from the end of the log and @msg will start after a new line if possible. ++ * ++ * Returns 0 on success or -1 on error + */ + static int +-qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, char **msg) ++qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, ++ char **msg, ++ size_t max) + { + char *buf; + ssize_t got; + char *eol; + char *filter_next; ++ size_t skip; + + if ((got = qemuDomainLogContextRead(logCtxt, &buf)) < 0) + return -1; +@@ -1848,7 +1855,7 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, char **msg) + *eol = '\0'; + if (virLogProbablyLogMessage(filter_next) || + strstr(filter_next, "char device redirected to")) { +- size_t skip = (eol + 1) - filter_next; ++ skip = (eol + 1) - filter_next; + memmove(filter_next, eol + 1, buf + got - eol); + got -= skip; + } else { +@@ -1863,6 +1870,19 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, char **msg) + buf[got - 1] = '\0'; + got--; + } ++ ++ if (max > 0 && got > max) { ++ skip = got - max; ++ ++ if (buf[skip - 1] != '\n' && ++ (eol = strchr(buf + skip, '\n')) && ++ !virStringIsEmpty(eol + 1)) ++ skip = eol + 1 - buf; ++ ++ memmove(buf, buf + skip, got - skip + 1); ++ got -= skip; ++ } ++ + ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); + *msg = buf; + return 0; +@@ -1874,8 +1894,14 @@ qemuProcessReportLogError(qemuDomainLogContextPtr logCtxt, + const char *msgprefix) + { + char *logmsg = NULL; ++ size_t max; + +- if (qemuProcessReadLog(logCtxt, &logmsg) < 0) ++ max = VIR_ERROR_MAX_LENGTH - 1; ++ max -= strlen(msgprefix); ++ /* The length of the formatting string minus two '%s' */ ++ max -= strlen(_("%s: %s")) - 4; ++ ++ if (qemuProcessReadLog(logCtxt, &logmsg, max) < 0) + return -1; + + virResetLastError(); +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-Use-updated-CPU-when-starting-QEMU-if-possible.patch b/SOURCES/libvirt-qemu-Use-updated-CPU-when-starting-QEMU-if-possible.patch deleted file mode 100644 index 7367e2d..0000000 --- a/SOURCES/libvirt-qemu-Use-updated-CPU-when-starting-QEMU-if-possible.patch +++ /dev/null @@ -1,325 +0,0 @@ -From 3b5aa0e6272a4b507034bba3d093734ebd658b3b Mon Sep 17 00:00:00 2001 -Message-Id: <3b5aa0e6272a4b507034bba3d093734ebd658b3b@dist-git> -From: Jiri Denemark -Date: Wed, 31 May 2017 12:34:10 +0200 -Subject: [PATCH] qemu: Use updated CPU when starting QEMU if possible - -If QEMU is new enough and we have the live updated CPU definition in -either save or migration cookie, we can use it to enforce ABI. The -original guest CPU from domain XML will be stored in private data. - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina -(cherry picked from commit 8e34f478137c2a6b5e57e382729bd2776b042301) - -https://bugzilla.redhat.com/show_bug.cgi?id=1441662 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 40 ++++++++++++++++++++++++++++++++++++++++ - src/qemu/qemu_domain.h | 5 +++++ - src/qemu/qemu_driver.c | 30 ++++++++++++++++++++++++------ - src/qemu/qemu_migration.c | 2 +- - src/qemu/qemu_process.c | 24 ++++++++++++++++++++++-- - src/qemu/qemu_process.h | 2 ++ - 6 files changed, 94 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 7897a44634..82dacb3c9c 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -9225,3 +9225,43 @@ virSaveCookieCallbacks virQEMUDriverDomainSaveCookie = { - .parse = qemuDomainSaveCookieParse, - .format = qemuDomainSaveCookieFormat, - }; -+ -+ -+/** -+ * qemuDomainUpdateCPU: -+ * @vm: domain which is being started -+ * @cpu: CPU updated when the domain was running previously (before migration, -+ * snapshot, or save) -+ * @origCPU: where to store the original CPU from vm->def in case @cpu was -+ * used instead -+ * -+ * Replace the CPU definition with the updated one when QEMU is new enough to -+ * allow us to check extra features it is about to enable or disable when -+ * starting a domain. The original CPU is stored in @origCPU. -+ * -+ * Returns 0 on success, -1 on error. -+ */ -+int -+qemuDomainUpdateCPU(virDomainObjPtr vm, -+ virCPUDefPtr cpu, -+ virCPUDefPtr *origCPU) -+{ -+ qemuDomainObjPrivatePtr priv = vm->privateData; -+ -+ *origCPU = NULL; -+ -+ if (!cpu || !vm->def->cpu || -+ !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION) || -+ virCPUDefIsEqual(vm->def->cpu, cpu, false)) -+ return 0; -+ -+ if (!(cpu = virCPUDefCopy(cpu))) -+ return -1; -+ -+ VIR_DEBUG("Replacing CPU def with the updated one"); -+ -+ *origCPU = vm->def->cpu; -+ vm->def->cpu = cpu; -+ -+ return 0; -+} -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 2eea7924fb..d635d2995f 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -921,4 +921,9 @@ char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, - virStorageSourcePtr qemuDomainGetStorageSourceByDevstr(const char *devstr, - virDomainDefPtr def); - -+int -+qemuDomainUpdateCPU(virDomainObjPtr vm, -+ virCPUDefPtr cpu, -+ virCPUDefPtr *origCPU); -+ - #endif /* __QEMU_DOMAIN_H__ */ -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index f5c5c302be..5567103c37 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -1782,7 +1782,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, - goto cleanup; - } - -- if (qemuProcessStart(conn, driver, vm, QEMU_ASYNC_JOB_START, -+ if (qemuProcessStart(conn, driver, vm, NULL, QEMU_ASYNC_JOB_START, - NULL, -1, NULL, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_CREATE, - start_flags) < 0) { -@@ -6500,8 +6500,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, - } - } - -- if (qemuProcessStart(conn, driver, vm, asyncJob, -- "stdio", *fd, path, NULL, -+ if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL, -+ asyncJob, "stdio", *fd, path, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_RESTORE, - VIR_QEMU_PROCESS_START_PAUSED) == 0) - restored = true; -@@ -7118,7 +7118,7 @@ qemuDomainObjStart(virConnectPtr conn, - } - } - -- ret = qemuProcessStart(conn, driver, vm, asyncJob, -+ ret = qemuProcessStart(conn, driver, vm, NULL, asyncJob, - NULL, -1, NULL, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags); - virDomainAuditStart(vm, "booted", ret >= 0); -@@ -15295,6 +15295,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - virCapsPtr caps = NULL; - bool was_running = false; - bool was_stopped = false; -+ qemuDomainSaveCookiePtr cookie; -+ virCPUDefPtr origCPU = NULL; - - virCheckFlags(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | - VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED | -@@ -15400,6 +15402,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - goto endjob; - } - -+ cookie = (qemuDomainSaveCookiePtr) snap->def->cookie; -+ - switch ((virDomainState) snap->def->state) { - case VIR_DOMAIN_RUNNING: - case VIR_DOMAIN_PAUSED: -@@ -15411,6 +15415,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - * to have finer control. */ - if (virDomainObjIsActive(vm)) { - /* Transitions 5, 6, 8, 9 */ -+ /* Replace the CPU in config and put the original one in priv -+ * once we're done. -+ */ -+ if (cookie && cookie->cpu && config->cpu) { -+ origCPU = config->cpu; -+ if (!(config->cpu = virCPUDefCopy(cookie->cpu))) -+ goto endjob; -+ } -+ - /* Check for ABI compatibility. We need to do this check against - * the migratable XML or it will always fail otherwise */ - if (config && -@@ -15470,8 +15483,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - * failed loadvm attempt? */ - goto endjob; - } -- if (config) -+ if (config) { - virDomainObjAssignDef(vm, config, false, NULL); -+ virCPUDefFree(priv->origCPU); -+ VIR_STEAL_PTR(priv->origCPU, origCPU); -+ } - } else { - /* Transitions 2, 3 */ - load: -@@ -15480,6 +15496,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - virDomainObjAssignDef(vm, config, false, NULL); - - rc = qemuProcessStart(snapshot->domain->conn, driver, vm, -+ cookie ? cookie->cpu : NULL, - QEMU_ASYNC_JOB_START, NULL, -1, NULL, snap, - VIR_NETDEV_VPORT_PROFILE_OP_CREATE, - VIR_QEMU_PROCESS_START_PAUSED); -@@ -15573,7 +15590,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - start_flags |= paused ? VIR_QEMU_PROCESS_START_PAUSED : 0; - - qemuDomainEventQueue(driver, event); -- rc = qemuProcessStart(snapshot->domain->conn, driver, vm, -+ rc = qemuProcessStart(snapshot->domain->conn, driver, vm, NULL, - QEMU_ASYNC_JOB_START, NULL, -1, NULL, NULL, - VIR_NETDEV_VPORT_PROFILE_OP_CREATE, - start_flags); -@@ -15645,6 +15662,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, - virObjectUnref(caps); - virObjectUnref(cfg); - virNWFilterUnlockFilterUpdates(); -+ virCPUDefFree(origCPU); - - return ret; - } -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index c03f1be575..a4540ce3c4 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -2650,7 +2650,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, - goto stopjob; - } - -- if (qemuProcessInit(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, -+ if (qemuProcessInit(driver, vm, mig->cpu, QEMU_ASYNC_JOB_MIGRATION_IN, - true, VIR_QEMU_PROCESS_START_AUTODESTROY) < 0) - goto stopjob; - stopProcess = true; -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 79f780ed46..a7abfc720e 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3946,6 +3946,13 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driver, - if (qemuProcessVerifyCPUFeatures(def, cpu) < 0) - goto cleanup; - -+ /* Don't update the CPU if we already did so when starting a domain -+ * during migration, restore or snapshot revert. */ -+ if (priv->origCPU) { -+ ret = 0; -+ goto cleanup; -+ } -+ - if (!(orig = virCPUDefCopy(def->cpu))) - goto cleanup; - -@@ -4864,6 +4871,7 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, - int - qemuProcessInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, -+ virCPUDefPtr updatedCPU, - qemuDomainAsyncJob asyncJob, - bool migration, - unsigned int flags) -@@ -4872,6 +4880,7 @@ qemuProcessInit(virQEMUDriverPtr driver, - virCapsPtr caps = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - int stopFlags; -+ virCPUDefPtr origCPU = NULL; - int ret = -1; - - VIR_DEBUG("vm=%p name=%s id=%d migration=%d", -@@ -4896,6 +4905,9 @@ qemuProcessInit(virQEMUDriverPtr driver, - vm->def->os.machine))) - goto cleanup; - -+ if (qemuDomainUpdateCPU(vm, updatedCPU, &origCPU) < 0) -+ goto cleanup; -+ - if (qemuProcessStartValidate(driver, vm, priv->qemuCaps, caps, flags) < 0) - goto cleanup; - -@@ -4928,11 +4940,14 @@ qemuProcessInit(virQEMUDriverPtr driver, - - if (qemuDomainSetPrivatePaths(driver, vm) < 0) - goto stop; -+ -+ VIR_STEAL_PTR(priv->origCPU, origCPU); - } - - ret = 0; - - cleanup: -+ virCPUDefFree(origCPU); - virObjectUnref(cfg); - virObjectUnref(caps); - return ret; -@@ -5963,6 +5978,7 @@ int - qemuProcessStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, -+ virCPUDefPtr updatedCPU, - qemuDomainAsyncJob asyncJob, - const char *migrateFrom, - int migrateFd, -@@ -5993,7 +6009,8 @@ qemuProcessStart(virConnectPtr conn, - if (!migrateFrom && !snapshot) - flags |= VIR_QEMU_PROCESS_START_NEW; - -- if (qemuProcessInit(driver, vm, asyncJob, !!migrateFrom, flags) < 0) -+ if (qemuProcessInit(driver, vm, updatedCPU, -+ asyncJob, !!migrateFrom, flags) < 0) - goto cleanup; - - if (migrateFrom) { -@@ -6072,7 +6089,8 @@ qemuProcessCreatePretendCmd(virConnectPtr conn, - flags |= VIR_QEMU_PROCESS_START_PRETEND; - flags |= VIR_QEMU_PROCESS_START_NEW; - -- if (qemuProcessInit(driver, vm, QEMU_ASYNC_JOB_NONE, !!migrateURI, flags) < 0) -+ if (qemuProcessInit(driver, vm, NULL, QEMU_ASYNC_JOB_NONE, -+ !!migrateURI, flags) < 0) - goto cleanup; - - if (qemuProcessPrepareDomain(conn, driver, vm, flags) < 0) -@@ -6474,6 +6492,8 @@ void qemuProcessStop(virQEMUDriverPtr driver, - - /* clean up migration data */ - VIR_FREE(priv->migTLSAlias); -+ virCPUDefFree(priv->origCPU); -+ priv->origCPU = NULL; - - /* clear previously used namespaces */ - virBitmapFree(priv->namespaces); -diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h -index 830d8cef84..c38310b47a 100644 ---- a/src/qemu/qemu_process.h -+++ b/src/qemu/qemu_process.h -@@ -75,6 +75,7 @@ typedef enum { - int qemuProcessStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, -+ virCPUDefPtr updatedCPU, - qemuDomainAsyncJob asyncJob, - const char *migrateFrom, - int stdin_fd, -@@ -93,6 +94,7 @@ virCommandPtr qemuProcessCreatePretendCmd(virConnectPtr conn, - - int qemuProcessInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, -+ virCPUDefPtr updatedCPU, - qemuDomainAsyncJob asyncJob, - bool migration, - unsigned int flags); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-Validate-target-model-for-serial-devices.patch b/SOURCES/libvirt-qemu-Validate-target-model-for-serial-devices.patch new file mode 100644 index 0000000..6004ce1 --- /dev/null +++ b/SOURCES/libvirt-qemu-Validate-target-model-for-serial-devices.patch @@ -0,0 +1,99 @@ +From 37bf217cd53b115427999d5421dca30eb472616c Mon Sep 17 00:00:00 2001 +Message-Id: <37bf217cd53b115427999d5421dca30eb472616c@dist-git> +From: Andrea Bolognani +Date: Wed, 29 Nov 2017 16:23:09 +0100 +Subject: [PATCH] qemu: Validate target model for serial devices + +Target model and target type must agree for the configuration +to make sense, so check that's actually the case and error out +otherwise. + +Signed-off-by: Andrea Bolognani +Reviewed-by: Pavel Hrdina +(cherry picked from commit a9254a2d6e9db1030350ff562b9ea91494143aa9) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/libvirt_private.syms | 2 ++ + src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 43 insertions(+) + +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 65b1143c9b..ecf7036dff 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -209,6 +209,8 @@ virDomainChrGetDomainPtrs; + virDomainChrInsertPreAlloced; + virDomainChrPreAlloc; + virDomainChrRemove; ++virDomainChrSerialTargetModelTypeFromString; ++virDomainChrSerialTargetModelTypeToString; + virDomainChrSerialTargetTypeFromString; + virDomainChrSerialTargetTypeToString; + virDomainChrSourceDefClear; +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index a8a91de2fe..7b5bc97de6 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3475,6 +3475,25 @@ qemuDomainChrSerialTargetTypeToAddressType(int targetType) + } + + ++static int ++qemuDomainChrSerialTargetModelToTargetType(int targetModel) ++{ ++ switch ((virDomainChrSerialTargetModel) targetModel) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI; ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: ++ break; ++ } ++ ++ return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE; ++} ++ ++ + static int + qemuDomainChrTargetDefValidate(const virDomainDef *def, + const virDomainChrDef *chr) +@@ -3511,6 +3530,28 @@ qemuDomainChrTargetDefValidate(const virDomainDef *def, + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: + break; + } ++ ++ /* Validate target model */ ++ switch ((virDomainChrSerialTargetModel) chr->targetModel) { ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL: ++ ++ expected = qemuDomainChrSerialTargetModelToTargetType(chr->targetModel); ++ ++ if (chr->targetType != expected) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("Target model '%s' requires target type '%s'"), ++ virDomainChrSerialTargetModelTypeToString(chr->targetModel), ++ virDomainChrSerialTargetTypeToString(expected)); ++ return -1; ++ } ++ break; ++ ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: ++ case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: ++ break; ++ } + break; + + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-add-QEMU_CAPS_DEVICE_SCLPLMCONSOLE.patch b/SOURCES/libvirt-qemu-add-QEMU_CAPS_DEVICE_SCLPLMCONSOLE.patch new file mode 100644 index 0000000..0e0d604 --- /dev/null +++ b/SOURCES/libvirt-qemu-add-QEMU_CAPS_DEVICE_SCLPLMCONSOLE.patch @@ -0,0 +1,162 @@ +From c77b3a25ee9f277359018a1b65ea73fefd9d4c4e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pino Toscano +Date: Wed, 29 Nov 2017 16:22:53 +0100 +Subject: [PATCH] qemu: add QEMU_CAPS_DEVICE_SCLPLMCONSOLE + +Add a separate capability for the sclplmconsole device, and check it +specifically instead of using QEMU_CAPS_DEVICE_SCLPCONSOLE for that too. + +Signed-off-by: Pino Toscano +Reviewed-by: Andrea Bolognani +(cherry picked from commit 593639ffffa43f52aae53038bc8bd75ec700b12f) + + Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml + tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml + + Insert the new capability in the right place, both in the + declaration and in caps. + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 3 ++- + src/qemu/qemu_capabilities.h | 2 +- + src/qemu/qemu_command.c | 22 +++++++++++++++++++++- + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 + + 7 files changed, 28 insertions(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 374a2e79a7..322e0423d6 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -448,7 +448,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "spapr-vty", + + /* 275 */ +- ++ "sclplmconsole", + + "disk-share-rw", + ); +@@ -1680,6 +1680,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, + { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, + { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, ++ { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index f115738b6b..c3a15948cf 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -434,7 +434,7 @@ typedef enum { + QEMU_CAPS_DEVICE_SPAPR_VTY, /* -device spapr-vty */ + + /* 275 */ +- ++ QEMU_CAPS_DEVICE_SCLPLMCONSOLE, /* -device sclplmconsole */ + + QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */ + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 092d820b1d..19a819a3aa 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9419,7 +9419,6 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, + + switch (console->targetType) { + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: +- case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCLPCONSOLE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("sclpconsole is not supported in this QEMU binary")); +@@ -9440,6 +9439,27 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, + return -1; + break; + ++ case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCLPLMCONSOLE)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("sclplmconsole is not supported in this QEMU binary")); ++ return -1; ++ } ++ ++ if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, ++ console->source, ++ console->info.alias, ++ qemuCaps, true, ++ chardevStdioLogd))) ++ return -1; ++ virCommandAddArg(cmd, "-chardev"); ++ virCommandAddArg(cmd, devstr); ++ VIR_FREE(devstr); ++ ++ if (qemuBuildChrDeviceCommandLine(cmd, def, console, qemuCaps) < 0) ++ return -1; ++ break; ++ + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: + if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, + console->source, +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +index a6900bf1ef..463c30c77a 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +@@ -141,6 +141,7 @@ + + + ++ + + 2010000 + 0 +diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +index c5dfa2a9d0..c2f310cd46 100644 +--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +@@ -135,6 +135,7 @@ + + + ++ + 2007000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +index 6d26896ef9..f6e024dc61 100644 +--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +@@ -137,6 +137,7 @@ + + + ++ + 2007093 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +index 4150b8eee7..5c4a02c8b1 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +@@ -138,6 +138,7 @@ + + + ++ + + 2009000 + 0 +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-add-support-for-qemu-xhci-USB-controller.patch b/SOURCES/libvirt-qemu-add-support-for-qemu-xhci-USB-controller.patch deleted file mode 100644 index f5c1258..0000000 --- a/SOURCES/libvirt-qemu-add-support-for-qemu-xhci-USB-controller.patch +++ /dev/null @@ -1,263 +0,0 @@ -From 41750fbfbd634a090bbe399e18196d080e89b014 Mon Sep 17 00:00:00 2001 -Message-Id: <41750fbfbd634a090bbe399e18196d080e89b014@dist-git> -From: Pavel Hrdina -Date: Fri, 28 Apr 2017 11:59:50 +0200 -Subject: [PATCH] qemu: add support for qemu-xhci USB controller - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438682 - -Signed-off-by: Pavel Hrdina -Acked-by: Andrea Bolognani -(cherry picked from commit 278e70f8f8bac9e6482099d7f3f1a7a8f2109b5f) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - docs/formatdomain.html.in | 4 ++-- - docs/schemas/domaincommon.rng | 1 + - src/conf/domain_addr.c | 1 + - src/conf/domain_conf.c | 1 + - src/conf/domain_conf.h | 1 + - src/qemu/qemu_command.c | 8 ++++++-- - src/qemu/qemu_domain.c | 12 +++++++----- - src/qemu/qemu_domain_address.c | 1 + - .../qemuxml2argv-usb-controller-qemu-xhci-limit.xml | 14 ++++++++++++++ - ...uxml2argv-usb-controller-qemu-xhci-unavailable.xml | 1 + - .../qemuxml2argv-usb-controller-qemu-xhci.args | 19 +++++++++++++++++++ - .../qemuxml2argv-usb-controller-qemu-xhci.xml | 14 ++++++++++++++ - tests/qemuxml2argvtest.c | 4 ++++ - 13 files changed, 72 insertions(+), 9 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-limit.xml - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-unavailable.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.xml - -diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in -index c82cd69a2..2dc5e751a 100644 ---- a/docs/formatdomain.html.in -+++ b/docs/formatdomain.html.in -@@ -3495,8 +3495,8 @@ - model, which is one of "piix3-uhci", "piix4-uhci", - "ehci", "ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3", - "vt82c686b-uhci", "pci-ohci", "nec-xhci", "qusb1" (xen pvusb -- with qemu backend, version 1.1) or "qusb2" (xen pvusb with qemu -- backend, version 2.0). Additionally, -+ with qemu backend, version 1.1), "qusb2" (xen pvusb with qemu -+ backend, version 2.0) or "qemu-xhci". Additionally, - since 0.10.0, if the USB bus needs to - be explicitly disabled for the guest, model='none' - may be used. Since 1.0.5, no default -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 7a9b4b702..7271f0113 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -1877,6 +1877,7 @@ - none - qusb1 - qusb2 -+ qemu-xhci - - - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index 8b6109199..639168eff 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -1673,6 +1673,7 @@ virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont) - return 3; - - case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: -+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI: - if (cont->opts.usbopts.ports != -1) - return cont->opts.usbopts.ports; - return 4; -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 2d5d00cf2..7ab5e5051 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -366,6 +366,7 @@ VIR_ENUM_IMPL(virDomainControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST, - "nec-xhci", - "qusb1", - "qusb2", -+ "qemu-xhci", - "none") - - VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST, -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 1dbbcdc51..c91791262 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -735,6 +735,7 @@ typedef enum { - VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI, - VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1, - VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2, -+ VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI, - VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE, - - VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 9ce90c25b..30feef1de 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -152,6 +152,7 @@ VIR_ENUM_IMPL(qemuControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST, - "nec-usb-xhci", - "qusb1", - "qusb2", -+ "qemu-xhci", - "none"); - - VIR_ENUM_DECL(qemuDomainFSDriver) -@@ -2558,6 +2559,8 @@ qemuControllerModelUSBToCaps(int model) - return QEMU_CAPS_PCI_OHCI; - case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: - return QEMU_CAPS_NEC_USB_XHCI; -+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI: -+ return QEMU_CAPS_DEVICE_QEMU_XHCI; - default: - return -1; - } -@@ -2592,8 +2595,9 @@ qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def, - virBufferAsprintf(buf, "%s", smodel); - - if (def->opts.usbopts.ports != -1) { -- if (model != VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI || -- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI_PORTS)) { -+ if ((model != VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI || -+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI_PORTS)) && -+ model != VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("usb controller type %s doesn't support 'ports' " - "with this QEMU binary"), smodel); -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 25ab1f639..4d7de60cb 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3194,7 +3194,7 @@ qemuDomainShmemDefPostParse(virDomainShmemDefPtr shm) - } - - --#define QEMU_USB_NEC_XHCI_MAXPORTS 15 -+#define QEMU_USB_XHCI_MAXPORTS 15 - - - static int -@@ -3262,11 +3262,13 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - virDomainVirtTypeToString(def->virtType)); - return -1; - } -- if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI && -- cont->opts.usbopts.ports > QEMU_USB_NEC_XHCI_MAXPORTS) { -+ if ((cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI || -+ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI) && -+ cont->opts.usbopts.ports > QEMU_USB_XHCI_MAXPORTS) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- _("nec-xhci controller only supports up to %u ports"), -- QEMU_USB_NEC_XHCI_MAXPORTS); -+ _("'%s' controller only supports up to '%u' ports"), -+ virDomainControllerModelUSBTypeToString(cont->model), -+ QEMU_USB_XHCI_MAXPORTS); - return -1; - } - break; -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 064d05079..3da6b7369 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -502,6 +502,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, - case VIR_DOMAIN_CONTROLLER_TYPE_USB: - switch ((virDomainControllerModelUSB) cont->model) { - case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: -+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI: - return pcieFlags; - - case VIR_DOMAIN_CONTROLLER_MODEL_USB_EHCI: -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-limit.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-limit.xml -new file mode 100644 -index 000000000..27cc99127 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-limit.xml -@@ -0,0 +1,14 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-unavailable.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-unavailable.xml -new file mode 120000 -index 000000000..989306fa7 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci-unavailable.xml -@@ -0,0 +1 @@ -+qemuxml2argv-usb-controller-qemu-xhci.xml -\ No newline at end of file -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args -new file mode 100644 -index 000000000..8adb3022f ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-M pc-0.11 \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device qemu-xhci,p2=8,p3=8,id=usb,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.xml -new file mode 100644 -index 000000000..b63f9e1c4 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.xml -@@ -0,0 +1,14 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index ca1d23c10..317f17e74 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1424,6 +1424,10 @@ mymain(void) - DO_TEST_PARSE_ERROR("usb-controller-xhci-limit", - QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, - QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS); -+ DO_TEST("usb-controller-qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI); -+ DO_TEST_FAILURE("usb-controller-qemu-xhci-unavailable", NONE); -+ DO_TEST_PARSE_ERROR("usb-controller-qemu-xhci-limit", -+ QEMU_CAPS_DEVICE_QEMU_XHCI); - - DO_TEST("smbios", QEMU_CAPS_SMBIOS_TYPE); - DO_TEST_PARSE_ERROR("smbios-date", QEMU_CAPS_SMBIOS_TYPE); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-add-vmcoreinfo-support.patch b/SOURCES/libvirt-qemu-add-vmcoreinfo-support.patch new file mode 100644 index 0000000..0cc7d72 --- /dev/null +++ b/SOURCES/libvirt-qemu-add-vmcoreinfo-support.patch @@ -0,0 +1,342 @@ +From b66931b0282f0209a262854b54b590d008070f85 Mon Sep 17 00:00:00 2001 +Message-Id: +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Wed, 29 Nov 2017 17:00:04 +0100 +Subject: [PATCH] qemu: add vmcoreinfo support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Starting from qemu 2.11, the `-device vmcoreinfo` will create a fw_cfg +entry for a guest to store dump details, necessary to process kernel +dump with KASLR enabled and providing additional kernel details. + +In essence, it is similar to -fw_cfg name=etc/vmcoreinfo,file=X but in +this case it is not backed by a file, but collected by QEMU itself. + +Since the device is a singleton and shouldn't use additional hardware +resources, it is presented as a element in the libvirt +domain XML. + +The device is arm/x86 only for now (targets that support fw_cfg+dma). + +Related to: +https://bugzilla.redhat.com/show_bug.cgi?id=1395248 + +Signed-off-by: Marc-André Lureau +(cherry picked from commit 7e4177a35bae49a53b04940be04418daaa988734) +Signed-off-by: Martin Kletzander +Signed-off-by: Jiri Denemark +--- + docs/formatdomain.html.in | 4 +++ + docs/schemas/domaincommon.rng | 9 +++++ + src/conf/domain_conf.c | 3 ++ + src/conf/domain_conf.h | 1 + + src/qemu/qemu_capabilities.c | 3 +- + src/qemu/qemu_capabilities.h | 2 +- + src/qemu/qemu_command.c | 25 ++++++++++++++ + .../qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args | 25 ++++++++++++++ + tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml | 28 ++++++++++++++++ + tests/qemuxml2argvtest.c | 1 + + .../qemuxml2xmlout-vmcoreinfo.xml | 38 ++++++++++++++++++++++ + tests/qemuxml2xmltest.c | 1 + + 12 files changed, 138 insertions(+), 2 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml + create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml + +diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in +index cc1c5577cd..6807da5c6f 100644 +--- a/docs/formatdomain.html.in ++++ b/docs/formatdomain.html.in +@@ -1940,6 +1940,10 @@ + which is also known as a split I/O APIC mode. + Since 3.4.0 (QEMU/KVM only) + ++
      vmcoreinfo
      ++
      Enable QEMU vmcoreinfo device to let the guest kernel save debug ++ details. Since 3.10.0 (QEMU only) ++
      + + +

      Time keeping

      +diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng +index 5576128db5..05709afc0c 100644 +--- a/docs/schemas/domaincommon.rng ++++ b/docs/schemas/domaincommon.rng +@@ -4747,6 +4747,9 @@ + + + ++ ++ ++ + + + +@@ -4947,6 +4950,12 @@ + + + ++ ++ ++ ++ ++ ++ + + + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index bd6d851f21..2d54037b71 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -150,6 +150,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, + "smm", + "ioapic", + "hpt", ++ "vmcoreinfo", + ); + + VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, +@@ -18824,6 +18825,7 @@ virDomainDefParseXML(xmlDocPtr xml, + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: ++ case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_KVM: + def->features[val] = VIR_TRISTATE_SWITCH_ON; + break; +@@ -26265,6 +26267,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_VIRIDIAN: ++ case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_PRIVNET: + switch ((virTristateSwitch) def->features[i]) { + case VIR_TRISTATE_SWITCH_ABSENT: +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 479a791f29..698d3280fe 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -1735,6 +1735,7 @@ typedef enum { + VIR_DOMAIN_FEATURE_SMM, + VIR_DOMAIN_FEATURE_IOAPIC, + VIR_DOMAIN_FEATURE_HPT, ++ VIR_DOMAIN_FEATURE_VMCOREINFO, + + VIR_DOMAIN_FEATURE_LAST + } virDomainFeature; +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 13ff1286c4..4301d2e799 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -444,7 +444,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "vxhs", + "virtio-blk.num-queues", + "machine.pseries.resize-hpt", +- ++ "vmcoreinfo", + "spapr-vty", + + /* 275 */ +@@ -1684,6 +1684,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, + { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, + { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, ++ { "vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO }, + { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, + { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, + { "isa-serial", QEMU_CAPS_DEVICE_ISA_SERIAL }, +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 3e016b7c79..c6eb9df146 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -430,7 +430,7 @@ typedef enum { + QEMU_CAPS_VXHS, /* -drive file.driver=vxhs via query-qmp-schema */ + QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */ + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */ +- ++ QEMU_CAPS_DEVICE_VMCOREINFO, /* -device vmcoreinfo */ + QEMU_CAPS_DEVICE_SPAPR_VTY, /* -device spapr-vty */ + + /* 275 */ +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index b462c7cf09..a1bf230fad 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9922,6 +9922,28 @@ qemuBuildTPMCommandLine(virCommandPtr cmd, + } + + ++static int ++qemuBuildVMCoreInfoCommandLine(virCommandPtr cmd, ++ const virDomainDef *def, ++ virQEMUCapsPtr qemuCaps) ++{ ++ virTristateSwitch vmci = def->features[VIR_DOMAIN_FEATURE_VMCOREINFO]; ++ ++ if (vmci != VIR_TRISTATE_SWITCH_ON) ++ return 0; ++ ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("vmcoreinfo is not available " ++ "with this QEMU binary")); ++ return -1; ++ } ++ ++ virCommandAddArgList(cmd, "-device", "vmcoreinfo", NULL); ++ return 0; ++} ++ ++ + static int + qemuBuildPanicCommandLine(virCommandPtr cmd, + const virDomainDef *def, +@@ -10341,6 +10363,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, + if (qemuBuildNVRAMCommandLine(cmd, def, qemuCaps) < 0) + goto error; + ++ if (qemuBuildVMCoreInfoCommandLine(cmd, def, qemuCaps) < 0) ++ goto error; ++ + if (snapshot) + virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL); + +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args +new file mode 100644 +index 0000000000..772e5a071f +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.args +@@ -0,0 +1,25 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-i686 \ ++-name QEMUGuest1 \ ++-S \ ++-M pc \ ++-m 214 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-usb \ ++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ ++-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ ++-device vmcoreinfo +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml +new file mode 100644 +index 0000000000..f8e5865310 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-vmcoreinfo.xml +@@ -0,0 +1,28 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++
      ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 686a63855c..686d289b89 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -2933,6 +2933,7 @@ mymain(void) + DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM); + DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM); + DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM); ++ DO_TEST("vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO); + + DO_TEST("user-aliases", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_CIRRUS_VGA, + QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_PIIX_DISABLE_S3, +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml +new file mode 100644 +index 0000000000..a3922d6304 +--- /dev/null ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-vmcoreinfo.xml +@@ -0,0 +1,38 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++
      ++ ++ ++
      ++ ++ ++
      ++ ++ ++ ++ ++ ++
      ++ ++ ++ +diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c +index 8766646738..5ca0ea3a22 100644 +--- a/tests/qemuxml2xmltest.c ++++ b/tests/qemuxml2xmltest.c +@@ -1319,6 +1319,7 @@ mymain(void) + DO_TEST("cpu-check-default-none2", NONE); + DO_TEST("cpu-check-default-partial", NONE); + DO_TEST("cpu-check-default-partial2", NONE); ++ DO_TEST("vmcoreinfo", NONE); + + DO_TEST("smartcard-host", NONE); + DO_TEST("smartcard-host-certificates", NONE); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-allow-conditional-device-property-probing.patch b/SOURCES/libvirt-qemu-allow-conditional-device-property-probing.patch deleted file mode 100644 index f694282..0000000 --- a/SOURCES/libvirt-qemu-allow-conditional-device-property-probing.patch +++ /dev/null @@ -1,175 +0,0 @@ -From 363d20b7336faeb280bf583d9d148e441d4286be Mon Sep 17 00:00:00 2001 -Message-Id: <363d20b7336faeb280bf583d9d148e441d4286be@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:50 +0200 -Subject: [PATCH] qemu: allow conditional device property probing -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Do not probe for devices that QEMU does not know -when probing for device options. - -(cherry picked from commit 4ae59411fa3f16e18e16cc4db7894fe5fd6404ce) -Signed-off-by: Ján Tomko - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 99 ++++++++++++++++++++++++++++++-------------- - 1 file changed, 68 insertions(+), 31 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index b76b79342..49fb52e03 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -1728,71 +1728,103 @@ struct virQEMUCapsObjectTypeProps { - const char *type; - struct virQEMUCapsStringFlags *props; - size_t nprops; -+ int capsCondition; - }; - - static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { - { "virtio-blk-pci", virQEMUCapsObjectPropsVirtioBlk, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), -+ -1 }, - { "virtio-net-pci", virQEMUCapsObjectPropsVirtioNet, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), -+ -1 }, - { "virtio-scsi-pci", virQEMUCapsObjectPropsVirtioSCSI, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), -+ -1 }, - { "virtio-blk-ccw", virQEMUCapsObjectPropsVirtioBlk, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), -+ -1 }, - { "virtio-net-ccw", virQEMUCapsObjectPropsVirtioNet, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), -+ -1 }, - { "virtio-scsi-ccw", virQEMUCapsObjectPropsVirtioSCSI, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), -+ -1 }, - { "virtio-blk-s390", virQEMUCapsObjectPropsVirtioBlk, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), -+ -1 }, - { "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), -+ -1 }, - { "pci-assign", virQEMUCapsObjectPropsPCIAssign, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), -+ -1 }, - { "kvm-pci-assign", virQEMUCapsObjectPropsPCIAssign, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), -+ -1 }, - { "vfio-pci", virQEMUCapsObjectPropsVfioPCI, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI), -+ -1 }, - { "scsi-disk", virQEMUCapsObjectPropsSCSIDisk, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk), -+ -1 }, - { "ide-drive", virQEMUCapsObjectPropsIDEDrive, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive), -+ -1 }, - { "PIIX4_PM", virQEMUCapsObjectPropsPiix4PM, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsPiix4PM) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsPiix4PM), -+ -1 }, - { "usb-redir", virQEMUCapsObjectPropsUSBRedir, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir), -+ -1 }, - { "usb-host", virQEMUCapsObjectPropsUSBHost, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost), -+ -1 }, - { "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric), -+ -1 }, - { "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPCIHost, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost), -+ -1 }, - { "q35-pcihost", virQEMUCapsObjectPropsQ35PCIHost, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost), -+ -1 }, - { "usb-storage", virQEMUCapsObjectPropsUSBStorage, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage), -+ -1 }, - { "kvm-pit", virQEMUCapsObjectPropsKVMPit, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit), -+ -1 }, - { "VGA", virQEMUCapsObjectPropsVGA, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA), -+ -1 }, - { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga), -+ -1 }, - { "qxl", virQEMUCapsObjectPropsQxl, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl), -+ -1 }, - { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), -+ -1 }, - { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), -+ -1 }, - { "ICH9-LPC", virQEMUCapsObjectPropsICH9, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9), -+ -1 }, - { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), -+ -1 }, - { "virtio-balloon-ccw", virQEMUCapsObjectPropsVirtioBalloon, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), -+ -1 }, - { "virtio-balloon-device", virQEMUCapsObjectPropsVirtioBalloon, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), -+ -1 }, - { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, -- ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI) }, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), -+ -1 }, - }; - - struct virQEMUCapsPropTypeObjects { -@@ -2767,6 +2799,11 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, - - for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type = virQEMUCapsObjectProps[i].type; -+ int cap = virQEMUCapsObjectProps[i].capsCondition; -+ -+ if (cap >= 0 && !virQEMUCapsGet(qemuCaps, cap)) -+ continue; -+ - if ((nvalues = qemuMonitorGetObjectProps(mon, - type, - &values)) < 0) --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-block-Add-function-to-check-if-storage-source-allows-concurrent-access.patch b/SOURCES/libvirt-qemu-block-Add-function-to-check-if-storage-source-allows-concurrent-access.patch new file mode 100644 index 0000000..f077d25 --- /dev/null +++ b/SOURCES/libvirt-qemu-block-Add-function-to-check-if-storage-source-allows-concurrent-access.patch @@ -0,0 +1,67 @@ +From a77029a7a8885902edbc0034c15c2a609a1093ba Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:18 +0100 +Subject: [PATCH] qemu: block: Add function to check if storage source allows + concurrent access + +Storage source format backing a shared device (e.g. running a cluster +filesystem) needs to support the sharing so that metadata are not +corrupted. Add a central function for checking this. + +(cherry picked from commit 1fc3cd8731640aefc48bbd9fc489f21cb99c6f67) + + Conflicts: + src/qemu/qemu_block.c: context of one of the blockdev-add saga + refactors not being backported + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_block.c | 15 +++++++++++++++ + src/qemu/qemu_block.h | 3 +++ + 2 files changed, 18 insertions(+) + +diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c +index 0761f89913..86fa565f39 100644 +--- a/src/qemu/qemu_block.c ++++ b/src/qemu/qemu_block.c +@@ -390,6 +390,21 @@ qemuBlockGetNodeData(virJSONValuePtr data) + } + + ++/** ++ * qemuBlockStorageSourceSupportsConcurrentAccess: ++ * @src: disk storage source ++ * ++ * Returns true if the given storage format supports concurrent access from two ++ * separate processes. ++ */ ++bool ++qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src) ++{ ++ /* no need to check in backing chain since only RAW storage supports this */ ++ return src->format == VIR_STORAGE_FILE_RAW; ++} ++ ++ + /** + * qemuBlockStorageSourceBuildJSONSocketAddress + * @host: the virStorageNetHostDefPtr definition to build +diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h +index f0a2c9aa7d..ebf3149ce8 100644 +--- a/src/qemu/qemu_block.h ++++ b/src/qemu/qemu_block.h +@@ -53,6 +53,9 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, + virHashTablePtr + qemuBlockGetNodeData(virJSONValuePtr data); + ++bool ++qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src); ++ + virJSONValuePtr + qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src); + +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-blockjob-Reset-disk-source-index-after-pivot.patch b/SOURCES/libvirt-qemu-blockjob-Reset-disk-source-index-after-pivot.patch new file mode 100644 index 0000000..b7d2681 --- /dev/null +++ b/SOURCES/libvirt-qemu-blockjob-Reset-disk-source-index-after-pivot.patch @@ -0,0 +1,40 @@ +From cf8fcc97c173618534874046d2f29d4135cf2441 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Fri, 8 Dec 2017 10:27:03 +0100 +Subject: [PATCH] qemu: blockjob: Reset disk source index after pivot + +Since we are re-detecting the backing chain after pivoting to the active +block commit target (or block copy target) the disk index needs to be +reset to 0. This is necessary since we move a member of the backing +chain to disk->src but clear indexes only starting from +disk->src->backingStore. The freshly detected images have indexes +starting from 1, but since we've pivoted into an image which was +previously a backing store it would have a non-0 index. +The lookup function would then return the top of the chain for queries +like 'vda[1]' instead of the first backing store. + +This problem will not be present once we keep the disk indexes stable. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1519745 +(cherry picked from commit fac8724ceb371f962d5d185c639456a34d71659e) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_blockjob.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c +index c1b46f7d0a..afc05f161c 100644 +--- a/src/qemu/qemu_blockjob.c ++++ b/src/qemu/qemu_blockjob.c +@@ -165,6 +165,7 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, + disk->mirror = NULL; + disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE; + disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; ++ disk->src->id = 0; + ignore_value(qemuDomainDetermineDiskChain(driver, vm, disk, + true, true)); + ignore_value(qemuBlockNodeNamesDetect(driver, vm, asyncJob)); +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-capabilities-force-update-if-the-microcode-version-does-not-match.patch b/SOURCES/libvirt-qemu-capabilities-force-update-if-the-microcode-version-does-not-match.patch new file mode 100644 index 0000000..f7ce68c --- /dev/null +++ b/SOURCES/libvirt-qemu-capabilities-force-update-if-the-microcode-version-does-not-match.patch @@ -0,0 +1,579 @@ +From 94ea163b2853d51a3037e8f8ee664058ae7c541d Mon Sep 17 00:00:00 2001 +Message-Id: <94ea163b2853d51a3037e8f8ee664058ae7c541d@dist-git> +From: Paolo Bonzini +Date: Tue, 12 Dec 2017 16:23:41 +0100 +Subject: [PATCH] qemu: capabilities: force update if the microcode version + does not match + +A microcode update can cause the CPUID bits to change; an example +from the past was the update that disabled TSX on several Haswell +and Broadwell machines. + +Therefore, place microcode version in the virQEMUCaps struct and +XML, and rebuild the cache if the versions do not match. + +CVE-2017-5715 + +Signed-off-by: Paolo Bonzini +Signed-off-by: Jiri Denemark + +Conflicts: + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml + - missing in 7.5 +--- + src/qemu/qemu_capabilities.c | 40 +++++++++++++++++++++- + src/qemu/qemu_capabilities.h | 6 ++-- + src/qemu/qemu_capspriv.h | 5 +++ + src/qemu/qemu_driver.c | 9 ++++- + tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + + .../caps_2.6.0-gicv2.aarch64.xml | 1 + + .../caps_2.6.0-gicv3.aarch64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + + tests/qemucapabilitiestest.c | 14 +++++--- + tests/qemucapsprobe.c | 2 +- + tests/testutilsqemu.c | 2 +- + 30 files changed, 91 insertions(+), 10 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 165fdbc5ea..09323d2580 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -507,6 +507,7 @@ struct _virQEMUCaps { + unsigned int version; + unsigned int kvmVersion; + unsigned int libvirtVersion; ++ unsigned int microcodeVersion; + char *package; + + virArch arch; +@@ -2296,6 +2297,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) + + ret->version = qemuCaps->version; + ret->kvmVersion = qemuCaps->kvmVersion; ++ ret->microcodeVersion = qemuCaps->microcodeVersion; + + if (VIR_STRDUP(ret->package, qemuCaps->package) < 0) + goto error; +@@ -3819,6 +3821,7 @@ struct _virQEMUCapsCachePriv { + uid_t runUid; + gid_t runGid; + virArch hostArch; ++ unsigned int microcodeVersion; + }; + typedef struct _virQEMUCapsCachePriv virQEMUCapsCachePriv; + typedef virQEMUCapsCachePriv *virQEMUCapsCachePrivPtr; +@@ -3941,6 +3944,13 @@ virQEMUCapsLoadCache(virArch hostArch, + goto cleanup; + } + ++ if (virXPathUInt("string(./microcodeVersion)", ctxt, ++ &qemuCaps->microcodeVersion) < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", ++ _("missing microcode version in QEMU capabilities cache")); ++ goto cleanup; ++ } ++ + if (virXPathBoolean("boolean(./package)", ctxt) > 0) { + qemuCaps->package = virXPathString("string(./package)", ctxt); + if (!qemuCaps->package && +@@ -4219,6 +4229,9 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) + virBufferAsprintf(&buf, "%d\n", + qemuCaps->kvmVersion); + ++ virBufferAsprintf(&buf, "%u\n", ++ qemuCaps->microcodeVersion); ++ + if (qemuCaps->package) + virBufferAsprintf(&buf, "%s\n", + qemuCaps->package); +@@ -4360,6 +4373,16 @@ virQEMUCapsIsValid(void *data, + return false; + } + ++ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && ++ priv->microcodeVersion != qemuCaps->microcodeVersion) { ++ VIR_DEBUG("Outdated capabilities for '%s': microcode version changed " ++ "(%u vs %u)", ++ qemuCaps->binary, ++ priv->microcodeVersion, ++ qemuCaps->microcodeVersion); ++ return false; ++ } ++ + return true; + } + +@@ -5189,6 +5212,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, + const char *libDir, + uid_t runUid, + gid_t runGid, ++ unsigned int microcodeVersion, + bool qmpOnly) + { + virQEMUCapsPtr qemuCaps; +@@ -5245,6 +5269,9 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU); + ++ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) ++ qemuCaps->microcodeVersion = microcodeVersion; ++ + cleanup: + VIR_FREE(qmperr); + return qemuCaps; +@@ -5266,6 +5293,7 @@ virQEMUCapsNewData(const char *binary, + priv->libDir, + priv->runUid, + priv->runGid, ++ priv->microcodeVersion, + false); + } + +@@ -5348,7 +5376,8 @@ virFileCachePtr + virQEMUCapsCacheNew(const char *libDir, + const char *cacheDir, + uid_t runUid, +- gid_t runGid) ++ gid_t runGid, ++ unsigned int microcodeVersion) + { + char *capsCacheDir = NULL; + virFileCachePtr cache = NULL; +@@ -5371,6 +5400,7 @@ virQEMUCapsCacheNew(const char *libDir, + + priv->runUid = runUid; + priv->runGid = runGid; ++ priv->microcodeVersion = microcodeVersion; + + cleanup: + VIR_FREE(capsCacheDir); +@@ -5848,3 +5878,11 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, + return -1; + return 0; + } ++ ++ ++void ++virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, ++ unsigned int microcodeVersion) ++{ ++ qemuCaps->microcodeVersion = microcodeVersion; ++} +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 0fb2a10a17..4b5d70fbb0 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -520,8 +520,10 @@ void virQEMUCapsFilterByMachineType(virQEMUCapsPtr qemuCaps, + const char *machineType); + + virFileCachePtr virQEMUCapsCacheNew(const char *libDir, +- const char *cacheDir, +- uid_t uid, gid_t gid); ++ const char *cacheDir, ++ uid_t uid, ++ gid_t gid, ++ unsigned int microcodeVersion); + virQEMUCapsPtr virQEMUCapsCacheLookup(virFileCachePtr cache, + const char *binary); + virQEMUCapsPtr virQEMUCapsCacheLookupCopy(virFileCachePtr cache, +diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h +index 219daa3629..98d163b920 100644 +--- a/src/qemu/qemu_capspriv.h ++++ b/src/qemu/qemu_capspriv.h +@@ -36,6 +36,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, + const char *libDir, + uid_t runUid, + gid_t runGid, ++ unsigned int microcodeVersion, + bool qmpOnly); + + int virQEMUCapsLoadCache(virArch hostArch, +@@ -102,4 +103,8 @@ int + virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, + qemuMonitorPtr mon, + bool tcg); ++ ++void ++virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, ++ unsigned int microcodeVersion); + #endif +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index fa73fc30d6..0bc6eaa431 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -633,6 +633,8 @@ qemuStateInitialize(bool privileged, + char *hugepagePath = NULL; + char *memoryBackingPath = NULL; + size_t i; ++ virCPUDefPtr hostCPU = NULL; ++ unsigned int microcodeVersion = 0; + + if (VIR_ALLOC(qemu_driver) < 0) + return -1; +@@ -855,10 +857,15 @@ qemuStateInitialize(bool privileged, + run_gid = cfg->group; + } + ++ if ((hostCPU = virCPUProbeHost(virArchFromHost()))) ++ microcodeVersion = hostCPU->microcodeVersion; ++ virCPUDefFree(hostCPU); ++ + qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir, + cfg->cacheDir, + run_uid, +- run_gid); ++ run_gid, ++ microcodeVersion); + if (!qemu_driver->qemuCapsCache) + goto error; + +diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +index d560811ab7..3001d487c6 100644 +--- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml +@@ -112,6 +112,7 @@ + + 1002002 + 0 ++ 26900 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +index 576475f7fa..283f30ef07 100644 +--- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml +@@ -130,6 +130,7 @@ + + 1003001 + 0 ++ 30198 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +index 0c271d3e41..200069ae86 100644 +--- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml +@@ -131,6 +131,7 @@ + + 1004002 + 0 ++ 30915 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +index 5c667975bf..e02c0961cd 100644 +--- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +@@ -143,6 +143,7 @@ + + 1005003 + 0 ++ 47019 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +index 8ae07a91db..e3896685e9 100644 +--- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +@@ -148,6 +148,7 @@ + + 1006000 + 0 ++ 45248 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +index 34bd6be1cd..5b4d1ea661 100644 +--- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +@@ -150,6 +150,7 @@ + + 1007000 + 0 ++ 50692 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +index 0d7c144ff7..200e57adac 100644 +--- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +@@ -166,6 +166,7 @@ + + 2001001 + 0 ++ 59488 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index 09cce92067..d9ba077123 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -184,6 +184,7 @@ + + 2010000 + 0 ++ 383421 + (v2.10.0) + ppc64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +index 00fe1cffa7..d9cbbd8ccb 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +@@ -146,6 +146,7 @@ + + 2010000 + 0 ++ 304153 + + s390x + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +index 2417251678..c7b9787142 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +@@ -229,6 +229,7 @@ + + 2010000 + 0 ++ 345185 + (v2.10.0) + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +index 5007523c1f..9b315aecf4 100644 +--- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +@@ -191,6 +191,7 @@ + + 2004000 + 0 ++ 75653 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +index a9ad292d01..3096eadf72 100644 +--- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +@@ -197,6 +197,7 @@ + + 2005000 + 0 ++ 216775 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +index d3e2e18faa..4cdd894a97 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +@@ -176,6 +176,7 @@ + + 2006000 + 0 ++ 228838 + + aarch64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +index bc86d03537..5655af7d3d 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +@@ -176,6 +176,7 @@ + + 2006000 + 0 ++ 228838 + + aarch64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +index 27d99bd937..31701bb40b 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml +@@ -171,6 +171,7 @@ + + 2006000 + 0 ++ 263602 + + ppc64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +index 97621612ab..6ae19ffd36 100644 +--- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +@@ -207,6 +207,7 @@ + + 2006000 + 0 ++ 227579 + + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +index c2f310cd46..b6ec680d5c 100644 +--- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +@@ -138,6 +138,7 @@ + + 2007000 + 0 ++ 217559 + + s390x + +diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +index e4ea9452c5..294ac126e5 100644 +--- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +@@ -211,6 +211,7 @@ + + 2007000 + 0 ++ 239276 + (v2.7.0) + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +index f6e024dc61..d788ad206e 100644 +--- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +@@ -140,6 +140,7 @@ + + 2007093 + 0 ++ 242460 + + s390x + +diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +index c6d3e21d5c..156563d99a 100644 +--- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +@@ -213,6 +213,7 @@ + + 2008000 + 0 ++ 255931 + (v2.8.0) + x86_64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +index f5cf0ba932..aa0c833a0c 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +@@ -178,6 +178,7 @@ + + 2009000 + 0 ++ 347135 + (v2.9.0) + ppc64 + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +index 5c4a02c8b1..ba809b6ae3 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +@@ -142,6 +142,7 @@ + + 2009000 + 0 ++ 265878 + + s390x + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +index 82cc4e79f4..11f2508a04 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +@@ -225,6 +225,7 @@ + + 2009000 + 0 ++ 321194 + (v2.9.0) + x86_64 + +diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c +index 6e39866ebe..44b3b1fda5 100644 +--- a/tests/qemucapabilitiestest.c ++++ b/tests/qemucapabilitiestest.c +@@ -61,10 +61,16 @@ testQemuCaps(const void *opaque) + qemuMonitorTestGetMonitor(mon)) < 0) + goto cleanup; + +- if (virQEMUCapsGet(capsActual, QEMU_CAPS_KVM) && +- virQEMUCapsInitQMPMonitorTCG(capsActual, +- qemuMonitorTestGetMonitor(mon)) < 0) +- goto cleanup; ++ if (virQEMUCapsGet(capsActual, QEMU_CAPS_KVM)) { ++ if (virQEMUCapsInitQMPMonitorTCG(capsActual, ++ qemuMonitorTestGetMonitor(mon)) < 0) ++ goto cleanup; ++ ++ /* Fill microcodeVersion with a "random" value which is the file ++ * length to provide a reproducible number for testing. ++ */ ++ virQEMUCapsSetMicrocodeVersion(capsActual, virFileLength(repliesFile, -1)); ++ } + + if (!(actual = virQEMUCapsFormatCache(capsActual))) + goto cleanup; +diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c +index 4b8d6229b4..a5f5a38b16 100644 +--- a/tests/qemucapsprobe.c ++++ b/tests/qemucapsprobe.c +@@ -72,7 +72,7 @@ main(int argc, char **argv) + return EXIT_FAILURE; + + if (!(caps = virQEMUCapsNewForBinaryInternal(VIR_ARCH_NONE, argv[1], "/tmp", +- -1, -1, true))) ++ -1, -1, 0, true))) + return EXIT_FAILURE; + + virObjectUnref(caps); +diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c +index 2c7124bf26..f8182033fc 100644 +--- a/tests/testutilsqemu.c ++++ b/tests/testutilsqemu.c +@@ -603,7 +603,7 @@ int qemuTestDriverInit(virQEMUDriver *driver) + + /* Using /dev/null for libDir and cacheDir automatically produces errors + * upon attempt to use any of them */ +- driver->qemuCapsCache = virQEMUCapsCacheNew("/dev/null", "/dev/null", 0, 0); ++ driver->qemuCapsCache = virQEMUCapsCacheNew("/dev/null", "/dev/null", 0, 0, 0); + if (!driver->qemuCapsCache) + goto error; + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-capabilitity-Introduce-QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE.patch b/SOURCES/libvirt-qemu-capabilitity-Introduce-QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE.patch deleted file mode 100644 index 704fa2a..0000000 --- a/SOURCES/libvirt-qemu-capabilitity-Introduce-QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE.patch +++ /dev/null @@ -1,363 +0,0 @@ -From ff8d12140ce541923021e2669e6be8a324114ad5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Shivaprasad G Bhat -Date: Thu, 3 Aug 2017 10:11:47 +0200 -Subject: [PATCH] qemu: capabilitity: Introduce - QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE - -The patch adds a capability for spapr-pci-host-bridge.numa_node. - -Signed-off-by: Shivaprasad G Bhat -Reviewed-by: Andrea Bolognani -(cherry picked from commit 11b2ebf3e152ac27191f539334afcb660100ecc9) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1474327 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 8 ++ - src/qemu/qemu_capabilities.h | 1 + - .../caps_2.6.0.ppc64le.replies | 66 +++++++++++-- - .../caps_2.9.0.ppc64le.replies | 106 +++++++++++++++++++-- - tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml | 1 + - 5 files changed, 162 insertions(+), 20 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index daf0c42c9a..a34206bd8a 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -377,6 +377,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "virtio.iommu_platform", - "virtio.ats", - "spapr-pci-host-bridge", -+ "spapr-pci-host-bridge.numa_node", - ); - - -@@ -1644,6 +1645,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = { - { "host_mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU }, - }; - -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSpaprPCIHostBridge[] = { -+ { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE }, -+}; -+ - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = { - { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD }, - }; -@@ -1844,6 +1849,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { - { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), - QEMU_CAPS_DEVICE_INTEL_IOMMU}, -+ { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge), -+ QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, - }; - - struct virQEMUCapsPropTypeObjects { -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index f0739117d2..b4d1e35da2 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -416,6 +416,7 @@ typedef enum { - QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */ - QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */ - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, /* -device spapr-pci-host-bridge */ -+ QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE, /* spapr-pci-host-bridge.numa_node= */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies -index 6350269684..2e4fa72daa 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.replies -@@ -3812,6 +3812,52 @@ - { - "return": [ - { -+ "name": "dynamic-reconfiguration", -+ "type": "bool" -+ }, -+ { -+ "name": "dma_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "dma_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "io_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "mem_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "buid", -+ "type": "uint64" -+ }, -+ { -+ "name": "io_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "liobn", -+ "type": "uint32" -+ }, -+ { -+ "name": "mem_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "index", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "name": "ref405ep", - "cpu-max": 1 - }, -@@ -3878,7 +3924,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -5180,12 +5226,6 @@ - "name": "MPC8541E_v11" - } - ], -- "id": "libvirt-42" --} -- --{ -- "return": [ -- ], - "id": "libvirt-43" - } - -@@ -5197,6 +5237,12 @@ - - { - "return": [ -+ ], -+ "id": "libvirt-45" -+} -+ -+{ -+ "return": [ - { - "parameters": [ - { -@@ -6159,7 +6205,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -6193,7 +6239,7 @@ - "capability": "postcopy-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -14198,7 +14244,7 @@ - "meta-type": "array" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies -index 0c85f9ed45..0b286dc967 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.replies -@@ -4274,6 +4274,92 @@ - { - "return": [ - { -+ "name": "dynamic-reconfiguration", -+ "type": "bool" -+ }, -+ { -+ "name": "ddw", -+ "type": "bool" -+ }, -+ { -+ "name": "dma_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "numa_node", -+ "type": "uint32" -+ }, -+ { -+ "name": "pre-2.8-migration", -+ "type": "bool" -+ }, -+ { -+ "name": "mem64_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "pgsz", -+ "type": "uint64" -+ }, -+ { -+ "name": "liobn64", -+ "type": "uint32" -+ }, -+ { -+ "name": "dma_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "io_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "mem_win_size", -+ "type": "uint64" -+ }, -+ { -+ "name": "buid", -+ "type": "uint64" -+ }, -+ { -+ "name": "dma64_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "mem64_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "pcie-extended-configuration-space", -+ "type": "bool" -+ }, -+ { -+ "name": "io_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "liobn", -+ "type": "uint32" -+ }, -+ { -+ "name": "mem_win_addr", -+ "type": "uint64" -+ }, -+ { -+ "name": "mem64_win_pciaddr", -+ "type": "uint64" -+ }, -+ { -+ "name": "index", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "hotpluggable-cpus": false, - "name": "ref405ep", - "cpu-max": 1 -@@ -4381,7 +4467,7 @@ - "cpu-max": 1 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -6557,12 +6643,6 @@ - "static": false - } - ], -- "id": "libvirt-42" --} -- --{ -- "return": [ -- ], - "id": "libvirt-43" - } - -@@ -6574,6 +6654,12 @@ - - { - "return": [ -+ ], -+ "id": "libvirt-45" -+} -+ -+{ -+ "return": [ - { - "parameters": [ - { -@@ -7679,7 +7765,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -7721,7 +7807,7 @@ - "capability": "release-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -17007,7 +17093,7 @@ - "meta-type": "object" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml -index 29721b04f0..ba22878fe2 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml -@@ -168,6 +168,7 @@ - - - -+ - 2009000 - 0 - (v2.9.0) --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-caps-Add-capability-for-share-rw-disk-option.patch b/SOURCES/libvirt-qemu-caps-Add-capability-for-share-rw-disk-option.patch new file mode 100644 index 0000000..72eff63 --- /dev/null +++ b/SOURCES/libvirt-qemu-caps-Add-capability-for-share-rw-disk-option.patch @@ -0,0 +1,185 @@ +From dbb91baa8d629753ac7a686ca38a621553875005 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:22 +0100 +Subject: [PATCH] qemu: caps: Add capability for 'share-rw' disk option + +'share-rw' for the disk device configures qemu to allow concurrent +access to the backing storage. + +The capability is checked in various supported disk frontend buses since +it does not make sense to partially backport it. + +(cherry picked from commit 860a3c4bea1d24773d8a495f213d5de3ac48a462) + + Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + + Few capabilities were not backported, so I left empty space + instead. + + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml + + Some of the test files were missing and the rest had conflict + due to the above capabilities not being backported. + +https://bugzilla.redhat.com/show_bug.cgi?id=1378242 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 11 +++++++++++ + src/qemu/qemu_capabilities.h | 7 +++++++ + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + + 8 files changed, 24 insertions(+) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index f30d2fa09e..2f41e076cb 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -444,6 +444,13 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + "vxhs", + "virtio-blk.num-queues", + "machine.pseries.resize-hpt", ++ ++ ++ ++ /* 275 */ ++ ++ ++ "disk-share-rw", + ); + + +@@ -1686,6 +1693,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { + { "scsi", QEMU_CAPS_VIRTIO_BLK_SCSI }, + { "logical_block_size", QEMU_CAPS_BLOCKIO }, + { "num-queues", QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES }, ++ { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = { +@@ -1716,10 +1724,12 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] = { + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] = { + { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL }, + { "wwn", QEMU_CAPS_SCSI_DISK_WWN }, ++ { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] = { + { "wwn", QEMU_CAPS_IDE_DRIVE_WWN }, ++ { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] = { +@@ -1750,6 +1760,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = { + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = { + { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE }, ++ { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, + }; + + static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = { +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index e7d766f801..60818daa1c 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -431,6 +431,13 @@ typedef enum { + QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */ + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */ + ++ ++ ++ /* 275 */ ++ ++ ++ QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */ ++ + QEMU_CAPS_LAST /* this must always be the last item */ + } virQEMUCapsFlags; + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index b0ee3f1523..c01777a5a3 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -178,6 +178,7 @@ + + + ++ + 2010000 + 0 + (v2.10.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +index 7e44652feb..a6900bf1ef 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +@@ -141,6 +141,7 @@ + + + ++ + 2010000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +index ddbd8c32fa..33db3e6674 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +@@ -224,6 +224,7 @@ + + + ++ + 2010000 + 0 + (v2.10.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +index 786cea8eab..e912211f40 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml +@@ -173,6 +173,7 @@ + + + ++ + 2009000 + 0 + (v2.9.0) +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +index 896ed503c3..4150b8eee7 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +@@ -138,6 +138,7 @@ + + + ++ + 2009000 + 0 + +diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +index 05f9dc0308..0ea9a2fce3 100644 +--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +@@ -221,6 +221,7 @@ + + + ++ + 2009000 + 0 + (v2.9.0) +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-caps-Tweak-arm-conditional-in-SupportsChardev.patch b/SOURCES/libvirt-qemu-caps-Tweak-arm-conditional-in-SupportsChardev.patch deleted file mode 100644 index 1facbc5..0000000 --- a/SOURCES/libvirt-qemu-caps-Tweak-arm-conditional-in-SupportsChardev.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 33c2ec7685c3b223b73974862ed8d28c7e44dc75 Mon Sep 17 00:00:00 2001 -Message-Id: <33c2ec7685c3b223b73974862ed8d28c7e44dc75@dist-git> -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:39 +0200 -Subject: [PATCH] qemu: caps: Tweak arm conditional in SupportsChardev - -Rather than try to whitelist all device configs that can't use --chardev, blacklist the only one that really can't, which is the -default serial/console target type=isa case. - -ISA specifically isn't a valid config for arm/aarch64, but we've -always implicitly treated it to mean 'default platform device'. - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit 948e429f485056e08f9f33bb577ff610a998ce70) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index eea57e4c9c..d5dd262ff2 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -5522,15 +5522,16 @@ virQEMUCapsSupportsChardev(const virDomainDef *def, - return false; - } - -- if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64)) -- return true; -+ if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) { -+ /* TARGET_TYPE_ISA here really means 'the default', which we -+ treat as whatever the built in platform serial device is on. -+ And for platform devices we can't use -chardev */ -+ if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -+ chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) -+ return false; -+ } - -- /* This may not be true for all ARM machine types, but at least -- * the only supported non-virtio serial devices of vexpress and versatile -- * don't have the -chardev property wired up. */ -- return (chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO || -- (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && -- chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO)); -+ return true; - } - - --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-caps-blacklist-QEMU_CAPS_CHARDEV.patch b/SOURCES/libvirt-qemu-caps-blacklist-QEMU_CAPS_CHARDEV.patch deleted file mode 100644 index 1d45122..0000000 --- a/SOURCES/libvirt-qemu-caps-blacklist-QEMU_CAPS_CHARDEV.patch +++ /dev/null @@ -1,1034 +0,0 @@ -From 4dea9b6452bf7fdb45f475ee3c6de047e67d5273 Mon Sep 17 00:00:00 2001 -Message-Id: <4dea9b6452bf7fdb45f475ee3c6de047e67d5273@dist-git> -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:47 +0200 -Subject: [PATCH] qemu: caps: blacklist QEMU_CAPS_CHARDEV - -Every qemu version we support has QEMU_CAPS_CHARDEV, so stop -explicitly tracking it and blacklist it like we've done for many -other feature flags. - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit b4d560435041216fab4e4b417aef708107c83c4b) - -Conflicts: - - * tests/qemucapabilitiesdata/caps_2.9.50.s390x.xml: - - caused by the commit introducing the file, - b24eaf6210ebaf5dc8d29621063873c8419c517e, not being in the - tree; resolved by dropping the hunk that would have updated it. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 17 +- - src/qemu/qemu_capabilities.h | 2 +- - tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 - - .../caps_2.6.0-gicv2.aarch64.xml | 1 - - .../caps_2.6.0-gicv3.aarch64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 - - tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 - - tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 - - tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 - - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 - - tests/qemuhelptest.c | 5 - - tests/qemuxml2argvtest.c | 397 ++++++++++++--------- - tests/qemuxml2xmltest.c | 1 - - 23 files changed, 235 insertions(+), 205 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index d5dd262ff2..0e611c343c 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -1218,13 +1218,10 @@ virQEMUCapsComputeCmdFlags(const char *help, - virQEMUCapsSet(qemuCaps, QEMU_CAPS_HOST_PCI_MULTIDOMAIN); - if (strstr(help, "-mem-path")) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MEM_PATH); -- if (strstr(help, "-chardev")) { -- virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV); -- if (strstr(help, "-chardev spicevmc")) -- virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC); -- if (strstr(help, "-chardev spiceport")) -- virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEPORT); -- } -+ if (strstr(help, "-chardev spicevmc")) -+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC); -+ if (strstr(help, "-chardev spiceport")) -+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEPORT); - if (strstr(help, "-nodefconfig")) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NODEFCONFIG); - if (strstr(help, "-no-user-config")) -@@ -4410,7 +4407,6 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps) - { - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MEM_PATH); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL); -- virQEMUCapsSet(qemuCaps, QEMU_CAPS_CHARDEV); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MONITOR_JSON); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_SDL); - virQEMUCapsSet(qemuCaps, QEMU_CAPS_NETDEV); -@@ -5507,12 +5503,9 @@ virQEMUCapsCacheFree(virQEMUCapsCachePtr cache) - - bool - virQEMUCapsSupportsChardev(const virDomainDef *def, -- virQEMUCapsPtr qemuCaps, -+ virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, - virDomainChrDefPtr chr) - { -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) -- return false; -- - if ((def->os.arch == VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch)) { - if (!qemuDomainIsPSeries(def)) - return false; -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index bbc6f6812f..433aa7f90b 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -77,7 +77,7 @@ typedef enum { - /* 20 */ - X_QEMU_CAPS_XEN_DOMID, /* -xen-domid */ - X_QEMU_CAPS_MIGRATE_QEMU_UNIX, /* qemu migration via unix sockets */ -- QEMU_CAPS_CHARDEV, /* Is the new -chardev arg available */ -+ X_QEMU_CAPS_CHARDEV, /* Is the new -chardev arg available */ - QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */ - QEMU_CAPS_MONITOR_JSON, /* JSON mode for monitor */ - -diff --git a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml -index 5ad406ce1b..956284d5d3 100644 ---- a/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml -index 4ec731d655..99384ce5e6 100644 ---- a/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml -index 601c62e65a..aea043c57d 100644 ---- a/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -index 14f34b2771..6f860e4f25 100644 ---- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -index 8fc23d6aad..e5dc8360de 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -index 47c8956b44..86d87eaf0c 100644 ---- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -index afe7d53ff4..2fa551b1a0 100644 ---- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -index 5bdc1a2bdd..b7ba2240aa 100644 ---- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -index 36bc1342bb..f3289df306 100644 ---- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -index 33bc462084..af60bf6c6e 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -index a8ce6b03b1..d4eb19102c 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -index 425992f0d5..6d031f6f70 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -index 97e71ec4f4..e4615c02ab 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -index 70cce64179..ec79115cf1 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -index 49c046212b..5f98db8d1a 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -index 51be9bce4d..ac40ecc7fc 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -index 01edbc88da..e42e47a8ee 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 2140eab398..a418f084c2 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -6,7 +6,6 @@ - - - -- - - - -diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c -index c7355e3d53..0a9b2b94f6 100644 ---- a/tests/qemuhelptest.c -+++ b/tests/qemuhelptest.c -@@ -155,7 +155,6 @@ mymain(void) - QEMU_CAPS_DRIVE_SERIAL, - QEMU_CAPS_ENABLE_KVM, - QEMU_CAPS_SDL, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_RTC, - QEMU_CAPS_NO_HPET, - QEMU_CAPS_BOOT_MENU, -@@ -188,7 +187,6 @@ mymain(void) - QEMU_CAPS_DRIVE_SERIAL, - QEMU_CAPS_MEM_PATH, - QEMU_CAPS_SDL, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_ENABLE_KVM, - QEMU_CAPS_RTC, - QEMU_CAPS_NO_HPET, -@@ -226,7 +224,6 @@ mymain(void) - QEMU_CAPS_DRIVE_SERIAL, - QEMU_CAPS_MEM_PATH, - QEMU_CAPS_SDL, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_ENABLE_KVM, - QEMU_CAPS_MONITOR_JSON, - QEMU_CAPS_NETDEV, -@@ -273,7 +270,6 @@ mymain(void) - QEMU_CAPS_DRIVE_SERIAL, - QEMU_CAPS_MEM_PATH, - QEMU_CAPS_SDL, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_ENABLE_KVM, - QEMU_CAPS_MONITOR_JSON, - QEMU_CAPS_NETDEV, -@@ -344,7 +340,6 @@ mymain(void) - QEMU_CAPS_DRIVE_SERIAL, - QEMU_CAPS_MEM_PATH, - QEMU_CAPS_SDL, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_ENABLE_KVM, - QEMU_CAPS_MONITOR_JSON, - QEMU_CAPS_NETDEV, -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 58c7a32043..d4afaef06e 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -748,8 +748,7 @@ mymain(void) - DO_TEST_FAILURE("reboot-timeout-enabled", NONE); - - DO_TEST("bios", -- QEMU_CAPS_SGA, -- QEMU_CAPS_CHARDEV); -+ QEMU_CAPS_SGA); - DO_TEST("bios-nvram", NONE); - DO_TEST("bios-nvram-secure", - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -@@ -781,12 +780,17 @@ mymain(void) - DO_TEST("cpu-eoi-disabled", QEMU_CAPS_ENABLE_KVM); - DO_TEST("cpu-eoi-enabled", QEMU_CAPS_ENABLE_KVM); - DO_TEST("controller-order", -- QEMU_CAPS_KVM, QEMU_CAPS_ENABLE_KVM, -- QEMU_CAPS_BOOT_MENU, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DRIVE_AIO, -- QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV, -- QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_SPICE, -- QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_KVM, -+ QEMU_CAPS_ENABLE_KVM, -+ QEMU_CAPS_BOOT_MENU, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_DRIVE_AIO, -+ QEMU_CAPS_CCID_PASSTHRU, -+ QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_HDA_DUPLEX, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("eoi-disabled", NONE); - DO_TEST("eoi-enabled", NONE); -@@ -1095,10 +1099,13 @@ mymain(void) - QEMU_CAPS_DEVICE_QXL); - DO_TEST("graphics-spice-usb-redir", - QEMU_CAPS_SPICE, -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, -- QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, -- QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_DEVICE_CIRRUS_VGA); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_USB_REDIR, -+ QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("graphics-spice-agent-file-xfer", - QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_QXL, -@@ -1178,50 +1185,50 @@ mymain(void) - QEMU_CAPS_DEVICE_VFIO_PCI); - - -- DO_TEST("serial-file-log", QEMU_CAPS_CHARDEV, QEMU_CAPS_CHARDEV_FILE_APPEND, -+ DO_TEST("serial-file-log", -+ QEMU_CAPS_CHARDEV_FILE_APPEND, - QEMU_CAPS_CHARDEV_LOGFILE); - DO_TEST("serial-spiceport", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_DEVICE_QXL, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEPORT); -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEPORT); - DO_TEST("serial-spiceport-nospice", NONE); - -- DO_TEST("console-compat", -- QEMU_CAPS_CHARDEV); -- DO_TEST("console-compat-auto", -- QEMU_CAPS_CHARDEV); -+ DO_TEST("console-compat", NONE); -+ DO_TEST("console-compat-auto", NONE); - - DO_TEST("serial-vc-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-pty-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-dev-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-dev-chardev-iobase", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-file-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_CHARDEV_FILE_APPEND); - DO_TEST("serial-unix-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-tcp-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-udp-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("serial-tcp-telnet-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - driver.config->chardevTLS = 1; - DO_TEST("serial-tcp-tlsx509-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_OBJECT_TLS_CREDS_X509); - driver.config->chardevTLSx509verify = 1; - DO_TEST("serial-tcp-tlsx509-chardev-verify", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_OBJECT_TLS_CREDS_X509); - driver.config->chardevTLSx509verify = 0; - DO_TEST("serial-tcp-tlsx509-chardev-notls", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_OBJECT_TLS_CREDS_X509); - VIR_FREE(driver.config->chardevTLSx509certdir); - if (VIR_STRDUP_QUIET(driver.config->chardevTLSx509certdir, "/etc/pki/libvirt-chardev") < 0) -@@ -1231,171 +1238,195 @@ mymain(void) - return EXIT_FAILURE; - # ifdef HAVE_GNUTLS_CIPHER_ENCRYPT - DO_TEST("serial-tcp-tlsx509-secret-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_OBJECT_SECRET, - QEMU_CAPS_OBJECT_TLS_CREDS_X509); - # else - DO_TEST_FAILURE("serial-tcp-tlsx509-secret-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_OBJECT_SECRET, - QEMU_CAPS_OBJECT_TLS_CREDS_X509); - # endif - driver.config->chardevTLS = 0; - VIR_FREE(driver.config->chardevTLSx509certdir); - DO_TEST("serial-many-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("parallel-tcp-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("parallel-parport-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("console-compat-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pci-serial-dev-chardev", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_DEVICE_PCI_SERIAL); - - DO_TEST("channel-guestfwd", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio-state", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio-auto", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio-autoassign", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("channel-virtio-autoadd", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("console-virtio", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("console-virtio-many", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("console-virtio-s390", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_VIRTIO_S390); - DO_TEST("console-virtio-ccw", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_CCW, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_VIRTIO_CCW, - QEMU_CAPS_VIRTIO_S390); - DO_TEST("console-sclp", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_VIRTIO_S390, -+ QEMU_CAPS_SCLP_S390); - DO_TEST("channel-spicevmc", - QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("channel-spicevmc-old", - QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_SPICEVMC, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_DEVICE_SPICEVMC, - QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("channel-virtio-default", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC); - DO_TEST("channel-virtio-unix", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - - DO_TEST("smartcard-host", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_CCID_EMULATED); - DO_TEST("smartcard-host-certificates", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_CCID_EMULATED); - DO_TEST("smartcard-passthrough-tcp", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_PASSTHRU); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_CCID_PASSTHRU); - DO_TEST("smartcard-passthrough-spicevmc", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_CCID_PASSTHRU, QEMU_CAPS_CHARDEV_SPICEVMC); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_CCID_PASSTHRU, -+ QEMU_CAPS_CHARDEV_SPICEVMC); - DO_TEST("smartcard-controller", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CCID_EMULATED); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_CCID_EMULATED); - - DO_TEST("usb-controller", -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-piix3-controller", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-ich9-ehci-addr", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_ICH9_USB_EHCI1); - DO_TEST("input-usbmouse-addr", - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-ich9-companion", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_ICH9_USB_EHCI1); - DO_TEST_PARSE_ERROR("usb-ich9-no-companion", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_ICH9_USB_EHCI1); - DO_TEST("usb-ich9-autoassign", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_ICH9_USB_EHCI1, - QEMU_CAPS_USB_HUB); - DO_TEST("usb-hub", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-hub-autoadd", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-hub-autoadd-deluxe", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-hub-conflict", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-hub-nonexistent", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-port-missing", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-bus-missing", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-ports", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-ports-out-of-range", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-port-autoassign", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-redir", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, -- QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_USB_REDIR, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC); - DO_TEST("usb-redir-boot", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, -- QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_USB_REDIR, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_BOOTINDEX, - QEMU_CAPS_USB_REDIR_BOOTINDEX); - DO_TEST("usb-redir-filter", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, -- QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_USB_REDIR, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_USB_REDIR_FILTER); - DO_TEST("usb-redir-filter-version", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_USB_REDIR, -- QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_CHARDEV_SPICEVMC, - QEMU_CAPS_USB_REDIR_FILTER); - DO_TEST("usb1-usb2", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_USB_HUB, QEMU_CAPS_ICH9_USB_EHCI1); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_ICH9_USB_EHCI1); - DO_TEST("usb-none", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-none-other", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("usb-none-hub", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_USB_HUB); - DO_TEST_PARSE_ERROR("usb-none-usbtablet", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-controller-default-q35", - QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_PCI_OHCI, -@@ -1415,15 +1446,21 @@ mymain(void) - QEMU_CAPS_PCI_OHCI, - QEMU_CAPS_PIIX3_USB_UHCI); - DO_TEST("usb-controller-xhci", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_NEC_USB_XHCI, -+ QEMU_CAPS_NEC_USB_XHCI_PORTS); - DO_TEST("usb-xhci-autoassign", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_NEC_USB_XHCI, -+ QEMU_CAPS_NEC_USB_XHCI_PORTS, - QEMU_CAPS_USB_HUB); - DO_TEST_PARSE_ERROR("usb-controller-xhci-limit", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_NEC_USB_XHCI_PORTS); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_NEC_USB_XHCI, -+ QEMU_CAPS_NEC_USB_XHCI_PORTS); - DO_TEST("usb-controller-qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI); - DO_TEST_FAILURE("usb-controller-qemu-xhci-unavailable", NONE); - DO_TEST_PARSE_ERROR("usb-controller-qemu-xhci-limit", -@@ -1438,7 +1475,7 @@ mymain(void) - DO_TEST("watchdog-dump", NONE); - DO_TEST("watchdog-injectnmi", NONE); - DO_TEST("watchdog-diag288", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390); - DO_TEST("balloon-device", QEMU_CAPS_NODEFCONFIG); - DO_TEST("balloon-device-deflate", QEMU_CAPS_NODEFCONFIG, -@@ -1636,9 +1673,11 @@ mymain(void) - QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_SCSI_LSI); - - DO_TEST("monitor-json", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_MONITOR_JSON, -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("no-shutdown", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_MONITOR_JSON, -+ QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_NO_SHUTDOWN); - - DO_TEST("seclabel-dynamic", NONE); -@@ -1655,48 +1694,51 @@ mymain(void) - DO_TEST_PARSE_ERROR("seclabel-device-duplicates", NONE); - - DO_TEST("pseries-basic", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-vio", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-usb-default", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_PCI_OHCI, QEMU_CAPS_PCI_MULTIFUNCTION); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_PCI_OHCI, -+ QEMU_CAPS_PCI_MULTIFUNCTION); - DO_TEST("pseries-usb-multi", -- QEMU_CAPS_CHARDEV, -- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_PIIX3_USB_UHCI, -- QEMU_CAPS_PCI_OHCI, QEMU_CAPS_PCI_MULTIFUNCTION); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_PIIX3_USB_UHCI, -+ QEMU_CAPS_PCI_OHCI, -+ QEMU_CAPS_PCI_MULTIFUNCTION); - DO_TEST("pseries-vio-user-assigned", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST_PARSE_ERROR("pseries-vio-address-clash", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM); - DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI, -- QEMU_CAPS_DEVICE_USB_KBD, QEMU_CAPS_CHARDEV, -+ QEMU_CAPS_DEVICE_USB_KBD, - QEMU_CAPS_NODEFCONFIG); -- DO_TEST("pseries-cpu-exact", QEMU_CAPS_CHARDEV, -+ DO_TEST("pseries-cpu-exact", - QEMU_CAPS_NODEFCONFIG); - - qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64); - DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM, -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST_FAILURE("pseries-cpu-compat-power9", QEMU_CAPS_KVM); - - qemuTestSetHostCPU(driver.caps, cpuPower9); - DO_TEST("pseries-cpu-compat-power9", -- QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_KVM, -+ QEMU_CAPS_NODEFCONFIG); - qemuTestSetHostCPU(driver.caps, NULL); - - qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); - - DO_TEST("pseries-panic-missing", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("pseries-panic-no-address", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST_FAILURE("pseries-panic-address", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("disk-ide-drive-split", - QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_IDE_CD); -@@ -1767,43 +1809,61 @@ mymain(void) - QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - DO_TEST_PARSE_ERROR("video-invalid", NONE); - -- DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ DO_TEST("virtio-rng-default", -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM); -- DO_TEST("virtio-rng-random", QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ DO_TEST("virtio-rng-random", -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM); -- DO_TEST("virtio-rng-egd", QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ DO_TEST("virtio-rng-egd", -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_EGD); -- DO_TEST("virtio-rng-multiple", QEMU_CAPS_DEVICE_VIRTIO_RNG, -- QEMU_CAPS_OBJECT_RNG_EGD, QEMU_CAPS_OBJECT_RNG_RANDOM); -+ DO_TEST("virtio-rng-multiple", -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_OBJECT_RNG_EGD, -+ QEMU_CAPS_OBJECT_RNG_RANDOM); - DO_TEST_PARSE_ERROR("virtio-rng-egd-crash", -- QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_EGD); -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_OBJECT_RNG_EGD); - DO_TEST("virtio-rng-ccw", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_CCW, -- QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_VIRTIO_CCW, -+ QEMU_CAPS_VIRTIO_S390, -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM); - - DO_TEST("s390-allow-bogus-usb-none", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390, -- QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_VIRTIO_S390, -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_OBJECT_RNG_RANDOM); - DO_TEST("s390-allow-bogus-usb-controller", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390, -- QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_BOOTINDEX, -+ QEMU_CAPS_VIRTIO_S390, -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_OBJECT_RNG_RANDOM); - - DO_TEST("s390-panic-no-address", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_VIRTIO_CCW, -+ QEMU_CAPS_VIRTIO_S390); - DO_TEST_FAILURE("s390-panic-address", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_VIRTIO_CCW, -+ QEMU_CAPS_VIRTIO_S390); - DO_TEST("s390-panic-missing", -- QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); -+ QEMU_CAPS_NODEFCONFIG, -+ QEMU_CAPS_VIRTIO_CCW, -+ QEMU_CAPS_VIRTIO_S390); - -- DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB); -- DO_TEST("ppce500-serial", QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV); -+ DO_TEST("ppc-dtb", -+ QEMU_CAPS_KVM, -+ QEMU_CAPS_DTB); -+ DO_TEST("ppce500-serial", -+ QEMU_CAPS_KVM); - - DO_TEST("tpm-passthrough", - QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS); -@@ -2013,7 +2073,6 @@ mymain(void) - QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - DO_TEST("q35-virt-manager-basic", - QEMU_CAPS_KVM, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_RTC, - QEMU_CAPS_ICH9_DISABLE_S3, - QEMU_CAPS_ICH9_DISABLE_S4, -@@ -2344,7 +2403,6 @@ mymain(void) - QEMU_CAPS_KVM); - DO_TEST("aarch64-pci-serial", - QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_DEVICE_PCI_SERIAL, - QEMU_CAPS_CHARDEV_LOGFILE, - QEMU_CAPS_OBJECT_GPEX, -@@ -2519,17 +2577,20 @@ mymain(void) - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, - NONE); - -- DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, -- QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, -- QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA, -- QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_UNIX); -+ DO_TEST("name-escape", -+ QEMU_CAPS_NAME_DEBUG_THREADS, -+ QEMU_CAPS_OBJECT_SECRET, -+ QEMU_CAPS_VNC, -+ QEMU_CAPS_NAME_GUEST, -+ QEMU_CAPS_DEVICE_CIRRUS_VGA, -+ QEMU_CAPS_SPICE, -+ QEMU_CAPS_SPICE_UNIX); - DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS); - - DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET); -- DO_TEST("usb-long-port-path", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, -+ DO_TEST("usb-long-port-path", QEMU_CAPS_NODEFCONFIG, - QEMU_CAPS_USB_HUB); - DO_TEST_PARSE_ERROR("usb-too-long-port-path-invalid", -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_USB_HUB); - - DO_TEST("acpi-table", NONE); -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 73bc87f87c..d026bdfa68 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -1065,7 +1065,6 @@ mymain(void) - QEMU_CAPS_DEVICE_VIRTIO_GPU, QEMU_CAPS_BOOTINDEX); - DO_TEST("aarch64-pci-serial", - QEMU_CAPS_NODEFCONFIG, -- QEMU_CAPS_CHARDEV, - QEMU_CAPS_DEVICE_PCI_SERIAL, - QEMU_CAPS_CHARDEV_LOGFILE, - QEMU_CAPS_OBJECT_GPEX, --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-change-the-logic-of-setting-default-USB-controller.patch b/SOURCES/libvirt-qemu-change-the-logic-of-setting-default-USB-controller.patch deleted file mode 100644 index 0cb71a1..0000000 --- a/SOURCES/libvirt-qemu-change-the-logic-of-setting-default-USB-controller.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 09e42278625a78997f11ffe898e82684a6524131 Mon Sep 17 00:00:00 2001 -Message-Id: <09e42278625a78997f11ffe898e82684a6524131@dist-git> -From: Pavel Hrdina -Date: Fri, 28 Apr 2017 11:59:47 +0200 -Subject: [PATCH] qemu: change the logic of setting default USB controller - -The new logic will set the piix3-uhci if available regardless of -any architecture and it will be updated to better model based on -architecture and device existence. - -Signed-off-by: Pavel Hrdina -Acked-by: Andrea Bolognani -(cherry picked from commit e69001b46448ae7e0f9f727965d4bea169ca2d9e) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438682 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 23 ++++++++++++++--------- - 1 file changed, 14 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 53586878b..a1a4003af 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3223,11 +3223,17 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - * when the relevant device is not available. - * - * See qemuBuildControllerDevCommandLine() */ -- if (ARCH_IS_S390(def->os.arch) && -- cont->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -- /* set the default USB model to none for s390 unless an -- * address is found */ -- cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; -+ -+ /* Default USB controller is piix3-uhci if available. */ -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; -+ -+ if (ARCH_IS_S390(def->os.arch)) { -+ if (cont->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -+ /* set the default USB model to none for s390 unless an -+ * address is found */ -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; -+ } - } else if (ARCH_IS_PPC64(def->os.arch)) { - /* To not break migration we need to set default USB controller - * for ppc64 to pci-ohci if we cannot change ABI of the VM. -@@ -3238,11 +3244,10 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; -+ } else { -+ /* Explicitly fallback to legacy USB controller for PPC64. */ -+ cont->model = -1; - } -- } else { -- /* Default USB controller for anything else is piix3-uhci */ -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) -- cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; - } - } - /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */ --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-command-Drop-some-QEMU_CAPS_CHARDEV-checks.patch b/SOURCES/libvirt-qemu-command-Drop-some-QEMU_CAPS_CHARDEV-checks.patch deleted file mode 100644 index b06eeb7..0000000 --- a/SOURCES/libvirt-qemu-command-Drop-some-QEMU_CAPS_CHARDEV-checks.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 50f1f290f3a0ea5a025d6a2a33f96c8b05d8b13a Mon Sep 17 00:00:00 2001 -Message-Id: <50f1f290f3a0ea5a025d6a2a33f96c8b05d8b13a@dist-git> -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:42 +0200 -Subject: [PATCH] qemu: command: Drop some QEMU_CAPS_CHARDEV checks - -AFAIK there aren't any cases where we should fail these checks with -supported qemu versions, so just drop them. - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit 8fc7cf6aa88266fb218bbff4f65d6b377e9bc91d) - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 15 +++------------ - 1 file changed, 3 insertions(+), 12 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index f3a9466083..5c2607fe41 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -8847,8 +8847,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, - - switch (smartcard->type) { - case VIR_DOMAIN_SMARTCARD_TYPE_HOST: -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || -- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard host " - "mode support")); -@@ -8859,8 +8858,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, - break; - - case VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES: -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || -- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard host " - "mode support")); -@@ -8895,8 +8893,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, - break; - - case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH: -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || -- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_PASSTHRU)) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCID_PASSTHRU)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard " - "passthrough mode support")); -@@ -9276,12 +9273,6 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager, - - switch (channel->targetType) { - case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- "%s", _("guestfwd requires QEMU to support -chardev & -device")); -- return -1; -- } -- - if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, - channel->source, - channel->info.alias, --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-command-Mark-shared-disks-as-such-in-qemu.patch b/SOURCES/libvirt-qemu-command-Mark-shared-disks-as-such-in-qemu.patch new file mode 100644 index 0000000..969c0db --- /dev/null +++ b/SOURCES/libvirt-qemu-command-Mark-shared-disks-as-such-in-qemu.patch @@ -0,0 +1,139 @@ +From 378887595f3cbb937f6c3e88ed3828e5f6698e33 Mon Sep 17 00:00:00 2001 +Message-Id: <378887595f3cbb937f6c3e88ed3828e5f6698e33@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:23 +0100 +Subject: [PATCH] qemu: command: Mark disks as such in qemu + +Qemu has now an internal mechanism for locking images to fix specific +cases of disk corruption. This requires libvirt to mark the image as +shared so that qemu lifts certain restrictions. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1378242 +(cherry picked from commit 28907b0043fbf71085a798372ab9c816ba043b93) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 4 +++ + .../qemuxml2argv-disk-drive-shared-locking.args | 32 +++++++++++++++++ + .../qemuxml2argv-disk-drive-shared-locking.xml | 42 ++++++++++++++++++++++ + tests/qemuxml2argvtest.c | 2 ++ + 4 files changed, 80 insertions(+) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.xml + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index dfacff4b12..fc7f54e81e 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -2182,6 +2182,10 @@ qemuBuildDriveDevStr(const virDomainDef *def, + goto error; + } + ++ if (disk->src->shared && ++ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_SHARE_RW)) ++ virBufferAddLit(&opt, ",share-rw=on"); ++ + if (!(drivealias = qemuAliasFromDisk(disk))) + goto error; + virBufferAsprintf(&opt, ",drive=%s,id=%s", drivealias, disk->info.alias); +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.args +new file mode 100644 +index 0000000000..cdf17f26d1 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.args +@@ -0,0 +1,32 @@ ++LC_ALL=C \ ++PATH=/bin \ ++HOME=/home/test \ ++USER=test \ ++LOGNAME=test \ ++QEMU_AUDIO_DRV=none \ ++/usr/bin/qemu-system-i686 \ ++-name QEMUGuest1 \ ++-S \ ++-M pc \ ++-m 214 \ ++-smp 1,sockets=1,cores=1,threads=1 \ ++-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ++-nographic \ ++-nodefaults \ ++-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ ++server,nowait \ ++-mon chardev=charmonitor,id=monitor,mode=readline \ ++-no-acpi \ ++-boot c \ ++-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ ++-usb \ ++-drive file=/dev/ide,format=raw,if=none,id=drive-ide0-0-0,cache=none \ ++-device ide-drive,bus=ide.0,unit=0,share-rw=on,drive=drive-ide0-0-0,\ ++id=ide0-0-0 \ ++-drive file=/dev/scsi,format=raw,if=none,id=drive-scsi0-0-0-0,cache=none \ ++-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,share-rw=on,\ ++drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \ ++-drive file=/dev/virtio,format=raw,if=none,id=drive-virtio-disk0,cache=none \ ++-device virtio-blk-pci,bus=pci.0,addr=0x4,share-rw=on,drive=drive-virtio-disk0,\ ++id=virtio-disk0 \ ++-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.xml +new file mode 100644 +index 0000000000..dd48857a30 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-locking.xml +@@ -0,0 +1,42 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++
      ++ ++ ++ ++ ++ ++ ++
      ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 00110cae19..4e981c9fab 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -909,6 +909,8 @@ mymain(void) + DO_TEST("disk-drive-shared", + QEMU_CAPS_DRIVE_SERIAL); + DO_TEST_PARSE_ERROR("disk-drive-shared-qcow", NONE); ++ DO_TEST("disk-drive-shared-locking", ++ QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DISK_SHARE_RW); + DO_TEST("disk-drive-error-policy-stop", + QEMU_CAPS_MONITOR_JSON); + DO_TEST("disk-drive-error-policy-enospace", +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-command-Remove-old-style-parallel-building.patch b/SOURCES/libvirt-qemu-command-Remove-old-style-parallel-building.patch deleted file mode 100644 index ab96a42..0000000 --- a/SOURCES/libvirt-qemu-command-Remove-old-style-parallel-building.patch +++ /dev/null @@ -1,184 +0,0 @@ -From 7cb923a5d76d710401399990f8f395770d62c0f7 Mon Sep 17 00:00:00 2001 -Message-Id: <7cb923a5d76d710401399990f8f395770d62c0f7@dist-git> -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:41 +0200 -Subject: [PATCH] qemu: command: Remove old style -parallel building - -AFAIK there aren't any qemu arch/machine types with platform parallel -devices that would require old style -parallel config, so we shouldn't -ever need this nowadays. - -Remove a now redundant test - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit ca5c5b997b348e650a086965c5e975c7101ee40e) - -Conflicts: - - * src/qemu/qemu_command.c: - - caused by fcd922427cf6a264d3cb89915481be6594e6df03 not being - in the tree; resolved by removing the chardevStdioLogd argument - from the call to qemuBuildChrChardevStr(); - - * tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args, - * tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml: - - caused by e6e26a899df05e3c1b36c40eef5ba0a4b1e36f95 not being - in the tree; resolved by removing the files regardless of their - contents. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 31 +++++++------------ - .../qemuxml2argv-parallel-tcp.args | 22 -------------- - .../qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml | 35 ---------------------- - tests/qemuxml2argvtest.c | 1 - - tests/qemuxml2xmltest.c | 1 - - 5 files changed, 11 insertions(+), 79 deletions(-) - delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args - delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index e3be487d20..f3a9466083 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -9243,27 +9243,18 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager, - virDomainChrDefPtr parallel = def->parallels[i]; - char *devstr; - -- /* Use -chardev with -device if they are available */ -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) { -- if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -- parallel->source, -- parallel->info.alias, -- qemuCaps, true))) -- return -1; -- virCommandAddArg(cmd, "-chardev"); -- virCommandAddArg(cmd, devstr); -- VIR_FREE(devstr); -+ if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -+ parallel->source, -+ parallel->info.alias, -+ qemuCaps, true))) -+ return -1; -+ virCommandAddArg(cmd, "-chardev"); -+ virCommandAddArg(cmd, devstr); -+ VIR_FREE(devstr); - -- if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, -- qemuCaps) < 0) -- return -1; -- } else { -- virCommandAddArg(cmd, "-parallel"); -- if (!(devstr = qemuBuildChrArgStr(parallel->source, NULL))) -- return -1; -- virCommandAddArg(cmd, devstr); -- VIR_FREE(devstr); -- } -+ if (qemuBuildChrDeviceCommandLine(cmd, def, parallel, -+ qemuCaps) < 0) -+ return -1; - } - - return 0; -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args -deleted file mode 100644 -index fab1167c15..0000000000 ---- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args -+++ /dev/null -@@ -1,22 +0,0 @@ --LC_ALL=C \ --PATH=/bin \ --HOME=/home/test \ --USER=test \ --LOGNAME=test \ --QEMU_AUDIO_DRV=none \ --/usr/bin/qemu \ ---name QEMUGuest1 \ ---S \ ---M pc \ ---m 214 \ ---smp 1,sockets=1,cores=1,threads=1 \ ---uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ---nographic \ ---nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ ---no-acpi \ ---boot c \ ---usb \ ---drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ ---device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ ---parallel tcp:127.0.0.1:9999,server,nowait -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml -deleted file mode 100644 -index 99d2110b21..0000000000 ---- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml -+++ /dev/null -@@ -1,35 +0,0 @@ -- -- QEMUGuest1 -- c7a5fdbd-edaf-9455-926a-d65c16db1809 -- 219100 -- 219100 -- 1 -- -- hvm -- -- -- -- destroy -- restart -- destroy -- -- /usr/bin/qemu -- -- -- -- --
      -- -- -- -- -- -- -- -- -- -- -- -- -- -- -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index f47d282e31..3e029224dc 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1194,7 +1194,6 @@ mymain(void) - QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEPORT); - DO_TEST("serial-spiceport-nospice", NONE); - -- DO_TEST("parallel-tcp", NONE); - DO_TEST("console-compat", NONE); - DO_TEST("console-compat-auto", NONE); - -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 95bb154400..fe4fd6afa2 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -549,7 +549,6 @@ mymain(void) - DO_TEST("serial-many", NONE); - DO_TEST("serial-spiceport", NONE); - DO_TEST("serial-spiceport-nospice", NONE); -- DO_TEST("parallel-tcp", NONE); - DO_TEST("console-compat", NONE); - DO_TEST("console-compat2", NONE); - DO_TEST("console-virtio-many", NONE); --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-command-always-use-chardev-for-monitor-config.patch b/SOURCES/libvirt-qemu-command-always-use-chardev-for-monitor-config.patch deleted file mode 100644 index d89bcc7..0000000 --- a/SOURCES/libvirt-qemu-command-always-use-chardev-for-monitor-config.patch +++ /dev/null @@ -1,7838 +0,0 @@ -From ec5f82ad6ab59212848359296d84657b907d87b5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:43 +0200 -Subject: [PATCH] qemu: command: always use -chardev for monitor config - -AFAIK there aren't any cases where we will/should hit the old code -path for our supported qemu versions, so drop the old code. - -Massive test suite churn follows - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit 56540950e73d331fc04443409c578e4354337309) - -Conflicts: - - * src/qemu/qemu_command.c: - - caused by fcd922427cf6a264d3cb89915481be6594e6df03 not being - in the tree; resolved by removing the chardevStdioLogd argument - from the call to qemuBuildChrChardevStr(); - - * tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-tcg.args, - tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-multiple-disks-nets-s390.args, - tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-net-s390.args, - tests/qemuxml2argvdata/qemuxml2argv-machine-loadparm-s390.args: - - caused by the commits introducing the respective test cases, - b24eaf6210ebaf5dc8d29621063873c8419c517e for the first file - and 29ba41c2d400d44632e4f91e3f1daecfef5bbf97 for the remaining - three, not being in the tree; resolved by dropping the hunks - that would have updated them. - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 36 +++++++--------------- - .../qemuxml2argv-aarch64-aavmf-virtio-mmio.args | 4 ++- - .../qemuxml2argv-aarch64-acpi-uefi.args | 4 ++- - .../qemuxml2argv-aarch64-cpu-passthrough.args | 4 ++- - .../qemuxml2argv-aarch64-gic-host.args | 4 ++- - .../qemuxml2argv-aarch64-gic-v2.args | 4 ++- - .../qemuxml2argv-aarch64-gic-v3.args | 4 ++- - .../qemuxml2argv-aarch64-kvm-32-on-64.args | 4 ++- - .../qemuxml2argv-aarch64-noacpi-nouefi.args | 4 ++- - .../qemuxml2argv-aarch64-noacpi-uefi.args | 4 ++- - ...muxml2argv-aarch64-usb-controller-nec-xhci.args | 4 ++- - ...uxml2argv-aarch64-usb-controller-qemu-xhci.args | 4 ++- - .../qemuxml2argv-aarch64-video-virtio-gpu-pci.args | 4 ++- - ...l2argv-aarch64-virt-2.6-virtio-pci-default.args | 4 ++- - .../qemuxml2argv-aarch64-virt-default-nic.args | 5 +-- - .../qemuxml2argv-aarch64-virt-virtio.args | 4 ++- - .../qemuxml2argv-aarch64-virtio-pci-default.args | 4 ++- - ...l2argv-aarch64-virtio-pci-manual-addresses.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-acpi-table.args | 4 ++- - .../qemuxml2argv-arm-vexpressa9-basic.args | 4 ++- - .../qemuxml2argv-arm-vexpressa9-nodevs.args | 4 ++- - .../qemuxml2argv-arm-vexpressa9-virtio.args | 4 ++- - .../qemuxml2argv-arm-virt-virtio.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-autoindex.args | 4 ++- - .../qemuxml2argv-balloon-ccw-deflate.args | 4 ++- - .../qemuxml2argv-balloon-device-auto.args | 4 ++- - .../qemuxml2argv-balloon-device-deflate-off.args | 4 ++- - .../qemuxml2argv-balloon-device-deflate.args | 4 ++- - .../qemuxml2argv-balloon-device-period.args | 4 ++- - .../qemuxml2argv-balloon-device.args | 4 ++- - .../qemuxml2argv-balloon-mmio-deflate.args | 4 ++- - .../qemuxml2argv-bios-nvram-secure.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-bios-nvram.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-bios.args | 4 ++- - .../qemuxml2argv-blkdeviotune-group-num.args | 4 ++- - .../qemuxml2argv-blkdeviotune-max-length.args | 4 ++- - .../qemuxml2argv-blkdeviotune-max.args | 4 ++- - .../qemuxml2argv-blkdeviotune.args | 4 ++- - .../qemuxml2argv-blkiotune-device.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 4 ++- - .../qemuxml2argv-boot-complex-bootindex.args | 4 ++- - .../qemuxml2argv-boot-complex.args | 4 ++- - .../qemuxml2argv-boot-floppy-q35.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 4 ++- - ...xml2argv-boot-menu-disable-drive-bootindex.args | 4 ++- - .../qemuxml2argv-boot-menu-disable-drive.args | 4 ++- - .../qemuxml2argv-boot-menu-disable.args | 4 ++- - .../qemuxml2argv-boot-menu-enable-bootindex.args | 4 ++- - ...qemuxml2argv-boot-menu-enable-with-timeout.args | 4 ++- - .../qemuxml2argv-boot-menu-enable.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-boot-multi.args | 4 ++- - .../qemuxml2argv-boot-network.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-boot-order.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-boot-strict.args | 4 ++- - .../qemuxml2argv-bootindex-floppy-q35.args | 4 ++- - .../qemuxml2argv-channel-spicevmc-old.args | 4 ++- - .../qemuxml2argv-channel-spicevmc.args | 4 ++- - .../qemuxml2argv-clock-catchup.args | 4 ++- - .../qemuxml2argv-clock-france.args | 4 ++- - .../qemuxml2argv-clock-hpet-off.args | 4 ++- - ...muxml2argv-clock-localtime-basis-localtime.args | 4 ++- - .../qemuxml2argv-clock-localtime.args | 4 ++- - .../qemuxml2argv-clock-timer-hyperv-rtc.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 4 ++- - .../qemuxml2argv-clock-variable.args | 4 ++- - .../qemuxml2argv-console-compat-auto.args | 4 ++- - .../qemuxml2argv-console-compat.args | 4 ++- - .../qemuxml2argv-cpu-Haswell-noTSX.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args | 4 ++- - .../qemuxml2argv-cpu-Haswell2.args | 4 ++- - .../qemuxml2argv-cpu-Haswell3.args | 4 ++- - .../qemuxml2argv-cpu-cache-disable.args | 4 ++- - .../qemuxml2argv-cpu-cache-disable2.args | 4 ++- - .../qemuxml2argv-cpu-cache-disable3.args | 4 ++- - .../qemuxml2argv-cpu-cache-emulate-l3.args | 4 ++- - .../qemuxml2argv-cpu-cache-passthrough.args | 4 ++- - .../qemuxml2argv-cpu-cache-passthrough2.args | 4 ++- - .../qemuxml2argv-cpu-check-default-none.args | 4 ++- - .../qemuxml2argv-cpu-check-default-none2.args | 4 ++- - .../qemuxml2argv-cpu-check-default-partial.args | 4 ++- - .../qemuxml2argv-cpu-check-default-partial2.args | 4 ++- - .../qemuxml2argv-cpu-check-none.args | 4 ++- - .../qemuxml2argv-cpu-eoi-disabled.args | 4 ++- - .../qemuxml2argv-cpu-eoi-enabled.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-cpu-exact1.args | 4 ++- - .../qemuxml2argv-cpu-exact2-nofallback.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args | 4 ++- - .../qemuxml2argv-cpu-fallback.args | 4 ++- - .../qemuxml2argv-cpu-host-kvmclock.args | 4 ++- - .../qemuxml2argv-cpu-host-model-cmt.args | 4 ++- - .../qemuxml2argv-cpu-host-model-fallback.args | 4 ++- - .../qemuxml2argv-cpu-host-model-vendor.args | 4 ++- - .../qemuxml2argv-cpu-host-model.args | 4 ++- - ...qemuxml2argv-cpu-host-passthrough-features.args | 4 ++- - .../qemuxml2argv-cpu-host-passthrough.args | 4 ++- - .../qemuxml2argv-cpu-hotplug-startup.args | 4 ++- - .../qemuxml2argv-cpu-kvmclock.args | 4 ++- - .../qemuxml2argv-cpu-minimum1.args | 4 ++- - .../qemuxml2argv-cpu-minimum2.args | 4 ++- - .../qemuxml2argv-cpu-numa-disjoint.args | 4 ++- - .../qemuxml2argv-cpu-numa-memshared.args | 4 ++- - .../qemuxml2argv-cpu-numa-no-memory-element.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args | 4 ++- - .../qemuxml2argv-cpu-s390-features.args | 4 ++- - .../qemuxml2argv-cpu-s390-zEC12.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args | 4 ++- - .../qemuxml2argv-cpu-topology1.args | 4 ++- - .../qemuxml2argv-cpu-topology2.args | 4 ++- - .../qemuxml2argv-cpu-topology3.args | 4 ++- - .../qemuxml2argv-cpu-tsc-frequency.args | 4 ++- - .../qemuxml2argv-cputune-numatune.args | 4 ++- - .../qemuxml2argv-cputune-zero-shares.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-cputune.args | 4 ++- - .../qemuxml2argv-debug-threads.args | 4 ++- - .../qemuxml2argv-default-kvm-host-arch.args | 4 ++- - .../qemuxml2argv-default-qemu-host-arch.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args | 4 ++- - .../qemuxml2argv-disk-blockio.args | 4 ++- - .../qemuxml2argv-disk-cdrom-empty.args | 4 ++- - .../qemuxml2argv-disk-cdrom-network-ftp.args | 4 ++- - .../qemuxml2argv-disk-cdrom-network-ftps.args | 4 ++- - .../qemuxml2argv-disk-cdrom-network-http.args | 4 ++- - .../qemuxml2argv-disk-cdrom-network-https.args | 4 ++- - .../qemuxml2argv-disk-cdrom-network-tftp.args | 4 ++- - ...qemuxml2argv-disk-cdrom-tray-no-device-cap.args | 4 ++- - .../qemuxml2argv-disk-cdrom-tray.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 4 ++- - .../qemuxml2argv-disk-copy_on_read.args | 4 ++- - .../qemuxml2argv-disk-drive-boot-cdrom.args | 4 ++- - .../qemuxml2argv-disk-drive-boot-disk.args | 4 ++- - .../qemuxml2argv-disk-drive-cache-directsync.args | 4 ++- - .../qemuxml2argv-disk-drive-cache-unsafe.args | 4 ++- - .../qemuxml2argv-disk-drive-cache-v2-none.args | 4 ++- - .../qemuxml2argv-disk-drive-cache-v2-wb.args | 4 ++- - .../qemuxml2argv-disk-drive-cache-v2-wt.args | 4 ++- - .../qemuxml2argv-disk-drive-copy-on-read.args | 4 ++- - .../qemuxml2argv-disk-drive-detect-zeroes.args | 4 ++- - .../qemuxml2argv-disk-drive-discard.args | 4 ++- - ...uxml2argv-disk-drive-error-policy-enospace.args | 4 ++- - .../qemuxml2argv-disk-drive-error-policy-stop.args | 4 ++- - ...gv-disk-drive-error-policy-wreport-rignore.args | 4 ++- - .../qemuxml2argv-disk-drive-fmt-qcow.args | 4 ++- - .../qemuxml2argv-disk-drive-network-gluster.args | 4 ++- - ...qemuxml2argv-disk-drive-network-iscsi-auth.args | 4 ++- - .../qemuxml2argv-disk-drive-network-iscsi-lun.args | 4 ++- - .../qemuxml2argv-disk-drive-network-iscsi.args | 4 ++- - ...qemuxml2argv-disk-drive-network-nbd-export.args | 4 ++- - ...ml2argv-disk-drive-network-nbd-ipv6-export.args | 4 ++- - .../qemuxml2argv-disk-drive-network-nbd-ipv6.args | 4 ++- - .../qemuxml2argv-disk-drive-network-nbd-unix.args | 4 ++- - .../qemuxml2argv-disk-drive-network-nbd.args | 4 ++- - ...muxml2argv-disk-drive-network-rbd-auth-AES.args | 4 ++- - .../qemuxml2argv-disk-drive-network-rbd-auth.args | 4 ++- - .../qemuxml2argv-disk-drive-network-rbd-ipv6.args | 4 ++- - .../qemuxml2argv-disk-drive-network-rbd.args | 4 ++- - .../qemuxml2argv-disk-drive-network-sheepdog.args | 4 ++- - .../qemuxml2argv-disk-drive-no-boot.args | 4 ++- - .../qemuxml2argv-disk-drive-readonly-disk.args | 4 ++- - ...qemuxml2argv-disk-drive-readonly-no-device.args | 4 ++- - .../qemuxml2argv-disk-drive-shared.args | 4 ++- - ...emuxml2argv-disk-floppy-tray-no-device-cap.args | 4 ++- - .../qemuxml2argv-disk-floppy-tray.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 4 ++- - .../qemuxml2argv-disk-geometry.args | 4 ++- - .../qemuxml2argv-disk-ide-drive-split.args | 4 ++- - .../qemuxml2argv-disk-ide-wwn.args | 4 ++- - .../qemuxml2argv-disk-ioeventfd.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-iscsi.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-order.args | 4 ++- - .../qemuxml2argv-disk-sata-device.args | 4 ++- - .../qemuxml2argv-disk-scsi-device-auto.args | 4 ++- - .../qemuxml2argv-disk-scsi-device.args | 4 ++- - .../qemuxml2argv-disk-scsi-disk-split.args | 4 ++- - .../qemuxml2argv-disk-scsi-disk-vpd.args | 4 ++- - .../qemuxml2argv-disk-scsi-disk-wwn.args | 4 ++- - .../qemuxml2argv-disk-scsi-lun-passthrough.args | 4 ++- - .../qemuxml2argv-disk-scsi-megasas.args | 4 ++- - .../qemuxml2argv-disk-scsi-mptsas1068.args | 4 ++- - .../qemuxml2argv-disk-scsi-virtio-scsi.args | 4 ++- - .../qemuxml2argv-disk-scsi-vscsi.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-serial.args | 4 ++- - .../qemuxml2argv-disk-snapshot.args | 4 ++- - .../qemuxml2argv-disk-source-pool-mode.args | 4 ++- - .../qemuxml2argv-disk-source-pool.args | 4 ++- - .../qemuxml2argv-disk-usb-device-removable.args | 4 ++- - .../qemuxml2argv-disk-usb-device.args | 4 ++- - .../qemuxml2argv-disk-virtio-ccw-many.args | 4 ++- - .../qemuxml2argv-disk-virtio-ccw.args | 4 ++- - .../qemuxml2argv-disk-virtio-s390.args | 4 ++- - .../qemuxml2argv-disk-virtio-scsi-ccw.args | 4 ++- - .../qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args | 4 ++- - .../qemuxml2argv-disk-virtio-scsi-ioeventfd.args | 4 ++- - .../qemuxml2argv-disk-virtio-scsi-max_sectors.args | 4 ++- - .../qemuxml2argv-disk-virtio-scsi-num_queues.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 4 ++- - .../qemuxml2argv-encrypted-disk-usage.args | 4 ++- - .../qemuxml2argv-encrypted-disk.args | 4 ++- - .../qemuxml2argv-eoi-disabled.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-eoi-enabled.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-event_idx.args | 4 ++- - .../qemuxml2argv-fd-memory-no-numa-topology.args | 4 ++- - .../qemuxml2argv-fd-memory-numa-topology.args | 4 ++- - .../qemuxml2argv-fd-memory-numa-topology2.args | 4 ++- - .../qemuxml2argv-fd-memory-numa-topology3.args | 4 ++- - .../qemuxml2argv-fips-enabled.args | 4 ++- - .../qemuxml2argv-floppy-drive-fat.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-fs9p.args | 4 ++- - .../qemuxml2argv-graphics-sdl-fullscreen.args | 4 ++- - .../qemuxml2argv-graphics-sdl.args | 4 ++- - ...emuxml2argv-graphics-spice-agent-file-xfer.args | 4 ++- - .../qemuxml2argv-graphics-spice-agentmouse.args | 4 ++- - ...emuxml2argv-graphics-spice-auto-socket-cfg.args | 4 ++- - .../qemuxml2argv-graphics-spice-auto-socket.args | 4 ++- - .../qemuxml2argv-graphics-spice-compression.args | 4 ++- - .../qemuxml2argv-graphics-spice-no-args.args | 4 ++- - .../qemuxml2argv-graphics-spice-qxl-vga.args | 4 ++- - .../qemuxml2argv-graphics-spice-sasl.args | 4 ++- - .../qemuxml2argv-graphics-spice-socket.args | 4 ++- - .../qemuxml2argv-graphics-spice-timeout.args | 4 ++- - .../qemuxml2argv-graphics-spice.args | 4 ++- - .../qemuxml2argv-graphics-vnc-auto-socket-cfg.args | 4 ++- - .../qemuxml2argv-graphics-vnc-auto-socket.args | 4 ++- - .../qemuxml2argv-graphics-vnc-no-listen-attr.args | 4 ++- - .../qemuxml2argv-graphics-vnc-none.args | 4 ++- - .../qemuxml2argv-graphics-vnc-policy.args | 4 ++- - ...2argv-graphics-vnc-remove-generated-socket.args | 4 ++- - .../qemuxml2argv-graphics-vnc-sasl.args | 4 ++- - .../qemuxml2argv-graphics-vnc-socket.args | 4 ++- - .../qemuxml2argv-graphics-vnc-tls.args | 4 ++- - .../qemuxml2argv-graphics-vnc-websocket.args | 4 ++- - .../qemuxml2argv-graphics-vnc.args | 4 ++- - .../qemuxml2argv-hostdev-mdev-precreated.args | 4 ++- - .../qemuxml2argv-hostdev-pci-address-device.args | 4 ++- - .../qemuxml2argv-hostdev-pci-address.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-lsi-iscsi.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-lsi.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-readonly.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-vhost-scsi-pci.args | 4 ++- - ...emuxml2argv-hostdev-scsi-virtio-iscsi-auth.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-virtio-iscsi.args | 4 ++- - .../qemuxml2argv-hostdev-scsi-virtio-scsi.args | 4 ++- - ...muxml2argv-hostdev-usb-address-device-boot.args | 4 ++- - .../qemuxml2argv-hostdev-usb-address-device.args | 4 ++- - .../qemuxml2argv-hostdev-usb-address.args | 4 ++- - .../qemuxml2argv-hostdev-vfio-multidomain.args | 4 ++- - .../qemuxml2argv-hostdev-vfio.args | 4 ++- - .../qemuxml2argv-hotplug-base.args | 4 ++- - .../qemuxml2argv-hugepages-memaccess.args | 4 ++- - .../qemuxml2argv-hugepages-memaccess2.args | 4 ++- - .../qemuxml2argv-hugepages-numa.args | 4 ++- - .../qemuxml2argv-hugepages-pages.args | 4 ++- - .../qemuxml2argv-hugepages-pages2.args | 5 +-- - .../qemuxml2argv-hugepages-pages3.args | 5 +-- - .../qemuxml2argv-hugepages-pages5.args | 5 +-- - .../qemuxml2argv-hugepages-pages6.args | 5 +-- - .../qemuxml2argv-hugepages-shared.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-hugepages.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-hyperv-off.args | 4 ++- - .../qemuxml2argv-hyperv-panic.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-hyperv.args | 4 ++- - .../qemuxml2argv-input-usbmouse-addr.args | 4 ++- - .../qemuxml2argv-input-usbmouse.args | 4 ++- - .../qemuxml2argv-input-usbtablet.args | 4 ++- - .../qemuxml2argv-intel-iommu-caching-mode.args | 4 ++- - .../qemuxml2argv-intel-iommu-device-iotlb.args | 4 ++- - .../qemuxml2argv-intel-iommu-eim.args | 4 ++- - .../qemuxml2argv-intel-iommu-ioapic.args | 4 ++- - .../qemuxml2argv-intel-iommu-machine.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-intel-iommu.args | 4 ++- - .../qemuxml2argv-iothreads-disk-virtio-ccw.args | 4 ++- - .../qemuxml2argv-iothreads-disk.args | 4 ++- - .../qemuxml2argv-iothreads-ids-partial.args | 4 ++- - .../qemuxml2argv-iothreads-ids.args | 4 ++- - .../qemuxml2argv-iothreads-virtio-scsi-ccw.args | 4 ++- - .../qemuxml2argv-iothreads-virtio-scsi-pci.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-iothreads.args | 4 ++- - .../qemuxml2argv-kvm-features-off.args | 4 ++- - .../qemuxml2argv-kvm-features.args | 4 ++- - .../qemuxml2argv-kvm-pit-delay.args | 4 ++- - .../qemuxml2argv-kvm-pit-discard.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-kvm.args | 4 ++- - .../qemuxml2argv-kvmclock+eoi-disabled.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-luks-disks.args | 4 ++- - .../qemuxml2argv-machine-aeskeywrap-off-cap.args | 4 ++- - .../qemuxml2argv-machine-aeskeywrap-off-caps.args | 4 ++- - .../qemuxml2argv-machine-aeskeywrap-on-cap.args | 4 ++- - .../qemuxml2argv-machine-aeskeywrap-on-caps.args | 4 ++- - .../qemuxml2argv-machine-aliases1.args | 4 ++- - .../qemuxml2argv-machine-aliases2.args | 4 ++- - .../qemuxml2argv-machine-core-cfg-off.args | 4 ++- - .../qemuxml2argv-machine-core-off.args | 4 ++- - .../qemuxml2argv-machine-core-on.args | 4 ++- - .../qemuxml2argv-machine-deakeywrap-off-cap.args | 4 ++- - .../qemuxml2argv-machine-deakeywrap-off-caps.args | 4 ++- - .../qemuxml2argv-machine-deakeywrap-on-cap.args | 4 ++- - .../qemuxml2argv-machine-deakeywrap-on-caps.args | 4 ++- - .../qemuxml2argv-machine-keywrap-none-caps.args | 4 ++- - .../qemuxml2argv-machine-keywrap-none.args | 4 ++- - .../qemuxml2argv-machine-smm-opt.args | 4 ++- - .../qemuxml2argv-machine-usb-opt.args | 4 ++- - .../qemuxml2argv-machine-vmport-opt.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-master-key.args | 4 ++- - .../qemuxml2argv-memory-hotplug-dimm-addr.args | 4 ++- - .../qemuxml2argv-memory-hotplug-dimm.args | 4 ++- - .../qemuxml2argv-memory-hotplug-nvdimm-access.args | 4 ++- - .../qemuxml2argv-memory-hotplug-nvdimm-label.args | 4 ++- - .../qemuxml2argv-memory-hotplug-nvdimm.args | 4 ++- - .../qemuxml2argv-memory-hotplug-ppc64-nonuma.args | 4 ++- - .../qemuxml2argv-memory-hotplug.args | 4 ++- - .../qemuxml2argv-memtune-unlimited.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-memtune.args | 4 ++- - .../qemuxml2argv-migrate-numa-unaligned.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-migrate.args | 4 ++- - .../qemuxml2argv-minimal-msg-timestamp.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 4 ++- - .../qemuxml2argv-misc-disable-s3.args | 4 ++- - .../qemuxml2argv-misc-disable-suspends.args | 4 ++- - .../qemuxml2argv-misc-enable-s4.args | 4 ++- - .../qemuxml2argv-misc-no-reboot.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args | 4 ++- - .../qemuxml2argv-mlock-unsupported.args | 4 ++- - .../qemuxml2argv-multifunction-pci-device.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-net-client.args | 4 ++- - .../qemuxml2argv-net-eth-hostip.args | 4 ++- - .../qemuxml2argv-net-eth-ifname.args | 4 ++- - .../qemuxml2argv-net-eth-names.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 4 ++- - .../qemuxml2argv-net-hostdev-multidomain.args | 4 ++- - .../qemuxml2argv-net-hostdev-vfio-multidomain.args | 4 ++- - .../qemuxml2argv-net-hostdev-vfio.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-net-hostdev.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-net-server.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-net-udp.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 4 ++- - .../qemuxml2argv-net-vhostuser-multiq.args | 4 ++- - .../qemuxml2argv-net-vhostuser.args | 4 ++- - .../qemuxml2argv-net-virtio-ccw.args | 4 ++- - .../qemuxml2argv-net-virtio-device.args | 4 ++- - .../qemuxml2argv-net-virtio-disable-offloads.args | 4 ++- - .../qemuxml2argv-net-virtio-netdev.args | 4 ++- - .../qemuxml2argv-net-virtio-rxqueuesize.args | 4 ++- - .../qemuxml2argv-net-virtio-s390.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-net-virtio.args | 4 ++- - .../qemuxml2argv-no-kvm-pit-device.args | 4 ++- - .../qemuxml2argv-nographics-display.args | 4 ++- - .../qemuxml2argv-nographics-vga.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-nographics.args | 4 ++- - .../qemuxml2argv-nosharepages.args | 4 ++- - ...qemuxml2argv-numad-auto-memory-vcpu-cpuset.args | 4 ++- - ...d-auto-memory-vcpu-no-cpuset-and-placement.args | 4 ++- - ...muxml2argv-numad-auto-vcpu-static-numatune.args | 4 ++- - ...qemuxml2argv-numad-static-memory-auto-vcpu.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-numad.args | 4 ++- - ...qemuxml2argv-numatune-auto-nodeset-invalid.args | 4 ++- - .../qemuxml2argv-numatune-auto-prefer.args | 4 ++- - .../qemuxml2argv-numatune-memnode-no-memory.args | 4 ++- - .../qemuxml2argv-numatune-memnode.args | 4 ++- - .../qemuxml2argv-numatune-memory.args | 4 ++- - .../qemuxml2argv-panic-double.args | 4 ++- - .../qemuxml2argv-panic-no-address.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-panic.args | 4 ++- - .../qemuxml2argv-pci-autoadd-addr.args | 4 ++- - .../qemuxml2argv-pci-autoadd-idx.args | 4 ++- - .../qemuxml2argv-pci-autofill-addr.args | 4 ++- - .../qemuxml2argv-pci-bridge-many-disks.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-pci-bridge.args | 4 ++- - .../qemuxml2argv-pci-expander-bus.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-pci-many.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args | 4 ++- - .../qemuxml2argv-pcie-expander-bus.args | 5 +-- - .../qemuxml2argv-pcie-root-port-model-generic.args | 4 ++- - .../qemuxml2argv-pcie-root-port-model-ioh3420.args | 4 ++- - .../qemuxml2argv-pcie-root-port.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args | 4 ++- - .../qemuxml2argv-pcie-switch-downstream-port.args | 4 ++- - .../qemuxml2argv-pcie-switch-upstream-port.args | 4 ++- - .../qemuxml2argv-pcihole64-q35.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args | 4 ++- - .../qemuxml2argv-pmu-feature-off.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-pmu-feature.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 4 ++- - .../qemuxml2argv-ppc64-usb-controller-legacy.args | 4 ++- - ...emuxml2argv-ppc64-usb-controller-qemu-xhci.args | 4 ++- - .../qemuxml2argv-ppc64-usb-controller.args | 4 ++- - .../qemuxml2argv-pseries-nvram.args | 4 ++- - .../qemuxml2argv-pv-spinlock-disabled.args | 4 ++- - .../qemuxml2argv-pv-spinlock-enabled.args | 4 ++- - .../qemuxml2argv-q35-acpi-nouefi.args | 4 ++- - .../qemuxml2argv-q35-acpi-uefi.args | 4 ++- - .../qemuxml2argv-q35-default-devices-only.args | 4 ++- - .../qemuxml2argv-q35-multifunction.args | 4 ++- - .../qemuxml2argv-q35-noacpi-nouefi.args | 4 ++- - .../qemuxml2argv-q35-pci-force-address.args | 4 ++- - .../qemuxml2argv-q35-pcie-autoadd.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args | 4 ++- - .../qemuxml2argv-q35-pm-disable-fallback.args | 4 ++- - .../qemuxml2argv-q35-pm-disable.args | 4 ++- - .../qemuxml2argv-q35-usb2-multi.args | 4 ++- - .../qemuxml2argv-q35-usb2-reorder.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args | 4 ++- - .../qemuxml2argv-q35-virt-manager-basic.args | 4 ++- - .../qemuxml2argv-q35-virtio-pci.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-q35.args | 4 ++- - .../qemuxml2argv-qemu-ns-commandline-ns0.args | 4 ++- - .../qemuxml2argv-qemu-ns-commandline-ns1.args | 4 ++- - .../qemuxml2argv-qemu-ns-commandline.args | 4 ++- - ...emuxml2argv-qemu-ns-domain-commandline-ns0.args | 4 ++- - .../qemuxml2argv-qemu-ns-domain-commandline.args | 4 ++- - .../qemuxml2argv-qemu-ns-domain-ns0.args | 4 ++- - .../qemuxml2argv-qemu-ns-no-env.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args | 4 ++- - .../qemuxml2argv-reboot-timeout-disabled.args | 4 ++- - .../qemuxml2argv-reboot-timeout-enabled.args | 4 ++- - .../qemuxml2argv-restore-v2-fd.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-restore-v2.args | 4 ++- - .../qemuxml2argv-seclabel-dac-none.args | 4 ++- - .../qemuxml2argv-seclabel-dynamic-baselabel.args | 4 ++- - .../qemuxml2argv-seclabel-dynamic-labelskip.args | 4 ++- - .../qemuxml2argv-seclabel-dynamic-override.args | 4 ++- - .../qemuxml2argv-seclabel-dynamic-relabel.args | 4 ++- - .../qemuxml2argv-seclabel-dynamic.args | 4 ++- - .../qemuxml2argv-seclabel-none.args | 4 ++- - .../qemuxml2argv-seclabel-static-labelskip.args | 4 ++- - .../qemuxml2argv-seclabel-static-relabel.args | 4 ++- - .../qemuxml2argv-seclabel-static.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-dev.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-file.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-many.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-pty.args | 4 ++- - .../qemuxml2argv-serial-spiceport-nospice.args | 4 ++- - .../qemuxml2argv-serial-tcp-telnet.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-udp.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-serial-unix.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 4 ++- - .../qemuxml2argv-shmem-plain-doorbell.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-shmem.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-smbios.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-smp.args | 4 ++- - .../qemuxml2argv-sound-device.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-sound.args | 4 ++- - .../qemuxml2argv-tpm-passthrough.args | 4 ++- - .../qemuxml2argv-usb-controller-default-q35.args | 4 ++- - .../qemuxml2argv-usb-controller-explicit-q35.args | 4 ++- - .../qemuxml2argv-usb-controller-qemu-xhci.args | 4 ++- - .../qemuxml2argv-vcpu-placement-static.args | 4 ++- - .../qemuxml2argv-video-device-pciaddr-default.args | 4 ++- - .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++- - .../qemuxml2argv-video-qxl-device.args | 4 ++- - .../qemuxml2argv-video-qxl-heads.args | 4 ++- - .../qemuxml2argv-video-qxl-nodevice.args | 4 ++- - .../qemuxml2argv-video-qxl-noheads.args | 4 ++- - .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 4 ++- - .../qemuxml2argv-video-qxl-sec-device.args | 4 ++- - .../qemuxml2argv-video-vga-device-vgamem.args | 4 ++- - .../qemuxml2argv-video-vga-device.args | 4 ++- - .../qemuxml2argv-video-vga-nodevice.args | 4 ++- - .../qemuxml2argv-video-vga-qxl-heads.args | 4 ++- - .../qemuxml2argv-video-virtio-gpu-device.args | 4 ++- - .../qemuxml2argv-video-virtio-gpu-secondary.args | 4 ++- - .../qemuxml2argv-video-virtio-gpu-spice-gl.args | 4 ++- - .../qemuxml2argv-video-virtio-gpu-virgl.args | 4 ++- - .../qemuxml2argv-video-virtio-vga.args | 4 ++- - .../qemuxml2argv-virtio-input-passthrough.args | 4 ++- - .../qemuxml2argv-virtio-input.args | 4 ++- - .../qemuxml2argvdata/qemuxml2argv-virtio-lun.args | 4 ++- - .../qemuxml2argv-virtio-options.args | 4 ++- - .../qemuxml2argv-virtio-rng-default.args | 4 ++- - .../qemuxml2argv-virtio-rng-egd.args | 4 ++- - .../qemuxml2argv-virtio-rng-multiple.args | 4 ++- - .../qemuxml2argv-virtio-rng-random.args | 4 ++- - .../qemuxml2argv-watchdog-device.args | 4 ++- - .../qemuxml2argv-watchdog-dump.args | 4 ++- - .../qemuxml2argv-watchdog-injectnmi.args | 4 ++- - tests/qemuxml2argvdata/qemuxml2argv-watchdog.args | 4 ++- - 486 files changed, 1466 insertions(+), 516 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 5c2607fe41..3517329a6b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -5623,32 +5623,18 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager, - if (!monitor_chr) - return 0; - -- /* Use -chardev if it's available */ -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV)) { -+ if (!(chrdev = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -+ monitor_chr, "monitor", -+ qemuCaps, true))) -+ return -1; -+ virCommandAddArg(cmd, "-chardev"); -+ virCommandAddArg(cmd, chrdev); -+ VIR_FREE(chrdev); - -- if (!(chrdev = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -- monitor_chr, "monitor", -- qemuCaps, true))) -- return -1; -- virCommandAddArg(cmd, "-chardev"); -- virCommandAddArg(cmd, chrdev); -- VIR_FREE(chrdev); -- -- virCommandAddArg(cmd, "-mon"); -- virCommandAddArgFormat(cmd, -- "chardev=charmonitor,id=monitor,mode=%s", -- monitor_json ? "control" : "readline"); -- } else { -- const char *prefix = NULL; -- if (monitor_json) -- prefix = "control,"; -- -- virCommandAddArg(cmd, "-monitor"); -- if (!(chrdev = qemuBuildChrArgStr(monitor_chr, prefix))) -- return -1; -- virCommandAddArg(cmd, chrdev); -- VIR_FREE(chrdev); -- } -+ virCommandAddArg(cmd, "-mon"); -+ virCommandAddArgFormat(cmd, -+ "chardev=charmonitor,id=monitor,mode=%s", -+ monitor_json ? "control" : "readline"); - - return 0; - } -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -index 68fb61b1e4..ffb37a55a5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args -index 36371ba02d..d715a97b74 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args -@@ -18,5 +18,7 @@ unit=1 \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -index 9c8c001f1a..511b27c226 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -index 23276ad71a..3574ab0c40 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -index f79c1c60e9..7e88bbde3f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -index fce9308b01..6e6105cfe8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -index c9eb68a7ca..4c95c32a05 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-armtest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-armtest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /arm.kernel \ - -initrd /arm.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args -index 301eda89e2..a282bbf45c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /var/lib/libvirt/images/guest.vmlinuz \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args -index c62de750fe..34e088d732 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args -@@ -18,6 +18,8 @@ unit=1 \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args -index e97431f8be..d9d476bfc3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device nec-usb-xhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args -index 0aa27f7abb..456b4dfead 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device qemu-xhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -index 2f8c51610b..779ab52e96 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ - addr=0x1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -index e99d412a7e..c640edc6fb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -index 47d77618b9..f27fe0a1d3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args -@@ -15,8 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64-virt-default/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64-virt-default/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -index 5fef3b4882..eca4c4bacf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -index 23a5fffd09..a5bc66ecd2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -index 54244fdcf7..d3a68eae4c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.args b/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.args -index e7f62d3012..0605e72e78 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -acpitable sig=SLIC,file=/var/lib/libvirt/acpi/slic.dat \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -index e91c628a74..198e663d6f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-armtest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-armtest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /arm.kernel \ - -initrd /arm.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.args -index 49fccd8b94..f8a6237dd4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-armtest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-armtest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /arm.kernel \ - -initrd /arm.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -index 747e360262..1402fead1c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-armtest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-armtest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /arm.kernel \ - -initrd /arm.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -index 800c5f52ad..d391a4d02a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-armtest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-armtest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /arm.kernel \ - -initrd /arm.initrd \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args b/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args -index fc14dc4062..b4cc4a3ec0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-ccw-deflate.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-ccw-deflate.args -index c8bb7260fd..e5c46533fa 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-ccw-deflate.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-ccw-deflate.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a,deflate-on-oom=on -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-auto.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-auto.args -index 7875e14a75..34c47dd7af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-auto.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-auto.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.args -index 2060ad2190..6fe28b152d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate-off.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.args -index 57ac6003c2..1e3df28b76 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-deflate.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.args -index 9b63b680f4..34224ce278 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device.args -index 9b63b680f4..34224ce278 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -index e568e3c393..0b0dc9f1a8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /aarch64.kernel \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args -index c5fe72bd56..e61436833c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args -@@ -17,7 +17,9 @@ readonly=on \ - -uuid 362d1fc1-df7d-193e-5c18-49a71bd1da66 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test-bios/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test-bios/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args -index 92e6362596..8322b4d00f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram.args -@@ -16,7 +16,9 @@ readonly=on \ - -uuid 362d1fc1-df7d-193e-5c18-49a71bd1da66 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test-bios/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test-bios/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios.args b/tests/qemuxml2argvdata/qemuxml2argv-bios.args -index fdd9a4e1e1..15a237302e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-bios.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefaults \ - -device sga \ ---monitor unix:/tmp/lib/domain--1-test-bios/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test-bios/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-group-num.args b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-group-num.args -index b5a5cc0f9c..f6dafe6ae8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-group-num.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-group-num.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args -index b656aeae51..f323da4097 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max.args b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max.args -index 58c15c86db..2cd37e74f6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args -index 11833e63fb..8f4d3de356 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.args b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args -index 32de47b4d2..ab0e42c71f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot d \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-complex-bootindex.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-complex-bootindex.args -index c18873e7f9..a9e8f4cc2c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-complex-bootindex.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-complex-bootindex.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -usb \ - -drive file=/tmp/vda.img,format=raw,if=none,id=drive-virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-complex.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-complex.args -index 45da3870fd..91cc0c7401 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-complex.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-complex.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dnca \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args -index caaf75892e..e33baecac8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot a \ - -drive file=/tmp/firmware.img,format=raw,if=none,id=drive-fdc0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args -index 2c5387074f..d8c5cb94d0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot a \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive-bootindex.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive-bootindex.args -index 81fa346364..da1849ad5d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive-bootindex.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive-bootindex.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot menu=off \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive.args -index ef59ff70b1..dde3d928e9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable-drive.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=d,menu=off \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args -index ef59ff70b1..dde3d928e9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=d,menu=off \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-bootindex.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-bootindex.args -index 4641c1e562..1362b0c75e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-bootindex.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-bootindex.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot menu=on \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args -index a16bc296f3..e0e8064d08 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=d,menu=on,splash-time=3000 \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable.args -index f56a9d5b2b..7ff081db27 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=d,menu=on \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args -index a258c8a933..18930020a9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=dcna,menu=on \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args -index bf57a6e750..6da139bba3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args -index 348c1105d5..ec8edbced8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-strict.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-strict.args -index 6238dca6e0..599249cbf6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-boot-strict.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-strict.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot strict=on \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args -index 10ae65ec9d..bcd90fd179 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-bootindex-floppy-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -drive file=/tmp/firmware.img,format=raw,if=none,id=drive-fdc0-0-0 \ - -device isa-fdc,driveA=drive-fdc0-0-0,bootindexA=1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args b/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args -index 81d4c7e599..7e0ae09d42 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=spice \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.args b/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.args -index 1dc068eea7..137d92ff6d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=spice \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-catchup.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-catchup.args -index c47e2dbe0f..8009800fc5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-catchup.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-catchup.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=utc,driftfix=slew \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-france.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-france.args -index 8535d12307..0ae49443bd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-france.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-france.args -@@ -14,7 +14,9 @@ TZ=Europe/Paris \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=localtime \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args -index e978689a56..ae7a2531d2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-hpet-off.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=utc,driftfix=slew \ - -no-kvm-pit-reinjection \ - -no-hpet \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime-basis-localtime.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime-basis-localtime.args -index 82482a9eff..620ae1d6d2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime-basis-localtime.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime-basis-localtime.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 1c15a1f6-f4f0-4d3c-9002-667ddb458736 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=2009-02-14T00:01:30 \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args -index 5a015a8f3a..e4cffe8a82 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -localtime \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-timer-hyperv-rtc.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-timer-hyperv-rtc.args -index cd38855b50..374445b555 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-timer-hyperv-rtc.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-timer-hyperv-rtc.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args -index 3c210455ae..8da27cf5d9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.args b/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.args -index a8716a22da..432e3c7e0b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-variable.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=2009-02-15T09:49:06 \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-auto.args b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-auto.args -index bb7dbff308..901b6ca7b3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-auto.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-auto.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args -index 1a63b9ab7b..7edf64debb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell-noTSX.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell-noTSX.args -index 783a4ab196..ab8f206e8a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell-noTSX.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell-noTSX.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args -index 2e74a67039..5eff1b9ca0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args -index e089a745b3..25cf0e06db 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args -index 2e74a67039..5eff1b9ca0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-Haswell3.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args -index 386e38d379..750577ade7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args -index 9348e01f8a..99d435cedd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args -index b882710c12..09eabb82fa 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-disable3.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args -index c2f5d19e18..0dddd32462 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-emulate-l3.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args -index 1d824f6dd1..2b08cd4e17 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args -index d7863ba2e2..4657550fe7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-cache-passthrough2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none.args -index 24d9f53067..9e87846b6a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none2.args -index b6a5d4dd45..af31a40140 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-none2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial.args -index decf7fdd4a..0859d97eb7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial2.args -index bd4cefaebb..e5bb55f05e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-default-partial2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-none.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-none.args -index bd4cefaebb..e5bb55f05e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-check-none.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args -index db14ac4dc7..58b849e8c5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args -index ce964a6734..122ea13ee5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args -index 4a7f174696..dfc840093f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args -index 628be8324d..8e114c75c2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2-nofallback.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args -index 628be8324d..8e114c75c2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args -index 6afcc584ac..13c99df3fb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-fallback.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args -index 6eead4baef..86ba0720c9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args -index e02f996eeb..58a15c4e0e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-cmt.args -@@ -16,7 +16,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args -index 26b838ef1e..d15db5d960 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-fallback.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args -index b0f8f5202b..4a5340c443 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model-vendor.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args -index a57ef9ad4f..123ece369b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-model.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args -index fa960c38e5..85ea3be4a8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args -index aa73f89013..3fbcd17d76 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-hotplug-startup.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-hotplug-startup.args -index 035f250195..dbb57a85a7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-hotplug-startup.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-hotplug-startup.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args -index 6e50dc1c94..9779899a71 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args -index decf7fdd4a..0859d97eb7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args -index d9821b6aa5..5b083e5647 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disjoint.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disjoint.args -index 5ff7a43a2a..d9305a0655 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disjoint.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disjoint.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args -index 677e17e7df..f3f0c45cb7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-memshared.args -@@ -19,7 +19,9 @@ share=no,size=112197632 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.args -index 2613649a8b..346e3699f0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-no-memory-element.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args -index 2613649a8b..346e3699f0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args -index 2613649a8b..346e3699f0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-features.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-features.args -index 0b4ce4c68c..f9fcb1a17e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-features.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-features.args -@@ -14,5 +14,7 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args -index 48850b8ca2..a19b92faaf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args -@@ -14,5 +14,7 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args -index e011095409..373042afd7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args -index eb001c1e21..4274989b8c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args -index 53764ff112..cfe6066795 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args -index eb001c1e21..4274989b8c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args -index cd9a3ef167..4848ce069f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-tsc-frequency.args -@@ -16,7 +16,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args -index 90c2555ce1..94538c713d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-dummy2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-dummy2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-zero-shares.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-cputune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-debug-threads.args b/tests/qemuxml2argvdata/qemuxml2argv-debug-threads.args -index b57f143fc6..c96439b6c0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-debug-threads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-debug-threads.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args -index 39195f27de..74868a8f74 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-default-kvm-host-arch.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid d091ea82-29e6-2e34-3005-f02617b36e87 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-kvm/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-kvm/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-default-qemu-host-arch.args b/tests/qemuxml2argvdata/qemuxml2argv-default-qemu-host-arch.args -index 039681023e..7272069234 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-default-qemu-host-arch.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-default-qemu-host-arch.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid d091ea82-29e6-2e34-3005-f02617b36e87 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-qemu-host/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-qemu-host/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args -index b0d1f04a88..4e39e4739f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args -index 9367a960ea..1b0769c9f8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-blockio.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args -index 1477bbb8f7..273c9b8852 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftp.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftp.args -index 16b9a001ac..e2987f1726 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot d \ - -usb \ - -drive file=ftp://host.name:21/url/path/file.iso,format=raw,if=none,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftps.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftps.args -index 2c1481868b..0db0933925 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-ftps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot d \ - -usb \ - -drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-http.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-http.args -index 3c60478b2a..31aeac4a77 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-http.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-http.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot d \ - -usb \ - -drive file=http://host.name:80/url/path/file.iso,format=raw,if=none,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-https.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-https.args -index 3934842756..92513a1006 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-https.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-https.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot d \ - -usb \ - -drive file=https://host.name:443/url/path/file.iso,format=raw,if=none,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-tftp.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-tftp.args -index e5b46dad4d..cee56ef060 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-tftp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network-tftp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot d \ - -usb \ - -drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray-no-device-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray-no-device-cap.args -index 0231d03b37..06d24d8b23 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray-no-device-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray-no-device-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray.args -index 0655ee2f6f..bc22b92f59 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-tray.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3fa02811-7832-34bd-004d-1ff56a9286ff \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args -index ad5523bb17..d0fb109f57 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.args -index 02a7970b82..3f06a53b04 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-copy_on_read.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 468404ad-d49c-40f2-9e14-02294f9c1be3 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args -index 9c73926e22..3c0791f45f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot d \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args -index f24c0f0450..483ca57dd8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.args -index 6ef08ae448..677727b753 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.args -index 96f768aae5..eb6804df75 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args -index 7e555fa403..77074af9f5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args -index 8a0362d853..40a85bef16 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args -index 80b34ae6ba..ec5ef60f16 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args -index 72f0d932dc..bf97416c40 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args -index 24a1bf1099..78ff31c6bb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 92d7a226-cfae-425b-a6d3-00bbf9ec5c9e \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args -index e3e62ac868..05238dc3e1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-discard.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 92d7a226-cfae-425b-a6d3-00bbf9ec5c9e \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.args -index 9b68e85220..b497f2c4c7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor control,unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=control \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.args -index b3e22e43d7..965749fcbf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor control,unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=control \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.args -index 480f921744..52ae75d712 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor control,unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=control \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args -index bd571ab995..76c84a9fe7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args -index cd5294e3b6..b88b945290 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args -index 6fa0cee340..f9d05f7057 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-lun.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-lun.args -index 0963f2a996..cb0f1961cd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-lun.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-lun.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.args -index 5e0276c29d..756aa010b3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.args -index 512eb1468b..b5971a5d73 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.args -index ff130315ac..869496bb3e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.args -index 156efcb024..3e02ff7339 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.args -index 4ac944ec65..f13ac14685 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.args -index 8d2ea28e58..d67de82aa0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.args -index d5361367f9..f78548cd0f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.args -@@ -15,7 +15,9 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args -index 1be5c26062..55e0e386a3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.args -index aa69f6dcf0..f6e9cb2ed5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.args -index 042a8140b5..717fb1b359 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.args -index 1ab4b1c210..a811183f35 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-no-boot.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-no-boot.args -index 6eb8dd6ef9..ec3c3db2ac 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-no-boot.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-no-boot.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args -index 2b8aeb694d..c22cf532a0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-no-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-no-device.args -index 2b8aeb694d..c22cf532a0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-no-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-no-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args -index 9ffffa813b..d29f080f7d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray-no-device-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray-no-device-cap.args -index 314860b2b9..39b8e87dd8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray-no-device-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray-no-device-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray.args -index 314860b2b9..39b8e87dd8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-tray.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args -index b5f30c9080..bff12612af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args -index 34e9358a20..6e7523a90f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args -index 262f793a17..5a8299b0ce 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-drive-split.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args -index 2507f796c5..30c0eb3390 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-ioeventfd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-ioeventfd.args -index 743fbe0278..ed8f6c30a9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-ioeventfd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-ioeventfd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 8c273d77-39b0-47c4-9714-6dddcad56b88 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args -index 35c1151a70..46515b7770 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args -index 793c65a2f8..c9373567fb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args -index b80d349be6..c2e2867d9f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-order.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args -index f47983a5fb..a8cabc18c8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ahci,id=sata0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device-auto.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device-auto.args -index 995d2ed655..5047d37f3b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device-auto.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device-auto.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.args -index 995d2ed655..5047d37f3b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-split.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-split.args -index a63e0e30c5..9b7c391176 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-split.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-split.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.args -index b92824ee13..32b56a1b29 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args -index bfb63d4ef0..dbe595dc52 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough.args -index f63bd95238..4d0ee0e537 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args -index 459ce1f90f..1c5c5aacbc 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device megasas,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args -index e07b407497..d90b9b182b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device mptsas1068,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.args -index 246e0427fd..7c7cefa29e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args -index b12693c6f4..a1819fbd5a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device spapr-vscsi,id=scsi0,reg=0x2000 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args -index 2cefdcab53..96e806cdca 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args -index dc3792b2c6..f47fa5c0d7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args -index 0cece76d01..d62b4afcaf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args -index 83ac5992c6..5b4461fbd4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args -index d002f99aa9..99c14182c8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args -index 4ac1a9c28b..11e4fff5e0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args -index 8290cd652a..2ca974625f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=0.0.0007,drive=drive-virtio-disk0,id=virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args -index 2f77a29550..2481a6ec66 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args -index 45c465912e..a7aada6494 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ccw.args -index 522fd99547..9f280f5c81 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ccw.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-scsi-ccw,id=scsi0,devno=fe.0.0001 \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args -index c9d1d0e9c1..97a581740d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,cmd_per_lun=50,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args -index 041af534cb..7798d5b65c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,ioeventfd=on,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-max_sectors.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-max_sectors.args -index f0913152e6..c58652d994 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-max_sectors.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-max_sectors.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,max_sectors=512,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.args -index 16e968fc1c..6876e5ec10 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,num_queues=8,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args -index b405242de6..bd6cd18510 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args -index 82f1f80cb1..c08144ec75 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 496898a6-e6ff-f7c8-5dc2-3cf410945ee9 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args -index 82f1f80cb1..c08144ec75 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 496898a6-e6ff-f7c8-5dc2-3cf410945ee9 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args -index db14ac4dc7..58b849e8c5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args -index ce964a6734..122ea13ee5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-event_idx.args b/tests/qemuxml2argvdata/qemuxml2argv-event_idx.args -index f862362218..039c5a2f61 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-event_idx.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-event_idx.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid bba65c0e-c049-934f-b6aa-4e2c0582acdf \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args -index 951a7cb956..8df5b35f9c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args -index bef81362f0..12f3d8ab8c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args -@@ -17,7 +17,9 @@ share=yes,size=15032385536 \ - -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -index e36f98b907..585e4d5061 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args -@@ -20,7 +20,9 @@ share=yes,size=15032385536 \ - -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args -index 4d98aa04bd..e9a57a69e5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args -@@ -23,7 +23,9 @@ share=no,size=15032385536 \ - -uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-instance-00000092/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args -index cff1a9a606..b963ec108c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fips-enabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args -index f5668d89e0..38e76fdb38 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot a \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args -index 6d4f65e0c9..e8050d83f9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args -index 02f3701bfb..1802c091d6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args -index 70d47090ad..aa044a66e1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.args -@@ -13,7 +13,9 @@ DISPLAY=:0.1 \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args -index b911baa305..307d9d33cb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args -@@ -13,7 +13,9 @@ DISPLAY=:0.1 \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args -index 88fa81363e..a832288a78 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.args -index 08ebc20d2e..dc1afb71a1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=spice \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args -index f19ace982b..fb68997b2a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args -index f19ace982b..fb68997b2a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -index 774a086177..0d86252675 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-no-args.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-no-args.args -index 86ef0272f8..a98594e33e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-no-args.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-no-args.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args -index 8f86ff9c0e..ab133b71ce 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -index 5ab7c9cfee..0d0a331e6a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args -index a1b618c039..af21538f4b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args -index bab81ffdb9..8a83e29041 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 2,sockets=1,cores=2,threads=1 \ - -uuid 553effab-b5e1-2d80-dfe3-da4344826c43 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-f14/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-f14/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot dc \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -index 972dea98ff..73d7c0c6da 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args -index 640b53b62c..9f25e340df 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args -index 10c816201d..a88e886556 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-no-listen-attr.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-no-listen-attr.args -index f2dc11e8c8..420c0e06e4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-no-listen-attr.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-no-listen-attr.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.args -index 649fd91873..73dee4ebed 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args -index f18df4a9b8..52ebc8fcd3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.args -index fd634f3515..c53e33e237 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args -index ab30a48177..bca9f7c326 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.args -index aae7adee0d..63c7910d81 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args -index f7f586a2d4..e3041d5a3f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.args -index 239f98e770..1506b5b5c0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args -index f2dc11e8c8..420c0e06e4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -index 76e77707bf..cafb66a297 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args -index d37f729476..4c6833c443 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args -index 405ee076d1..506dadfc2e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args -index 35b69a9c63..2833319a0a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.args -index 8efb1f88ec..960e5b7bba 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.args -index d52a1e5dbe..941505f832 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.args -index 1ec75040f7..bf8855aa4e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args -index 03de632ecd..7980d2104f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-scsi-ccw,id=scsi0,devno=fe.0.0001 \ - -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-pci.args -index cb4553fe29..7bc828e9dc 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-pci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi-pci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args -index 7548aa4880..64a247bad2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.args -index 7a42872876..61c8c881a0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.args -index 2e344b6f2f..915c94ebd9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.args -index 4d24cb40a0..711306c9e9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args -index 06187ec28b..9471d6ba0b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args -index da409f6692..e2f48606bf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.args -index d18387cb6c..253f09d44c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.args -index 59415d66f1..6fa731bc3f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.args b/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.args -index 1df7121289..0d86288537 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid d091ea82-29e6-2e34-3005-f02617b36e87 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-hotplug/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-hotplug/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args -index d584d465b5..2386acf003 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args -@@ -33,7 +33,9 @@ host-nodes=0-3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args -index 11985232a7..55db491719 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess2.args -@@ -30,7 +30,9 @@ host-nodes=0-3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args -index 1b2a52bcc4..90ffa6fa80 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args -@@ -19,7 +19,9 @@ host-nodes=1-3,policy=bind \ - -device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \ - -uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fedora/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fedora/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=utc,driftfix=slew \ - -no-kvm-pit-reinjection \ - -no-hpet \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages.args -index 4c11bb762a..91c09a2e2f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages.args -@@ -29,7 +29,9 @@ host-nodes=3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args -index 72a1d8c9ba..a930a97fa1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args -@@ -17,8 +17,9 @@ QEMU_AUDIO_DRV=none \ - -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -index 75cb1de59a..af77e02c6f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages3.args -@@ -18,8 +18,9 @@ mem-path=/dev/hugepages1G/libvirt/qemu/-1-SomeDummyHugepagesGu,size=805306368 \ - -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args -index fb9fa8a8fe..ae23f6156d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages5.args -@@ -15,8 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args -index df7dbc5c39..34b5a0276e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args -@@ -13,8 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-SomeDummyHugepagesGu/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args -index 27a6d849a9..6083e97198 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-shared.args -@@ -29,7 +29,9 @@ host-nodes=3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.args -index 52d04cdf65..7adec46306 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hyperv-off.args b/tests/qemuxml2argvdata/qemuxml2argv-hyperv-off.args -index c268db1096..a8a7e7bec6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hyperv-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hyperv-off.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hyperv-panic.args b/tests/qemuxml2argvdata/qemuxml2argv-hyperv-panic.args -index c8bc6b3829..b666db1397 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hyperv-panic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hyperv-panic.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hyperv.args b/tests/qemuxml2argvdata/qemuxml2argv-hyperv.args -index 4903759ac8..c653008bcf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-hyperv.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-hyperv.args -@@ -15,6 +15,8 @@ hv_synic,hv_stimer,hv_reset,hv_vendor_id=KVM Hv' \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse-addr.args -index 08dc180548..cc3b64757a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse-addr.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse-addr.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args -index f8250549f8..e7390e93d1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args -index 54f8d0cdf6..f26e5c1634 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args -index 1bec6d00b5..5d12aabf4b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device intel-iommu,intremap=on,caching-mode=on \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args -index 6d8f8e2188..bbb91918b8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device intel-iommu,intremap=on,device-iotlb=on -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args -index ebf7c49bf1..f5cc87ed30 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device intel-iommu,intremap=on,eim=on -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -index c6539878ad..8e70bf9107 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device intel-iommu,intremap=on -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-machine.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-machine.args -index 91e37e32ec..f8800ea0be 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-machine.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-machine.args -@@ -13,6 +13,8 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.args -index dfc2183bae..af2b692f2f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device intel-iommu -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args -index ba4e699eec..516edec961 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,iothread=iothread1,devno=fe.0.0000,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk.args -index a984e99be2..5e38c5f6e6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.args -index c44162074a..b1baa978cc 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.args -@@ -17,7 +17,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.args -index 607fb0dfb1..5cd2f38d0e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args -index e87912b96c..22a4e0434a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-ccw.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-scsi-ccw,iothread=iothread2,id=scsi0,devno=fe.0.0001 \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args -index cd773b7e77..901251353f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-virtio-scsi-pci.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,iothread=iothread2,id=scsi0,bus=pci.0,addr=0xb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads.args -index c4521f281a..ae850d6b13 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-iothreads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.args -index c268db1096..a8a7e7bec6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args -index a7a7a3b690..26418aa9a7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm-features.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args -index 7a02d362bb..bd48e1278d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-delay.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -global kvm-pit.lost_tick_policy=delay \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-discard.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-discard.args -index 5ff60affd7..8daf6fe971 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-discard.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm-pit-discard.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -global kvm-pit.lost_tick_policy=discard \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvm.args b/tests/qemuxml2argvdata/qemuxml2argv-kvm.args -index a522c0978f..60ed331e7a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvm.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvm.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid d091ea82-29e6-2e34-3005-f02617b36e87 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-kvm/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-kvm/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock+eoi-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock+eoi-disabled.args -index 96b3c31a10..f1c0a31997 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock+eoi-disabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock+eoi-disabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args -index 50b0bd403a..60f7c9ba7d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-luks-disks.args b/tests/qemuxml2argvdata/qemuxml2argv-luks-disks.args -index 270322f6ee..33206c3d60 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-luks-disks.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-luks-disks.args -@@ -15,7 +15,9 @@ file=/tmp/lib/domain--1-encryptdisk/master-key.aes \ - -uuid 496898a6-e6ff-f7c8-5dc2-3cf410945ee9 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-encryptdisk/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.args -index c718084dbb..1c70bf8a25 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.args -index c718084dbb..1c70bf8a25 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.args -index c6eaa244b6..9e58194e13 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.args -index c6eaa244b6..9e58194e13 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.args -index 5e2d0c0633..a6149373ae 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.args -index 07a6600afd..b05490317a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-cfg-off.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-cfg-off.args -index a6635a6814..729ab06e0f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-cfg-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-cfg-off.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args -index a6635a6814..729ab06e0f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args -index 578ba6acbe..c9f7e6cd0b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.args -index 434f5061ef..0a3000473f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.args -index 434f5061ef..0a3000473f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.args -index 24e2035a39..aefc0b4bca 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.args -index 24e2035a39..aefc0b4bca 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.args -index acde08a4b5..f1a920cc65 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.args -index acde08a4b5..f1a920cc65 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ - -device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args -index cc9c35590d..ff06decb08 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-usb-opt.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-usb-opt.args -index 96f8f6c28b..bdc2020a72 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-usb-opt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-usb-opt.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args -index f7a6dcc578..7c1f9b4083 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-vmport-opt.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-master-key.args b/tests/qemuxml2argvdata/qemuxml2argv-master-key.args -index ec6b1eeb07..c99d462de5 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-master-key.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-master-key.args -@@ -15,7 +15,9 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args -index 6825fa5332..acfd2764a9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-addr.args -@@ -20,7 +20,9 @@ host-nodes=1-3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.args -index 321e64e23a..6ca8151a70 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.args -@@ -20,7 +20,9 @@ host-nodes=1-3,policy=bind \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args -index d398b22946..34f7a25bf6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args -@@ -17,7 +17,9 @@ share=no,size=536870912 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args -index 8669f2d84c..7c0dd15fd3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args -@@ -17,7 +17,9 @@ share=no,size=536870912 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args -index 907bcbeda9..50bfc795b8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args -@@ -17,7 +17,9 @@ size=536870912 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args -index 88ed6b6151..8d8b6e9154 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-ppc64-nonuma.args -@@ -17,7 +17,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 49545eb3-75e1-2d0a-acdd-f0294406c99e \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /media/ram/uImage \ - -initrd /media/ram/ramdisk \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args -index 94b1773db1..82c1318810 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memtune.args b/tests/qemuxml2argvdata/qemuxml2argv-memtune.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-memtune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-memtune.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-migrate-numa-unaligned.args b/tests/qemuxml2argvdata/qemuxml2argv-migrate-numa-unaligned.args -index a20e1c04fe..3705117703 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-migrate-numa-unaligned.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-migrate-numa-unaligned.args -@@ -22,7 +22,9 @@ host-nodes=5,host-nodes=7,policy=bind \ - -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-migrate.args b/tests/qemuxml2argvdata/qemuxml2argv-migrate.args -index 742e29eca3..10e89df6d6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-migrate.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-migrate.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal-msg-timestamp.args b/tests/qemuxml2argvdata/qemuxml2argv-minimal-msg-timestamp.args -index 8be17730c6..bbd63e59b0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-minimal-msg-timestamp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal-msg-timestamp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args -index 4744b11be4..b4ee7807de 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.args -index 21c6322070..33d921bf57 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 8caaa98c-e7bf-5845-126a-1fc316bd1089 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -global PIIX4_PM.disable_s3=1 \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.args -index 224e0f3c8d..c1110f099e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 8caaa98c-e7bf-5845-126a-1fc316bd1089 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -global PIIX4_PM.disable_s3=1 \ - -global PIIX4_PM.disable_s4=1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.args -index 61eba8c22d..1a678a8754 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 8caaa98c-e7bf-5845-126a-1fc316bd1089 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -global PIIX4_PM.disable_s4=0 \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args -index cb5a707781..b7333dc471 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-reboot \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args -index 4744b11be4..b4ee7807de 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args b/tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args -index 508d139f80..2db4c1bd65 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args b/tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args -index 8db643d8c8..a13315cdc0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args b/tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args -index a401b9a70c..9f18cd8d4e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-mlock-unsupported.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-multifunction-pci-device.args b/tests/qemuxml2argvdata/qemuxml2argv-multifunction-pci-device.args -index abb1694f4b..8ce312c4eb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-multifunction-pci-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-multifunction-pci-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device lsi,id=scsi0,bus=pci.0,multifunction=off,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-client.args b/tests/qemuxml2argvdata/qemuxml2argv-net-client.args -index f923a14865..852a8c8303 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-client.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-client.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args -index 181eb3b7e3..bf4ac16a6c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args -index 181eb3b7e3..bf4ac16a6c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args -index 745cf3e3ac..432ef2ac60 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args -index 181eb3b7e3..bf4ac16a6c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.args b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.args -index d266a44571..aa38660fcf 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.args b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.args -index 81fe791d63..9cb98dd560 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.args b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.args -index eda2a91c64..2bf8d12b20 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.args b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.args -index 04c6712672..ef33b29d5d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args -index 30486db515..8a44142cc2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-server.args b/tests/qemuxml2argvdata/qemuxml2argv-net-server.args -index ba2b585591..0d813c6092 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-server.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-server.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-udp.args b/tests/qemuxml2argvdata/qemuxml2argv-net-udp.args -index 4ab945e26b..df26f246c6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-udp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-udp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args -index 315cbebcaa..24b18a1aed 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args -index 59929c1b45..6f7750ba39 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args -index e15d735429..2ab87d5996 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args -index 8a0598a9ab..01d266481d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-net-ccw,vlan=0,id=net0,mac=00:11:22:33:44:55,devno=fe.0.0001 \ - -net user,vlan=0,name=hostnet0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args -index e04e66f793..53c0675b02 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args -index 03ab1301a6..2e029194c7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args -index a12d5003ec..6e2ac08500 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args -index 7d275a723d..fe217e8b60 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-rxqueuesize.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args -index ef31b791a6..fa78a04bc9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device virtio-net-s390,vlan=0,id=net0,mac=00:11:22:33:44:55 \ - -net user,vlan=0,name=hostnet0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args -index 51869505fa..4ae9aec56e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-no-kvm-pit-device.args b/tests/qemuxml2argvdata/qemuxml2argv-no-kvm-pit-device.args -index 1d69797dd5..c70fffa2a3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-no-kvm-pit-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-no-kvm-pit-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-kvm-pit-reinjection \ - -no-acpi \ - -boot c \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-nographics-display.args b/tests/qemuxml2argvdata/qemuxml2argv-nographics-display.args -index 67e2f84366..691d233f42 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-nographics-display.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-nographics-display.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -display none \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args -index 93ce4b2e14..21d88daea4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-nographics.args b/tests/qemuxml2argvdata/qemuxml2argv-nographics.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-nographics.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-nographics.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-nosharepages.args b/tests/qemuxml2argvdata/qemuxml2argv-nosharepages.args -index 0b45663801..e9beab3609 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-nosharepages.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-nosharepages.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.args b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.args b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.args b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.args b/tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad.args b/tests/qemuxml2argvdata/qemuxml2argv-numad.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numad.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-nodeset-invalid.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-nodeset-invalid.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-nodeset-invalid.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-nodeset-invalid.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args -index d873b88756..02da1b352b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -index ad024fb8fa..c57a1bceef 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode-no-memory.args -@@ -18,7 +18,9 @@ policy=preferred \ - -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode.args -index bcd49d8714..1043cd8364 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memnode.args -@@ -22,7 +22,9 @@ host-nodes=5,host-nodes=7,policy=bind \ - -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.args b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.args -index d732b04980..33594091af 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic-double.args b/tests/qemuxml2argvdata/qemuxml2argv-panic-double.args -index 71ab7a7811..6119a46f0e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-panic-double.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic-double.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device pvpanic,ioport=1285 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args -index caec1590f1..6e94050687 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic-no-address.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-panic.args b/tests/qemuxml2argvdata/qemuxml2argv-panic.args -index 7db4b4a5b9..b42e728db8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-panic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-panic.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.args -index 36756fcfbb..25d3537cb8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fdr-br/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.args -index 6766d67ceb..7dd988904c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fdr-br/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device pci-bridge,chassis_nr=8,id=pci.8,bus=pci.0,addr=0x3 \ - -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args -index b8071eade8..e51059fd0d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fdr-br/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-many-disks.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-many-disks.args -index c3ee9c7eb9..b137fb713e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-many-disks.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge-many-disks.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 04872dc1-e1de-434b-ab21-e3e80e416349 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-lots-of-disks/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-lots-of-disks/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.args -index d1d51b3c2a..877cb1786d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 2,sockets=2,cores=1,threads=1 \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fdr-br/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \ - -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-expander-bus.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-expander-bus.args -index b608cf6cef..7327afbc4b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-expander-bus.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-expander-bus.args -@@ -15,7 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-expander-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-expander-test/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device pxb,bus_nr=254,id=pci.1,numa_node=1,bus=pci.0,addr=0x3 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-many.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-many.args -index 59e134328f..27df74be76 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-many.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-many.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3ec6cbe1-b5a2-4515-b800-31a61855df41 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-fdr-br/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-fdr-br/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -drive file=/var/iso/f18kde.iso,format=raw,if=none,media=cdrom,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args -index 9fc178b4ee..1ad149a10a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-expander-bus.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-expander-bus.args -index 92199ee51a..3f662a0709 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-expander-bus.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-expander-bus.args -@@ -15,8 +15,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-pcie-expander-bus-te/monitor.sock,server,\ --nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-pcie-expander-bus-te/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device pxb-pcie,bus_nr=254,id=pci.1,numa_node=0,bus=pcie.0,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.args -index 96239bd313..befbd4b515 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.args -index 73f533bd00..89ac4cd56f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args -index 4e852ff8ee..ca92c40c1b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args -index 59a849f08f..113c377c4a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args -@@ -13,6 +13,8 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args -index 1102b38f0a..620fbc9acd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-downstream-port.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,addr=0x2 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args -index 05db65b029..010fb0fecb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-switch-upstream-port.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -index 179a7c5792..a4491441b1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -global q35-pcihost.pci-hole64-size=1048576K \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args -index 992d8899c8..92c7ea5c85 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 3c7c30b5-7866-4b05-8a29-efebccba52a0 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-foo/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -global i440FX-pcihost.pci-hole64-size=1048576K \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.args b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.args -index 6fcd23f61e..f608b295de 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.args b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.args -index 5f648e6439..bf4d4ac12e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.args -@@ -14,6 +14,8 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -index 10ddca0dc4..182744c236 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 49545eb3-75e1-2d0a-acdd-f0294406c99e \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /media/ram/uImage \ - -initrd /media/ram/ramdisk \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args -index 9226c5e89f..ee4cf33a66 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-legacy.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args -index b34e480dd4..2cda237b98 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device qemu-xhci,id=usb,bus=pci.0,addr=0x1 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args -index 157f5d9d4e..a008d238bb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-nvram.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-nvram.args -index 904b9518e9..1c777b3ff0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-nvram.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-nvram.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -global spapr-nvram.reg=0x4000 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-disabled.args -index e678ffbcaa..b035a1734f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-disabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-disabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-enabled.args -index bcdeaf7482..da08442b5c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-enabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-pv-spinlock-enabled.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot n \ - -usb \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args -index 531520b0ab..5e1d3b4eb0 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -kernel /var/lib/libvirt/images/guest.vmlinuz \ - -initrd /var/lib/libvirt/images/guest.initramfs \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args -index 4dd99676ed..40214c69e8 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args -@@ -18,5 +18,7 @@ unit=1 \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.args -index 30fc9b708c..81186b62eb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args -index 1b607448fb..b1f0b6db65 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args -index 4d7cdfbe30..1be5968e02 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -kernel /var/lib/libvirt/images/guest.vmlinuz \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pci-force-address.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pci-force-address.args -index 9ca342ba71..416f46c832 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pci-force-address.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pci-force-address.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.args -index f3d44c0d84..f4df620065 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ioh3420,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args -index 3b507f3e41..ede67b466b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args -index 739c918d90..8dc11e7c4b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -global PIIX4_PM.disable_s3=1 \ - -global PIIX4_PM.disable_s4=1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args -index 5ee16b7a19..25311357e2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35/monitor.sock,server,\ -+nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -global ICH9-LPC.disable_s3=1 \ - -global ICH9-LPC.disable_s4=1 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args -index 01d296d185..925d7be7e1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args -index 1548845eff..adb49644ff 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args -index 733a4dc51c..59bfd34fcb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.args -index 91598e9d8d..a3aaf2133f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 2,sockets=2,cores=1,threads=1 \ - -uuid 1b826c23-8767-47ad-a6b5-c83a88277f71 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-virt-manager-basic/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,\ -+path=/tmp/lib/domain--1-virt-manager-basic/monitor.sock,server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -rtc base=utc,driftfix=slew \ - -no-kvm-pit-reinjection \ - -no-hpet \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args -index a1025dc930..04a5d143e2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args -index e572e8cd13..f0952750fc 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x1d.0x7 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns0.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns0.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns0.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns0.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns1.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns1.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns1.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline-ns1.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-commandline.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline-ns0.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline-ns0.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline-ns0.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline-ns0.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-commandline.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-ns0.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-ns0.args -index afaa462dec..dbef686892 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-ns0.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-domain-ns0.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.args -index 603af8be29..bf01391ea9 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args -index 9bb1b49126..9c742968e1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args -@@ -15,7 +15,9 @@ BAR='' \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.args -index c69a3a093f..fdb8ae5063 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=n,reboot-timeout=-1 \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.args -index 94013f0148..4f80888383 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot order=n,reboot-timeout=128 \ - -usb -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args -index 0954c1ac01..01f2c2ce0d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args -index 2220522862..12d939c77c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dac-none.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dac-none.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dac-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dac-none.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-labelskip.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-labelskip.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-labelskip.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-labelskip.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args -index 02fa000d55..c5ea11b682 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-relabel.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-relabel.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-relabel.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-relabel.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-labelskip.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-labelskip.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-labelskip.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-labelskip.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static-relabel.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.args b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args -index 7587eab232..609f34a51d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args -index 298a57a93d..aa4ca764fd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args -index 8efc238117..99ad62b046 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args -index 1a63b9ab7b..7edf64debb 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport-nospice.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport-nospice.args -index 4ed60f8da2..e08ec0a986 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport-nospice.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport-nospice.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args -index 86bdc2cd6c..7d6ac361d7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args -index e5fc807493..ec000e9949 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args -index 7d12cd6c96..4731e28490 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args -index 259a562257..7828afcdc3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args -index 8798554d3a..760da03dff 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args b/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args -index 688b7c7f63..d3d32b4e2b 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem-plain-doorbell.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-shmem.args b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args -index bdf660a3c4..b7ec7ad05a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-shmem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-shmem.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smbios.args b/tests/qemuxml2argvdata/qemuxml2argv-smbios.args -index 34753d7ffb..479df4a8aa 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-smbios.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-smbios.args -@@ -19,7 +19,9 @@ uuid=c7a5fdbd-edaf-9455-926a-d65c16db1809,sku=1234567890,family=Red Hat' \ - serial=CZC1065993,asset=CZC1065993,location=Upside down' \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smp.args b/tests/qemuxml2argvdata/qemuxml2argv-smp.args -index 06fc811535..c2ccb2339e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-smp.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-smp.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound-device.args b/tests/qemuxml2argvdata/qemuxml2argv-sound-device.args -index 6735182b4c..497a61bd5e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-sound-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound.args b/tests/qemuxml2argvdata/qemuxml2argv-sound.args -index 0ee5c500fb..c1fe2b3dd6 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-sound.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args -index 3cdd980033..2334637e0a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11d7cd22-da89-3094-6212-079a48a309a1 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-TPM-VM/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-TPM-VM/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -boot c \ - -usb \ - -tpmdev passthrough,id=tpm-tpm0,path=/dev/tpm0,\ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args -index 36237d6454..225ba47578 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-default-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device piix3-usb-uhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args -index 6ea531fb6f..f34dd70092 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-explicit-q35.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-q35-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device nec-usb-xhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args -index 8adb3022f6..610e413994 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-controller-qemu-xhci.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device qemu-xhci,p2=8,p3=8,id=usb,bus=pci.0,addr=0x3 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-vcpu-placement-static.args b/tests/qemuxml2argvdata/qemuxml2argv-vcpu-placement-static.args -index 387ffd20ec..fd562bfb59 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-vcpu-placement-static.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-vcpu-placement-static.args -@@ -15,6 +15,8 @@ QEMU_AUDIO_DRV=none \ - -uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-dummy2/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-dummy2/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args -index 3de081b0cb..3e9fdcf42c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=none \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid cdbebdfa-1d6d-65c3-be0f-fd74b978a773 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -index f81fd99bb7..42e4220957 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args -index fa2c50517b..7ae9eb04bd 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.args -index 967838967d..4eb10cf6b3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-heads.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args -index 92db6f88c0..ceef16be15 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.args -index 84abe6b895..4f704aa656 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-noheads.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -index 6e157e20a3..c2c11794c7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args -index 7c7a0f12b1..239586e70a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args -index a5c2509c8f..753c7abc95 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args -index d93839389b..7d9afc1a35 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args -index a2663392b8..8bb65e58f7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args -index 411a2eedbc..952da6065c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-qxl-heads.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args -index 1107409250..cf23213779 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-secondary.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-secondary.args -index 9d47e87986..a82ff719e4 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-secondary.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-secondary.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args -index 84439cddcd..89810f632d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args -@@ -12,7 +12,9 @@ QEMU_AUDIO_DRV=spice \ - -smp 1,sockets=1,cores=1,threads=1 \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args -index 0131be8ddb..049f810417 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args -index fefa2b6943..cc41916957 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-vga.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-input-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-input-passthrough.args -index 287de66eae..0ea96a3bd1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-input-passthrough.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-input-passthrough.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-input.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-input.args -index 9baefc49ed..2b810d42a7 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-input.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-input.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.args -index 22df96f6fe..560077213c 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid bba65c0e-c049-934f-b6aa-4e2c0582acdf \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-test/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-test/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot dc \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -index ce0388dfc2..5509de5346 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -device virtio-scsi-pci,iommu_platform=on,ats=on,id=scsi0,bus=pci.0,addr=0x8 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args -index 11b7e82eeb..d68289b99a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-default.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.args -index 3c069d7171..ee441f62ef 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args -index 8f8159aeaa..dad1a176aa 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-multiple.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args -index a613cd6300..1bfdf9390f 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args -index 641f238520..39e4fe5df3 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args -@@ -14,7 +14,9 @@ QEMU_AUDIO_DRV=none \ - -nographic \ - -nodefconfig \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args -index a0a726c33e..ff94fd6a1a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-injectnmi.args b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-injectnmi.args -index 6bf6f3d72f..d2f3276156 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-injectnmi.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-injectnmi.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.args b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.args -index fd5d4a7e49..d76fc5839d 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.args -@@ -13,7 +13,9 @@ QEMU_AUDIO_DRV=none \ - -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ - -nographic \ - -nodefaults \ ---monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -+server,nowait \ -+-mon chardev=charmonitor,id=monitor,mode=readline \ - -no-acpi \ - -boot c \ - -usb \ --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-command-support-chardev-for-platform-devices.patch b/SOURCES/libvirt-qemu-command-support-chardev-for-platform-devices.patch deleted file mode 100644 index a669d33..0000000 --- a/SOURCES/libvirt-qemu-command-support-chardev-for-platform-devices.patch +++ /dev/null @@ -1,347 +0,0 @@ -From d3a9364d3c7789e3c234a361f24c20405f61216e Mon Sep 17 00:00:00 2001 -Message-Id: -From: Cole Robinson -Date: Tue, 11 Jul 2017 10:57:48 +0200 -Subject: [PATCH] qemu: command: support -chardev for platform devices - -Some qemu arch/machine types have built in platform devices that -are always implicitly available. For platform serial devices, the -current code assumes that only old style -serial config can be -used for these devices. - -Apparently though since -chardev was introduced, we can use -chardev -in these cases, like this: - - -chardev pty,id=foo - -serial chardev:foo - -Since -chardev enables all sorts of modern features, use this method -for platform devices. - -Reviewed-by: Andrea Bolognani -Signed-off-by: Cole Robinson -(cherry picked from commit 426dc5eb28bade109bf27bdd10d7305a040b4a3e) - -Conflicts: - - * src/qemu/qemu_command.c: - - caused by fcd922427cf6a264d3cb89915481be6594e6df03 not being - in the tree; resolved by removing the chardevStdioLogd argument - from the call to qemuBuildChrChardevStr(). - -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435681 - -Signed-off-by: Andrea Bolognani -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 123 ++------------------- - src/qemu/qemu_process.c | 9 +- - .../qemuxml2argv-aarch64-kvm-32-on-64.args | 3 +- - ...l2argv-aarch64-virt-2.6-virtio-pci-default.args | 3 +- - .../qemuxml2argv-aarch64-virt-virtio.args | 3 +- - .../qemuxml2argv-aarch64-virtio-pci-default.args | 3 +- - .../qemuxml2argv-arm-vexpressa9-basic.args | 3 +- - .../qemuxml2argv-arm-vexpressa9-virtio.args | 3 +- - .../qemuxml2argv-arm-virt-virtio.args | 3 +- - tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 3 +- - .../qemuxml2argv-ppce500-serial.args | 3 +- - 11 files changed, 31 insertions(+), 128 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 3517329a6b..69f4323a3b 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -5508,106 +5508,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, - return 0; - } - --static char * --qemuBuildChrArgStr(const virDomainChrSourceDef *dev, -- const char *prefix) --{ -- virBuffer buf = VIR_BUFFER_INITIALIZER; -- -- if (dev->logfile) { -- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -- _("logfile not supported in this QEMU binary")); -- goto error; -- } -- -- if (prefix) -- virBufferAdd(&buf, prefix, strlen(prefix)); -- -- switch ((virDomainChrType)dev->type) { -- case VIR_DOMAIN_CHR_TYPE_NULL: -- virBufferAddLit(&buf, "null"); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_VC: -- virBufferAddLit(&buf, "vc"); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_PTY: -- virBufferAddLit(&buf, "pty"); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_DEV: -- virBufferStrcat(&buf, dev->data.file.path, NULL); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_FILE: -- virBufferAsprintf(&buf, "file:%s", dev->data.file.path); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_PIPE: -- virBufferAsprintf(&buf, "pipe:%s", dev->data.file.path); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_STDIO: -- virBufferAddLit(&buf, "stdio"); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_UDP: { -- const char *connectHost = dev->data.udp.connectHost; -- const char *bindHost = dev->data.udp.bindHost; -- const char *bindService = dev->data.udp.bindService; -- -- if (connectHost == NULL) -- connectHost = ""; -- if (bindHost == NULL) -- bindHost = ""; -- if (bindService == NULL) -- bindService = "0"; -- -- virBufferAsprintf(&buf, "udp:%s:%s@%s:%s", -- connectHost, -- dev->data.udp.connectService, -- bindHost, -- bindService); -- break; -- } -- case VIR_DOMAIN_CHR_TYPE_TCP: -- if (dev->data.tcp.protocol == VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET) { -- virBufferAsprintf(&buf, "telnet:%s:%s%s", -- dev->data.tcp.host, -- dev->data.tcp.service, -- dev->data.tcp.listen ? ",server,nowait" : ""); -- } else { -- virBufferAsprintf(&buf, "tcp:%s:%s%s", -- dev->data.tcp.host, -- dev->data.tcp.service, -- dev->data.tcp.listen ? ",server,nowait" : ""); -- } -- break; -- -- case VIR_DOMAIN_CHR_TYPE_UNIX: -- virBufferAsprintf(&buf, "unix:%s%s", -- dev->data.nix.path, -- dev->data.nix.listen ? ",server,nowait" : ""); -- break; -- -- case VIR_DOMAIN_CHR_TYPE_SPICEVMC: -- case VIR_DOMAIN_CHR_TYPE_SPICEPORT: -- case VIR_DOMAIN_CHR_TYPE_NMDM: -- case VIR_DOMAIN_CHR_TYPE_LAST: -- break; -- } -- -- if (virBufferCheckError(&buf) < 0) -- goto error; -- -- return virBufferContentAndReset(&buf); -- -- error: -- virBufferFreeAndReset(&buf); -- return NULL; --} -- - - static int - qemuBuildMonitorCommandLine(virLogManagerPtr logManager, -@@ -9187,25 +9087,22 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager, - if (serial->source->type == VIR_DOMAIN_CHR_TYPE_SPICEPORT && !havespice) - continue; - -+ if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -+ serial->source, -+ serial->info.alias, -+ qemuCaps, true))) -+ return -1; -+ virCommandAddArg(cmd, "-chardev"); -+ virCommandAddArg(cmd, devstr); -+ VIR_FREE(devstr); -+ - /* Use -chardev with -device if they are available */ - if (virQEMUCapsSupportsChardev(def, qemuCaps, serial)) { -- if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, -- serial->source, -- serial->info.alias, -- qemuCaps, true))) -- return -1; -- virCommandAddArg(cmd, "-chardev"); -- virCommandAddArg(cmd, devstr); -- VIR_FREE(devstr); -- - if (qemuBuildChrDeviceCommandLine(cmd, def, serial, qemuCaps) < 0) - return -1; - } else { - virCommandAddArg(cmd, "-serial"); -- if (!(devstr = qemuBuildChrArgStr(serial->source, NULL))) -- return -1; -- virCommandAddArg(cmd, devstr); -- VIR_FREE(devstr); -+ virCommandAddArgFormat(cmd, "chardev:char%s", serial->info.alias); - } - } - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 4d7c8d8e40..274309030e 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -1877,8 +1877,8 @@ qemuProcessMonitorReportLogError(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - - - static int --qemuProcessLookupPTYs(virDomainDefPtr def, -- virQEMUCapsPtr qemuCaps, -+qemuProcessLookupPTYs(virDomainDefPtr def ATTRIBUTE_UNUSED, -+ virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, - virDomainChrDefPtr *devices, - int count, - virHashTablePtr info) -@@ -1887,14 +1887,11 @@ qemuProcessLookupPTYs(virDomainDefPtr def, - - for (i = 0; i < count; i++) { - virDomainChrDefPtr chr = devices[i]; -- bool chardevfmt = virQEMUCapsSupportsChardev(def, qemuCaps, chr); -- - if (chr->source->type == VIR_DOMAIN_CHR_TYPE_PTY) { - char id[32]; - qemuMonitorChardevInfoPtr entry; - -- if (snprintf(id, sizeof(id), "%s%s", -- chardevfmt ? "char" : "", -+ if (snprintf(id, sizeof(id), "char%s", - chr->info.alias) >= sizeof(id)) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to format device alias " -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -index 4c95c32a05..9893b116f2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-kvm-32-on-64.args -@@ -26,4 +26,5 @@ server,nowait \ - -device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \ - -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -index c640edc6fb..662259e229 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args -@@ -33,7 +33,8 @@ path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ - id=virtio-disk0 \ - -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:09:a4:37,bus=pci.2,addr=0x1 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -chardev pty,id=charconsole1 \ - -device virtconsole,chardev=charconsole1,id=console1 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x4 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -index eca4c4bacf..b1f7e6ea5e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args -@@ -29,7 +29,8 @@ path=/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ - -device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \ - -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -chardev pty,id=charconsole1 \ - -device virtconsole,chardev=charconsole1,id=console1 \ - -device virtio-balloon-device,id=balloon0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -index a5bc66ecd2..28ec390a13 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args -@@ -37,7 +37,8 @@ addr=0x1 \ - id=virtio-disk0 \ - -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:09:a4:37,bus=pci.1,addr=0x0 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -chardev pty,id=charconsole1 \ - -device virtconsole,chardev=charconsole1,id=console1 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.4,addr=0x0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -index 198e663d6f..73d1314b57 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args -@@ -27,4 +27,5 @@ server,nowait \ - -drive file=/arm.raw,format=raw,if=sd,index=0 \ - -net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=lan9118,name=net0 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -index 1402fead1c..850775177e 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args -@@ -29,7 +29,8 @@ server,nowait \ - -device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \ - -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -chardev pty,id=charconsole1 \ - -device virtconsole,chardev=charconsole1,id=console1 \ - -device virtio-balloon-device,id=balloon0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -index d391a4d02a..f051839dd1 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-arm-virt-virtio.args -@@ -27,7 +27,8 @@ server,nowait \ - -device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \ - -device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \ - -net user,vlan=0,name=hostnet0 \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -chardev pty,id=charconsole1 \ - -device virtconsole,chardev=charconsole1,id=console1 \ - -device virtio-balloon-device,id=balloon0 \ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -index 182744c236..2cdb45e35a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args -@@ -22,5 +22,6 @@ server,nowait \ - -append 'root=/dev/ram rw console=ttyS0,115200' \ - -dtb /media/ram/test.dtb \ - -usb \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args -index 87f4ee5e43..56b0a1c494 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args -@@ -21,5 +21,6 @@ server,nowait \ - -initrd /media/ram/ramdisk \ - -append 'root=/dev/ram rw console=ttyS0,115200' \ - -usb \ ---serial pty \ -+-chardev pty,id=charserial0 \ -+-serial chardev:charserial0 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-do-not-crash-on-USB-address-with-no-port-and-invalid-bus.patch b/SOURCES/libvirt-qemu-do-not-crash-on-USB-address-with-no-port-and-invalid-bus.patch deleted file mode 100644 index dffa58f..0000000 --- a/SOURCES/libvirt-qemu-do-not-crash-on-USB-address-with-no-port-and-invalid-bus.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 74f7abdf0e567914abc12319f1e3d723e18d0d6d Mon Sep 17 00:00:00 2001 -Message-Id: <74f7abdf0e567914abc12319f1e3d723e18d0d6d@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 13 Apr 2017 12:05:48 +0200 -Subject: [PATCH] qemu: do not crash on USB address with no port and invalid - bus -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Properly error out when the user requests a port from a bus -that does not have a controller present in the domain XML. - -https://bugzilla.redhat.com/show_bug.cgi?id=1441589 -(cherry picked from commit b003b9781b6ae633cfe4fdf6b9620ca246fa2432) -Signed-off-by: Ján Tomko ---- - src/conf/domain_addr.c | 3 ++- - .../qemuxml2argv-usb-bus-missing.xml | 22 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 3 +++ - 3 files changed, 27 insertions(+), 1 deletion(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-bus-missing.xml - -diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c -index 35bdc3453..8b6109199 100644 ---- a/src/conf/domain_addr.c -+++ b/src/conf/domain_addr.c -@@ -2009,7 +2009,8 @@ virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs, - - if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { - VIR_DEBUG("A USB port on bus %u was requested", info->addr.usb.bus); -- if (!addrs->buses[info->addr.usb.bus]) { -+ if (info->addr.usb.bus >= addrs->nbuses || -+ !addrs->buses[info->addr.usb.bus]) { - virReportError(VIR_ERR_XML_ERROR, - _("USB bus %u requested but no controller " - "with that index is present"), info->addr.usb.bus); -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-bus-missing.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-bus-missing.xml -new file mode 100644 -index 000000000..831a4c0af ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-bus-missing.xml -@@ -0,0 +1,22 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ /usr/bin/qemu-system-i686 -+ -+ -+ -+
      -+ -+ -+
      -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index cfd6dcd55..94be771d3 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -1349,6 +1349,9 @@ mymain(void) - DO_TEST("usb-port-missing", - QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); -+ DO_TEST_PARSE_ERROR("usb-bus-missing", -+ QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, -+ QEMU_CAPS_NODEFCONFIG); - DO_TEST("usb-ports", - QEMU_CAPS_CHARDEV, QEMU_CAPS_USB_HUB, - QEMU_CAPS_NODEFCONFIG); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-domain-Despaghettify-qemuDomainDeviceDefValidate.patch b/SOURCES/libvirt-qemu-domain-Despaghettify-qemuDomainDeviceDefValidate.patch new file mode 100644 index 0000000..df9427a --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Despaghettify-qemuDomainDeviceDefValidate.patch @@ -0,0 +1,223 @@ +From 1747bfd95ad80d2453de11e99a7bf9fa53c9aa55 Mon Sep 17 00:00:00 2001 +Message-Id: <1747bfd95ad80d2453de11e99a7bf9fa53c9aa55@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:14 +0100 +Subject: [PATCH] qemu: domain: Despaghettify qemuDomainDeviceDefValidate + +Move network device validation into a separate function. + +(cherry picked from commit 577ccd07c35a8e9b9d682778cc7d6c1d34d891f9) + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 184 ++++++++++++++++++++++++++----------------------- + 1 file changed, 97 insertions(+), 87 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 72d67adfe3..30a602a1e9 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3553,102 +3553,112 @@ qemuDomainWatchdogDefValidate(const virDomainWatchdogDef *dev, + } + + ++static int ++qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net) ++{ ++ bool hasIPv4 = false; ++ bool hasIPv6 = false; ++ size_t i; ++ ++ if (net->type == VIR_DOMAIN_NET_TYPE_USER) { ++ if (net->guestIP.nroutes) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Invalid attempt to set network interface " ++ "guest-side IP route, not supported by QEMU")); ++ return -1; ++ } ++ ++ for (i = 0; i < net->guestIP.nips; i++) { ++ const virNetDevIPAddr *ip = net->guestIP.ips[i]; ++ ++ if (VIR_SOCKET_ADDR_VALID(&net->guestIP.ips[i]->peer)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Invalid attempt to set peer IP for guest")); ++ return -1; ++ } ++ ++ if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) { ++ if (hasIPv4) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Only one IPv4 address per " ++ "interface is allowed")); ++ return -1; ++ } ++ hasIPv4 = true; ++ ++ if (ip->prefix > 27) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("prefix too long")); ++ return -1; ++ } ++ } ++ ++ if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) { ++ if (hasIPv6) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Only one IPv6 address per " ++ "interface is allowed")); ++ return -1; ++ } ++ hasIPv6 = true; ++ ++ if (ip->prefix > 120) { ++ virReportError(VIR_ERR_XML_ERROR, "%s", ++ _("prefix too long")); ++ return -1; ++ } ++ } ++ } ++ } else if (net->guestIP.nroutes || net->guestIP.nips) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("Invalid attempt to set network interface " ++ "guest-side IP route and/or address info, " ++ "not supported by QEMU")); ++ return -1; ++ } ++ ++ if (STREQ_NULLABLE(net->model, "virtio")) { ++ if (net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queue_size - 1)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("rx_queue_size has to be a power of two")); ++ return -1; ++ } ++ if (net->driver.virtio.tx_queue_size & (net->driver.virtio.tx_queue_size - 1)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("tx_queue_size has to be a power of two")); ++ return -1; ++ } ++ } ++ ++ if (net->mtu && ++ !qemuDomainNetSupportsMTU(net->type)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("setting MTU on interface type %s is not supported yet"), ++ virDomainNetTypeToString(net->type)); ++ return -1; ++ } ++ ++ if (net->coalesce && !qemuDomainNetSupportsCoalesce(net->type)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("coalesce settings on interface type %s are not supported"), ++ virDomainNetTypeToString(net->type)); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def, + void *opaque ATTRIBUTE_UNUSED) + { + int ret = -1; +- size_t i; + + if (dev->type == VIR_DOMAIN_DEVICE_NET) { +- const virDomainNetDef *net = dev->data.net; +- bool hasIPv4 = false, hasIPv6 = false; +- +- if (net->type == VIR_DOMAIN_NET_TYPE_USER) { +- if (net->guestIP.nroutes) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Invalid attempt to set network interface " +- "guest-side IP route, not supported by QEMU")); +- goto cleanup; +- } +- +- for (i = 0; i < net->guestIP.nips; i++) { +- const virNetDevIPAddr *ip = net->guestIP.ips[i]; +- +- if (VIR_SOCKET_ADDR_VALID(&net->guestIP.ips[i]->peer)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Invalid attempt to set peer IP for guest")); +- goto cleanup; +- } +- +- if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) { +- if (hasIPv4) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Only one IPv4 address per " +- "interface is allowed")); +- goto cleanup; +- } +- hasIPv4 = true; +- +- if (ip->prefix > 27) { +- virReportError(VIR_ERR_XML_ERROR, "%s", +- _("prefix too long")); +- goto cleanup; +- } +- } +- +- if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) { +- if (hasIPv6) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Only one IPv6 address per " +- "interface is allowed")); +- goto cleanup; +- } +- hasIPv6 = true; +- +- if (ip->prefix > 120) { +- virReportError(VIR_ERR_XML_ERROR, "%s", +- _("prefix too long")); +- goto cleanup; +- } +- } +- } +- } else if (net->guestIP.nroutes || net->guestIP.nips) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("Invalid attempt to set network interface " +- "guest-side IP route and/or address info, " +- "not supported by QEMU")); ++ if (qemuDomainDeviceDefValidateNetwork(dev->data.net) < 0) + goto cleanup; +- } +- +- if (STREQ_NULLABLE(net->model, "virtio")) { +- if (net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queue_size - 1)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("rx_queue_size has to be a power of two")); +- goto cleanup; +- } +- if (net->driver.virtio.tx_queue_size & (net->driver.virtio.tx_queue_size - 1)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("tx_queue_size has to be a power of two")); +- goto cleanup; +- } +- } +- +- if (net->mtu && +- !qemuDomainNetSupportsMTU(net->type)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("setting MTU on interface type %s is not supported yet"), +- virDomainNetTypeToString(net->type)); +- goto cleanup; +- } +- +- if (net->coalesce && !qemuDomainNetSupportsCoalesce(net->type)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("coalesce settings on interface type %s are not supported"), +- virDomainNetTypeToString(net->type)); +- goto cleanup; +- } + } else if (dev->type == VIR_DOMAIN_DEVICE_CHR) { + if (qemuDomainChrDefValidate(dev->data.chr, def) < 0) + goto cleanup; +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Don-t-allocate-storage-source-private-data-if-not-needed.patch b/SOURCES/libvirt-qemu-domain-Don-t-allocate-storage-source-private-data-if-not-needed.patch new file mode 100644 index 0000000..bc349d7 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Don-t-allocate-storage-source-private-data-if-not-needed.patch @@ -0,0 +1,50 @@ +From f0ec77f06f7f72d29748c2a04877ac97632ef63b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Mon, 13 Nov 2017 13:43:22 +0100 +Subject: [PATCH] qemu: domain: Don't allocate storage source private data if + not needed + +(cherry picked from commit 2c82fddca93ea83736260a5a90040fb5fa391e9a) +https://bugzilla.redhat.com/show_bug.cgi?id=1510323 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 27117d83ef..81f45516af 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -1385,13 +1385,18 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn, + { + virStorageSourcePtr src = disk->src; + qemuDomainStorageSourcePrivatePtr srcPriv; ++ bool hasAuth = qemuDomainSecretDiskCapable(src); ++ bool hasEnc = qemuDomainDiskHasEncryptionSecret(src); ++ ++ if (!hasAuth && !hasEnc) ++ return 0; + + if (!(disk->src->privateData = qemuDomainStorageSourcePrivateNew())) + return -1; + + srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); + +- if (qemuDomainSecretDiskCapable(src)) { ++ if (hasAuth) { + virSecretUsageType usageType = VIR_SECRET_USAGE_TYPE_ISCSI; + + if (src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) +@@ -1404,7 +1409,7 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn, + return -1; + } + +- if (qemuDomainDiskHasEncryptionSecret(src)) { ++ if (hasEnc) { + if (!(srcPriv->encinfo = + qemuDomainSecretInfoNew(conn, priv, disk->info.alias, + VIR_SECRET_USAGE_TYPE_VOLUME, NULL, +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Don-t-call-namespace-setup-for-storage-already-accessed-by-vm.patch b/SOURCES/libvirt-qemu-domain-Don-t-call-namespace-setup-for-storage-already-accessed-by-vm.patch new file mode 100644 index 0000000..5dd8f09 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Don-t-call-namespace-setup-for-storage-already-accessed-by-vm.patch @@ -0,0 +1,138 @@ +From 2570986655a119553082702dad8f256fb72ead75 Mon Sep 17 00:00:00 2001 +Message-Id: <2570986655a119553082702dad8f256fb72ead75@dist-git> +From: Peter Krempa +Date: Wed, 22 Nov 2017 18:21:35 +0100 +Subject: [PATCH] qemu: domain: Don't call namespace setup for storage already + accessed by vm + +When doing block commit we need to allow write for members of the +backing chain so that we can commit the data into them. + +qemuDomainDiskChainElementPrepare was used for this which since commit +786d8d91b4 calls qemuDomainNamespaceSetupDisk which has very adverse +side-effects, namely it relabels the nodes to the same label it has in +the main namespace. This was messing up permissions for the commit +operation since its touching various parts of a single backing chain. + +Since we are are actually not introducing new images at that point add a +flag for qemuDomainDiskChainElementPrepare which will refrain from +calling to the namespace setup function. + +Calls from qemuDomainSnapshotCreateSingleDiskActive and +qemuDomainBlockCopyCommon do introduce new members all calls from +qemuDomainBlockCommit do not, so the calls are anotated accordingly. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1506072 +(cherry picked from commit 3746a38e7b9ae5342675547624122d55e73d6c81) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 17 ++++++++++++++--- + src/qemu/qemu_domain.h | 3 ++- + src/qemu/qemu_driver.c | 12 ++++++------ + 3 files changed, 22 insertions(+), 10 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 485e085cea..72d67adfe3 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -6074,15 +6074,25 @@ qemuDomainDiskChainElementRevoke(virQEMUDriverPtr driver, + + /** + * qemuDomainDiskChainElementPrepare: ++ * @driver: qemu driver data ++ * @vm: domain object ++ * @elem: source structure to set access for ++ * @readonly: setup read-only access if true ++ * @newSource: @elem describes a storage source which @vm can't access yet + * + * Allow a VM access to a single element of a disk backing chain; this helper + * ensures that the lock manager, cgroup device controller, and security manager +- * labelling are all aware of each new file before it is added to a chain */ ++ * labelling are all aware of each new file before it is added to a chain. ++ * ++ * When modifying permissions of @elem which @vm can already access (is in the ++ * backing chain) @newSource needs to be set to false. ++ */ + int + qemuDomainDiskChainElementPrepare(virQEMUDriverPtr driver, + virDomainObjPtr vm, + virStorageSourcePtr elem, +- bool readonly) ++ bool readonly, ++ bool newSource) + { + bool was_readonly = elem->readonly; + virQEMUDriverConfigPtr cfg = NULL; +@@ -6095,7 +6105,8 @@ qemuDomainDiskChainElementPrepare(virQEMUDriverPtr driver, + if (virDomainLockImageAttach(driver->lockManager, cfg->uri, vm, elem) < 0) + goto cleanup; + +- if (qemuDomainNamespaceSetupDisk(driver, vm, elem) < 0) ++ if (newSource && ++ qemuDomainNamespaceSetupDisk(driver, vm, elem) < 0) + goto cleanup; + + if (qemuSetupImageCgroup(vm, elem) < 0) +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index ff5328277c..caf583373f 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -688,7 +688,8 @@ void qemuDomainDiskChainElementRevoke(virQEMUDriverPtr driver, + int qemuDomainDiskChainElementPrepare(virQEMUDriverPtr driver, + virDomainObjPtr vm, + virStorageSourcePtr elem, +- bool readonly); ++ bool readonly, ++ bool newSource); + + int qemuDomainCleanupAdd(virDomainObjPtr vm, + qemuDomainCleanupCallback cb); +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 6096e00b2a..b35ab6d30e 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -14578,7 +14578,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver, + } + + /* set correct security, cgroup and locking options on the new image */ +- if (qemuDomainDiskChainElementPrepare(driver, vm, dd->src, false) < 0) { ++ if (qemuDomainDiskChainElementPrepare(driver, vm, dd->src, false, true) < 0) { + qemuDomainDiskChainElementRevoke(driver, vm, dd->src); + goto cleanup; + } +@@ -17173,7 +17173,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, + keepParentLabel) < 0) + goto endjob; + +- if (qemuDomainDiskChainElementPrepare(driver, vm, mirror, false) < 0) { ++ if (qemuDomainDiskChainElementPrepare(driver, vm, mirror, false, true) < 0) { + qemuDomainDiskChainElementRevoke(driver, vm, mirror); + goto endjob; + } +@@ -17566,9 +17566,9 @@ qemuDomainBlockCommit(virDomainPtr dom, + * operation succeeds, but doing that requires tracking the + * operation in XML across libvirtd restarts. */ + clean_access = true; +- if (qemuDomainDiskChainElementPrepare(driver, vm, baseSource, false) < 0 || ++ if (qemuDomainDiskChainElementPrepare(driver, vm, baseSource, false, false) < 0 || + (top_parent && top_parent != disk->src && +- qemuDomainDiskChainElementPrepare(driver, vm, top_parent, false) < 0)) ++ qemuDomainDiskChainElementPrepare(driver, vm, top_parent, false, false) < 0)) + goto endjob; + + /* Start the commit operation. Pass the user's original spelling, +@@ -17612,9 +17612,9 @@ qemuDomainBlockCommit(virDomainPtr dom, + if (ret < 0 && clean_access) { + virErrorPtr orig_err = virSaveLastError(); + /* Revert access to read-only, if possible. */ +- qemuDomainDiskChainElementPrepare(driver, vm, baseSource, true); ++ qemuDomainDiskChainElementPrepare(driver, vm, baseSource, true, false); + if (top_parent && top_parent != disk->src) +- qemuDomainDiskChainElementPrepare(driver, vm, top_parent, true); ++ qemuDomainDiskChainElementPrepare(driver, vm, top_parent, true, false); + + if (orig_err) { + virSetError(orig_err); +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Fix-backing-store-terminator-for-non-backing-local-files.patch b/SOURCES/libvirt-qemu-domain-Fix-backing-store-terminator-for-non-backing-local-files.patch new file mode 100644 index 0000000..6d27d1b --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Fix-backing-store-terminator-for-non-backing-local-files.patch @@ -0,0 +1,186 @@ +From d3cf944874059fd81b68f8cc0beef6b8b69490bb Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Fri, 1 Dec 2017 15:57:03 +0100 +Subject: [PATCH] qemu: domain: Fix backing store terminator for non-backing + local files + +Raw local files do not pass through the backing store detector and thus +the code did not allocate the required backing store terminator for +them. Previously the terminating element would be formatted into the XML +since the default values used for the metadata allowed that. This is a +regression since a693fdba0111ff which was not detected in the review. + +This patch also reverts all the changes in the test files. + +(cherry picked from commit adcc31bb89e47ef642cbcfcff372131db7cd8d8b) + + Conflicts: + src/qemu/qemu_domain.c - as with previous patch the return code + logic hat do be negated + +https://bugzilla.redhat.com/show_bug.cgi?id=1509110 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 7 +++++++ + .../qemuhotplug-base-ccw-live+ccw-virtio.xml | 1 + + ...otplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 2 ++ + .../qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 1 + + ...hotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 1 + + .../qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 1 + + ...qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml | 1 + + tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml | 1 + + tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml | 1 + + tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml | 1 + + .../qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml | 1 + + 11 files changed, 18 insertions(+) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 33cb3df949..9dd9db049b 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -6372,6 +6372,13 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, + goto cleanup; + } + ++ /* terminate the chain for such images as the code below would do */ ++ if (!disk->src->backingStore && ++ VIR_ALLOC(disk->src->backingStore) < 0) { ++ ret = -1; ++ goto cleanup; ++ } ++ + goto cleanup; + } + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +index 0fa8d036b9..cd03d0e09b 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml +index 135427fff5..7be75f977b 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +@@ -31,6 +32,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml +index e17c4e43b2..a83f1b5d73 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml +index 326d312fa9..3e90207519 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml +index 326d312fa9..3e90207519 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml +index 16caeb3542..4c3ea3202b 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml +@@ -33,6 +33,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml +index a6dbf0b1bd..493a615fd3 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml +index 6ccb88f140..3609819ea3 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml +index b97c0b41e2..b88b220e33 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml +index 6422e1640d..c12d18f716 100644 +--- a/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml ++++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml +@@ -22,6 +22,7 @@ + + + ++ + + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-domain-Move-hostdev-validation-into-separate-function.patch b/SOURCES/libvirt-qemu-domain-Move-hostdev-validation-into-separate-function.patch new file mode 100644 index 0000000..5588ea5 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Move-hostdev-validation-into-separate-function.patch @@ -0,0 +1,65 @@ +From 413eb4cbdddfd7ecc3fd12320a59033c76f878cc Mon Sep 17 00:00:00 2001 +Message-Id: <413eb4cbdddfd7ecc3fd12320a59033c76f878cc@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:15 +0100 +Subject: [PATCH] qemu: domain: Move hostdev validation into separate function + +(cherry picked from commit a6936ec0987f6b014516e4d51b44c9c9de57a6cb) + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 30 ++++++++++++++++++++---------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 30a602a1e9..13b96368c1 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3649,6 +3649,23 @@ qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net) + } + + ++static int ++qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, ++ const virDomainDef *def) ++{ ++ /* forbid capabilities mode hostdev in this kind of hypervisor */ ++ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("hostdev mode 'capabilities' is not " ++ "supported in %s"), ++ virDomainVirtTypeToString(def->virtType)); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def, +@@ -3674,16 +3691,9 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + } else if (dev->type == VIR_DOMAIN_DEVICE_WATCHDOG) { + if (qemuDomainWatchdogDefValidate(dev->data.watchdog, def) < 0) + goto cleanup; +- } +- +- /* forbid capabilities mode hostdev in this kind of hypervisor */ +- if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && +- dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("hostdev mode 'capabilities' is not " +- "supported in %s"), +- virDomainVirtTypeToString(def->virtType)); +- goto cleanup; ++ } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { ++ if (qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def) < 0) ++ goto cleanup; + } + + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Move-video-device-validation-into-separate-function.patch b/SOURCES/libvirt-qemu-domain-Move-video-device-validation-into-separate-function.patch new file mode 100644 index 0000000..e804d01 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Move-video-device-validation-into-separate-function.patch @@ -0,0 +1,79 @@ +From 2cfaf0011f6462310f658a650fbdf998ed575ff0 Mon Sep 17 00:00:00 2001 +Message-Id: <2cfaf0011f6462310f658a650fbdf998ed575ff0@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:16 +0100 +Subject: [PATCH] qemu: domain: Move video device validation into separate + function + +(cherry picked from commit ab948b6299aa311c07bb46b79c6ccbe7d46fb94e) + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 43 ++++++++++++++++++++++++++----------------- + 1 file changed, 26 insertions(+), 17 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 13b96368c1..1b72d95d7e 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3666,6 +3666,29 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev, + } + + ++static int ++qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video) ++{ ++ if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && ++ video->vgamem) { ++ if (video->vgamem < 1024) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("value for 'vgamem' must be at least 1 MiB " ++ "(1024 KiB)")); ++ return -1; ++ } ++ ++ if (video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(video->vgamem)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", ++ _("value for 'vgamem' must be power of two")); ++ return -1; ++ } ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def, +@@ -3694,23 +3717,9 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { + if (qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def) < 0) + goto cleanup; +- } +- +- if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { +- if (dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && +- dev->data.video->vgamem) { +- if (dev->data.video->vgamem < 1024) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("value for 'vgamem' must be at least 1 MiB " +- "(1024 KiB)")); +- goto cleanup; +- } +- if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { +- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("value for 'vgamem' must be power of two")); +- goto cleanup; +- } +- } ++ } else if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { ++ if (qemuDomainDeviceDefValidateVideo(dev->data.video) < 0) ++ goto cleanup; + } + + ret = 0; +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Parse-and-format-relPath-into-disk-source-private-data.patch b/SOURCES/libvirt-qemu-domain-Parse-and-format-relPath-into-disk-source-private-data.patch new file mode 100644 index 0000000..5f899ce --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Parse-and-format-relPath-into-disk-source-private-data.patch @@ -0,0 +1,32 @@ +From c6ff8d075d0fd4b2819d1c4858ad2c8e8c45c051 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Thu, 14 Dec 2017 14:31:53 +0100 +Subject: [PATCH] qemu: domain: Parse and format relPath into disk source + private data + +Register the helpers directly to format and parse the data. + +https://bugzilla.redhat.com/show_bug.cgi?id=1523261 +(cherry picked from commit b3d0270c44b85944f91906225b27bca6700a6333) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 625bcb20d5..8967f2774d 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -2439,6 +2439,8 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { + .chrSourceNew = qemuDomainChrSourcePrivateNew, + .parse = qemuDomainObjPrivateXMLParse, + .format = qemuDomainObjPrivateXMLFormat, ++ .storageParse = virStorageSourcePrivateDataParseRelPath, ++ .storageFormat = virStorageSourcePrivateDataFormatRelPath, + }; + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-domain-Refactor-control-flow-in-qemuDomainDetermineDiskChain.patch b/SOURCES/libvirt-qemu-domain-Refactor-control-flow-in-qemuDomainDetermineDiskChain.patch new file mode 100644 index 0000000..397b0e9 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Refactor-control-flow-in-qemuDomainDetermineDiskChain.patch @@ -0,0 +1,52 @@ +From 3dcba116fd4e0a6df50b905b021151b30ef55714 Mon Sep 17 00:00:00 2001 +Message-Id: <3dcba116fd4e0a6df50b905b021151b30ef55714@dist-git> +From: Peter Krempa +Date: Fri, 1 Dec 2017 15:57:01 +0100 +Subject: [PATCH] qemu: domain: Refactor control flow in + qemuDomainDetermineDiskChain + +Split out clearing of the backing chain prior to other code since it +will be required later and optimize few layers of nested conditions and +loops. + +(cherry picked from commit b19710b9b6039728620a8d557a322ef139529226) + + Conflicts: + src/qemu/qemu_domain.c: + a92c4f7537577f1443ddd6fef4e0dfcb054e5f08 was not backported thus + the code skipping to the end of the backing chain is missing + + This patch only moves the block that clears the backing store + earlier so that the rest of the patches will apply + +https://bugzilla.redhat.com/show_bug.cgi?id=1509110 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 1b5f439621..13d120040b 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -6355,12 +6355,11 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, + if (virStorageSourceIsEmpty(disk->src)) + goto cleanup; + +- if (virStorageSourceHasBacking(disk->src)) { +- if (force_probe) +- virStorageSourceBackingStoreClear(disk->src); +- else +- goto cleanup; +- } ++ if (force_probe) ++ virStorageSourceBackingStoreClear(disk->src); ++ ++ if (virStorageSourceHasBacking(disk->src)) ++ goto cleanup; + + qemuDomainGetImageIds(cfg, vm, disk->src, &uid, &gid); + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-domain-Refactor-domain-device-validation-function.patch b/SOURCES/libvirt-qemu-domain-Refactor-domain-device-validation-function.patch new file mode 100644 index 0000000..e962ee9 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Refactor-domain-device-validation-function.patch @@ -0,0 +1,112 @@ +From 2d801f20547584950c0b312e5d6fbc975d65868e Mon Sep 17 00:00:00 2001 +Message-Id: <2d801f20547584950c0b312e5d6fbc975d65868e@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:17 +0100 +Subject: [PATCH] qemu: domain: Refactor domain device validation function + +Use a style that will discourage from adding inline checks. + +(cherry picked from commit 85b0e2f1260bb169298db5b44859be48426821f0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 79 +++++++++++++++++++++++++++++++++----------------- + 1 file changed, 52 insertions(+), 27 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 1b72d95d7e..1159be9980 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -3694,36 +3694,61 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def, + void *opaque ATTRIBUTE_UNUSED) + { +- int ret = -1; ++ int ret = 0; + +- if (dev->type == VIR_DOMAIN_DEVICE_NET) { +- if (qemuDomainDeviceDefValidateNetwork(dev->data.net) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_CHR) { +- if (qemuDomainChrDefValidate(dev->data.chr, def) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_SMARTCARD) { +- if (qemuDomainSmartcardDefValidate(dev->data.smartcard) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_RNG) { +- if (qemuDomainRNGDefValidate(dev->data.rng) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_REDIRDEV) { +- if (qemuDomainRedirdevDefValidate(dev->data.redirdev) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_WATCHDOG) { +- if (qemuDomainWatchdogDefValidate(dev->data.watchdog, def) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { +- if (qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def) < 0) +- goto cleanup; +- } else if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { +- if (qemuDomainDeviceDefValidateVideo(dev->data.video) < 0) +- goto cleanup; ++ switch ((virDomainDeviceType) dev->type) { ++ case VIR_DOMAIN_DEVICE_NET: ++ ret = qemuDomainDeviceDefValidateNetwork(dev->data.net); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_CHR: ++ ret = qemuDomainChrDefValidate(dev->data.chr, def); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_SMARTCARD: ++ ret = qemuDomainSmartcardDefValidate(dev->data.smartcard); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_RNG: ++ ret = qemuDomainRNGDefValidate(dev->data.rng); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_REDIRDEV: ++ ret = qemuDomainRedirdevDefValidate(dev->data.redirdev); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_WATCHDOG: ++ ret = qemuDomainWatchdogDefValidate(dev->data.watchdog, def); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_HOSTDEV: ++ ret = qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_VIDEO: ++ ret = qemuDomainDeviceDefValidateVideo(dev->data.video); ++ break; ++ ++ case VIR_DOMAIN_DEVICE_DISK: ++ case VIR_DOMAIN_DEVICE_LEASE: ++ case VIR_DOMAIN_DEVICE_FS: ++ case VIR_DOMAIN_DEVICE_INPUT: ++ case VIR_DOMAIN_DEVICE_SOUND: ++ case VIR_DOMAIN_DEVICE_CONTROLLER: ++ case VIR_DOMAIN_DEVICE_GRAPHICS: ++ case VIR_DOMAIN_DEVICE_HUB: ++ case VIR_DOMAIN_DEVICE_MEMBALLOON: ++ case VIR_DOMAIN_DEVICE_NVRAM: ++ case VIR_DOMAIN_DEVICE_SHMEM: ++ case VIR_DOMAIN_DEVICE_TPM: ++ case VIR_DOMAIN_DEVICE_PANIC: ++ case VIR_DOMAIN_DEVICE_MEMORY: ++ case VIR_DOMAIN_DEVICE_IOMMU: ++ case VIR_DOMAIN_DEVICE_NONE: ++ case VIR_DOMAIN_DEVICE_LAST: ++ break; + } + +- ret = 0; +- cleanup: + return ret; + } + +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Reject-shared-disk-access-if-backing-format-does-not-support-it.patch b/SOURCES/libvirt-qemu-domain-Reject-shared-disk-access-if-backing-format-does-not-support-it.patch new file mode 100644 index 0000000..2f3ab52 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Reject-shared-disk-access-if-backing-format-does-not-support-it.patch @@ -0,0 +1,150 @@ +From e335715f4f93b62641b8a3a780c8617b1db1434b Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:19 +0100 +Subject: [PATCH] qemu: domain: Reject shared disk access if backing format + does not support it + +Disk sharing between two VMs may corrupt the images if the format driver +does not support it. Check that the user declared use of a supported +storage format when they want to share the disk. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +(cherry picked from commit 3b03a27cd00c2f032661d2bf8905795425752fc7) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 27 +++++++++++++++++++++ + .../qemuxml2argv-disk-drive-shared-qcow.xml | 28 ++++++++++++++++++++++ + .../qemuxml2argv-disk-drive-shared.args | 2 +- + .../qemuxml2argv-disk-drive-shared.xml | 2 +- + tests/qemuxml2argvtest.c | 1 + + 5 files changed, 58 insertions(+), 2 deletions(-) + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-qcow.xml + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 1159be9980..2f987787cd 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -25,6 +25,7 @@ + + #include "qemu_domain.h" + #include "qemu_alias.h" ++#include "qemu_block.h" + #include "qemu_cgroup.h" + #include "qemu_command.h" + #include "qemu_process.h" +@@ -3689,6 +3690,29 @@ qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video) + } + + ++static int ++qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk) ++{ ++ if (disk->src->shared && !disk->src->readonly) { ++ if (disk->src->format <= VIR_STORAGE_FILE_AUTO) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("shared access for disk '%s' requires use of " ++ "explicitly specified disk format"), disk->dst); ++ return -1; ++ } ++ ++ if (!qemuBlockStorageSourceSupportsConcurrentAccess(disk->src)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("shared access for disk '%s' requires use of " ++ "supported storage format"), disk->dst); ++ return -1; ++ } ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + const virDomainDef *def, +@@ -3730,6 +3754,9 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, + break; + + case VIR_DOMAIN_DEVICE_DISK: ++ ret = qemuDomainDeviceDefValidateDisk(dev->data.disk); ++ break; ++ + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_FS: + case VIR_DOMAIN_DEVICE_INPUT: +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-qcow.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-qcow.xml +new file mode 100644 +index 0000000000..ca88a944b3 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared-qcow.xml +@@ -0,0 +1,28 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219136 ++ 219136 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-i686 ++ ++ ++ ++ ++ ++
      ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args +index 502157bf8c..326fde1b36 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args +@@ -19,7 +19,7 @@ server,nowait \ + -no-acpi \ + -boot c \ + -usb \ +--drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\ ++-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\ + serial=XYZXYZXYZYXXYZYZYXYZY,cache=none \ + -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ + -drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,media=cdrom,\ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml +index 9f74723783..677c2b0b7d 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml ++++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml +@@ -15,7 +15,7 @@ + + /usr/bin/qemu-system-i686 + +- ++ + + + +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index ff9c8608aa..00110cae19 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -908,6 +908,7 @@ mymain(void) + QEMU_CAPS_DRIVE_BOOT); + DO_TEST("disk-drive-shared", + QEMU_CAPS_DRIVE_SERIAL); ++ DO_TEST_PARSE_ERROR("disk-drive-shared-qcow", NONE); + DO_TEST("disk-drive-error-policy-stop", + QEMU_CAPS_MONITOR_JSON); + DO_TEST("disk-drive-error-policy-enospace", +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-domain-Store-vcpu-halted-state-as-a-tristate.patch b/SOURCES/libvirt-qemu-domain-Store-vcpu-halted-state-as-a-tristate.patch new file mode 100644 index 0000000..2731a00 --- /dev/null +++ b/SOURCES/libvirt-qemu-domain-Store-vcpu-halted-state-as-a-tristate.patch @@ -0,0 +1,96 @@ +From d75ea91fe4c95b17f928931637f65fcf317e986c Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Wed, 7 Feb 2018 14:16:01 +0100 +Subject: [PATCH] qemu: domain: Store vcpu halted state as a tristate + +Since it may be possible that the state is unknown in some cases we +should store it as a tristate so that other code using it can determine +whether the state was updated. + +(cherry picked from commit ca588a34b23a1f30dc7eeb7d5134706e31b403ef) + +https://bugzilla.redhat.com/show_bug.cgi?id=1534585 +--- + src/qemu/qemu_domain.c | 3 ++- + src/qemu/qemu_domain.h | 2 +- + src/qemu/qemu_driver.c | 13 ++++--------- + 3 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index b0c78cc7c4..e87c7d030c 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -8000,7 +8000,8 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver, + for (i = 0; i < maxvcpus; i++) { + vcpu = virDomainDefGetVcpu(vm->def, i); + vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); +- vcpupriv->halted = virBitmapIsBitSet(haltedmap, vcpupriv->qemu_id); ++ vcpupriv->halted = virTristateBoolFromBool(virBitmapIsBitSet(haltedmap, ++ vcpupriv->qemu_id)); + } + + ret = 0; +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index 1a82922415..19e58ef3be 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -389,7 +389,7 @@ struct _qemuDomainVcpuPrivate { + int enable_id; /* order in which the vcpus were enabled in qemu */ + int qemu_id; /* ID reported by qemu as 'CPU' in query-cpus */ + char *alias; +- bool halted; ++ virTristateBool halted; + + /* information for hotpluggable cpus */ + char *type; +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index b5bef7442e..b8022a06ba 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -19526,7 +19526,6 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; + virVcpuInfoPtr cpuinfo = NULL; + unsigned long long *cpuwait = NULL; +- bool vcpuhalted = false; + + if (virTypedParamsAddUInt(&record->params, + &record->nparams, +@@ -19546,15 +19545,11 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + VIR_ALLOC_N(cpuwait, virDomainDefGetVcpus(dom->def)) < 0) + goto cleanup; + +- if (HAVE_JOB(privflags) && virDomainObjIsActive(dom)) { +- if (qemuDomainRefreshVcpuHalted(driver, dom, +- QEMU_ASYNC_JOB_NONE) < 0) { ++ if (HAVE_JOB(privflags) && virDomainObjIsActive(dom) && ++ qemuDomainRefreshVcpuHalted(driver, dom, QEMU_ASYNC_JOB_NONE) < 0) { + /* it's ok to be silent and go ahead, because halted vcpu info + * wasn't here from the beginning */ + virResetLastError(); +- } else { +- vcpuhalted = true; +- } + } + + if (qemuDomainHelperGetVcpus(dom, cpuinfo, cpuwait, +@@ -19602,14 +19597,14 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + + vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); + +- if (vcpuhalted) { ++ if (vcpupriv->halted != VIR_TRISTATE_BOOL_ABSENT) { + snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, + "vcpu.%u.halted", cpuinfo[i].number); + if (virTypedParamsAddBoolean(&record->params, + &record->nparams, + maxparams, + param_name, +- vcpupriv->halted) < 0) ++ vcpupriv->halted == VIR_TRISTATE_BOOL_YES) < 0) + goto cleanup; + } + } +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-don-t-kill-qemu-process-on-restart-if-networkNotify-fails.patch b/SOURCES/libvirt-qemu-don-t-kill-qemu-process-on-restart-if-networkNotify-fails.patch deleted file mode 100644 index 638dae4..0000000 --- a/SOURCES/libvirt-qemu-don-t-kill-qemu-process-on-restart-if-networkNotify-fails.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 01c309a7d81daa85e7212e37c8b4b9dd2c08f898 Mon Sep 17 00:00:00 2001 -Message-Id: <01c309a7d81daa85e7212e37c8b4b9dd2c08f898@dist-git> -From: Laine Stump -Date: Tue, 2 May 2017 12:31:51 -0400 -Subject: [PATCH] qemu: don't kill qemu process on restart if networkNotify - fails - -Nothing that could happen during networkNotifyActualDevice() could -justify unceremoniously killing the qemu process, but that's what we -were doing. - -In particular, new code added in commit 85bcc022 (first appearred in -libvirt-3.2.0) attempts to reattach tap devices to their assigned -bridge devices when libvirtd restarts (to make it easier to recover -from a restart of a libvirt network). But if the network has been -stopped and *not* restarted, the bridge device won't exist and -networkNotifyActualDevice() will fail. - -This patch changes networkNotifyActualDevice() and -qemuProcessNotifyNets() to return void, so that qemuProcessReconnect() -will soldier on regardless of what happens (any errors will still be -logged though). - -Partially resolves: https://bugzilla.redhat.com/1442700 - -(cherry picked from commit cb182eb11d3a99adb06e188989899dcd488c43fc) - -Signed-off-by: Jiri Denemark ---- - src/network/bridge_driver.c | 10 ++++------ - src/network/bridge_driver.h | 7 +++---- - src/qemu/qemu_process.c | 9 +++------ - 3 files changed, 10 insertions(+), 16 deletions(-) - -diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c -index ef982363b..cb91a2c90 100644 ---- a/src/network/bridge_driver.c -+++ b/src/network/bridge_driver.c -@@ -4656,9 +4656,9 @@ networkAllocateActualDevice(virDomainDefPtr dom, - * order, or re-attach the interface's tap device to the network's - * bridge. - * -- * Returns 0 on success, -1 on failure. -+ * No return value (but does log any failures) - */ --int -+void - networkNotifyActualDevice(virDomainDefPtr dom, - virDomainNetDefPtr iface) - { -@@ -4668,11 +4668,10 @@ networkNotifyActualDevice(virDomainDefPtr dom, - virNetworkDefPtr netdef; - virNetworkForwardIfDefPtr dev = NULL; - size_t i; -- int ret = -1; - char *master = NULL; - - if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK) -- return 0; -+ return; - - network = virNetworkObjFindByName(driver->networks, iface->data.network.name); - if (!network) { -@@ -4848,11 +4847,10 @@ networkNotifyActualDevice(virDomainDefPtr dom, - } - networkLogAllocation(netdef, actualType, dev, iface, true); - -- ret = 0; - cleanup: - virNetworkObjEndAPI(&network); - VIR_FREE(master); -- return ret; -+ return; - - error: - goto cleanup; -diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h -index c696f0301..aaedd67a1 100644 ---- a/src/network/bridge_driver.h -+++ b/src/network/bridge_driver.h -@@ -37,8 +37,8 @@ int networkRegister(void); - int networkAllocateActualDevice(virDomainDefPtr dom, - virDomainNetDefPtr iface) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --int networkNotifyActualDevice(virDomainDefPtr dom, -- virDomainNetDefPtr iface) -+void networkNotifyActualDevice(virDomainDefPtr dom, -+ virDomainNetDefPtr iface) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - int networkReleaseActualDevice(virDomainDefPtr dom, - virDomainNetDefPtr iface) -@@ -72,11 +72,10 @@ int networkBandwidthUpdate(virDomainNetDefPtr iface, - # define networkDnsmasqConfContents(network, pidfile, configstr, \ - dctx, caps) 0 - --static inline int -+static inline void - networkNotifyActualDevice(virDomainDefPtr dom ATTRIBUTE_UNUSED, - virDomainNetDefPtr iface ATTRIBUTE_UNUSED) - { -- return 0; - } - - static inline int -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index a33ec87e6..df5ba575a 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -2825,7 +2825,7 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver, - - - --static int -+static void - qemuProcessNotifyNets(virDomainDefPtr def) - { - size_t i; -@@ -2840,10 +2840,8 @@ qemuProcessNotifyNets(virDomainDefPtr def) - if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) - ignore_value(virNetDevMacVLanReserveName(net->ifname, false)); - -- if (networkNotifyActualDevice(def, net) < 0) -- return -1; -+ networkNotifyActualDevice(def, net); - } -- return 0; - } - - static int -@@ -3480,8 +3478,7 @@ qemuProcessReconnect(void *opaque) - if (qemuSecurityReserveLabel(driver->securityManager, obj->def, obj->pid) < 0) - goto error; - -- if (qemuProcessNotifyNets(obj->def) < 0) -- goto error; -+ qemuProcessNotifyNets(obj->def); - - if (qemuProcessFiltersInstantiate(obj->def)) - goto error; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-driver-Allow-passing-disk-target-as-top-image-with-block-commit.patch b/SOURCES/libvirt-qemu-driver-Allow-passing-disk-target-as-top-image-with-block-commit.patch deleted file mode 100644 index fc292ce..0000000 --- a/SOURCES/libvirt-qemu-driver-Allow-passing-disk-target-as-top-image-with-block-commit.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6126edc9e0fcf658c95f8ede0c05b72dad6d221b Mon Sep 17 00:00:00 2001 -Message-Id: <6126edc9e0fcf658c95f8ede0c05b72dad6d221b@dist-git> -From: Peter Krempa -Date: Wed, 17 May 2017 17:44:54 +0200 -Subject: [PATCH] qemu: driver: Allow passing disk target as top image with - block commit - -Since we allow active layer block commit the users are allowed to commit -the top of the chain (e.g. vda) into the backing image. The API would -not accept that parameter, as it tried to look up the image in the -backing chain. - -Add the ability to use the top level image target name explicitly as the -top image of the block commit operation. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1451394 -(cherry picked from commit ed61e0b368859b25beb5259f84edd4910cd5218f) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index 8699fb2fe..a0f641fd4 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -16933,7 +16933,7 @@ qemuDomainBlockCommit(virDomainPtr dom, - if (qemuDomainDiskBlockJobIsActive(disk)) - goto endjob; - -- if (!top) -+ if (!top || STREQ(top, disk->dst)) - topSource = disk->src; - else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) < 0 || - !(topSource = virStorageFileChainLookup(disk->src, NULL, --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-driver-Extract-vcpu-halted-state-directly.patch b/SOURCES/libvirt-qemu-driver-Extract-vcpu-halted-state-directly.patch new file mode 100644 index 0000000..674fc61 --- /dev/null +++ b/SOURCES/libvirt-qemu-driver-Extract-vcpu-halted-state-directly.patch @@ -0,0 +1,89 @@ +From 82aa1d86ca26a7693b3817cc6331c9f094549098 Mon Sep 17 00:00:00 2001 +Message-Id: <82aa1d86ca26a7693b3817cc6331c9f094549098@dist-git> +From: Peter Krempa +Date: Wed, 7 Feb 2018 14:15:59 +0100 +Subject: [PATCH] qemu: driver: Extract vcpu halted state directly + +Don't extract the halted state into a separate array, but rater access +the vcpu structures directly. We still need to call the vcpu helper to +retrieve the performance statistics though. + +(cherry picked from commit 38d26864f7b0bf780ff07bf95c81a68699ddebaf) + +https://bugzilla.redhat.com/show_bug.cgi?id=1534585 +--- + src/qemu/qemu_driver.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index 0bc6eaa431..bfb3c3c4c5 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -19527,12 +19527,14 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + int *maxparams, + unsigned int privflags) + { ++ virDomainVcpuDefPtr vcpu; ++ qemuDomainVcpuPrivatePtr vcpupriv; + size_t i; + int ret = -1; + char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; + virVcpuInfoPtr cpuinfo = NULL; + unsigned long long *cpuwait = NULL; +- bool *cpuhalted = NULL; ++ bool vcpuhalted = false; + + if (virTypedParamsAddUInt(&record->params, + &record->nparams, +@@ -19558,14 +19560,14 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + /* it's ok to be silent and go ahead, because halted vcpu info + * wasn't here from the beginning */ + virResetLastError(); +- } else if (VIR_ALLOC_N(cpuhalted, virDomainDefGetVcpus(dom->def)) < 0) { +- goto cleanup; ++ } else { ++ vcpuhalted = true; + } + } + + if (qemuDomainHelperGetVcpus(dom, cpuinfo, cpuwait, + virDomainDefGetVcpus(dom->def), +- NULL, 0, cpuhalted) < 0) { ++ NULL, 0, NULL) < 0) { + virResetLastError(); + ret = 0; /* it's ok to be silent and go ahead */ + goto cleanup; +@@ -19602,14 +19604,20 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + cpuwait[i]) < 0) + goto cleanup; + +- if (cpuhalted) { ++ /* state below is extracted from the individual vcpu structs */ ++ if (!(vcpu = virDomainDefGetVcpu(dom->def, cpuinfo[i].number))) ++ continue; ++ ++ vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); ++ ++ if (vcpuhalted) { + snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, + "vcpu.%u.halted", cpuinfo[i].number); + if (virTypedParamsAddBoolean(&record->params, + &record->nparams, + maxparams, + param_name, +- cpuhalted[i]) < 0) ++ vcpupriv->halted) < 0) + goto cleanup; + } + } +@@ -19619,7 +19627,6 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, + cleanup: + VIR_FREE(cpuinfo); + VIR_FREE(cpuwait); +- VIR_FREE(cpuhalted); + return ret; + } + +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-fix-security-labeling-for-attach-detach-of-char-devices.patch b/SOURCES/libvirt-qemu-fix-security-labeling-for-attach-detach-of-char-devices.patch new file mode 100644 index 0000000..c4d6daa --- /dev/null +++ b/SOURCES/libvirt-qemu-fix-security-labeling-for-attach-detach-of-char-devices.patch @@ -0,0 +1,154 @@ +From f0e402ae3edf7717f1f2c1317f8b445ad20fdda4 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Tue, 5 Dec 2017 14:02:34 +0100 +Subject: [PATCH] qemu: fix security labeling for attach/detach of char devices + +Commit e93d844b90 was not enough to fix the permission denied +issue. We need to apply security labels as well. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1465833 + +Signed-off-by: Pavel Hrdina +(cherry picked from commit 1c57eea3625f59a80bea08d8779837a40acc4660) +Signed-off-by: Pavel Hrdina +Reviewed-by: Erik Skultety +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_hotplug.c | 10 ++++++++ + src/qemu/qemu_security.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/qemu/qemu_security.h | 8 +++++++ + 3 files changed, 78 insertions(+) + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index 56e8a93885..eab9ad794a 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -1818,6 +1818,7 @@ int qemuDomainAttachChrDevice(virConnectPtr conn, + bool chardevAttached = false; + bool teardowncgroup = false; + bool teardowndevice = false; ++ bool teardownlabel = false; + char *tlsAlias = NULL; + char *secAlias = NULL; + bool need_release = false; +@@ -1838,6 +1839,10 @@ int qemuDomainAttachChrDevice(virConnectPtr conn, + goto cleanup; + teardowndevice = true; + ++ if (qemuSecuritySetChardevLabel(driver, vm, chr) < 0) ++ goto cleanup; ++ teardownlabel = true; ++ + if (qemuSetupChardevCgroup(vm, chr) < 0) + goto cleanup; + teardowncgroup = true; +@@ -1880,6 +1885,8 @@ int qemuDomainAttachChrDevice(virConnectPtr conn, + qemuDomainReleaseDeviceAddress(vm, &chr->info, NULL); + if (teardowncgroup && qemuTeardownChardevCgroup(vm, chr) < 0) + VIR_WARN("Unable to remove chr device cgroup ACL on hotplug fail"); ++ if (teardownlabel && qemuSecurityRestoreChardevLabel(driver, vm, chr) < 0) ++ VIR_WARN("Unable to restore security label on char device"); + if (teardowndevice && qemuDomainNamespaceTeardownChardev(driver, vm, chr) < 0) + VIR_WARN("Unable to remove chr device from /dev"); + } +@@ -4111,6 +4118,9 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, + if (qemuTeardownChardevCgroup(vm, chr) < 0) + VIR_WARN("Failed to remove chr device cgroup ACL"); + ++ if (qemuSecurityRestoreChardevLabel(driver, vm, chr) < 0) ++ VIR_WARN("Unable to restore security label on char device"); ++ + if (qemuDomainNamespaceTeardownChardev(driver, vm, chr) < 0) + VIR_WARN("Unable to remove chr device from /dev"); + +diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c +index e7d2bbd5a3..2aced22d2d 100644 +--- a/src/qemu/qemu_security.c ++++ b/src/qemu/qemu_security.c +@@ -364,3 +364,63 @@ qemuSecurityRestoreInputLabel(virDomainObjPtr vm, + virSecurityManagerTransactionAbort(driver->securityManager); + return ret; + } ++ ++ ++int ++qemuSecuritySetChardevLabel(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainChrDefPtr chr) ++{ ++ int ret = -1; ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionStart(driver->securityManager) < 0) ++ goto cleanup; ++ ++ if (virSecurityManagerSetChardevLabel(driver->securityManager, ++ vm->def, ++ chr->source, ++ priv->chardevStdioLogd) < 0) ++ goto cleanup; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionCommit(driver->securityManager, ++ vm->pid) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virSecurityManagerTransactionAbort(driver->securityManager); ++ return ret; ++} ++ ++ ++int ++qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainChrDefPtr chr) ++{ ++ int ret = -1; ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionStart(driver->securityManager) < 0) ++ goto cleanup; ++ ++ if (virSecurityManagerRestoreChardevLabel(driver->securityManager, ++ vm->def, ++ chr->source, ++ priv->chardevStdioLogd) < 0) ++ goto cleanup; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionCommit(driver->securityManager, ++ vm->pid) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virSecurityManagerTransactionAbort(driver->securityManager); ++ return ret; ++} +diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h +index 76d63f06ec..d54ce6fead 100644 +--- a/src/qemu/qemu_security.h ++++ b/src/qemu/qemu_security.h +@@ -76,6 +76,14 @@ int qemuSecuritySetInputLabel(virDomainObjPtr vm, + int qemuSecurityRestoreInputLabel(virDomainObjPtr vm, + virDomainInputDefPtr input); + ++int qemuSecuritySetChardevLabel(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainChrDefPtr chr); ++ ++int qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainChrDefPtr chr); ++ + /* Please note that for these APIs there is no wrapper yet. Do NOT blindly add + * new APIs here. If an API can touch a /dev file add a proper wrapper instead. + */ +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-format-caching-mode-on-iommu-command-line.patch b/SOURCES/libvirt-qemu-format-caching-mode-on-iommu-command-line.patch deleted file mode 100644 index 2e36e87..0000000 --- a/SOURCES/libvirt-qemu-format-caching-mode-on-iommu-command-line.patch +++ /dev/null @@ -1,159 +0,0 @@ -From d5e2a0cc600ea90645df6161b662cf32a16a7a1b Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:57 +0200 -Subject: [PATCH] qemu: format caching-mode on iommu command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Format the caching-mode option for the intel-iommu device, -based on its attribute value. - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit a56914486ca67f921ee6e3ce26b5787fccb47155) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - - downstream did not update qemu version to 2.9.0 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 ++ - src/qemu/qemu_capabilities.h | 1 + - src/qemu/qemu_command.c | 11 ++++++++++ - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - .../qemuxml2argv-intel-iommu-caching-mode.args | 25 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 11 ++++++++++ - 6 files changed, 51 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 4fd0df260..c970d70e3 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -370,6 +370,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "kernel-irqchip", /* 255 */ - "kernel-irqchip.split", - "intel-iommu.intremap", -+ "intel-iommu.caching-mode", - ); - - -@@ -1724,6 +1725,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = { - - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { - { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, -+ { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, - }; - - /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index d1730a725..4e322b5c2 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -408,6 +408,7 @@ typedef enum { - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=split */ - QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */ -+ QEMU_CAPS_INTEL_IOMMU_CACHING_MODE, /* intel-iommu.caching-mode */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index a8dac1489..d4d0c00d5 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6680,6 +6680,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - "with this QEMU binary")); - return -1; - } -+ if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT && -+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("iommu: caching mode is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } - break; - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; -@@ -6709,6 +6716,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - virBufferAsprintf(&opts, ",intremap=%s", - virTristateSwitchTypeToString(iommu->intremap)); - } -+ if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&opts, ",caching-mode=%s", -+ virTristateSwitchTypeToString(iommu->caching_mode)); -+ } - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; - } -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 5a88cf505..b5649d8d7 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -212,6 +212,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args -new file mode 100644 -index 000000000..1bec6d00b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-caching-mode.args -@@ -0,0 +1,25 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-machine q35,accel=tcg \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device intel-iommu,intremap=on,caching-mode=on \ -+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -+-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \ -+-device ich9-usb-ehci1,id=usb,bus=pci.2,addr=0x2.0x7 \ -+-device rtl8139,vlan=0,id=net0,mac=52:54:00:ab:0c:5c,bus=pci.2,addr=0x1 \ -+-net user,vlan=0,name=hostnet0 -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 8061292b3..e3d6d757b 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2523,6 +2523,17 @@ mymain(void) - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, - QEMU_CAPS_INTEL_IOMMU_INTREMAP, - QEMU_CAPS_DEVICE_INTEL_IOMMU); -+ DO_TEST("intel-iommu-caching-mode", -+ QEMU_CAPS_MACHINE_OPT, -+ QEMU_CAPS_DEVICE_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -+ QEMU_CAPS_DEVICE_IOH3420, -+ QEMU_CAPS_ICH9_AHCI, -+ QEMU_CAPS_PCI_MULTIFUNCTION, -+ QEMU_CAPS_ICH9_USB_EHCI1, -+ QEMU_CAPS_DEVICE_INTEL_IOMMU, -+ QEMU_CAPS_INTEL_IOMMU_INTREMAP, -+ QEMU_CAPS_INTEL_IOMMU_CACHING_MODE); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-format-device-iotlb-on-intel-iommu-command-line.patch b/SOURCES/libvirt-qemu-format-device-iotlb-on-intel-iommu-command-line.patch deleted file mode 100644 index e8e5a49..0000000 --- a/SOURCES/libvirt-qemu-format-device-iotlb-on-intel-iommu-command-line.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 6fa4cae7c760c804c601735a4eba91e72e2e756b Mon Sep 17 00:00:00 2001 -Message-Id: <6fa4cae7c760c804c601735a4eba91e72e2e756b@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:48:57 +0200 -Subject: [PATCH] qemu: format device-iotlb on intel-iommu command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Format the device-iotlb attribute. - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit 240e443afdac0df342bb462ac2754a46e6efbc23) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - that QEMU version again -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 3 +++ - src/qemu/qemu_capabilities.h | 3 +++ - src/qemu/qemu_command.c | 11 +++++++++++ - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - .../qemuxml2argv-intel-iommu-device-iotlb.args | 19 +++++++++++++++++++ - tests/qemuxml2argvtest.c | 7 +++++++ - 6 files changed, 44 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 29bb9949af..d8f3079083 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -372,6 +372,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "intel-iommu.intremap", - "intel-iommu.caching-mode", - "intel-iommu.eim", -+ -+ "intel-iommu.device-iotlb", /* 260 */ - ); - - -@@ -1728,6 +1730,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { - { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, - { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, - { "eim", QEMU_CAPS_INTEL_IOMMU_EIM }, -+ { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB }, - }; - - /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 1c64364af4..e0f81711fe 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -411,6 +411,9 @@ typedef enum { - QEMU_CAPS_INTEL_IOMMU_CACHING_MODE, /* intel-iommu.caching-mode */ - QEMU_CAPS_INTEL_IOMMU_EIM, /* intel-iommu.eim */ - -+ /* 260 */ -+ QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, /* intel-iommu.device-iotlb */ -+ - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 9c0d151da1..9c5639b036 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6694,6 +6694,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - "with this QEMU binary")); - return -1; - } -+ if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT && -+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("iommu: device IOTLB is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } - break; - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; -@@ -6731,6 +6738,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - virBufferAsprintf(&opts, ",eim=%s", - virTristateSwitchTypeToString(iommu->eim)); - } -+ if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&opts, ",device-iotlb=%s", -+ virTristateSwitchTypeToString(iommu->iotlb)); -+ } - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; - } -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 2002dc7c0d..29a483d123 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -214,6 +214,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args -new file mode 100644 -index 0000000000..6d8f8e2188 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-device-iotlb.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-machine q35,accel=kvm,kernel_irqchip=split \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device intel-iommu,intremap=on,device-iotlb=on -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 9e0d4d7141..bff32200d7 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2541,6 +2541,13 @@ mymain(void) - QEMU_CAPS_INTEL_IOMMU_INTREMAP, - QEMU_CAPS_INTEL_IOMMU_EIM, - QEMU_CAPS_DEVICE_INTEL_IOMMU); -+ DO_TEST("intel-iommu-device-iotlb", -+ QEMU_CAPS_MACHINE_OPT, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, -+ QEMU_CAPS_INTEL_IOMMU_INTREMAP, -+ QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, -+ QEMU_CAPS_DEVICE_INTEL_IOMMU); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); - --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-format-eim-on-intel-iommu-command-line.patch b/SOURCES/libvirt-qemu-format-eim-on-intel-iommu-command-line.patch deleted file mode 100644 index 3ef2d8a..0000000 --- a/SOURCES/libvirt-qemu-format-eim-on-intel-iommu-command-line.patch +++ /dev/null @@ -1,207 +0,0 @@ -From 2c6067b5f21f5965912c115d0b5e3afd2d1f6ddd Mon Sep 17 00:00:00 2001 -Message-Id: <2c6067b5f21f5965912c115d0b5e3afd2d1f6ddd@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 26 May 2017 08:52:57 +0200 -Subject: [PATCH] qemu: format eim on intel-iommu command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This option turns on extended interrupt mode, -which allows more than 255 vCPUs. - -https://bugzilla.redhat.com/show_bug.cgi?id=1451282 - -Reviewed-by: Andrea Bolognani -(cherry picked from commit 381e638d81fd13475112ec9ae2cc4fdbe546ed4d) -Signed-off-by: Ján Tomko - -Also: -https://bugzilla.redhat.com/show_bug.cgi?id=1289153 - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - that QEMU version again -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 ++ - src/qemu/qemu_capabilities.h | 1 + - src/qemu/qemu_command.c | 11 +++++++++++ - src/qemu/qemu_domain.c | 21 +++++++++++++++++++++ - tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - .../qemuxml2argv-intel-iommu-eim.args | 19 +++++++++++++++++++ - tests/qemuxml2argvtest.c | 7 +++++++ - 8 files changed, 63 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index c970d70e3..80db60bc4 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -371,6 +371,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "kernel-irqchip.split", - "intel-iommu.intremap", - "intel-iommu.caching-mode", -+ "intel-iommu.eim", - ); - - -@@ -1726,6 +1727,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = { - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { - { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, - { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, -+ { "eim", QEMU_CAPS_INTEL_IOMMU_EIM }, - }; - - /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 4e322b5c2..1c64364af 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -409,6 +409,7 @@ typedef enum { - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=split */ - QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */ - QEMU_CAPS_INTEL_IOMMU_CACHING_MODE, /* intel-iommu.caching-mode */ -+ QEMU_CAPS_INTEL_IOMMU_EIM, /* intel-iommu.eim */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index d4d0c00d5..9c0d151da 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6687,6 +6687,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - "with this QEMU binary")); - return -1; - } -+ if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT && -+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("iommu: eim is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } - break; - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; -@@ -6720,6 +6727,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - virBufferAsprintf(&opts, ",caching-mode=%s", - virTristateSwitchTypeToString(iommu->caching_mode)); - } -+ if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&opts, ",eim=%s", -+ virTristateSwitchTypeToString(iommu->eim)); -+ } - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; - } -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index a8a68aedd..89698d4fc 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2941,6 +2941,9 @@ qemuDomainDefValidateVideo(const virDomainDef *def) - } - - -+#define QEMU_MAX_VCPUS_WITHOUT_EIM 255 -+ -+ - static int - qemuDomainDefValidate(const virDomainDef *def, - virCapsPtr caps, -@@ -3020,6 +3023,24 @@ qemuDomainDefValidate(const virDomainDef *def, - } - } - -+ if (ARCH_IS_X86(def->os.arch) && -+ virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM) { -+ if (!qemuDomainIsQ35(def)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("more than %d vCPUs are only supported on " -+ "q35-based machine types"), -+ QEMU_MAX_VCPUS_WITHOUT_EIM); -+ goto cleanup; -+ } -+ if (!def->iommu || def->iommu->eim != VIR_TRISTATE_SWITCH_ON) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("more than %d vCPUs require extended interrupt " -+ "mode enabled on the iommu device"), -+ QEMU_MAX_VCPUS_WITHOUT_EIM); -+ goto cleanup; -+ } -+ } -+ - if (qemuDomainDefValidateVideo(def) < 0) - goto cleanup; - -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -index e51567817..01edbc88d 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -@@ -206,6 +206,7 @@ - - - -+ - 2008000 - 0 - (v2.8.0) -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index b5649d8d7..2002dc7c0 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -213,6 +213,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args -new file mode 100644 -index 000000000..ebf7c49bf ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-machine q35,accel=kvm,kernel_irqchip=split \ -+-m 214 \ -+-smp 288,sockets=288,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device intel-iommu,intremap=on,eim=on -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index e3d6d757b..ecdda2db9 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2534,6 +2534,13 @@ mymain(void) - QEMU_CAPS_DEVICE_INTEL_IOMMU, - QEMU_CAPS_INTEL_IOMMU_INTREMAP, - QEMU_CAPS_INTEL_IOMMU_CACHING_MODE); -+ DO_TEST("intel-iommu-eim", -+ QEMU_CAPS_MACHINE_OPT, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, -+ QEMU_CAPS_INTEL_IOMMU_INTREMAP, -+ QEMU_CAPS_INTEL_IOMMU_EIM, -+ QEMU_CAPS_DEVICE_INTEL_IOMMU); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-format-intel-iommu-intremap-on-the-command-line.patch b/SOURCES/libvirt-qemu-format-intel-iommu-intremap-on-the-command-line.patch deleted file mode 100644 index 8006311..0000000 --- a/SOURCES/libvirt-qemu-format-intel-iommu-intremap-on-the-command-line.patch +++ /dev/null @@ -1,715 +0,0 @@ -From f341f4c03ec726b6004e477259ba2da0932528e3 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:55 +0200 -Subject: [PATCH] qemu: format intel-iommu, intremap on the command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit 04028a9db9f2657e8d57d1e4705073c908aa248c) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - - downstream did not update qemu version to 2.9.0 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 8 ++++ - src/qemu/qemu_capabilities.h | 1 + - src/qemu/qemu_command.c | 18 ++++++++ - .../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 22 +++++++--- - .../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 24 +++++++---- - .../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 24 +++++++---- - .../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 28 +++++++++---- - tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 + - .../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 37 ++++++++++++---- - tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 + - .../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 49 ++++++++++++++++++---- - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - .../qemuxml2argv-intel-iommu-ioapic.args | 2 +- - tests/qemuxml2argvtest.c | 1 + - 14 files changed, 173 insertions(+), 44 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index f27fe0a24..4fd0df260 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -369,6 +369,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - - "kernel-irqchip", /* 255 */ - "kernel-irqchip.split", -+ "intel-iommu.intremap", - ); - - -@@ -1721,6 +1722,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = { - { "p3", QEMU_CAPS_NEC_USB_XHCI_PORTS }, - }; - -+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { -+ { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, -+}; -+ - /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ - static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { - { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, -@@ -1828,6 +1833,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { - { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), - -1 }, -+ { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, -+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), -+ QEMU_CAPS_DEVICE_INTEL_IOMMU}, - }; - - struct virQEMUCapsPropTypeObjects { -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index a6cdf2c3d..d1730a725 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -407,6 +407,7 @@ typedef enum { - /* 255 */ - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=split */ -+ QEMU_CAPS_INTEL_IOMMU_INTREMAP, /* intel-iommu.intremap */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 7151b1843..a8dac1489 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6671,6 +6671,20 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - if (!iommu) - return 0; - -+ switch (iommu->model) { -+ case VIR_DOMAIN_IOMMU_MODEL_INTEL: -+ if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT && -+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("iommu: interrupt remapping is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } -+ break; -+ case VIR_DOMAIN_IOMMU_MODEL_LAST: -+ break; -+ } -+ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) - return 0; /* Already handled via -machine */ - -@@ -6691,6 +6705,10 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - return -1; - } - virBufferAddLit(&opts, "intel-iommu"); -+ if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT) { -+ virBufferAsprintf(&opts, ",intremap=%s", -+ virTristateSwitchTypeToString(iommu->intremap)); -+ } - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; - } -diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies -index 68221816b..9f256c48a 100644 ---- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies -@@ -3123,6 +3123,16 @@ - { - "return": [ - { -+ "name": "version", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "name": "pc-i440fx-2.4", - "is-default": true, - "cpu-max": 255, -@@ -3246,7 +3256,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -3336,21 +3346,21 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -4358,7 +4368,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -4388,7 +4398,7 @@ - "capability": "events" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies -index 2eeed7d6c..876bc2f0a 100644 ---- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies -@@ -3286,6 +3286,16 @@ - { - "return": [ - { -+ "name": "version", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "name": "pc-i440fx-2.4", - "cpu-max": 255 - }, -@@ -3417,7 +3427,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -3507,21 +3517,21 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -4566,7 +4576,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -4600,7 +4610,7 @@ - "capability": "x-postcopy-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -12145,7 +12155,7 @@ - "meta-type": "array" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies -index 0c285cd95..d6d0b5786 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies -@@ -3368,6 +3368,16 @@ - { - "return": [ - { -+ "name": "version", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "name": "pc-0.12", - "cpu-max": 255 - }, -@@ -3475,7 +3485,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -3565,21 +3575,21 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -4673,7 +4683,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -4707,7 +4717,7 @@ - "capability": "postcopy-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -12712,7 +12722,7 @@ - "meta-type": "array" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies -index 4a872370b..671a958be 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies -@@ -3559,6 +3559,20 @@ - { - "return": [ - { -+ "name": "version", -+ "type": "uint32" -+ }, -+ { -+ "name": "intremap", -+ "type": "bool" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "hotpluggable-cpus": true, - "name": "pc-0.12", - "cpu-max": 255 -@@ -3702,7 +3716,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -3795,21 +3809,21 @@ - "name": "qemu64" - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -4907,7 +4921,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -4941,7 +4955,7 @@ - "capability": "postcopy-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -13297,7 +13311,7 @@ - "meta-type": "object" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -index 6c2ea59c6..49c046212 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -@@ -204,6 +204,7 @@ - - - -+ - 2007000 - 0 - (v2.7.0) -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies -index b3ad9121e..3087d7680 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies -@@ -3692,6 +3692,29 @@ - { - "return": [ - { -+ "name": "eim", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "x-buggy-eim", -+ "type": "bool" -+ }, -+ { -+ "name": "intremap", -+ "type": "bool" -+ }, -+ { -+ "name": "version", -+ "type": "uint32" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "hotpluggable-cpus": true, - "name": "pc-0.12", - "cpu-max": 255 -@@ -3855,7 +3878,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -4061,21 +4084,21 @@ - "static": false - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -5198,7 +5221,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -5236,7 +5259,7 @@ - "capability": "x-colo" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -14006,7 +14029,7 @@ - "meta-type": "object" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -index 9c8c79ab0..e51567817 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -@@ -205,6 +205,7 @@ - - - -+ - 2008000 - 0 - (v2.8.0) -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies -index bae24750c..3cfefb709 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies -@@ -4003,6 +4003,37 @@ - { - "return": [ - { -+ "name": "eim", -+ "description": "on/off/auto", -+ "type": "OnOffAuto" -+ }, -+ { -+ "name": "caching-mode", -+ "type": "bool" -+ }, -+ { -+ "name": "x-buggy-eim", -+ "type": "bool" -+ }, -+ { -+ "name": "intremap", -+ "type": "bool" -+ }, -+ { -+ "name": "version", -+ "type": "uint32" -+ }, -+ { -+ "name": "device-iotlb", -+ "type": "bool" -+ } -+ ], -+ "id": "libvirt-41" -+} -+ -+{ -+ "return": [ -+ { - "hotpluggable-cpus": true, - "name": "pc-0.12", - "cpu-max": 255 -@@ -4176,7 +4207,7 @@ - "cpu-max": 255 - } - ], -- "id": "libvirt-41" -+ "id": "libvirt-42" - } - - { -@@ -4458,21 +4489,21 @@ - "migration-safe": true - } - ], -- "id": "libvirt-42" -+ "id": "libvirt-43" - } - - { - "return": [ - "tpm-tis" - ], -- "id": "libvirt-43" -+ "id": "libvirt-44" - } - - { - "return": [ - "passthrough" - ], -- "id": "libvirt-44" -+ "id": "libvirt-45" - } - - { -@@ -5721,7 +5752,7 @@ - "option": "drive" - } - ], -- "id": "libvirt-45" -+ "id": "libvirt-46" - } - - { -@@ -5763,7 +5794,7 @@ - "capability": "release-ram" - } - ], -- "id": "libvirt-46" -+ "id": "libvirt-47" - } - - { -@@ -14888,7 +14919,7 @@ - "meta-type": "object" - } - ], -- "id": "libvirt-47" -+ "id": "libvirt-48" - } - - { -@@ -15067,7 +15098,7 @@ - } - } - }, -- "id": "libvirt-48" -+ "id": "libvirt-49" - } - - { -@@ -15308,7 +15339,7 @@ - } - } - }, -- "id": "libvirt-49" -+ "id": "libvirt-50" - } - - { -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index e4cdca89a..5a88cf505 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -211,6 +211,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -index 43d71adfc..c6539878a 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -@@ -16,4 +16,4 @@ QEMU_AUDIO_DRV=none \ - -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ - -no-acpi \ - -boot c \ ---device intel-iommu -+-device intel-iommu,intremap=on -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index c7aad297c..8061292b3 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2521,6 +2521,7 @@ mymain(void) - QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, - QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, -+ QEMU_CAPS_INTEL_IOMMU_INTREMAP, - QEMU_CAPS_DEVICE_INTEL_IOMMU); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-format-kernel_irqchip-on-the-command-line.patch b/SOURCES/libvirt-qemu-format-kernel_irqchip-on-the-command-line.patch deleted file mode 100644 index 30631b6..0000000 --- a/SOURCES/libvirt-qemu-format-kernel_irqchip-on-the-command-line.patch +++ /dev/null @@ -1,401 +0,0 @@ -From be9562bdb0bef5b3e8db7dd22104631f13188f3a Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:53 +0200 -Subject: [PATCH] qemu: format kernel_irqchip on the command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add kernel_irqchip=split/on to the QEMU command line -and a capability that looks for it in query-command-line-options -output. For the 'split' option, use a version check -since it cannot be reasonably probed. - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -(cherry picked from commit 6b5c6314b2f7a3b54c94a591e6b0dcd13ef1c6ce) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - - downstream did not update the qemu version to 2.9.0 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 8 +++++++ - src/qemu/qemu_capabilities.h | 4 ++++ - src/qemu/qemu_command.c | 25 ++++++++++++++++++++++ - src/qemu/qemu_domain.c | 19 ++++++++++++++++ - tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 + - tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 + - .../caps_2.6.0-gicv2.aarch64.xml | 2 ++ - .../caps_2.6.0-gicv3.aarch64.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 2 ++ - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 ++ - .../qemuxml2argv-intel-iommu-ioapic.args | 19 ++++++++++++++++ - tests/qemuxml2argvtest.c | 5 +++++ - 21 files changed, 104 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 49fb52e03..f27fe0a24 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -366,6 +366,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "query-named-block-nodes", - "cpu-cache", - "qemu-xhci", -+ -+ "kernel-irqchip", /* 255 */ -+ "kernel-irqchip.split", - ); - - -@@ -3128,6 +3131,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { - { "drive", "throttling.bps-total-max-length", QEMU_CAPS_DRIVE_IOTUNE_MAX_LENGTH }, - { "drive", "throttling.group", QEMU_CAPS_DRIVE_IOTUNE_GROUP }, - { "spice", "rendernode", QEMU_CAPS_SPICE_RENDERNODE }, -+ { "machine", "kernel_irqchip", QEMU_CAPS_MACHINE_KERNEL_IRQCHIP }, - }; - - static int -@@ -4743,6 +4747,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, - if (qemuCaps->version >= 2004050) - virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - -+ /* no way to query if -machine kernel_irqchip supports split */ -+ if (qemuCaps->version >= 2006000) -+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT); -+ - if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) - goto cleanup; - -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 1cd3ec37d..a6cdf2c3d 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -404,6 +404,10 @@ typedef enum { - QEMU_CAPS_CPU_CACHE, /* -cpu supports host-cache-info and l3-cache properties */ - QEMU_CAPS_DEVICE_QEMU_XHCI, /* -device qemu-xhci */ - -+ /* 255 */ -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, /* -machine kernel_irqchip */ -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, /* -machine kernel_irqchip=split */ -+ - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index b27b9f8ad..7151b1843 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -7429,6 +7429,31 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, - } - } - -+ if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] == VIR_TRISTATE_SWITCH_ON) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("I/O APIC tuning is not supported by this " -+ "QEMU binary")); -+ goto cleanup; -+ } -+ switch (def->ioapic) { -+ case VIR_DOMAIN_IOAPIC_QEMU: -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("split I/O APIC is not supported by this " -+ "QEMU binary")); -+ goto cleanup; -+ } -+ virBufferAddLit(&buf, ",kernel_irqchip=split"); -+ break; -+ case VIR_DOMAIN_IOAPIC_KVM: -+ virBufferAddLit(&buf, ",kernel_irqchip=on"); -+ break; -+ case VIR_DOMAIN_IOAPIC_LAST: -+ break; -+ } -+ } -+ - virCommandAddArgBuffer(cmd, &buf); - } - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 04d1b39db..a8a68aedd 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2776,6 +2776,22 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) - - - static int -+qemuDomainDefVerifyFeatures(const virDomainDef *def) -+{ -+ if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] == VIR_TRISTATE_SWITCH_ON && -+ !ARCH_IS_X86(def->os.arch)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("I/O APIC tuning is not supported " -+ "for '%s' architecture"), -+ virArchToString(def->os.arch)); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ -+static int - qemuDomainDefPostParse(virDomainDefPtr def, - virCapsPtr caps, - unsigned int parseFlags, -@@ -2830,6 +2846,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, - - qemuDomainDefEnableDefaultFeatures(def, qemuCaps); - -+ if (qemuDomainDefVerifyFeatures(def) < 0) -+ goto cleanup; -+ - if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) - goto cleanup; - -diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -index a68c13bbd..14f34b277 100644 ---- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml -@@ -140,6 +140,7 @@ - - - -+ - 1005003 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -index 365b3a650..8fc23d6aa 100644 ---- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml -@@ -145,6 +145,7 @@ - - - -+ - 1006000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -index 689fbf82c..47c8956b4 100644 ---- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml -@@ -147,6 +147,7 @@ - - - -+ - 1007000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -index e092dd254..afe7d53ff 100644 ---- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml -@@ -163,6 +163,7 @@ - - - -+ - 2001001 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -index ea03f2e66..5bdc1a2bd 100644 ---- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml -@@ -185,6 +185,7 @@ - - - -+ - 2004000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -index 164605f20..36bc1342b 100644 ---- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml -@@ -191,6 +191,7 @@ - - - -+ - 2005000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -index af3a8e7cb..33bc46208 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml -@@ -168,6 +168,8 @@ - - - -+ -+ - 2006000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -index 4402ffa6f..a8ce6b03b 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml -@@ -168,6 +168,8 @@ - - - -+ -+ - 2006000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -index 3f05169c8..425992f0d 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml -@@ -162,6 +162,8 @@ - - - -+ -+ - 2006000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -index 1d823eac2..97e71ec4f 100644 ---- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml -@@ -200,6 +200,8 @@ - - - -+ -+ - 2006000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -index 38d36b3e6..70cce6417 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml -@@ -130,6 +130,8 @@ - - - -+ -+ - 2007000 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -index 24d7cb438..6c2ea59c6 100644 ---- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml -@@ -202,6 +202,8 @@ - - - -+ -+ - 2007000 - 0 - (v2.7.0) -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -index 42c92c567..51be9bce4 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml -@@ -132,6 +132,8 @@ - - - -+ -+ - 2007093 - 0 - -diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -index 0bc13683e..9c8c79ab0 100644 ---- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml -@@ -203,6 +203,8 @@ - - - -+ -+ - 2008000 - 0 - (v2.8.0) -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 83ed0f1c6..e4cdca89a 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -209,6 +209,8 @@ - - - -+ -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -new file mode 100644 -index 000000000..43d71adfc ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-machine q35,accel=kvm,kernel_irqchip=split \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device intel-iommu -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 406fbfea4..c7aad297c 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2517,6 +2517,11 @@ mymain(void) - DO_TEST("intel-iommu-machine", - QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACHINE_IOMMU); -+ DO_TEST("intel-iommu-ioapic", -+ QEMU_CAPS_MACHINE_OPT, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP, -+ QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT, -+ QEMU_CAPS_DEVICE_INTEL_IOMMU); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-format-virtio-related-options-on-the-command-line.patch b/SOURCES/libvirt-qemu-format-virtio-related-options-on-the-command-line.patch deleted file mode 100644 index 27afdd1..0000000 --- a/SOURCES/libvirt-qemu-format-virtio-related-options-on-the-command-line.patch +++ /dev/null @@ -1,303 +0,0 @@ -From 27eff2a6edc81f85757d7d03134dc65d737c316f Mon Sep 17 00:00:00 2001 -Message-Id: <27eff2a6edc81f85757d7d03134dc65d737c316f@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:09 +0200 -Subject: [PATCH] qemu: format virtio-related options on the command line -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Format iommu_platform= and ats= for virtio devices. - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit b2cbc3a0607bf26a82911f7db6dcbc09c9bbf5e8) -Signed-off-by: Ján Tomko - -Conflicts: - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml - the version again -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 12 ++++- - src/qemu/qemu_capabilities.h | 2 + - src/qemu/qemu_command.c | 58 ++++++++++++++++++++++ - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 2 + - .../qemuxml2argv-virtio-options.args | 37 ++++++++------ - tests/qemuxml2argvtest.c | 4 +- - 6 files changed, 98 insertions(+), 17 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index d8f3079083..eea57e4c9c 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -374,6 +374,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "intel-iommu.eim", - - "intel-iommu.device-iotlb", /* 260 */ -+ "virtio.iommu_platform", -+ "virtio.ats", - ); - - -@@ -1851,7 +1853,7 @@ struct virQEMUCapsPropTypeObjects { - const char **objects; - }; - --static const char *virQEMUCapsVirtioPCIDisableLegacyObjects[] = { -+static const char *virQEMUCapsVirtioPCIObjects[] = { - "virtio-balloon-pci", - "virtio-blk-pci", - "virtio-scsi-pci", -@@ -1870,7 +1872,13 @@ static const char *virQEMUCapsVirtioPCIDisableLegacyObjects[] = { - static struct virQEMUCapsPropTypeObjects virQEMUCapsPropObjects[] = { - { "disable-legacy", - QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, -- virQEMUCapsVirtioPCIDisableLegacyObjects } -+ virQEMUCapsVirtioPCIObjects }, -+ { "iommu_platform", -+ QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, -+ virQEMUCapsVirtioPCIObjects }, -+ { "ats", -+ QEMU_CAPS_VIRTIO_PCI_ATS, -+ virQEMUCapsVirtioPCIObjects }, - }; - - -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index e0f81711fe..bbc6f6812f 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -413,6 +413,8 @@ typedef enum { - - /* 260 */ - QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB, /* intel-iommu.device-iotlb */ -+ QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */ -+ QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 9c5639b036..e220bf5ba0 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -389,6 +389,38 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, - } - - static int -+qemuBuildVirtioOptionsStr(virBufferPtr buf, -+ virDomainVirtioOptionsPtr virtio, -+ virQEMUCapsPtr qemuCaps) -+{ -+ if (!virtio) -+ return 0; -+ -+ if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("the iommu setting is not supported " -+ "with this QEMU binary")); -+ return -1; -+ } -+ virBufferAsprintf(buf, ",iommu_platform=%s", -+ virTristateSwitchTypeToString(virtio->iommu)); -+ } -+ if (virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) { -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_ATS)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("the ats setting is not supported with this " -+ "QEMU binary")); -+ return -1; -+ } -+ virBufferAsprintf(buf, ",ats=%s", -+ virTristateSwitchTypeToString(virtio->ats)); -+ } -+ -+ return 0; -+} -+ -+static int - qemuBuildRomStr(virBufferPtr buf, - virDomainDeviceInfoPtr info) - { -@@ -2167,6 +2199,10 @@ qemuBuildDriveDevStr(const virDomainDef *def, - (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) - ? "on" : "off"); - } -+ -+ if (qemuBuildVirtioOptionsStr(&opt, disk->virtio, qemuCaps) < 0) -+ goto error; -+ - if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < 0) - goto error; - break; -@@ -2490,6 +2526,8 @@ qemuBuildFSDevStr(const virDomainDef *def, - QEMU_FSDEV_HOST_PREFIX, fs->info.alias); - virBufferAsprintf(&opt, ",mount_tag=%s", fs->dst); - -+ qemuBuildVirtioOptionsStr(&opt, fs->virtio, qemuCaps); -+ - if (qemuBuildDeviceAddressStr(&opt, def, &fs->info, qemuCaps) < 0) - goto error; - -@@ -2734,6 +2772,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - def->iothread); - } - } -+ if (qemuBuildVirtioOptionsStr(&buf, def->virtio, qemuCaps) < 0) -+ goto error; - break; - case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC: - virBufferAddLit(&buf, "lsi"); -@@ -2779,6 +2819,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - virBufferAsprintf(&buf, ",vectors=%d", - def->opts.vioserial.vectors); - } -+ if (qemuBuildVirtioOptionsStr(&buf, def->virtio, qemuCaps) < 0) -+ goto error; - break; - - case VIR_DOMAIN_CONTROLLER_TYPE_CCID: -@@ -3773,12 +3815,16 @@ qemuBuildNicDevStr(virDomainDefPtr def, - virBufferAsprintf(&buf, ",id=%s", net->info.alias); - virBufferAsprintf(&buf, ",mac=%s", - virMacAddrFormat(&net->mac, macaddr)); -+ - if (qemuBuildDeviceAddressStr(&buf, def, &net->info, qemuCaps) < 0) - goto error; - if (qemuBuildRomStr(&buf, &net->info) < 0) - goto error; - if (bootindex && virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX)) - virBufferAsprintf(&buf, ",bootindex=%u", bootindex); -+ if (usingVirtio && -+ qemuBuildVirtioOptionsStr(&buf, net->virtio, qemuCaps) < 0) -+ goto error; - - if (virBufferCheckError(&buf) < 0) - goto error; -@@ -4053,6 +4099,9 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd, - virTristateSwitchTypeToString(def->memballoon->autodeflate)); - } - -+ if (qemuBuildVirtioOptionsStr(&buf, def->memballoon->virtio, qemuCaps) < 0) -+ goto error; -+ - virCommandAddArg(cmd, "-device"); - virCommandAddArgBuffer(cmd, &buf); - return 0; -@@ -4183,6 +4232,9 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, - if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0) - goto error; - -+ if (qemuBuildVirtioOptionsStr(&buf, dev->virtio, qemuCaps) < 0) -+ goto error; -+ - if (virBufferCheckError(&buf) < 0) - goto error; - -@@ -4495,6 +4547,9 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, - if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) - goto error; - -+ if (qemuBuildVirtioOptionsStr(&buf, video->virtio, qemuCaps) < 0) -+ goto error; -+ - if (virBufferCheckError(&buf) < 0) - goto error; - -@@ -5860,6 +5915,9 @@ qemuBuildRNGDevStr(const virDomainDef *def, - virBufferAddLit(&buf, ",period=1000"); - } - -+ if (qemuBuildVirtioOptionsStr(&buf, dev->virtio, qemuCaps) < 0) -+ goto error; -+ - if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0) - goto error; - if (virBufferCheckError(&buf) < 0) -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 29a483d123..2140eab398 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -215,6 +215,8 @@ - - - -+ -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -index f9f3c2cbad..ce0388dfc2 100644 ---- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -@@ -16,26 +16,35 @@ QEMU_AUDIO_DRV=none \ - -monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ - -no-acpi \ - -boot c \ ---device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8 \ ---device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x9 \ -+-device virtio-scsi-pci,iommu_platform=on,ats=on,id=scsi0,bus=pci.0,addr=0x8 \ -+-device virtio-serial-pci,id=virtio-serial0,iommu_platform=on,ats=on,bus=pci.0,\ -+addr=0x9 \ - -usb \ - -drive file=/var/lib/libvirt/images/img1,format=raw,if=none,\ - id=drive-virtio-disk0 \ ---device virtio-blk-pci,bus=pci.0,addr=0xa,drive=drive-virtio-disk0,\ --id=virtio-disk0 \ -+-device virtio-blk-pci,iommu_platform=on,ats=on,bus=pci.0,addr=0xa,\ -+drive=drive-virtio-disk0,id=virtio-disk0 \ - -fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \ ---device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.0,addr=0x3 \ -+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,iommu_platform=on,\ -+ats=on,bus=pci.0,addr=0x3 \ - -fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\ - path=/export/fs2 \ ---device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,bus=pci.0,addr=0x4 \ ---device virtio-net-pci,vlan=0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6 \ -+-device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,iommu_platform=on,\ -+ats=on,bus=pci.0,addr=0x4 \ -+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6,\ -+iommu_platform=on,ats=on \ - -net user,vlan=0,name=hostnet0 \ ---device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe \ ---device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10 \ ---device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11 \ -+-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe,iommu_platform=on,ats=on \ -+-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10,iommu_platform=on,\ -+ats=on \ -+-device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11,iommu_platform=on,\ -+ats=on \ - -device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\ --addr=0x12 \ ---device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ ---device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -+addr=0x12,iommu_platform=on,ats=on \ -+-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2,iommu_platform=on,\ -+ats=on \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,\ -+ats=on \ - -object rng-random,id=objrng0,filename=/dev/random \ ---device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0xd -+-device virtio-rng-pci,rng=objrng0,id=rng0,iommu_platform=on,ats=on,bus=pci.0,\ -+addr=0xd -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index c186780ef1..175037bf96 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2558,7 +2558,9 @@ mymain(void) - QEMU_CAPS_VIRTIO_GPU_VIRGL, - QEMU_CAPS_DEVICE_VIRTIO_RNG, - QEMU_CAPS_OBJECT_RNG_RANDOM, -- QEMU_CAPS_DEVICE_VIDEO_PRIMARY); -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY, -+ QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, -+ QEMU_CAPS_VIRTIO_PCI_ATS); - - DO_TEST("fd-memory-numa-topology", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_FILE, - QEMU_CAPS_KVM); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-functions-for-dealing-with-input-device-namespaces-and-labels.patch b/SOURCES/libvirt-qemu-functions-for-dealing-with-input-device-namespaces-and-labels.patch new file mode 100644 index 0000000..25439cd --- /dev/null +++ b/SOURCES/libvirt-qemu-functions-for-dealing-with-input-device-namespaces-and-labels.patch @@ -0,0 +1,212 @@ +From 2661dd59c5885adddb522be5e5542461f4e8bf3c Mon Sep 17 00:00:00 2001 +Message-Id: <2661dd59c5885adddb522be5e5542461f4e8bf3c@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Mon, 27 Nov 2017 14:21:01 +0100 +Subject: [PATCH] qemu: functions for dealing with input device namespaces and + labels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Introudce functions that will let us create the evdevs in namespaces +and label the devices on input device hotplug/hotunplug. + +(cherry picked from commit c4c7a18c4b8107b3521880eb20a94c928bdeacb0) + +https://bugzilla.redhat.com/show_bug.cgi?id=1509866 + +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ + src/qemu/qemu_domain.h | 6 ++++ + src/qemu/qemu_security.c | 58 ++++++++++++++++++++++++++++++++++++++ + src/qemu/qemu_security.h | 6 ++++ + 4 files changed, 142 insertions(+) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index dbe9ed5e98..138f773c22 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -9997,6 +9997,78 @@ qemuDomainNamespaceTeardownRNG(virQEMUDriverPtr driver, + } + + ++int ++qemuDomainNamespaceSetupInput(virDomainObjPtr vm, ++ virDomainInputDefPtr input) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ virQEMUDriverPtr driver = priv->driver; ++ virQEMUDriverConfigPtr cfg = NULL; ++ char **devMountsPath = NULL; ++ size_t ndevMountsPath = 0; ++ const char *path = NULL; ++ int ret = -1; ++ ++ if (!(path = virDomainInputDefGetPath(input))) ++ return 0; ++ ++ if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) ++ return 0; ++ ++ cfg = virQEMUDriverGetConfig(driver); ++ if (qemuDomainGetPreservedMounts(cfg, vm, ++ &devMountsPath, NULL, ++ &ndevMountsPath) < 0) ++ goto cleanup; ++ ++ if (qemuDomainAttachDeviceMknod(driver, vm, path, ++ devMountsPath, ndevMountsPath) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virStringListFreeCount(devMountsPath, ndevMountsPath); ++ virObjectUnref(cfg); ++ return ret; ++} ++ ++ ++int ++qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, ++ virDomainInputDefPtr input) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ virQEMUDriverPtr driver = priv->driver; ++ virQEMUDriverConfigPtr cfg = NULL; ++ char **devMountsPath = NULL; ++ size_t ndevMountsPath = 0; ++ const char *path = NULL; ++ int ret = -1; ++ ++ if (!(path = virDomainInputDefGetPath(input))) ++ return 0; ++ ++ if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) ++ return 0; ++ ++ cfg = virQEMUDriverGetConfig(driver); ++ if (qemuDomainGetPreservedMounts(cfg, vm, ++ &devMountsPath, NULL, ++ &ndevMountsPath) < 0) ++ goto cleanup; ++ ++ if (qemuDomainDetachDeviceUnlink(driver, vm, path, ++ devMountsPath, ndevMountsPath) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virStringListFreeCount(devMountsPath, ndevMountsPath); ++ virObjectUnref(cfg); ++ return ret; ++} ++ ++ + /** + * qemuDomainDiskLookupByNodename: + * @def: domain definition to look for the disk +diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h +index caf583373f..1a82922415 100644 +--- a/src/qemu/qemu_domain.h ++++ b/src/qemu/qemu_domain.h +@@ -969,6 +969,12 @@ int qemuDomainNamespaceTeardownRNG(virQEMUDriverPtr driver, + virDomainObjPtr vm, + virDomainRNGDefPtr rng); + ++int qemuDomainNamespaceSetupInput(virDomainObjPtr vm, ++ virDomainInputDefPtr input); ++ ++int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, ++ virDomainInputDefPtr input); ++ + virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, + const char *nodename, + virStorageSourcePtr *src, +diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c +index 6fc3b0bb6e..e7d2bbd5a3 100644 +--- a/src/qemu/qemu_security.c ++++ b/src/qemu/qemu_security.c +@@ -306,3 +306,61 @@ qemuSecurityRestoreMemoryLabel(virQEMUDriverPtr driver, + virSecurityManagerTransactionAbort(driver->securityManager); + return ret; + } ++ ++ ++int ++qemuSecuritySetInputLabel(virDomainObjPtr vm, ++ virDomainInputDefPtr input) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ virQEMUDriverPtr driver = priv->driver; ++ int ret = -1; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionStart(driver->securityManager) < 0) ++ goto cleanup; ++ ++ if (virSecurityManagerSetInputLabel(driver->securityManager, ++ vm->def, ++ input) < 0) ++ goto cleanup; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionCommit(driver->securityManager, ++ vm->pid) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virSecurityManagerTransactionAbort(driver->securityManager); ++ return ret; ++} ++ ++ ++int ++qemuSecurityRestoreInputLabel(virDomainObjPtr vm, ++ virDomainInputDefPtr input) ++{ ++ qemuDomainObjPrivatePtr priv = vm->privateData; ++ virQEMUDriverPtr driver = priv->driver; ++ int ret = -1; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionStart(driver->securityManager) < 0) ++ goto cleanup; ++ ++ if (virSecurityManagerRestoreInputLabel(driver->securityManager, ++ vm->def, ++ input) < 0) ++ goto cleanup; ++ ++ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) && ++ virSecurityManagerTransactionCommit(driver->securityManager, ++ vm->pid) < 0) ++ goto cleanup; ++ ++ ret = 0; ++ cleanup: ++ virSecurityManagerTransactionAbort(driver->securityManager); ++ return ret; ++} +diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h +index 7b25855bf9..76d63f06ec 100644 +--- a/src/qemu/qemu_security.h ++++ b/src/qemu/qemu_security.h +@@ -70,6 +70,12 @@ int qemuSecurityRestoreMemoryLabel(virQEMUDriverPtr driver, + virDomainObjPtr vm, + virDomainMemoryDefPtr mem); + ++int qemuSecuritySetInputLabel(virDomainObjPtr vm, ++ virDomainInputDefPtr input); ++ ++int qemuSecurityRestoreInputLabel(virDomainObjPtr vm, ++ virDomainInputDefPtr input); ++ + /* Please note that for these APIs there is no wrapper yet. Do NOT blindly add + * new APIs here. If an API can touch a /dev file add a proper wrapper instead. + */ +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-hotplug-Add-validation-for-coldplug-of-individual-vcpus.patch b/SOURCES/libvirt-qemu-hotplug-Add-validation-for-coldplug-of-individual-vcpus.patch deleted file mode 100644 index 52d8305..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Add-validation-for-coldplug-of-individual-vcpus.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 2d773381c7dd2d015a0890db36df64c76a6bfe46 Mon Sep 17 00:00:00 2001 -Message-Id: <2d773381c7dd2d015a0890db36df64c76a6bfe46@dist-git> -From: Peter Krempa -Date: Tue, 4 Apr 2017 09:31:23 +0200 -Subject: [PATCH] qemu: hotplug: Add validation for coldplug of individual - vcpus - -Validate that users don't try to disable vcpu 0. - -(cherry picked from commit ee86d45de35bff5f75d1583701cc9514b59e747c) - -https://bugzilla.redhat.com/show_bug.cgi?id=1437010 ---- - src/qemu/qemu_hotplug.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 5488b1dd4..999c8b804 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5875,6 +5875,21 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - } - - -+static int -+qemuDomainVcpuValidateConfig(virBitmapPtr map, -+ bool state) -+{ -+ /* vcpu 0 can't be disabled */ -+ if (!state && virBitmapIsBitSet(map, 0)) { -+ virReportError(VIR_ERR_INVALID_ARG, "%s", -+ _("vCPU '0' must be enabled")); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ - int - qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, -@@ -5909,6 +5924,11 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, - } - } - -+ if (persistentDef) { -+ if (qemuDomainVcpuValidateConfig(map, state) < 0) -+ goto cleanup; -+ } -+ - if (livevcpus && - qemuDomainSetVcpusLive(driver, cfg, vm, livevcpus, state) < 0) - goto cleanup; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Clear-vcpu-ordering-for-coldplug-of-vcpus.patch b/SOURCES/libvirt-qemu-hotplug-Clear-vcpu-ordering-for-coldplug-of-vcpus.patch deleted file mode 100644 index a44491d..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Clear-vcpu-ordering-for-coldplug-of-vcpus.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 3c2e5075ef3be22f203177cc9a1a912546d37ffe Mon Sep 17 00:00:00 2001 -Message-Id: <3c2e5075ef3be22f203177cc9a1a912546d37ffe@dist-git> -From: Peter Krempa -Date: Tue, 4 Apr 2017 09:31:22 +0200 -Subject: [PATCH] qemu: hotplug: Clear vcpu ordering for coldplug of vcpus - -Vcpu order is required to stay sequential. Clear the order on cpu -coldplug to avoid issues with removing vcpus out of sequence. - -(cherry picked from commit b416a33a6f49b7755a65d0de4ee09c770b79cc8d) - -https://bugzilla.redhat.com/show_bug.cgi?id=1437010 ---- - src/qemu/qemu_hotplug.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 48de6b815..5488b1dd4 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5784,13 +5784,15 @@ qemuDomainSetVcpuConfig(virDomainDefPtr def, - - def->individualvcpus = true; - -+ /* ordering information may become invalid, thus clear it */ -+ virDomainDefVcpuOrderClear(def); -+ - while ((next = virBitmapNextSetBit(map, next)) >= 0) { - if (!(vcpu = virDomainDefGetVcpu(def, next))) - continue; - - vcpu->online = state; - vcpu->hotpluggable = VIR_TRISTATE_BOOL_YES; -- vcpu->order = 0; - } - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Don-t-save-status-XML-when-monitor-is-closed.patch b/SOURCES/libvirt-qemu-hotplug-Don-t-save-status-XML-when-monitor-is-closed.patch deleted file mode 100644 index 1683c56..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Don-t-save-status-XML-when-monitor-is-closed.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 1cf501e2f4cb1e6840ddb8a8f7b051936f0f8b18 Mon Sep 17 00:00:00 2001 -Message-Id: <1cf501e2f4cb1e6840ddb8a8f7b051936f0f8b18@dist-git> -From: Peter Krempa -Date: Thu, 20 Apr 2017 11:33:10 +0200 -Subject: [PATCH] qemu: hotplug: Don't save status XML when monitor is closed - -In the vcpu hotplug code if exit from the monitor failed we would still -attempt to save the status XML. When the daemon is terminated the -monitor socket is closed. In such case, the written status XML would not -contain the monitor path and thus be invalid. - -Avoid this issue by only saving status XML on success of the monitor -command. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1439452 -(cherry picked from commit 355f5ab998994d40e011cec491483506bbefe04f) ---- - src/qemu/qemu_hotplug.c | 29 ++++++++++++++++------------- - 1 file changed, 16 insertions(+), 13 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 79d0dc94e..120bcdc62 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5386,6 +5386,7 @@ qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, - - static int - qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, -+ virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - unsigned int vcpu) - { -@@ -5427,6 +5428,11 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, - if (qemuDomainRemoveVcpu(driver, vm, vcpu) < 0) - goto cleanup; - -+ qemuDomainVcpuPersistOrder(vm->def); -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) -+ goto cleanup; -+ - ret = 0; - - cleanup: -@@ -5437,6 +5443,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, - - static int - qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver, -+ virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - unsigned int vcpu) - { -@@ -5497,6 +5504,11 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver, - if (qemuDomainValidateVcpuInfo(vm) < 0) - goto cleanup; - -+ qemuDomainVcpuPersistOrder(vm->def); -+ -+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) -+ goto cleanup; -+ - ret = 0; - - cleanup: -@@ -5611,7 +5623,6 @@ qemuDomainSetVcpusLive(virQEMUDriverPtr driver, - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuCgroupEmulatorAllNodesDataPtr emulatorCgroup = NULL; - ssize_t nextvcpu = -1; -- int rc = 0; - int ret = -1; - - if (qemuCgroupEmulatorAllNodesAllow(priv->cgroup, &emulatorCgroup) < 0) -@@ -5619,27 +5630,19 @@ qemuDomainSetVcpusLive(virQEMUDriverPtr driver, - - if (enable) { - while ((nextvcpu = virBitmapNextSetBit(vcpumap, nextvcpu)) != -1) { -- if ((rc = qemuDomainHotplugAddVcpu(driver, vm, nextvcpu)) < 0) -- break; -+ if (qemuDomainHotplugAddVcpu(driver, cfg, vm, nextvcpu) < 0) -+ goto cleanup; - } - } else { - for (nextvcpu = virDomainDefGetVcpusMax(vm->def) - 1; nextvcpu >= 0; nextvcpu--) { - if (!virBitmapIsBitSet(vcpumap, nextvcpu)) - continue; - -- if ((rc = qemuDomainHotplugDelVcpu(driver, vm, nextvcpu)) < 0) -- break; -+ if (qemuDomainHotplugDelVcpu(driver, cfg, vm, nextvcpu) < 0) -+ goto cleanup; - } - } - -- qemuDomainVcpuPersistOrder(vm->def); -- -- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) -- goto cleanup; -- -- if (rc < 0) -- goto cleanup; -- - ret = 0; - - cleanup: --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Fix-formatting-strings-in-qemuDomainFilterHotplugVcpuEntities.patch b/SOURCES/libvirt-qemu-hotplug-Fix-formatting-strings-in-qemuDomainFilterHotplugVcpuEntities.patch deleted file mode 100644 index e814390..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Fix-formatting-strings-in-qemuDomainFilterHotplugVcpuEntities.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 498fbdbe081260f7e42a1659e11912f9f2c0e5ad Mon Sep 17 00:00:00 2001 -Message-Id: <498fbdbe081260f7e42a1659e11912f9f2c0e5ad@dist-git> -From: Peter Krempa -Date: Tue, 4 Apr 2017 09:31:21 +0200 -Subject: [PATCH] qemu: hotplug: Fix formatting strings in - qemuDomainFilterHotplugVcpuEntities - -'next' is declared as 'ssize_t' so use '%zd' - -(cherry picked from commit 86d69c309181ed7782427261abd85a4b3fdc704f) - -https://bugzilla.redhat.com/show_bug.cgi?id=1437010 ---- - src/qemu/qemu_hotplug.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index b5b520d8c..48de6b815 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5823,13 +5823,13 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - - if (vcpu->online == state) { - virReportError(VIR_ERR_INVALID_ARG, -- _("vcpu '%zu' is already in requested state"), next); -+ _("vcpu '%zd' is already in requested state"), next); - goto cleanup; - } - - if (vcpu->online && !vcpu->hotpluggable) { - virReportError(VIR_ERR_INVALID_ARG, -- _("vcpu '%zu' can't be hotunplugged"), next); -+ _("vcpu '%zd' can't be hotunplugged"), next); - goto cleanup; - } - } -@@ -5845,7 +5845,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - - if (vcpupriv->vcpus == 0) { - virReportError(VIR_ERR_INVALID_ARG, -- _("vcpu '%zu' belongs to a larger hotpluggable entity, " -+ _("vcpu '%zd' belongs to a larger hotpluggable entity, " - "but siblings were not selected"), next); - goto cleanup; - } -@@ -5854,7 +5854,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - if (!virBitmapIsBitSet(map, i)) { - virReportError(VIR_ERR_INVALID_ARG, - _("vcpu '%zu' was not selected but it belongs to " -- "hotpluggable entity '%zu-%zu' which was " -+ "hotpluggable entity '%zd-%zd' which was " - "partially selected"), - i, next, next + vcpupriv->vcpus - 1); - goto cleanup; --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Iterate-over-vcpu-0-in-individual-vcpu-hotplug-code.patch b/SOURCES/libvirt-qemu-hotplug-Iterate-over-vcpu-0-in-individual-vcpu-hotplug-code.patch deleted file mode 100644 index 40d40ca..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Iterate-over-vcpu-0-in-individual-vcpu-hotplug-code.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 9dcf5d0029fe9b1e1e17b20070702bc1ce6382ad Mon Sep 17 00:00:00 2001 -Message-Id: <9dcf5d0029fe9b1e1e17b20070702bc1ce6382ad@dist-git> -From: Peter Krempa -Date: Tue, 4 Apr 2017 09:31:20 +0200 -Subject: [PATCH] qemu: hotplug: Iterate over vcpu 0 in individual vcpu hotplug - code - -Buggy condition meant that vcpu0 would not be iterated in the checks. -Since it's not hotpluggable anyways we would not be able to break the -configuration of a live VM. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1437013 -(cherry picked from commit 315f443dbb9f821fb207c30585e01dfbaac01878) ---- - src/qemu/qemu_hotplug.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index de561da58..b5b520d8c 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5784,7 +5784,7 @@ qemuDomainSetVcpuConfig(virDomainDefPtr def, - - def->individualvcpus = true; - -- while ((next = virBitmapNextSetBit(map, next)) > 0) { -+ while ((next = virBitmapNextSetBit(map, next)) >= 0) { - if (!(vcpu = virDomainDefGetVcpu(def, next))) - continue; - -@@ -5817,7 +5817,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - return NULL; - - /* make sure that all selected vcpus are in the correct state */ -- while ((next = virBitmapNextSetBit(map, next)) > 0) { -+ while ((next = virBitmapNextSetBit(map, next)) >= 0) { - if (!(vcpu = virDomainDefGetVcpu(def, next))) - continue; - -@@ -5837,7 +5837,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - /* Make sure that all vCPUs belonging to a single hotpluggable entity were - * selected and then de-select any sub-threads of it. */ - next = -1; -- while ((next = virBitmapNextSetBit(map, next)) > 0) { -+ while ((next = virBitmapNextSetBit(map, next)) >= 0) { - if (!(vcpu = virDomainDefGetVcpu(def, next))) - continue; - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Unexport-qemuDomainHotplugDelVcpu.patch b/SOURCES/libvirt-qemu-hotplug-Unexport-qemuDomainHotplugDelVcpu.patch deleted file mode 100644 index f560a5b..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Unexport-qemuDomainHotplugDelVcpu.patch +++ /dev/null @@ -1,46 +0,0 @@ -From abb3d4b218479bb4609a208491448bc70b0d356d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Thu, 20 Apr 2017 11:33:09 +0200 -Subject: [PATCH] qemu: hotplug: Unexport qemuDomainHotplugDelVcpu - -The function is used only in the hotplug module. - -(cherry picked from commit f24dc5e2c2ad184e64d8e80f196cee5006fc7e10) - -https://bugzilla.redhat.com/show_bug.cgi?id=1439452 ---- - src/qemu/qemu_hotplug.c | 2 +- - src/qemu/qemu_hotplug.h | 3 --- - 2 files changed, 1 insertion(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 37b8d455c..79d0dc94e 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5384,7 +5384,7 @@ qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, - } - - --int -+static int - qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, - virDomainObjPtr vm, - unsigned int vcpu) -diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h -index f06f232bb..985c6733f 100644 ---- a/src/qemu/qemu_hotplug.h -+++ b/src/qemu/qemu_hotplug.h -@@ -140,9 +140,6 @@ int qemuDomainDetachRNGDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng); - --int qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, -- virDomainObjPtr vm, -- unsigned int vcpu); - void qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, - virDomainObjPtr vm, - const char *alias); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-hotplug-Validate-that-vcpu-hotplug-does-not-break-config.patch b/SOURCES/libvirt-qemu-hotplug-Validate-that-vcpu-hotplug-does-not-break-config.patch deleted file mode 100644 index 4245ade..0000000 --- a/SOURCES/libvirt-qemu-hotplug-Validate-that-vcpu-hotplug-does-not-break-config.patch +++ /dev/null @@ -1,72 +0,0 @@ -From b6f6759fcada504563b4c439975bee66fd611162 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Tue, 4 Apr 2017 09:31:24 +0200 -Subject: [PATCH] qemu: hotplug: Validate that vcpu-hotplug does not break - config - -Make sure that non-hotpluggable vcpus stay clustered at the beginning -after modifying persistent definition. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1437010 -(cherry picked from commit 079832103c3b7883e36db90705631cc55cac9dcc) ---- - src/qemu/qemu_hotplug.c | 26 ++++++++++++++++++++++++-- - 1 file changed, 24 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index 999c8b804..a6dac6f09 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -5876,9 +5876,14 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - - - static int --qemuDomainVcpuValidateConfig(virBitmapPtr map, -+qemuDomainVcpuValidateConfig(virDomainDefPtr def, -+ virBitmapPtr map, - bool state) - { -+ virDomainVcpuDefPtr vcpu; -+ size_t maxvcpus = virDomainDefGetVcpusMax(def); -+ ssize_t next; -+ - /* vcpu 0 can't be disabled */ - if (!state && virBitmapIsBitSet(map, 0)) { - virReportError(VIR_ERR_INVALID_ARG, "%s", -@@ -5886,6 +5891,23 @@ qemuDomainVcpuValidateConfig(virBitmapPtr map, - return -1; - } - -+ /* non-hotpluggable vcpus need to stay clustered starting from vcpu 0 */ -+ for (next = virBitmapNextSetBit(map, -1) + 1; next < maxvcpus; next++) { -+ if (!(vcpu = virDomainDefGetVcpu(def, next))) -+ continue; -+ -+ /* skip vcpus being modified */ -+ if (virBitmapIsBitSet(map, next)) -+ continue; -+ -+ if (vcpu->online && vcpu->hotpluggable == VIR_TRISTATE_BOOL_NO) { -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("vcpu '%zd' can't be modified as it is followed " -+ "by non-hotpluggable online vcpus"), next); -+ return -1; -+ } -+ } -+ - return 0; - } - -@@ -5925,7 +5947,7 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, - } - - if (persistentDef) { -- if (qemuDomainVcpuValidateConfig(map, state) < 0) -+ if (qemuDomainVcpuValidateConfig(persistentDef, map, state) < 0) - goto cleanup; - } - --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-improve-detection-of-UNIX-path-generated-by-libvirt.patch b/SOURCES/libvirt-qemu-improve-detection-of-UNIX-path-generated-by-libvirt.patch deleted file mode 100644 index 009c002..0000000 --- a/SOURCES/libvirt-qemu-improve-detection-of-UNIX-path-generated-by-libvirt.patch +++ /dev/null @@ -1,229 +0,0 @@ -From b5c438b6dba5efe46a8489bde49201d953367c07 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Tue, 16 May 2017 11:46:13 +0200 -Subject: [PATCH] qemu: improve detection of UNIX path generated by libvirt - -Currently we consider all UNIX paths with specific prefix as generated -by libvirt, but that's a wrong assumption. Let's make the detection -better by actually checking whether the whole path matches one of the -paths that we generate or generated in the past. - -The UNIX path isn't stored in config XML since libvirt-1.3.1. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446980 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit ed996604464ab1652ad8d2de3ac446f460dd2ab1) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 66 +++++++++++++++++----- - .../qemuxml2argv-channel-unix-source-path.xml | 29 ++++++++++ - .../qemuxml2xmlout-channel-unix-source-path.xml | 45 +++++++++++++++ - tests/qemuxml2xmltest.c | 2 + - 4 files changed, 128 insertions(+), 14 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml - create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 5ef3d0577..117c6142b 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3123,24 +3123,58 @@ qemuDomainDefaultNetModel(const virDomainDef *def, - - - /* -- * Clear auto generated unix socket path, i.e., the one which starts with our -- * channel directory. -+ * Clear auto generated unix socket paths: -+ * -+ * libvirt 1.2.18 and older: -+ * {cfg->channelTargetDir}/{dom-name}.{target-name} -+ * -+ * libvirt 1.2.19 - 1.3.2: -+ * {cfg->channelTargetDir}/domain-{dom-name}/{target-name} -+ * -+ * libvirt 1.3.3 and newer: -+ * {cfg->channelTargetDir}/domain-{dom-id}-{short-dom-name}/{target-name} -+ * -+ * The unix socket path was stored in config XML until libvirt 1.3.0. -+ * If someone specifies the same path as we generate, they shouldn't do it. -+ * -+ * This function clears the path for migration as well, so we need to clear -+ * the path even if we are not storing it in the XML. - */ --static void -+static int - qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr, - virQEMUDriverPtr driver) - { -- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); -+ virQEMUDriverConfigPtr cfg; -+ virBuffer buf = VIR_BUFFER_INITIALIZER; -+ char *regexp = NULL; -+ int ret = -1; - -- if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && -- chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO && -- chr->source->type == VIR_DOMAIN_CHR_TYPE_UNIX && -- chr->source->data.nix.path && -- STRPREFIX(chr->source->data.nix.path, cfg->channelTargetDir)) { -- VIR_FREE(chr->source->data.nix.path); -+ if (chr->deviceType != VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL || -+ chr->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO || -+ chr->source->type != VIR_DOMAIN_CHR_TYPE_UNIX || -+ !chr->source->data.nix.path) { -+ return 0; - } - -+ cfg = virQEMUDriverGetConfig(driver); -+ -+ virBufferEscapeRegex(&buf, "^%s", cfg->channelTargetDir); -+ virBufferAddLit(&buf, "/([^/]+\\.)|(domain-[^/]+/)"); -+ virBufferEscapeRegex(&buf, "%s$", chr->target.name); -+ -+ if (virBufferCheckError(&buf) < 0) -+ goto cleanup; -+ -+ regexp = virBufferContentAndReset(&buf); -+ -+ if (virStringMatch(chr->source->data.nix.path, regexp)) -+ VIR_FREE(chr->source->data.nix.path); -+ -+ ret = 0; -+ cleanup: -+ VIR_FREE(regexp); - virObjectUnref(cfg); -+ return ret; - } - - -@@ -3408,8 +3442,10 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - - /* clear auto generated unix socket path for inactive definitions */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && -- dev->type == VIR_DOMAIN_DEVICE_CHR) -- qemuDomainChrDefDropDefaultPath(dev->data.chr, driver); -+ dev->type == VIR_DOMAIN_DEVICE_CHR) { -+ if (qemuDomainChrDefDropDefaultPath(dev->data.chr, driver) < 0) -+ goto cleanup; -+ } - - /* forbid capabilities mode hostdev in this kind of hypervisor */ - if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV && -@@ -4195,8 +4231,10 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver, - } - } - -- for (i = 0; i < def->nchannels; i++) -- qemuDomainChrDefDropDefaultPath(def->channels[i], driver); -+ for (i = 0; i < def->nchannels; i++) { -+ if (qemuDomainChrDefDropDefaultPath(def->channels[i], driver) < 0) -+ goto cleanup; -+ } - } - - format: -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml -new file mode 100644 -index 000000000..42cb3c387 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-unix-source-path.xml -@@ -0,0 +1,29 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml -new file mode 100644 -index 000000000..2d8fa1e3a ---- /dev/null -+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-unix-source-path.xml -@@ -0,0 +1,45 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+ -+
      -+ -+ -+ -+ -+ -+ -diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c -index 26a2259fd..ff533ab19 100644 ---- a/tests/qemuxml2xmltest.c -+++ b/tests/qemuxml2xmltest.c -@@ -555,6 +555,8 @@ mymain(void) - DO_TEST("channel-virtio", NONE); - DO_TEST("channel-virtio-state", NONE); - -+ DO_TEST_FULL("channel-unix-source-path", WHEN_INACTIVE, GIC_NONE, NONE); -+ - DO_TEST("hostdev-usb-address", NONE); - DO_TEST("hostdev-pci-address", NONE); - DO_TEST("hostdev-vfio", NONE); --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_DEVICE_QEMU_XHCI.patch b/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_DEVICE_QEMU_XHCI.patch deleted file mode 100644 index ef575a4..0000000 --- a/SOURCES/libvirt-qemu-introduce-QEMU_CAPS_DEVICE_QEMU_XHCI.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 0ca6807c400aa86fb9316f4fa481c253f0de1311 Mon Sep 17 00:00:00 2001 -Message-Id: <0ca6807c400aa86fb9316f4fa481c253f0de1311@dist-git> -From: Pavel Hrdina -Date: Fri, 28 Apr 2017 11:59:49 +0200 -Subject: [PATCH] qemu: introduce QEMU_CAPS_DEVICE_QEMU_XHCI - -Signed-off-by: Pavel Hrdina -Acked-by: Andrea Bolognani -(cherry picked from commit 5237a74d4aeb073255a2a7165144a56b9e2e3b53) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438682 - -Conflicts: - - resolved capabilities flag conflicts due to missing capability - in downstream code - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_capabilities.c | 2 ++ - src/qemu/qemu_capabilities.h | 1 + - tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + - 3 files changed, 4 insertions(+) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index 49de506ed..b76b79342 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -365,6 +365,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, - "block-write-threshold", - "query-named-block-nodes", - "cpu-cache", -+ "qemu-xhci", - ); - - -@@ -1611,6 +1612,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { - { "vhost-scsi", QEMU_CAPS_DEVICE_VHOST_SCSI }, - { "nvdimm", QEMU_CAPS_DEVICE_NVDIMM }, - { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, -+ { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, - }; - - static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { -diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h -index 644b8e27b..1cd3ec37d 100644 ---- a/src/qemu/qemu_capabilities.h -+++ b/src/qemu/qemu_capabilities.h -@@ -402,6 +402,7 @@ typedef enum { - QEMU_CAPS_BLOCK_WRITE_THRESHOLD, /* BLOCK_WRITE_THRESHOLD event */ - QEMU_CAPS_QUERY_NAMED_BLOCK_NODES, /* qmp query-named-block-nodes */ - QEMU_CAPS_CPU_CACHE, /* -cpu supports host-cache-info and l3-cache properties */ -+ QEMU_CAPS_DEVICE_QEMU_XHCI, /* -device qemu-xhci */ - - QEMU_CAPS_LAST /* this must always be the last item */ - } virQEMUCapsFlags; -diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -index 496c9ceb8..83ed0f1c6 100644 ---- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml -@@ -208,6 +208,7 @@ - - - -+ - 2008090 - 0 - (v2.9.0-rc0-142-g940a8ce) --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-json-Fix-daemon-crash-on-handling-domain-shutdown-event.patch b/SOURCES/libvirt-qemu-json-Fix-daemon-crash-on-handling-domain-shutdown-event.patch deleted file mode 100644 index b2501ff..0000000 --- a/SOURCES/libvirt-qemu-json-Fix-daemon-crash-on-handling-domain-shutdown-event.patch +++ /dev/null @@ -1,51 +0,0 @@ -From e42a328573e2cfc9e2715d2497ca98b55c067878 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Erik Skultety -Date: Wed, 31 May 2017 08:21:34 +0200 -Subject: [PATCH] qemu: json: Fix daemon crash on handling domain shutdown - event - -https://bugzilla.redhat.com/show_bug.cgi?id=1384007 - -commit a8eba5036 added further checking of the guest shutdown cause, but -this enhancement is available since qemu 2.10, causing a crash because -of a NULL pointer dereference on older qemus. - -Thread 1 "libvirtd" received signal SIGSEGV, Segmentation fault. -0x00007ffff72441af in virJSONValueObjectGet (object=0x0, - key=0x7fffd5ef11bf "guest") - at util/virjson.c:769 -769 if (object->type != VIR_JSON_TYPE_OBJECT) -(gdb) bt -0 in virJSONValueObjectGet -1 in virJSONValueObjectGetBoolean -2 in qemuMonitorJSONHandleShutdown -3 in qemuMonitorJSONIOProcessEvent -4 in qemuMonitorJSONIOProcessLine -5 in qemuMonitorJSONIOProcess -6 in qemuMonitorIOProcess - -Signed-off-by: Erik Skultety -(cherry picked from commit f9b69c828994ceea61759d4be43f66da67559033) -Signed-off-by: Martin Kletzander -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_json.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c -index f22df3007..a244403b5 100644 ---- a/src/qemu/qemu_monitor_json.c -+++ b/src/qemu/qemu_monitor_json.c -@@ -528,7 +528,7 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitorPtr mon, virJSONValuePtr da - bool guest = false; - virTristateBool guest_initiated = VIR_TRISTATE_BOOL_ABSENT; - -- if (virJSONValueObjectGetBoolean(data, "guest", &guest) == 0) -+ if (data && virJSONValueObjectGetBoolean(data, "guest", &guest) == 0) - guest_initiated = guest ? VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO; - - qemuMonitorEmitShutdown(mon, guest_initiated); --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-migration-Refresh-device-information-after-transferring-state.patch b/SOURCES/libvirt-qemu-migration-Refresh-device-information-after-transferring-state.patch new file mode 100644 index 0000000..46c76e1 --- /dev/null +++ b/SOURCES/libvirt-qemu-migration-Refresh-device-information-after-transferring-state.patch @@ -0,0 +1,113 @@ +From c043762bfe04d7b10030b76fae12473b031c3c0a Mon Sep 17 00:00:00 2001 +Message-Id: +From: Peter Krempa +Date: Fri, 2 Feb 2018 11:05:00 +0100 +Subject: [PATCH] qemu: migration: Refresh device information after + transferring state + +In my first approach in 4b480d10768c I overlooked the comment in +qemuMigrationRunIncoming stating that during actual migration the +qemuMigrationRunIncoming does not wait until the migration is complete +but rather offloads that to the Finish phase of migration. + +This means that during actual migration qemuProcessRefreshState was +called prior to qemu actually transferring the full state and thus the +queries did not get the correct information. The approach worked only +for restore, where we wait for the migration to finish during qemu +startup. + +Fix the issue by calling qemuProcessRefreshState both from +qemuProcessStart if there's no incomming migration and from +qemuMigrationFinish so that the code actually works as expected. + +(cherry picked from commit 93db7eea1b86408e02852a8c886d473f4f5007e3) + + https://bugzilla.redhat.com/show_bug.cgi?id=1463168 +--- + src/qemu/qemu_migration.c | 9 +++++++++ + src/qemu/qemu_process.c | 17 ++++++++++------- + src/qemu/qemu_process.h | 4 ++++ + 3 files changed, 23 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index a50bb7206c..0968dd62a4 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -5351,6 +5351,15 @@ qemuMigrationFinish(virQEMUDriverPtr driver, + goto endjob; + } + ++ /* Now that the state data was transferred we can refresh the actual state ++ * of the devices */ ++ if (qemuProcessRefreshState(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) { ++ /* Similarly to the case above v2 protocol will not be able to recover ++ * from this. Let's ignore this and perhaps stuff will not break. */ ++ if (v3proto) ++ goto endjob; ++ } ++ + if (priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_POSTCOPY) + inPostCopy = true; + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 3bb4b14948..caf967dac5 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -6080,7 +6080,7 @@ qemuProcessLaunch(virConnectPtr conn, + * function is called after a deferred migration finishes so that we can update + * state influenced by the migration stream. + */ +-static int ++int + qemuProcessRefreshState(virQEMUDriverPtr driver, + virDomainObjPtr vm, + qemuDomainAsyncJob asyncJob) +@@ -6121,9 +6121,6 @@ qemuProcessFinishStartup(virConnectPtr conn, + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + int ret = -1; + +- if (qemuProcessRefreshState(driver, vm, asyncJob) < 0) +- goto cleanup; +- + if (startCPUs) { + VIR_DEBUG("Starting domain CPUs"); + if (qemuProcessStartCPUs(driver, vm, conn, +@@ -6227,11 +6224,17 @@ qemuProcessStart(virConnectPtr conn, + VIR_DOMAIN_PAUSED_USER) < 0) + goto stop; + +- /* Keep watching qemu log for errors during incoming migration, otherwise +- * unset reporting errors from qemu log. */ +- if (!incoming) ++ if (!incoming) { ++ /* Keep watching qemu log for errors during incoming migration, otherwise ++ * unset reporting errors from qemu log. */ + qemuMonitorSetDomainLog(priv->mon, NULL, NULL, NULL); + ++ /* Refresh state of devices from qemu. During migration this needs to ++ * happen after the state information is fully transferred. */ ++ if (qemuProcessRefreshState(driver, vm, asyncJob) < 0) ++ goto stop; ++ } ++ + ret = 0; + + cleanup: +diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h +index cd9a720313..b383ff309b 100644 +--- a/src/qemu/qemu_process.h ++++ b/src/qemu/qemu_process.h +@@ -129,6 +129,10 @@ int qemuProcessFinishStartup(virConnectPtr conn, + bool startCPUs, + virDomainPausedReason pausedReason); + ++int qemuProcessRefreshState(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ qemuDomainAsyncJob asyncJob); ++ + typedef enum { + VIR_QEMU_PROCESS_STOP_MIGRATED = 1 << 0, + VIR_QEMU_PROCESS_STOP_NO_RELABEL = 1 << 1, +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemu-mkdir-memory_backing_dir-on-startup.patch b/SOURCES/libvirt-qemu-mkdir-memory_backing_dir-on-startup.patch deleted file mode 100644 index 649b2ed..0000000 --- a/SOURCES/libvirt-qemu-mkdir-memory_backing_dir-on-startup.patch +++ /dev/null @@ -1,56 +0,0 @@ -From d68103f77527b1f7a5a3cf1fdc4029a9181e6799 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Wed, 31 May 2017 15:20:17 +0200 -Subject: [PATCH] qemu: mkdir memory_backing_dir on startup - -https://bugzilla.redhat.com/show_bug.cgi?id=1214369 - -In 48d9e6cdcc and friends we've allowed users to back guest -memory by a file inside the host. And in order to keep things -manageable the memory_backing_dir variable was introduced to -qemu.conf to specify the directory where the files are kept. -However, libvirt's policy is that directories are created on -domain startup if they don't exist. We've missed this one. - -Signed-off-by: Michal Privoznik -(cherry picked from commit 3bab51e05656332f7952958705e59046ce30daa3) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c31d07a659..b741c1b5a6 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -706,6 +706,11 @@ qemuStateInitialize(bool privileged, - cfg->nvramDir); - goto error; - } -+ if (virFileMakePath(cfg->memoryBackingDir) < 0) { -+ virReportSystemError(errno, _("Failed to create memory backing dir %s"), -+ cfg->memoryBackingDir); -+ goto error; -+ } - - qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img"); - -@@ -830,6 +835,13 @@ qemuStateInitialize(bool privileged, - (int) cfg->group); - goto error; - } -+ if (chown(cfg->memoryBackingDir, cfg->user, cfg->group) < 0) { -+ virReportSystemError(errno, -+ _("unable to set ownership of '%s' to %d:%d"), -+ cfg->memoryBackingDir, (int) cfg->user, -+ (int) cfg->group); -+ goto error; -+ } - - run_uid = cfg->user; - run_gid = cfg->group; --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-monitor-Don-t-bother-extracting-vCPU-halted-state-in-text-monitor.patch b/SOURCES/libvirt-qemu-monitor-Don-t-bother-extracting-vCPU-halted-state-in-text-monitor.patch deleted file mode 100644 index 64b7377..0000000 --- a/SOURCES/libvirt-qemu-monitor-Don-t-bother-extracting-vCPU-halted-state-in-text-monitor.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3dfdc7e73f15216b0a9ef5858329c4daf3142ed5 Mon Sep 17 00:00:00 2001 -Message-Id: <3dfdc7e73f15216b0a9ef5858329c4daf3142ed5@dist-git> -From: Peter Krempa -Date: Fri, 19 May 2017 09:44:14 +0200 -Subject: [PATCH] qemu: monitor: Don't bother extracting vCPU halted state in - text monitor - -The code causes the 'offset' variable to be overwritten (possibly with -NULL if neither of the vCPUs is halted) which causes a crash since the -variable is still used after that part. - -Additionally there's a bug, since strstr() would look up the '(halted)' -string in the whole string rather than just the currently processed line -the returned data is completely bogus. - -Rather than switching to single line parsing let's remove the code -altogether since it has a commonly used JSON monitor alternative and -the data itself is not very useful to report. - -The code was introduced in commit cc5e695bde - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452106 -(cherry picked from commit 6ff99e95771bb33531ea6733a823bc6a30158256) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_monitor_text.c | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c -index 9c9eeea01..66c94fbcd 100644 ---- a/src/qemu/qemu_monitor_text.c -+++ b/src/qemu/qemu_monitor_text.c -@@ -552,12 +552,6 @@ qemuMonitorTextQueryCPUs(qemuMonitorPtr mon, - cpu.qemu_id = cpuid; - cpu.tid = tid; - -- /* Extract halted indicator */ -- if ((offset = strstr(line, "(halted)")) != NULL) -- cpu.halted = true; -- else -- cpu.halted = false; -- - if (VIR_APPEND_ELEMENT_COPY(cpus, ncpus, cpu) < 0) { - ret = -1; - goto cleanup; --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-parse-Allocate-disk-definition-with-private-data.patch b/SOURCES/libvirt-qemu-parse-Allocate-disk-definition-with-private-data.patch new file mode 100644 index 0000000..9db928d --- /dev/null +++ b/SOURCES/libvirt-qemu-parse-Allocate-disk-definition-with-private-data.patch @@ -0,0 +1,35 @@ +From 53806054c0b1b7ee2c8df5e46fa18b87aaee1ca1 Mon Sep 17 00:00:00 2001 +Message-Id: <53806054c0b1b7ee2c8df5e46fa18b87aaee1ca1@dist-git> +From: Peter Krempa +Date: Mon, 13 Nov 2017 13:37:52 +0100 +Subject: [PATCH] qemu: parse: Allocate disk definition with private data + +Use virDomainDiskDefNew instead of VIR_ALLOC in +qemuParseCommandLineDisk. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510781 +(cherry picked from commit 994c49ac34181cb664b18856df38c2f5c326ff03) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_parse_command.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c +index 649c3b1ccf..a8d0d7c535 100644 +--- a/src/qemu/qemu_parse_command.c ++++ b/src/qemu/qemu_parse_command.c +@@ -658,10 +658,8 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, + 0) < 0) + return NULL; + +- if (VIR_ALLOC(def) < 0) ++ if (!(def = virDomainDiskDefNew(xmlopt))) + goto cleanup; +- if (VIR_ALLOC(def->src) < 0) +- goto error; + + if (qemuDomainIsPSeries(dom)) + def->bus = VIR_DOMAIN_DISK_BUS_SCSI; +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-prefer-the-PCI-bus-alias-from-status-XML.patch b/SOURCES/libvirt-qemu-prefer-the-PCI-bus-alias-from-status-XML.patch new file mode 100644 index 0000000..946a89c --- /dev/null +++ b/SOURCES/libvirt-qemu-prefer-the-PCI-bus-alias-from-status-XML.patch @@ -0,0 +1,89 @@ +From 2e8ff390a9ee06b68a2591c761d185539beb49d4 Mon Sep 17 00:00:00 2001 +Message-Id: <2e8ff390a9ee06b68a2591c761d185539beb49d4@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Thu, 30 Nov 2017 17:45:58 +0100 +Subject: [PATCH] qemu: prefer the PCI bus alias from status XML +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For some corner cases, virQEMUCapsHasPCIMultiBus depends on the QEMU +version, which is by design not stored in the status XML and therefore +it cannot be fixed for all existing running domains. + +Prefer the controller alias read from the status XML when formatting +PCI addresses and only fall back to using virQEMUCapsHasPCIMultiBus +if the alias is a user alias. + +This fixes hotplug after daemon restart for domains not using user +aliases. + +Partially reverts commit 937f3195. + +https://bugzilla.redhat.com/show_bug.cgi?id=1518148 +(cherry picked from commit dacfc6b10bcff1c275d21a37edf0bc83e0947492) +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 42 ++++++++++++++++++++++-------------------- + 1 file changed, 22 insertions(+), 20 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 624a50d0b3..b462c7cf09 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -318,29 +318,31 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, + + if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && + cont->idx == info->addr.pci.bus) { ++ contAlias = cont->info.alias; + contIsPHB = virDomainControllerIsPSeriesPHB(cont); + contTargetIndex = cont->opts.pciopts.targetIndex; + +- /* When domain has builtin pci-root controller we don't put it +- * onto cmd line. Therefore we can't set its alias. In that +- * case, use the default one. */ +- if (!qemuDomainIsPSeries(domainDef) && +- cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { +- if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) +- contAlias = "pci.0"; +- else +- contAlias = "pci"; +- } else if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { +- contAlias = "pcie.0"; +- } else { +- contAlias = cont->info.alias; +- if (!contAlias) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Device alias was not set for PCI " +- "controller with index %u required " +- "for device at address %s"), +- info->addr.pci.bus, devStr); +- goto cleanup; ++ if (!contAlias) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Device alias was not set for PCI " ++ "controller with index %u required " ++ "for device at address %s"), ++ info->addr.pci.bus, devStr); ++ goto cleanup; ++ } ++ ++ if (virDomainDeviceAliasIsUserAlias(contAlias)) { ++ /* When domain has builtin pci-root controller we don't put it ++ * onto cmd line. Therefore we can't set its alias. In that ++ * case, use the default one. */ ++ if (!qemuDomainIsPSeries(domainDef) && ++ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { ++ if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) ++ contAlias = "pci.0"; ++ else ++ contAlias = "pci"; ++ } else if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { ++ contAlias = "pcie.0"; + } + } + break; +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-process-Clean-automatic-NUMA-cpu-pinning-information-on-shutdown.patch b/SOURCES/libvirt-qemu-process-Clean-automatic-NUMA-cpu-pinning-information-on-shutdown.patch deleted file mode 100644 index 2e2d155..0000000 --- a/SOURCES/libvirt-qemu-process-Clean-automatic-NUMA-cpu-pinning-information-on-shutdown.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 9cde726d82715272f2b06580dde9a65882263e85 Mon Sep 17 00:00:00 2001 -Message-Id: <9cde726d82715272f2b06580dde9a65882263e85@dist-git> -From: Peter Krempa -Date: Fri, 28 Apr 2017 10:45:16 +0200 -Subject: [PATCH] qemu: process: Clean automatic NUMA/cpu pinning information - on shutdown - -Clean the stale data after shutting down the VM. Otherwise the data -would be leaked on next VM start. This happens due to the fact that the -private data object is not freed on destroy of the VM. - -(cherry picked from commit 1730cdc665a499afc28683a4ce21493f967411b7) -https://bugzilla.redhat.com/show_bug.cgi?id=1445627 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 027c831e6..5d2d0662b 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -6433,6 +6433,12 @@ void qemuProcessStop(virQEMUDriverPtr driver, - priv->qemuCaps = NULL; - VIR_FREE(priv->pidfile); - -+ /* remove automatic pinning data */ -+ virBitmapFree(priv->autoNodeset); -+ priv->autoNodeset = NULL; -+ virBitmapFree(priv->autoCpuset); -+ priv->autoCpuset = NULL; -+ - /* The "release" hook cleans up additional resources */ - if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { - char *xml = qemuDomainDefFormatXML(driver, vm->def, 0); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-process-Clean-up-priv-migTLSAlias.patch b/SOURCES/libvirt-qemu-process-Clean-up-priv-migTLSAlias.patch deleted file mode 100644 index 00c7fc8..0000000 --- a/SOURCES/libvirt-qemu-process-Clean-up-priv-migTLSAlias.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3bd19fa5ff139e72fcb0e2982969263d554f6940 Mon Sep 17 00:00:00 2001 -Message-Id: <3bd19fa5ff139e72fcb0e2982969263d554f6940@dist-git> -From: Peter Krempa -Date: Fri, 28 Apr 2017 10:45:18 +0200 -Subject: [PATCH] qemu: process: Clean up priv->migTLSAlias - -The alias would be leaked, since it's not freed on the vm stop path. - -(cherry picked from commit 8c1fee5f12e607a775199b65915715bb5a2b581d) -https://bugzilla.redhat.com/show_bug.cgi?id=1445627 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index c23982db6..2eee70203 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -6443,6 +6443,9 @@ void qemuProcessStop(virQEMUDriverPtr driver, - virDomainUSBAddressSetFree(priv->usbaddrs); - priv->usbaddrs = NULL; - -+ /* clean up migration data */ -+ VIR_FREE(priv->migTLSAlias); -+ - /* The "release" hook cleans up additional resources */ - if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { - char *xml = qemuDomainDefFormatXML(driver, vm->def, 0); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-process-Clear-priv-namespaces-on-VM-shutdown.patch b/SOURCES/libvirt-qemu-process-Clear-priv-namespaces-on-VM-shutdown.patch deleted file mode 100644 index 14fe565..0000000 --- a/SOURCES/libvirt-qemu-process-Clear-priv-namespaces-on-VM-shutdown.patch +++ /dev/null @@ -1,35 +0,0 @@ -From eb52df58d1dc63812430728f173699665e936cdf Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Tue, 23 May 2017 16:33:26 +0200 -Subject: [PATCH] qemu: process: Clear priv->namespaces on VM shutdown - -Otherwise the private data entry would be kept across instances of the -same VM even if it's not configured to do so. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453142 -(cherry picked from commit 5203975f37e24f7b7156f0251f19f5001a6bd6eb) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index df5ba575a..6f0d07242 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -6447,6 +6447,10 @@ void qemuProcessStop(virQEMUDriverPtr driver, - /* clean up migration data */ - VIR_FREE(priv->migTLSAlias); - -+ /* clear previously used namespaces */ -+ virBitmapFree(priv->namespaces); -+ priv->namespaces = NULL; -+ - /* The "release" hook cleans up additional resources */ - if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { - char *xml = qemuDomainDefFormatXML(driver, vm->def, 0); --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-process-Don-t-leak-priv-usbaddrs-after-VM-restart.patch b/SOURCES/libvirt-qemu-process-Don-t-leak-priv-usbaddrs-after-VM-restart.patch deleted file mode 100644 index 071fdca..0000000 --- a/SOURCES/libvirt-qemu-process-Don-t-leak-priv-usbaddrs-after-VM-restart.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 197373d62cfb74faf62e0b1334afcb73fcf25550 Mon Sep 17 00:00:00 2001 -Message-Id: <197373d62cfb74faf62e0b1334afcb73fcf25550@dist-git> -From: Peter Krempa -Date: Fri, 28 Apr 2017 10:45:17 +0200 -Subject: [PATCH] qemu: process: Don't leak priv->usbaddrs after VM restart - -Since the private data structure is not freed upon stopping a VM, the -usbaddrs pointer would be leaked: - -==15388== 136 (16 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 893 of 1,019 -==15388== at 0x4C2CF55: calloc (vg_replace_malloc.c:711) -==15388== by 0x54BF64A: virAlloc (viralloc.c:144) -==15388== by 0x5547588: virDomainUSBAddressSetCreate (domain_addr.c:1608) -==15388== by 0x144D38A2: qemuDomainAssignUSBAddresses (qemu_domain_address.c:2458) -==15388== by 0x144D38A2: qemuDomainAssignAddresses (qemu_domain_address.c:2515) -==15388== by 0x144ED1E3: qemuProcessPrepareDomain (qemu_process.c:5398) -==15388== by 0x144F51FF: qemuProcessStart (qemu_process.c:5979) -[...] - -(cherry picked from commit 3ab802d689796ebac6545267d5db248e13a9a0e6) -https://bugzilla.redhat.com/show_bug.cgi?id=1445627 - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 5d2d0662b..c23982db6 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -6439,6 +6439,10 @@ void qemuProcessStop(virQEMUDriverPtr driver, - virBitmapFree(priv->autoCpuset); - priv->autoCpuset = NULL; - -+ /* remove address data */ -+ virDomainUSBAddressSetFree(priv->usbaddrs); -+ priv->usbaddrs = NULL; -+ - /* The "release" hook cleans up additional resources */ - if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { - char *xml = qemuDomainDefFormatXML(driver, vm->def, 0); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-process-Move-handling-of-non-backing-files-into-qemuDomainDetermineDiskChain.patch b/SOURCES/libvirt-qemu-process-Move-handling-of-non-backing-files-into-qemuDomainDetermineDiskChain.patch new file mode 100644 index 0000000..280f520 --- /dev/null +++ b/SOURCES/libvirt-qemu-process-Move-handling-of-non-backing-files-into-qemuDomainDetermineDiskChain.patch @@ -0,0 +1,88 @@ +From 3ad4635badd77642d59d3789286da72abb66ee72 Mon Sep 17 00:00:00 2001 +Message-Id: <3ad4635badd77642d59d3789286da72abb66ee72@dist-git> +From: Peter Krempa +Date: Fri, 1 Dec 2017 15:57:02 +0100 +Subject: [PATCH] qemu: process: Move handling of non-backing files into + qemuDomainDetermineDiskChain + +Until now we would skip loading of the backing chain for files which +don't support backing chains only when starting up the VM. Move the +check from qemuProcessPrepareHostStorage with some adaptations so that's +always applied. + +(cherry picked from commit 24e47ee2b93312742f73a785b9ca788df4677749) + + Conflicts: + src/qemu/qemu_domain.c: + - since quite lot of the blockdev saga was not backported and + the previous commit is different this one does not apply as + well. + + The changes are to accomodate the not-backported change in + return code logic of qemuDomainDetermineDiskChain which in this + instance initializes ret to 0 instead of -1, which was changed + in a patch that was not backported. + +https://bugzilla.redhat.com/show_bug.cgi?id=1509110 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 17 +++++++++++++++++ + src/qemu/qemu_process.c | 10 ---------- + 2 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 13d120040b..33cb3df949 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -6358,6 +6358,23 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, + if (force_probe) + virStorageSourceBackingStoreClear(disk->src); + ++ /* There is no need to check the backing chain for disks without backing ++ * support */ ++ if (virStorageSourceIsLocalStorage(disk->src) && ++ disk->src->format > VIR_STORAGE_FILE_NONE && ++ disk->src->format < VIR_STORAGE_FILE_BACKING) { ++ ++ if (!virFileExists(disk->src->path)) { ++ if (report_broken) ++ virStorageFileReportBrokenChain(errno, disk->src, disk->src); ++ ++ ret = -1; ++ goto cleanup; ++ } ++ ++ goto cleanup; ++ } ++ + if (virStorageSourceHasBacking(disk->src)) + goto cleanup; + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index f7808227a8..91426ad3c3 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -5554,20 +5554,10 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, + for (i = vm->def->ndisks; i > 0; i--) { + size_t idx = i - 1; + virDomainDiskDefPtr disk = vm->def->disks[idx]; +- virStorageFileFormat format = virDomainDiskGetFormat(disk); + + if (virStorageSourceIsEmpty(disk->src)) + continue; + +- /* There is no need to check the backing chain for disks +- * without backing support, the fact that the file exists is +- * more than enough */ +- if (virStorageSourceIsLocalStorage(disk->src) && +- format > VIR_STORAGE_FILE_NONE && +- format < VIR_STORAGE_FILE_BACKING && +- virFileExists(virDomainDiskGetSource(disk))) +- continue; +- + if (qemuDomainDetermineDiskChain(driver, vm, disk, true, true) >= 0) + continue; + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-process-Save-vcpu-ordering-information-on-reconnect.patch b/SOURCES/libvirt-qemu-process-Save-vcpu-ordering-information-on-reconnect.patch deleted file mode 100644 index 5cc3b93..0000000 --- a/SOURCES/libvirt-qemu-process-Save-vcpu-ordering-information-on-reconnect.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 8df453dfaafbd0001dcdc828eb8b2479b61dc74b Mon Sep 17 00:00:00 2001 -Message-Id: <8df453dfaafbd0001dcdc828eb8b2479b61dc74b@dist-git> -From: Peter Krempa -Date: Tue, 6 Jun 2017 12:28:01 +0200 -Subject: [PATCH] qemu: process: Save vcpu ordering information on reconnect - -vCPU ordering information would not be updated if a vCPU emerged or -disappeared during the time libvirtd is not running. This allowed to -create invalid configuration like: - - [...] - - - - -Call the function that records the information on reconnect. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1451251 -(cherry picked from commit ad3c6b229bcc91177db29d307e8ccc22c6c43565) - -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_process.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index 998dbeb6b5..7e51ca819a 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -3492,6 +3492,8 @@ qemuProcessReconnect(void *opaque) - if (qemuDomainRefreshVcpuInfo(driver, obj, QEMU_ASYNC_JOB_NONE, true) < 0) - goto error; - -+ qemuDomainVcpuPersistOrder(obj->def); -+ - if (qemuSecurityReserveLabel(driver->securityManager, obj->def, obj->pid) < 0) - goto error; - --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-refactor-qemuBuildIOMMUCommandLine.patch b/SOURCES/libvirt-qemu-refactor-qemuBuildIOMMUCommandLine.patch deleted file mode 100644 index 111466e..0000000 --- a/SOURCES/libvirt-qemu-refactor-qemuBuildIOMMUCommandLine.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 657451fe2a5e8b55adbae643ac818b496c9cbc0c Mon Sep 17 00:00:00 2001 -Message-Id: <657451fe2a5e8b55adbae643ac818b496c9cbc0c@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 16 May 2017 10:44:51 +0200 -Subject: [PATCH] qemu: refactor qemuBuildIOMMUCommandLine -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Introduce a separate buffer for options and use a helper -variable for def->iommu. - -(cherry picked from commit b595cc05e83288b743d48904964e4dcb547a2d26) -Signed-off-by: Ján Tomko - -https://bugzilla.redhat.com/show_bug.cgi?id=1427005 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 4d3a3d8ca..b27b9f8ad 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -6664,33 +6664,42 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - const virDomainDef *def, - virQEMUCapsPtr qemuCaps) - { -- if (!def->iommu) -+ virBuffer opts = VIR_BUFFER_INITIALIZER; -+ const virDomainIOMMUDef *iommu = def->iommu; -+ int ret = -1; -+ -+ if (!iommu) - return 0; - - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) - return 0; /* Already handled via -machine */ - -- switch (def->iommu->model) { -+ switch (iommu->model) { - case VIR_DOMAIN_IOMMU_MODEL_INTEL: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_INTEL_IOMMU)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("IOMMU device: '%s' is not supported with " - "this QEMU binary"), -- virDomainIOMMUModelTypeToString(def->iommu->model)); -+ virDomainIOMMUModelTypeToString(iommu->model)); - return -1; - } - if (!qemuDomainIsQ35(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("IOMMU device: '%s' is only supported with " - "Q35 machines"), -- virDomainIOMMUModelTypeToString(def->iommu->model)); -+ virDomainIOMMUModelTypeToString(iommu->model)); - return -1; - } -- virCommandAddArgList(cmd, "-device", "intel-iommu", NULL); -+ virBufferAddLit(&opts, "intel-iommu"); - case VIR_DOMAIN_IOMMU_MODEL_LAST: - break; - } -- return 0; -+ virCommandAddArg(cmd, "-device"); -+ virCommandAddArgBuffer(cmd, &opts); -+ -+ ret = 0; -+ virBufferFreeAndReset(&opts); -+ return ret; - } - - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemu-refactor-qemuDomainMachine-functions.patch b/SOURCES/libvirt-qemu-refactor-qemuDomainMachine-functions.patch deleted file mode 100644 index 8a34730..0000000 --- a/SOURCES/libvirt-qemu-refactor-qemuDomainMachine-functions.patch +++ /dev/null @@ -1,797 +0,0 @@ -From c3d1e1be0a0c972106fa25161777cf0a86c53d06 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Pavel Hrdina -Date: Wed, 19 Apr 2017 09:51:14 +0200 -Subject: [PATCH] qemu: refactor qemuDomainMachine* functions - -Introduce new wrapper functions without *Machine* in the function -name that take the whole virDomainDef structure as argument and -call the existing functions with *Machine* in the function name. - -Change the arguments of existing functions to *machine* and *arch* -because they don't need the whole virDomainDef structure and they -could be used in places where we don't have virDomainDef. - -Signed-off-by: Pavel Hrdina -(cherry picked from commit ac97658d4fe5ce2b4f4949813ded6e2d77b07ee8) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1441964 - -Signed-off-by: Pavel Hrdina ---- - src/qemu/qemu_alias.c | 4 +- - src/qemu/qemu_capabilities.c | 10 ++-- - src/qemu/qemu_command.c | 42 ++++++------- - src/qemu/qemu_domain.c | 131 ++++++++++++++++++++++++++++------------- - src/qemu/qemu_domain.h | 28 ++++++--- - src/qemu/qemu_domain_address.c | 24 ++++---- - src/qemu/qemu_hotplug.c | 14 ++--- - src/qemu/qemu_parse_command.c | 8 +-- - 8 files changed, 161 insertions(+), 100 deletions(-) - -diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c -index 05e1293ef..914b2b94d 100644 ---- a/src/qemu/qemu_alias.c -+++ b/src/qemu/qemu_alias.c -@@ -152,14 +152,14 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef, - * first (and currently only) IDE controller is an integrated - * controller hardcoded with id "ide" - */ -- if (qemuDomainMachineHasBuiltinIDE(domainDef) && -+ if (qemuDomainHasBuiltinIDE(domainDef) && - controller->idx == 0) - return VIR_STRDUP(controller->info.alias, "ide"); - } else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) { - /* for any Q35 machine, the first SATA controller is the - * integrated one, and it too is hardcoded with id "ide" - */ -- if (qemuDomainMachineIsQ35(domainDef) && controller->idx == 0) -+ if (qemuDomainIsQ35(domainDef) && controller->idx == 0) - return VIR_STRDUP(controller->info.alias, "ide"); - } else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) { - /* first USB device is "usb", others are normal "usb%d" */ -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index a8125102c..b7c2c3705 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -2284,7 +2284,7 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, - /* If 'virt' supports PCI, it supports multibus. - * No extra conditions here for simplicity. - */ -- if (qemuDomainMachineIsVirt(def)) -+ if (qemuDomainIsVirt(def)) - return true; - - return false; -@@ -5333,7 +5333,7 @@ virQEMUCapsSupportsChardev(const virDomainDef *def, - return false; - - if ((def->os.arch == VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch)) { -- if (!qemuDomainMachineIsPSeries(def)) -+ if (!qemuDomainIsPSeries(def)) - return false; - /* only pseries need -device spapr-vty with -chardev */ - if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -@@ -5360,8 +5360,8 @@ virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VMPORT_OPT)) - return false; - -- return qemuDomainMachineIsI440FX(def) || -- qemuDomainMachineIsQ35(def) || -+ return qemuDomainIsI440FX(def) || -+ qemuDomainIsQ35(def) || - STREQ(def->os.machine, "isapc"); - } - -@@ -5373,7 +5373,7 @@ virQEMUCapsSupportsSMM(virQEMUCapsPtr qemuCaps, - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT)) - return false; - -- return qemuDomainMachineIsQ35(def); -+ return qemuDomainIsQ35(def); - } - - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index 8ec4ec3a6..ff7f47e06 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -1390,7 +1390,7 @@ qemuCheckCCWS390AddressSupport(const virDomainDef *def, - const char *devicename) - { - if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { -- if (!qemuDomainMachineIsS390CCW(def)) { -+ if (!qemuDomainIsS390CCW(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot use CCW address type for device " - "'%s' using machine type '%s'"), -@@ -2294,7 +2294,7 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd, - - /* PowerPC pseries based VMs do not support floppy device */ - if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY && -- qemuDomainMachineIsPSeries(def)) { -+ qemuDomainIsPSeries(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("PowerPC pseries machines do not support floppy device")); - return -1; -@@ -2345,7 +2345,7 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd, - disk->info.alias) < 0) - return -1; - -- if (!qemuDomainMachineNeedsFDC(def)) { -+ if (!qemuDomainNeedsFDC(def)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); - } else { -@@ -2360,7 +2360,7 @@ qemuBuildDiskDriveCommandLine(virCommandPtr cmd, - bootindex) < 0) - return -1; - -- if (!qemuDomainMachineNeedsFDC(def)) { -+ if (!qemuDomainNeedsFDC(def)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "isa-fdc.%s", optstr); - } else { -@@ -3076,7 +3076,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, - * specified, or one with a single IDE contraller had multiple - * ide controllers specified. - */ -- if (qemuDomainMachineHasBuiltinIDE(domainDef)) -+ if (qemuDomainHasBuiltinIDE(domainDef)) - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Only a single IDE controller is supported " - "for this machine type")); -@@ -3174,18 +3174,18 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, - - /* first SATA controller on Q35 machines is implicit */ - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA && -- cont->idx == 0 && qemuDomainMachineIsQ35(def)) -+ cont->idx == 0 && qemuDomainIsQ35(def)) - continue; - - /* first IDE controller is implicit on various machines */ - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE && -- cont->idx == 0 && qemuDomainMachineHasBuiltinIDE(def)) -+ cont->idx == 0 && qemuDomainHasBuiltinIDE(def)) - continue; - - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && - cont->model == -1 && -- !qemuDomainMachineIsQ35(def) && -- !qemuDomainMachineIsVirt(def)) { -+ !qemuDomainIsQ35(def) && -+ !qemuDomainIsVirt(def)) { - - /* An appropriate default USB controller model should already - * have been selected in qemuDomainDeviceDefPostParse(); if -@@ -3222,8 +3222,8 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, - * not to add one either. Add a legacy USB controller, unless we're - * creating a kind of guest we want to keep legacy-free */ - if (usbcontroller == 0 && -- !qemuDomainMachineIsQ35(def) && -- !qemuDomainMachineIsVirt(def) && -+ !qemuDomainIsQ35(def) && -+ !qemuDomainIsVirt(def) && - !ARCH_IS_S390(def->os.arch)) - virCommandAddArg(cmd, "-usb"); - -@@ -4104,7 +4104,7 @@ qemuBuildNVRAMCommandLine(virCommandPtr cmd, - if (!def->nvram) - return 0; - -- if (qemuDomainMachineIsPSeries(def)) { -+ if (qemuDomainIsPSeries(def)) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVRAM)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("nvram device is not supported by " -@@ -6484,7 +6484,7 @@ qemuBuildPMCommandLine(virCommandPtr cmd, - if (def->pm.s3) { - const char *pm_object = "PIIX4_PM"; - -- if (qemuDomainMachineIsQ35(def) && -+ if (qemuDomainIsQ35(def) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S3)) { - pm_object = "ICH9-LPC"; - } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX_DISABLE_S3)) { -@@ -6501,7 +6501,7 @@ qemuBuildPMCommandLine(virCommandPtr cmd, - if (def->pm.s4) { - const char *pm_object = "PIIX4_PM"; - -- if (qemuDomainMachineIsQ35(def) && -+ if (qemuDomainIsQ35(def) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_DISABLE_S4)) { - pm_object = "ICH9-LPC"; - } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX_DISABLE_S4)) { -@@ -6686,7 +6686,7 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, - virDomainIOMMUModelTypeToString(def->iommu->model)); - return -1; - } -- if (!qemuDomainMachineIsQ35(def)) { -+ if (!qemuDomainIsQ35(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("IOMMU device: '%s' is only supported with " - "Q35 machines"), -@@ -6720,13 +6720,13 @@ qemuBuildGlobalControllerCommandLine(virCommandPtr cmd, - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: - hoststr = "i440FX-pcihost"; - cap = virQEMUCapsGet(qemuCaps, QEMU_CAPS_I440FX_PCI_HOLE64_SIZE); -- machine = qemuDomainMachineIsI440FX(def); -+ machine = qemuDomainIsI440FX(def); - break; - - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - hoststr = "q35-pcihost"; - cap = virQEMUCapsGet(qemuCaps, QEMU_CAPS_Q35_PCI_HOLE64_SIZE); -- machine = qemuDomainMachineIsQ35(def); -+ machine = qemuDomainIsQ35(def); - break; - - default: -@@ -7332,7 +7332,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, - - if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON) { - if (def->gic_version != VIR_GIC_VERSION_NONE) { -- if (!qemuDomainMachineIsVirt(def)) { -+ if (!qemuDomainIsVirt(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("gic-version option is available " - "only for ARM virt machine")); -@@ -7361,7 +7361,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, - virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_IOMMU)) { - switch (def->iommu->model) { - case VIR_DOMAIN_IOMMU_MODEL_INTEL: -- if (!qemuDomainMachineIsQ35(def)) { -+ if (!qemuDomainIsQ35(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("IOMMU device: '%s' is only supported with " - "Q35 machines"), -@@ -9624,7 +9624,7 @@ qemuBuildPanicCommandLine(virCommandPtr cmd, - /* For pSeries guests, the firmware provides the same - * functionality as the pvpanic device. The address - * cannot be configured by the user */ -- if (!qemuDomainMachineIsPSeries(def)) { -+ if (!qemuDomainIsPSeries(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("only pSeries guests support panic device " - "of model 'pseries'")); -@@ -10050,7 +10050,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, - { - virBuffer cmd = VIR_BUFFER_INITIALIZER; - -- if (qemuDomainMachineIsPSeries(def)) { -+ if (qemuDomainIsPSeries(def)) { - if (serial->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && - serial->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) { - virBufferAsprintf(&cmd, "spapr-vty,chardev=char%s", -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index f383a6cf2..3150e8760 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -2334,7 +2334,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, - addDefaultUSB = false; - break; - } -- if (qemuDomainMachineIsQ35(def)) { -+ if (qemuDomainIsQ35(def)) { - addPCIeRoot = true; - addImplicitSATA = true; - -@@ -2351,7 +2351,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, - addDefaultUSB = false; - break; - } -- if (qemuDomainMachineIsI440FX(def)) -+ if (qemuDomainIsI440FX(def)) - addPCIRoot = true; - break; - -@@ -2359,7 +2359,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, - case VIR_ARCH_AARCH64: - addDefaultUSB = false; - addDefaultMemballoon = false; -- if (qemuDomainMachineIsVirt(def)) -+ if (qemuDomainIsVirt(def)) - addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX); - break; - -@@ -2371,7 +2371,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, - /* For pSeries guests, the firmware provides the same - * functionality as the pvpanic device, so automatically - * add the definition if not already present */ -- if (qemuDomainMachineIsPSeries(def)) -+ if (qemuDomainIsPSeries(def)) - addPanicDevice = true; - break; - -@@ -2521,7 +2521,7 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def, - * was not included in the domain XML, we need to choose a suitable - * GIC version ourselves */ - if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ABSENT && -- qemuDomainMachineIsVirt(def)) { -+ qemuDomainIsVirt(def)) { - - VIR_DEBUG("Looking for usable GIC version in domain capabilities"); - for (version = VIR_GIC_VERSION_LAST - 1; -@@ -2909,7 +2909,7 @@ qemuDomainDefValidate(const virDomainDef *def, - /* These are the QEMU implementation limitations. But we - * have to live with them for now. */ - -- if (!qemuDomainMachineIsQ35(def)) { -+ if (!qemuDomainIsQ35(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Secure boot is supported with q35 machine types only")); - goto cleanup; -@@ -3008,7 +3008,7 @@ qemuDomainDefaultNetModel(const virDomainDef *def, - if (STREQ(def->os.machine, "versatilepb")) - return "smc91c111"; - -- if (qemuDomainMachineIsVirt(def)) -+ if (qemuDomainIsVirt(def)) - return "virtio"; - - /* Incomplete. vexpress (and a few others) use this, but not all -@@ -3167,14 +3167,14 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - - case VIR_DOMAIN_CONTROLLER_TYPE_PCI: - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS && -- !qemuDomainMachineIsI440FX(def)) { -+ !qemuDomainIsI440FX(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("pci-expander-bus controllers are only supported " - "on 440fx-based machinetypes")); - return -1; - } - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS && -- !qemuDomainMachineIsQ35(def)) { -+ !qemuDomainIsQ35(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("pcie-expander-bus controllers are only supported " - "on q35-based machinetypes")); -@@ -3329,7 +3329,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - - if (dev->type == VIR_DOMAIN_DEVICE_PANIC && - dev->data.panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT) { -- if (qemuDomainMachineIsPSeries(def)) -+ if (qemuDomainIsPSeries(def)) - dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_PSERIES; - else if (ARCH_IS_S390(def->os.arch)) - dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_S390; -@@ -4016,7 +4016,7 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver, - * because other architectures and machine types were introduced - * when libvirt already supported . - */ -- if (ARCH_IS_X86(def->os.arch) && qemuDomainMachineIsI440FX(def) && -+ if (ARCH_IS_X86(def->os.arch) && qemuDomainIsI440FX(def) && - usb && usb->idx == 0 && - (usb->model == -1 || - usb->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI)) { -@@ -5849,26 +5849,40 @@ qemuFindAgentConfig(virDomainDefPtr def) - - - bool --qemuDomainMachineIsQ35(const virDomainDef *def) -+qemuDomainIsQ35(const virDomainDef *def) - { -- return (STRPREFIX(def->os.machine, "pc-q35") || -- STREQ(def->os.machine, "q35")); -+ return qemuDomainMachineIsQ35(def->os.machine); - } - - - bool --qemuDomainMachineIsI440FX(const virDomainDef *def) -+qemuDomainMachineIsQ35(const char *machine) - { -- return (STREQ(def->os.machine, "pc") || -- STRPREFIX(def->os.machine, "pc-0.") || -- STRPREFIX(def->os.machine, "pc-1.") || -- STRPREFIX(def->os.machine, "pc-i440") || -- STRPREFIX(def->os.machine, "rhel")); -+ return (STRPREFIX(machine, "pc-q35") || -+ STREQ(machine, "q35")); - } - - - bool --qemuDomainMachineHasPCIRoot(const virDomainDef *def) -+qemuDomainIsI440FX(const virDomainDef *def) -+{ -+ return qemuDomainMachineIsI440FX(def->os.machine); -+} -+ -+ -+bool -+qemuDomainMachineIsI440FX(const char *machine) -+{ -+ return (STREQ(machine, "pc") || -+ STRPREFIX(machine, "pc-0.") || -+ STRPREFIX(machine, "pc-1.") || -+ STRPREFIX(machine, "pc-i440") || -+ STRPREFIX(machine, "rhel")); -+} -+ -+ -+bool -+qemuDomainHasPCIRoot(const virDomainDef *def) - { - int root = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0); - -@@ -5883,7 +5897,7 @@ qemuDomainMachineHasPCIRoot(const virDomainDef *def) - - - bool --qemuDomainMachineHasPCIeRoot(const virDomainDef *def) -+qemuDomainHasPCIeRoot(const virDomainDef *def) - { - int root = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0); - -@@ -5898,9 +5912,16 @@ qemuDomainMachineHasPCIeRoot(const virDomainDef *def) - - - bool --qemuDomainMachineNeedsFDC(const virDomainDef *def) -+qemuDomainNeedsFDC(const virDomainDef *def) - { -- char *p = STRSKIP(def->os.machine, "pc-q35-"); -+ return qemuDomainMachineNeedsFDC(def->os.machine); -+} -+ -+ -+bool -+qemuDomainMachineNeedsFDC(const char *machine) -+{ -+ const char *p = STRSKIP(machine, "pc-q35-"); - - if (p) { - if (STRPREFIX(p, "1.") || -@@ -5919,21 +5940,36 @@ qemuDomainMachineNeedsFDC(const virDomainDef *def) - - - bool --qemuDomainMachineIsS390CCW(const virDomainDef *def) -+qemuDomainIsS390CCW(const virDomainDef *def) - { -- return STRPREFIX(def->os.machine, "s390-ccw"); -+ return qemuDomainMachineIsS390CCW(def->os.machine); - } - - - bool --qemuDomainMachineIsVirt(const virDomainDef *def) -+qemuDomainMachineIsS390CCW(const char *machine) - { -- if (def->os.arch != VIR_ARCH_ARMV7L && -- def->os.arch != VIR_ARCH_AARCH64) -+ return STRPREFIX(machine, "s390-ccw"); -+} -+ -+ -+bool -+qemuDomainIsVirt(const virDomainDef *def) -+{ -+ return qemuDomainMachineIsVirt(def->os.machine, def->os.arch); -+} -+ -+ -+bool -+qemuDomainMachineIsVirt(const char *machine, -+ const virArch arch) -+{ -+ if (arch != VIR_ARCH_ARMV7L && -+ arch != VIR_ARCH_AARCH64) - return false; - -- if (STRNEQ(def->os.machine, "virt") && -- !STRPREFIX(def->os.machine, "virt-")) -+ if (STRNEQ(machine, "virt") && -+ !STRPREFIX(machine, "virt-")) - return false; - - return true; -@@ -5941,13 +5977,21 @@ qemuDomainMachineIsVirt(const virDomainDef *def) - - - bool --qemuDomainMachineIsPSeries(const virDomainDef *def) -+qemuDomainIsPSeries(const virDomainDef *def) - { -- if (!ARCH_IS_PPC64(def->os.arch)) -+ return qemuDomainMachineIsPSeries(def->os.machine, def->os.arch); -+} -+ -+ -+bool -+qemuDomainMachineIsPSeries(const char *machine, -+ const virArch arch) -+{ -+ if (!ARCH_IS_PPC64(arch)) - return false; - -- if (STRNEQ(def->os.machine, "pseries") && -- !STRPREFIX(def->os.machine, "pseries-")) -+ if (STRNEQ(machine, "pseries") && -+ !STRPREFIX(machine, "pseries-")) - return false; - - return true; -@@ -6149,12 +6193,19 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def, - - - bool --qemuDomainMachineHasBuiltinIDE(const virDomainDef *def) -+qemuDomainHasBuiltinIDE(const virDomainDef *def) - { -- return qemuDomainMachineIsI440FX(def) || -- STREQ(def->os.machine, "malta") || -- STREQ(def->os.machine, "sun4u") || -- STREQ(def->os.machine, "g3beige"); -+ return qemuDomainMachineHasBuiltinIDE(def->os.machine); -+} -+ -+ -+bool -+qemuDomainMachineHasBuiltinIDE(const char *machine) -+{ -+ return qemuDomainMachineIsI440FX(machine) || -+ STREQ(machine, "malta") || -+ STREQ(machine, "sun4u") || -+ STREQ(machine, "g3beige"); - } - - -diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h -index 91573ff06..0e32bb9ea 100644 ---- a/src/qemu/qemu_domain.h -+++ b/src/qemu/qemu_domain.h -@@ -677,15 +677,25 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, - - virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def); - --bool qemuDomainMachineIsQ35(const virDomainDef *def); --bool qemuDomainMachineIsI440FX(const virDomainDef *def); --bool qemuDomainMachineHasPCIRoot(const virDomainDef *def); --bool qemuDomainMachineHasPCIeRoot(const virDomainDef *def); --bool qemuDomainMachineNeedsFDC(const virDomainDef *def); --bool qemuDomainMachineIsS390CCW(const virDomainDef *def); --bool qemuDomainMachineIsVirt(const virDomainDef *def); --bool qemuDomainMachineIsPSeries(const virDomainDef *def); --bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def); -+bool qemuDomainIsQ35(const virDomainDef *def); -+bool qemuDomainIsI440FX(const virDomainDef *def); -+bool qemuDomainHasPCIRoot(const virDomainDef *def); -+bool qemuDomainHasPCIeRoot(const virDomainDef *def); -+bool qemuDomainNeedsFDC(const virDomainDef *def); -+bool qemuDomainIsS390CCW(const virDomainDef *def); -+bool qemuDomainIsVirt(const virDomainDef *def); -+bool qemuDomainIsPSeries(const virDomainDef *def); -+bool qemuDomainHasBuiltinIDE(const virDomainDef *def); -+ -+bool qemuDomainMachineIsQ35(const char *machine); -+bool qemuDomainMachineIsI440FX(const char *machine); -+bool qemuDomainMachineNeedsFDC(const char *machine); -+bool qemuDomainMachineIsS390CCW(const char *machine); -+bool qemuDomainMachineIsVirt(const char *machine, -+ const virArch arch); -+bool qemuDomainMachineIsPSeries(const char *machine, -+ const virArch arch); -+bool qemuDomainMachineHasBuiltinIDE(const char *machine); - - int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver, - virDomainObjPtr vm); -diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c -index 22d8bf67d..064d05079 100644 ---- a/src/qemu/qemu_domain_address.c -+++ b/src/qemu/qemu_domain_address.c -@@ -88,7 +88,7 @@ qemuDomainSetSCSIControllerModel(const virDomainDef *def, - return -1; - } - } else { -- if (qemuDomainMachineIsPSeries(def)) { -+ if (qemuDomainIsPSeries(def)) { - *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) { - *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC; -@@ -245,7 +245,7 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, - - for (i = 0; i < def->nserials; i++) { - if (def->serials[i]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && -- qemuDomainMachineIsPSeries(def)) -+ qemuDomainIsPSeries(def)) - def->serials[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; - if (qemuDomainAssignSpaprVIOAddress(def, &def->serials[i]->info, - VIO_ADDR_SERIAL) < 0) -@@ -253,7 +253,7 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, - } - - if (def->nvram) { -- if (qemuDomainMachineIsPSeries(def)) -+ if (qemuDomainIsPSeries(def)) - def->nvram->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; - if (qemuDomainAssignSpaprVIOAddress(def, &def->nvram->info, - VIO_ADDR_NVRAM) < 0) -@@ -375,7 +375,7 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def, - int ret = -1; - virDomainCCWAddressSetPtr addrs = NULL; - -- if (qemuDomainMachineIsS390CCW(def) && -+ if (qemuDomainIsS390CCW(def) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { - qemuDomainPrimeVirtioDeviceAddresses( - def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW); -@@ -445,13 +445,13 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def, - return; - - if (!(STRPREFIX(def->os.machine, "vexpress-") || -- qemuDomainMachineIsVirt(def))) -+ qemuDomainIsVirt(def))) - return; - - /* We use virtio-mmio by default on mach-virt guests only if they already - * have at least one virtio-mmio device: in all other cases, we prefer - * virtio-pci */ -- if (qemuDomainMachineHasPCIeRoot(def) && -+ if (qemuDomainHasPCIeRoot(def) && - !qemuDomainHasVirtioMMIODevices(def)) { - qemuDomainPrimeVirtioDeviceAddresses(def, - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI); -@@ -826,7 +826,7 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def, - - data->driver = driver; - -- if (qemuDomainMachineHasPCIeRoot(def)) { -+ if (qemuDomainHasPCIeRoot(def)) { - data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCIE_DEVICE | - VIR_PCI_CONNECT_HOTPLUGGABLE); - } else { -@@ -1479,12 +1479,12 @@ qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainPCIAddressSetPtr addrs) - { -- if (qemuDomainMachineIsI440FX(def) && -+ if (qemuDomainIsI440FX(def) && - qemuDomainValidateDevicePCISlotsPIIX3(def, qemuCaps, addrs) < 0) { - return -1; - } - -- if (qemuDomainMachineIsQ35(def) && -+ if (qemuDomainIsQ35(def) && - qemuDomainValidateDevicePCISlotsQ35(def, qemuCaps, addrs) < 0) { - return -1; - } -@@ -1845,7 +1845,7 @@ qemuDomainSupportsPCI(virDomainDefPtr def, - if (STREQ(def->os.machine, "versatilepb")) - return true; - -- if (qemuDomainMachineIsVirt(def) && -+ if (qemuDomainIsVirt(def) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX)) - return true; - -@@ -2024,7 +2024,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - * all *actual* devices. - */ - -- if (qemuDomainMachineHasPCIRoot(def)) { -+ if (qemuDomainHasPCIRoot(def)) { - /* This is a dummy info used to reserve a slot for a - * legacy PCI device that doesn't exist, but may in the - * future, e.g. if another device is hotplugged into the -@@ -2066,7 +2066,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, - - if (max_idx <= 0 && - addrs->nbuses > max_idx + 1 && -- qemuDomainMachineHasPCIeRoot(def)) { -+ qemuDomainHasPCIeRoot(def)) { - virDomainDeviceInfo info = { - .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE | - VIR_PCI_CONNECT_TYPE_PCIE_DEVICE) -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c -index a6dac6f09..37b8d455c 100644 ---- a/src/qemu/qemu_hotplug.c -+++ b/src/qemu/qemu_hotplug.c -@@ -329,7 +329,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, - qemuDomainSecretInfoPtr encinfo; - - if (!disk->info.type) { -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) - disk->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; - else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) -@@ -497,7 +497,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, - } - - if (controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) - controller->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; - else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) -@@ -1141,7 +1141,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, - goto cleanup; - } - -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { - net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; - if (!(ccwaddrs = qemuDomainCCWAddrSetCreateFromDomain(vm->def))) -@@ -2079,7 +2079,7 @@ qemuDomainAttachRNGDevice(virConnectPtr conn, - goto cleanup; - - if (rng->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { - rng->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; - } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) { -@@ -2620,7 +2620,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, - goto cleanup; - - if (hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) - hostdev->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW; - } -@@ -4447,7 +4447,7 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, - goto cleanup; - } - -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { - if (!virDomainDeviceAddressIsValid(&detach->info, - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) { -@@ -5007,7 +5007,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver, - virDomainNetGetActualHostdev(detach)); - goto cleanup; - } -- if (qemuDomainMachineIsS390CCW(vm->def) && -+ if (qemuDomainIsS390CCW(vm->def) && - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) { - if (!virDomainDeviceAddressIsValid(&detach->info, - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) { -diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c -index fc176c168..af9063c02 100644 ---- a/src/qemu/qemu_parse_command.c -+++ b/src/qemu/qemu_parse_command.c -@@ -654,7 +654,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, - if (VIR_ALLOC(def->src) < 0) - goto error; - -- if (qemuDomainMachineIsPSeries(dom)) -+ if (qemuDomainIsPSeries(dom)) - def->bus = VIR_DOMAIN_DISK_BUS_SCSI; - else - def->bus = VIR_DOMAIN_DISK_BUS_IDE; -@@ -746,7 +746,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, - } else if (STREQ(keywords[i], "if")) { - if (STREQ(values[i], "ide")) { - def->bus = VIR_DOMAIN_DISK_BUS_IDE; -- if (qemuDomainMachineIsPSeries(dom)) { -+ if (qemuDomainIsPSeries(dom)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("pseries systems do not support ide devices '%s'"), val); - goto error; -@@ -1950,7 +1950,7 @@ qemuParseCommandLine(virCapsPtr caps, - } - if (STREQ(arg, "-cdrom")) { - disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM; -- if (qemuDomainMachineIsPSeries(def)) -+ if (qemuDomainIsPSeries(def)) - disk->bus = VIR_DOMAIN_DISK_BUS_SCSI; - if (VIR_STRDUP(disk->dst, "hdc") < 0) - goto error; -@@ -1965,7 +1965,7 @@ qemuParseCommandLine(virCapsPtr caps, - disk->bus = VIR_DOMAIN_DISK_BUS_IDE; - else - disk->bus = VIR_DOMAIN_DISK_BUS_SCSI; -- if (qemuDomainMachineIsPSeries(def)) -+ if (qemuDomainIsPSeries(def)) - disk->bus = VIR_DOMAIN_DISK_BUS_SCSI; - } - if (VIR_STRDUP(disk->dst, arg + 1) < 0) --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-remove-input-device-after-receiving-the-event.patch b/SOURCES/libvirt-qemu-remove-input-device-after-receiving-the-event.patch new file mode 100644 index 0000000..7f2ff69 --- /dev/null +++ b/SOURCES/libvirt-qemu-remove-input-device-after-receiving-the-event.patch @@ -0,0 +1,46 @@ +From 4f65cfb51fcef877737edeb75f4a06a9988e592e Mon Sep 17 00:00:00 2001 +Message-Id: <4f65cfb51fcef877737edeb75f4a06a9988e592e@dist-git> +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Thu, 14 Dec 2017 17:01:33 +0100 +Subject: [PATCH] qemu: remove input device after receiving the event +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Also call qemuDomainRemoveInputDevice if we receive the +event after the Detach API ends. + +Commit 67486bb failed to include this. + +https://bugzilla.redhat.com/show_bug.cgi?id=1524837 +Signed-off-by: Ján Tomko +Reviewed-by: Erik Skultety +(cherry picked from commit 8d51042ef873d2a868d505f0eff32346ba041a95) +Signed-off-by: Ján Tomko +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_hotplug.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index eab9ad794a..f1056627f2 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -4368,10 +4368,13 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver, + ret = qemuDomainRemoveShmemDevice(driver, vm, dev->data.shmem); + break; + ++ case VIR_DOMAIN_DEVICE_INPUT: ++ ret = qemuDomainRemoveInputDevice(vm, dev->data.input); ++ break; ++ + case VIR_DOMAIN_DEVICE_NONE: + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_FS: +- case VIR_DOMAIN_DEVICE_INPUT: + case VIR_DOMAIN_DEVICE_SOUND: + case VIR_DOMAIN_DEVICE_VIDEO: + case VIR_DOMAIN_DEVICE_WATCHDOG: +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-rename-QEMU_CAPS_SCLP_S390-to-QEMU_CAPS_DEVICE_SCLPCONSOLE.patch b/SOURCES/libvirt-qemu-rename-QEMU_CAPS_SCLP_S390-to-QEMU_CAPS_DEVICE_SCLPCONSOLE.patch new file mode 100644 index 0000000..24decf5 --- /dev/null +++ b/SOURCES/libvirt-qemu-rename-QEMU_CAPS_SCLP_S390-to-QEMU_CAPS_DEVICE_SCLPCONSOLE.patch @@ -0,0 +1,83 @@ +From 25bfc26066807438fe1f738f6f90100cc5da6e42 Mon Sep 17 00:00:00 2001 +Message-Id: <25bfc26066807438fe1f738f6f90100cc5da6e42@dist-git> +From: Pino Toscano +Date: Wed, 29 Nov 2017 16:22:52 +0100 +Subject: [PATCH] qemu: rename QEMU_CAPS_SCLP_S390 to + QEMU_CAPS_DEVICE_SCLPCONSOLE + +Give a better name to the capability for the sclpconsole device. + +Signed-off-by: Pino Toscano +Reviewed-by: Andrea Bolognani +(cherry picked from commit 98b55862efb3aad3d96223286f417d1b85921a68) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +https://bugzilla.redhat.com/show_bug.cgi?id=1511421 +https://bugzilla.redhat.com/show_bug.cgi?id=1512929 +https://bugzilla.redhat.com/show_bug.cgi?id=1512934 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 2 +- + src/qemu/qemu_capabilities.h | 2 +- + src/qemu/qemu_command.c | 4 ++-- + tests/qemuxml2argvtest.c | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index 0defa9a3e4..374a2e79a7 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -1604,7 +1604,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { + { "ich9-ahci", QEMU_CAPS_ICH9_AHCI }, + { "virtio-blk-s390", QEMU_CAPS_VIRTIO_S390 }, + { "virtio-blk-ccw", QEMU_CAPS_VIRTIO_CCW }, +- { "sclpconsole", QEMU_CAPS_SCLP_S390 }, ++ { "sclpconsole", QEMU_CAPS_DEVICE_SCLPCONSOLE }, + { "lsi53c895a", QEMU_CAPS_SCSI_LSI }, + { "virtio-scsi-pci", QEMU_CAPS_VIRTIO_SCSI }, + { "virtio-scsi-s390", QEMU_CAPS_VIRTIO_SCSI }, +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index 65b969a0ea..f115738b6b 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -220,7 +220,7 @@ typedef enum { + QEMU_CAPS_DEVICE_CIRRUS_VGA, /* -device cirrus-vga */ + QEMU_CAPS_DEVICE_VMWARE_SVGA, /* -device vmware-svga */ + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, /* -device safe for primary video device */ +- QEMU_CAPS_SCLP_S390, /* -device sclp* */ ++ QEMU_CAPS_DEVICE_SCLPCONSOLE, /* -device sclpconsole */ + + /* 125 */ + QEMU_CAPS_DEVICE_USB_SERIAL, /* -device usb-serial */ +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 65b6a59d3f..092d820b1d 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -9420,9 +9420,9 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, + switch (console->targetType) { + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: +- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCLP_S390)) { ++ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCLPCONSOLE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", +- _("sclp console requires QEMU to support s390-sclp")); ++ _("sclpconsole is not supported in this QEMU binary")); + return -1; + } + +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index 70c72e4e64..747ad24663 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -1333,7 +1333,7 @@ mymain(void) + DO_TEST("console-sclp", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_S390, +- QEMU_CAPS_SCLP_S390); ++ QEMU_CAPS_DEVICE_SCLPCONSOLE); + DO_TEST("channel-spicevmc", + QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_SPICE, +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-report-IDE-bus-in-domain-capabilities-only-if-it-s-supported.patch b/SOURCES/libvirt-qemu-report-IDE-bus-in-domain-capabilities-only-if-it-s-supported.patch deleted file mode 100644 index 7ded9ac..0000000 --- a/SOURCES/libvirt-qemu-report-IDE-bus-in-domain-capabilities-only-if-it-s-supported.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 09f3f5a0fa779a4a151f1aeba1ec82d935beb248 Mon Sep 17 00:00:00 2001 -Message-Id: <09f3f5a0fa779a4a151f1aeba1ec82d935beb248@dist-git> -From: Pavel Hrdina -Date: Wed, 19 Apr 2017 09:51:15 +0200 -Subject: [PATCH] qemu: report IDE bus in domain capabilities only if it's - supported - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1441964 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 8ddd44806b62cec11072a5cccd4b1ab0da315425) -Signed-off-by: Pavel Hrdina ---- - src/qemu/qemu_capabilities.c | 4 +++- - tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml | 1 - - tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml | 1 - - tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 - - tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 - - tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 - - tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 - - 7 files changed, 3 insertions(+), 7 deletions(-) - -diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c -index b7c2c3705..950a42bae 100644 ---- a/src/qemu/qemu_capabilities.c -+++ b/src/qemu/qemu_capabilities.c -@@ -5512,8 +5512,10 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, - (STRNEQ(machine, "pseries") && !STRPREFIX(machine, "pseries-"))) - VIR_DOMAIN_CAPS_ENUM_SET(disk->diskDevice, VIR_DOMAIN_DISK_DEVICE_FLOPPY); - -+ if (qemuDomainMachineHasBuiltinIDE(machine)) -+ VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_IDE); -+ - VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, -- VIR_DOMAIN_DISK_BUS_IDE, - VIR_DOMAIN_DISK_BUS_SCSI, - VIR_DOMAIN_DISK_BUS_VIRTIO, - /* VIR_DOMAIN_DISK_BUS_SD */); -diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml -index 1fa7f6dff..54b89dc72 100644 ---- a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml -+++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml -@@ -63,7 +63,6 @@ - lun - - -- ide - fdc - scsi - virtio -diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml -index d60fc1df9..60bf2f54f 100644 ---- a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml -+++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml -@@ -63,7 +63,6 @@ - lun - - -- ide - fdc - scsi - virtio -diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml -index fcc6f50e0..1a980927c 100644 ---- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml -+++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml -@@ -63,7 +63,6 @@ - lun - - -- ide - fdc - scsi - virtio -diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml -index 755c4f447..4ecf8651b 100644 ---- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml -+++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml -@@ -37,7 +37,6 @@ - lun - - -- ide - scsi - virtio - usb -diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml -index 999e2795d..dc6d2d8f0 100644 ---- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml -+++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml -@@ -32,7 +32,6 @@ - lun - - -- ide - fdc - scsi - virtio -diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml -index 0b8135bc5..53c3190f2 100644 ---- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml -+++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml -@@ -113,7 +113,6 @@ - lun - - -- ide - fdc - scsi - virtio --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-report-an-error-if-usb-keyboards-are-unsupported.patch b/SOURCES/libvirt-qemu-report-an-error-if-usb-keyboards-are-unsupported.patch deleted file mode 100644 index e3d55ae..0000000 --- a/SOURCES/libvirt-qemu-report-an-error-if-usb-keyboards-are-unsupported.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 40cd16ee0d35948d1e713f0af629a65ce2e22114 Mon Sep 17 00:00:00 2001 -Message-Id: <40cd16ee0d35948d1e713f0af629a65ce2e22114@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 4 Jul 2017 14:17:18 +0200 -Subject: [PATCH] qemu: report an error if usb keyboards are unsupported -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Be nicer to the user and report a proper error instead of: -An error occurred, but the cause is unknown - -https://bugzilla.redhat.com/show_bug.cgi?id=1460086 -(cherry picked from commit 3596b1ddf912418f70c9eaa07d460aacf574bbfd) -Signed-off-by: Ján Tomko - -Note: the above bug link is completely irrelevant -https://bugzilla.redhat.com/show_bug.cgi?id=1460008 -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_command.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c -index a4184b7378..e3be487d20 100644 ---- a/src/qemu/qemu_command.c -+++ b/src/qemu/qemu_command.c -@@ -4250,8 +4250,12 @@ qemuBuildUSBInputDevStr(const virDomainDef *def, - virBufferAsprintf(&buf, "usb-tablet,id=%s", dev->info.alias); - break; - case VIR_DOMAIN_INPUT_TYPE_KBD: -- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) -+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -+ _("usb keyboard is not supported by this " -+ "QEMU binary")); - goto error; -+ } - virBufferAsprintf(&buf, "usb-kbd,id=%s", dev->info.alias); - break; - } --- -2.13.3 - diff --git a/SOURCES/libvirt-qemu-snapshot-Disallow-snapshot-of-unsupported-shared-disks.patch b/SOURCES/libvirt-qemu-snapshot-Disallow-snapshot-of-unsupported-shared-disks.patch new file mode 100644 index 0000000..3fe4631 --- /dev/null +++ b/SOURCES/libvirt-qemu-snapshot-Disallow-snapshot-of-unsupported-shared-disks.patch @@ -0,0 +1,69 @@ +From 6f750627ca303b962cf2c610b9cd27bae0fc1439 Mon Sep 17 00:00:00 2001 +Message-Id: <6f750627ca303b962cf2c610b9cd27bae0fc1439@dist-git> +From: Peter Krempa +Date: Thu, 23 Nov 2017 19:02:20 +0100 +Subject: [PATCH] qemu: snapshot: Disallow snapshot of unsupported shared disks + +Creating a snapshot would introduce a possibly unsupported member for +sharing into the backing chain. Add a check to prevent that from +happening. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 +(cherry picked from commit 9b2fbfa6f6b535b9f41a7503531d43d86d7a8868) +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index aa6a326bb4..620028fe07 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -13952,6 +13952,24 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, + } + + ++static int ++qemuDomainSnapshotPrepareDiskShared(virDomainSnapshotDiskDefPtr snapdisk, ++ virDomainDiskDefPtr domdisk) ++{ ++ if (!domdisk->src->shared || domdisk->src->readonly) ++ return 0; ++ ++ if (!qemuBlockStorageSourceSupportsConcurrentAccess(snapdisk->src)) { ++ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, ++ _("shared access for disk '%s' requires use of " ++ "supported storage format"), domdisk->dst); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ + static int + qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdisk, + virDomainDiskDefPtr domdisk) +@@ -14014,6 +14032,9 @@ qemuDomainSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdi + return -1; + } + ++ if (qemuDomainSnapshotPrepareDiskShared(snapdisk, domdisk) < 0) ++ return -1; ++ + return 0; + } + +@@ -14073,6 +14094,9 @@ qemuDomainSnapshotPrepareDiskExternalActive(virDomainSnapshotDiskDefPtr snapdisk + return -1; + } + ++ if (qemuDomainSnapshotPrepareDiskShared(snapdisk, domdisk) < 0) ++ return -1; ++ + return 0; + } + +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemu-snapshot-Load-data-necessary-for-relative-block-commit-to-work.patch b/SOURCES/libvirt-qemu-snapshot-Load-data-necessary-for-relative-block-commit-to-work.patch deleted file mode 100644 index d7192a8..0000000 --- a/SOURCES/libvirt-qemu-snapshot-Load-data-necessary-for-relative-block-commit-to-work.patch +++ /dev/null @@ -1,97 +0,0 @@ -From a1c6dd1700b461d84c6db3d62468c60f4e3b0a55 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Peter Krempa -Date: Tue, 20 Jun 2017 14:45:38 +0200 -Subject: [PATCH] qemu: snapshot: Load data necessary for relative block commit - to work - -Commit 7456c4f5f introduced a regression by not reloading the backing -chain of a disk after snapshot. The regression was caused as -src->relPath was not set and thus the block commit code could not -determine the relative path. - -This patch adds code that will load the backing store string if -VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT and store it in the correct place -when a snapshot is successfully completed. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1461303 -(cherry picked from commit e20853e1d32ff517e6feec3146066ec433fc39e6) - -Signed-off-by: Jiri Denemark -Reviewed-by: Pavel Hrdina ---- - src/qemu/qemu_driver.c | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index c7c5e28ca3..a2fb41b91a 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -14094,6 +14094,7 @@ struct _qemuDomainSnapshotDiskData { - bool created; /* @src was created by the snapshot code */ - bool prepared; /* @src was prepared using qemuDomainDiskChainElementPrepare */ - virDomainDiskDefPtr disk; -+ char *relPath; /* relative path component to fill into original disk */ - - virStorageSourcePtr persistsrc; - virDomainDiskDefPtr persistdisk; -@@ -14127,6 +14128,7 @@ qemuDomainSnapshotDiskDataFree(qemuDomainSnapshotDiskDataPtr data, - virStorageSourceFree(data[i].src); - } - virStorageSourceFree(data[i].persistsrc); -+ VIR_FREE(data[i].relPath); - } - - VIR_FREE(data); -@@ -14142,11 +14144,13 @@ qemuDomainSnapshotDiskDataFree(qemuDomainSnapshotDiskDataPtr data, - static qemuDomainSnapshotDiskDataPtr - qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, - virDomainObjPtr vm, -- virDomainSnapshotObjPtr snap) -+ virDomainSnapshotObjPtr snap, -+ bool reuse) - { - size_t i; - qemuDomainSnapshotDiskDataPtr ret; - qemuDomainSnapshotDiskDataPtr dd; -+ char *backingStoreStr; - - if (VIR_ALLOC_N(ret, snap->def->ndisks) < 0) - return NULL; -@@ -14170,6 +14174,16 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, - - dd->initialized = true; - -+ /* relative backing store paths need to be updated so that relative -+ * block commit still works */ -+ if (reuse && -+ (backingStoreStr = virStorageFileGetBackingStoreStr(dd->src))) { -+ if (virStorageIsRelative(backingStoreStr)) -+ VIR_STEAL_PTR(dd->relPath, backingStoreStr); -+ else -+ VIR_FREE(backingStoreStr); -+ } -+ - /* Note that it's unsafe to assume that the disks in the persistent - * definition match up with the disks in the live definition just by - * checking that the target name is the same. We've done that -@@ -14213,6 +14227,7 @@ qemuDomainSnapshotUpdateDiskSources(qemuDomainSnapshotDiskDataPtr dd, - if (dd->initialized) - virStorageFileDeinit(dd->src); - -+ VIR_STEAL_PTR(dd->disk->src->relPath, dd->relPath); - VIR_STEAL_PTR(dd->src->backingStore, dd->disk->src); - VIR_STEAL_PTR(dd->disk->src, dd->src); - -@@ -14326,7 +14341,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, - - /* prepare a list of objects to use in the vm definition so that we don't - * have to roll back later */ -- if (!(diskdata = qemuDomainSnapshotDiskDataCollect(driver, vm, snap))) -+ if (!(diskdata = qemuDomainSnapshotDiskDataCollect(driver, vm, snap, reuse))) - goto cleanup; - - cfg = virQEMUDriverGetConfig(driver); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemu-switch-s390-s390x-default-console-back-to-serial.patch b/SOURCES/libvirt-qemu-switch-s390-s390x-default-console-back-to-serial.patch new file mode 100644 index 0000000..830b9e0 --- /dev/null +++ b/SOURCES/libvirt-qemu-switch-s390-s390x-default-console-back-to-serial.patch @@ -0,0 +1,108 @@ +From 6fe46c6d8b1bfdd1f5d3e54798077e1db5b4180c Mon Sep 17 00:00:00 2001 +Message-Id: <6fe46c6d8b1bfdd1f5d3e54798077e1db5b4180c@dist-git> +From: Pino Toscano +Date: Wed, 29 Nov 2017 16:23:16 +0100 +Subject: [PATCH] qemu: switch s390/s390x default console back to serial + +Now that and on s390/s390x behave a bit more like the +other architectures, remove this extra differentation, and use sclp +console by default for new guests. New virtio consoles can still be +added, and it is actually needed because of the limited number of +instances for sclp and sclplm. + +This reverts commit b1c88c14764e0b043a269d454a83a6ac7af34eac, whose +reasons are not totally clear. + +Signed-off-by: Pino Toscano +Reviewed-by: Andrea Bolognani +Reviewed-by: Bjoern Walk +(cherry picked from commit 220c1f70dc96b1066cefbfe50f30e3111a2ecdc6) + +https://bugzilla.redhat.com/show_bug.cgi?id=1449265 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_domain.c | 7 ------- + tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args | 5 +---- + tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml | 8 ++++++-- + tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml | 6 ------ + 4 files changed, 7 insertions(+), 19 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 91c0e163e1..1b5f439621 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -4255,13 +4255,6 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, + virQEMUDriverPtr driver, + unsigned int parseFlags) + { +- /* set the default console type for S390 arches */ +- if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && +- chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE && +- ARCH_IS_S390(def->os.arch)) { +- chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO; +- } +- + /* Historically, isa-serial and the default matched, so in order to + * maintain backwards compatibility we map them here. The actual default + * will be picked below based on the architecture and machine type. */ +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args +index c405fb59ee..20968f7945 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-serial-console.args +@@ -18,8 +18,5 @@ QEMU_AUDIO_DRV=none \ + server,nowait \ + -mon chardev=charmonitor,id=monitor,mode=readline \ + -boot c \ +--device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ + -chardev pty,id=charserial0 \ +--device sclpconsole,chardev=charserial0,id=serial0 \ +--chardev pty,id=charconsole1 \ +--device virtconsole,chardev=charconsole1,id=console1 ++-device sclpconsole,chardev=charserial0,id=serial0 +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml +index 7eb1a765ab..0f278f2c9d 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml +@@ -14,9 +14,13 @@ + destroy + + /usr/bin/qemu-system-s390x +- ++ ++ ++ ++ ++ + +- ++ + + + +diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml +index db3023b7a6..9c9b4dd27a 100644 +--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml ++++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-serial-console.xml +@@ -14,9 +14,6 @@ + destroy + + /usr/bin/qemu-system-s390x +- +-
      +- + + + +@@ -25,9 +22,6 @@ + + + +- +- +- + + + +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu-use-nec-usb-xhci-as-a-default-controller-for-aarch64-if-available.patch b/SOURCES/libvirt-qemu-use-nec-usb-xhci-as-a-default-controller-for-aarch64-if-available.patch deleted file mode 100644 index 615c01d..0000000 --- a/SOURCES/libvirt-qemu-use-nec-usb-xhci-as-a-default-controller-for-aarch64-if-available.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 86987ff859c7c85f649c5845d2673a1ba5fc4fcc Mon Sep 17 00:00:00 2001 -Message-Id: <86987ff859c7c85f649c5845d2673a1ba5fc4fcc@dist-git> -From: Pavel Hrdina -Date: Fri, 28 Apr 2017 11:59:48 +0200 -Subject: [PATCH] qemu: use nec-usb-xhci as a default controller for aarch64 if - available - -This is a USB3 controller and it's a better choice than piix3-uhci. - -Signed-off-by: Pavel Hrdina -Acked-by: Andrea Bolognani -(cherry picked from commit 233f8d0bd413c5bda91ed678b705e0a9f7a9e922) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438682 - -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 3 +++ - .../qemuxml2argv-aarch64-usb-controller-nec-xhci.args | 19 +++++++++++++++++++ - .../qemuxml2argv-aarch64-usb-controller-nec-xhci.xml | 16 ++++++++++++++++ - tests/qemuxml2argvtest.c | 4 ++++ - 4 files changed, 42 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.xml - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index a1a4003af..25ab1f639 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3248,6 +3248,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - /* Explicitly fallback to legacy USB controller for PPC64. */ - cont->model = -1; - } -+ } else if (def->os.arch == VIR_ARCH_AARCH64) { -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } - } - /* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args -new file mode 100644 -index 000000000..e97431f8b ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-aarch64 \ -+-name QEMUGuest1 \ -+-S \ -+-M virt \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device nec-usb-xhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.xml -new file mode 100644 -index 000000000..1b7320f43 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-nec-xhci.xml -@@ -0,0 +1,16 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+
      -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 81cd2a6ec..ca1d23c10 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2477,6 +2477,10 @@ mymain(void) - DO_TEST("ppc64-usb-controller-legacy", - QEMU_CAPS_PIIX3_USB_UHCI); - -+ DO_TEST("aarch64-usb-controller-nec-xhci", -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_NEC_USB_XHCI); -+ - DO_TEST_PARSE_FLAGS_ERROR("missing-machine", - VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS, - NONE); --- -2.12.2 - diff --git a/SOURCES/libvirt-qemu-use-qemu-xhci-USB-controller-by-default-for-ppc64-and-aarch64.patch b/SOURCES/libvirt-qemu-use-qemu-xhci-USB-controller-by-default-for-ppc64-and-aarch64.patch deleted file mode 100644 index 43bce43..0000000 --- a/SOURCES/libvirt-qemu-use-qemu-xhci-USB-controller-by-default-for-ppc64-and-aarch64.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 5af922119074c1a74db6bebb272b6b9758c89c63 Mon Sep 17 00:00:00 2001 -Message-Id: <5af922119074c1a74db6bebb272b6b9758c89c63@dist-git> -From: Pavel Hrdina -Date: Fri, 28 Apr 2017 11:59:51 +0200 -Subject: [PATCH] qemu: use qemu-xhci USB controller by default for ppc64 and - aarch64 - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438682 - -Signed-off-by: Pavel Hrdina -Acked-by: Andrea Bolognani -(cherry picked from commit 568887a32f9985b95d998dd0d675255ea985013f) -Signed-off-by: Pavel Hrdina -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 11 ++++++++--- - ...qemuxml2argv-aarch64-usb-controller-qemu-xhci.args | 19 +++++++++++++++++++ - .../qemuxml2argv-aarch64-usb-controller-qemu-xhci.xml | 16 ++++++++++++++++ - .../qemuxml2argv-ppc64-usb-controller-qemu-xhci.args | 19 +++++++++++++++++++ - .../qemuxml2argv-ppc64-usb-controller-qemu-xhci.xml | 1 + - tests/qemuxml2argvtest.c | 9 +++++++++ - 6 files changed, 72 insertions(+), 3 deletions(-) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.xml - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args - create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.xml - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 4d7de60cb..2790d7e74 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3237,9 +3237,12 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - } else if (ARCH_IS_PPC64(def->os.arch)) { - /* To not break migration we need to set default USB controller - * for ppc64 to pci-ohci if we cannot change ABI of the VM. -- * The nec-usb-xhci controller is used as default only for -- * newly defined domains or devices. */ -+ * The nec-usb-xhci or qemu-xhci controller is used as default -+ * only for newly defined domains or devices. */ - if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) { -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; -+ } else if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { -@@ -3249,7 +3252,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - cont->model = -1; - } - } else if (def->os.arch == VIR_ARCH_AARCH64) { -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) -+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; -+ else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; - } - } -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args -new file mode 100644 -index 000000000..0aa27f7ab ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-aarch64 \ -+-name QEMUGuest1 \ -+-S \ -+-M virt \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device qemu-xhci,id=usb,bus=pcie.0,addr=0x1 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.xml -new file mode 100644 -index 000000000..1b7320f43 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-usb-controller-qemu-xhci.xml -@@ -0,0 +1,16 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219100 -+ 1 -+ -+ hvm -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+
      -+ -+ -+ -+ -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args -new file mode 100644 -index 000000000..b34e480dd ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.args -@@ -0,0 +1,19 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/libexec/qemu-system-ppc64 \ -+-name QEMUGuest1 \ -+-S \ -+-M pseries \ -+-m 256 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-boot c \ -+-device qemu-xhci,id=usb,bus=pci.0,addr=0x1 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.xml b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.xml -new file mode 120000 -index 000000000..831d9d4f1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc64-usb-controller-qemu-xhci.xml -@@ -0,0 +1 @@ -+qemuxml2argv-ppc64-usb-controller.xml -\ No newline at end of file -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index 317f17e74..406fbfea4 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2480,6 +2480,15 @@ mymain(void) - QEMU_CAPS_PCI_OHCI); - DO_TEST("ppc64-usb-controller-legacy", - QEMU_CAPS_PIIX3_USB_UHCI); -+ DO_TEST_FULL("ppc64-usb-controller-qemu-xhci", NULL, -1, 0, -+ VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, GIC_NONE, -+ QEMU_CAPS_NEC_USB_XHCI, -+ QEMU_CAPS_DEVICE_QEMU_XHCI); -+ -+ DO_TEST("aarch64-usb-controller-qemu-xhci", -+ QEMU_CAPS_OBJECT_GPEX, -+ QEMU_CAPS_NEC_USB_XHCI, -+ QEMU_CAPS_DEVICE_QEMU_XHCI); - - DO_TEST("aarch64-usb-controller-nec-xhci", - QEMU_CAPS_OBJECT_GPEX, --- -2.12.2 - diff --git a/SOURCES/libvirt-qemuBuildDeviceAddressStr-Prefer-default-alias-for-PCI-bus.patch b/SOURCES/libvirt-qemuBuildDeviceAddressStr-Prefer-default-alias-for-PCI-bus.patch new file mode 100644 index 0000000..df59c3a --- /dev/null +++ b/SOURCES/libvirt-qemuBuildDeviceAddressStr-Prefer-default-alias-for-PCI-bus.patch @@ -0,0 +1,81 @@ +From 57dd2427239f4de91c9735b1fa299d08d11a8dac Mon Sep 17 00:00:00 2001 +Message-Id: <57dd2427239f4de91c9735b1fa299d08d11a8dac@dist-git> +From: Michal Privoznik +Date: Mon, 20 Nov 2017 11:08:54 +0100 +Subject: [PATCH] qemuBuildDeviceAddressStr: Prefer default alias for PCI bus + +https://bugzilla.redhat.com/show_bug.cgi?id=1434451 + +Just like in 9324f67a572f9b32 we need to put default pci-root +alias onto the command line instead of the one provided by user. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 937f319536723fec57ad472b002a159d0f67a77c) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 30 ++++++++++++++++------ + .../qemuxml2argvdata/qemuxml2argv-user-aliases.xml | 4 ++- + 2 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 7dc7387a15..dfacff4b12 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -318,16 +318,30 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, + + if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && + cont->idx == info->addr.pci.bus) { +- contAlias = cont->info.alias; + contIsPHB = virDomainControllerIsPSeriesPHB(cont); + contTargetIndex = cont->opts.pciopts.targetIndex; +- if (!contAlias) { +- virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Device alias was not set for PCI " +- "controller with index %u required " +- "for device at address %s"), +- info->addr.pci.bus, devStr); +- goto cleanup; ++ ++ /* When domain has builtin pci-root controller we don't put it ++ * onto cmd line. Therefore we can't set its alias. In that ++ * case, use the default one. */ ++ if (!qemuDomainIsPSeries(domainDef) && ++ cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { ++ if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) ++ contAlias = "pci.0"; ++ else ++ contAlias = "pci"; ++ } else if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { ++ contAlias = "pcie.0"; ++ } else { ++ contAlias = cont->info.alias; ++ if (!contAlias) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, ++ _("Device alias was not set for PCI " ++ "controller with index %u required " ++ "for device at address %s"), ++ info->addr.pci.bus, devStr); ++ goto cleanup; ++ } + } + break; + } +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +index d1cb8fea6f..c760098fe0 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml ++++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.xml +@@ -74,7 +74,9 @@ + +
      + +- ++ ++ ++ + + +
      +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-alias-for-SATA-bus.patch b/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-alias-for-SATA-bus.patch new file mode 100644 index 0000000..ee65ae4 --- /dev/null +++ b/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-alias-for-SATA-bus.patch @@ -0,0 +1,114 @@ +From 0d4d7811a11bcd2bf12446425e5e05014faecf52 Mon Sep 17 00:00:00 2001 +Message-Id: <0d4d7811a11bcd2bf12446425e5e05014faecf52@dist-git> +From: Michal Privoznik +Date: Mon, 20 Nov 2017 11:08:53 +0100 +Subject: [PATCH] qemuBuildDriveDevStr: Prefer default alias for SATA bus + +https://bugzilla.redhat.com/show_bug.cgi?id=1434451 + +Just like in 9324f67a572f9b32 we need to put default sata alias +(which is hardcoded to "ide", obvious, right?) onto the command +line instead of the one provided by user. + +Signed-off-by: Michal Privoznik +(cherry picked from commit f66e5896ad6013c2f31eef1c909999b33ba8847e) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 15 ++++++++-- + .../qemuxml2argv-user-aliases2.args | 1 + + .../qemuxml2argv-user-aliases2.xml | 34 ++++++++++++++++++++++ + tests/qemuxml2argvtest.c | 1 + + 4 files changed, 48 insertions(+), 3 deletions(-) + create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.args + create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.xml + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 272ef610a3..7dc7387a15 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -2076,9 +2076,18 @@ qemuBuildDriveDevStr(const virDomainDef *def, + virBufferAddLit(&opt, "ide-drive"); + } + +- if (!(contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_SATA, +- disk->info.addr.drive.controller))) +- goto error; ++ /* When domain has builtin SATA controller we don't put it onto cmd ++ * line. Therefore we can't set its alias. In that case, use the ++ * default one. */ ++ if (qemuDomainIsQ35(def) && ++ disk->info.addr.drive.controller == 0) { ++ contAlias = "ide"; ++ } else { ++ if (!(contAlias = virDomainControllerAliasFind(def, ++ VIR_DOMAIN_CONTROLLER_TYPE_SATA, ++ disk->info.addr.drive.controller))) ++ goto error; ++ } + virBufferAsprintf(&opt, ",bus=%s.%d", + contAlias, + disk->info.addr.drive.unit); +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.args b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.args +new file mode 120000 +index 0000000000..e029bc0ec8 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.args +@@ -0,0 +1 @@ ++qemuxml2argv-boot-floppy-q35.args +\ No newline at end of file +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.xml b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.xml +new file mode 100644 +index 0000000000..a288b86117 +--- /dev/null ++++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases2.xml +@@ -0,0 +1,34 @@ ++ ++ QEMUGuest1 ++ c7a5fdbd-edaf-9455-926a-d65c16db1809 ++ 219100 ++ 219100 ++ 1 ++ ++ hvm ++ ++ ++ ++ destroy ++ restart ++ destroy ++ ++ /usr/bin/qemu-system-x86_64 ++ ++ ++ ++ ++
      ++ ++ ++
      ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c +index ecc86d045c..ff9c8608aa 100644 +--- a/tests/qemuxml2argvtest.c ++++ b/tests/qemuxml2argvtest.c +@@ -2827,6 +2827,7 @@ mymain(void) + QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_PIIX_DISABLE_S3, + QEMU_CAPS_PIIX_DISABLE_S4, QEMU_CAPS_VNC, + QEMU_CAPS_HDA_DUPLEX); ++ DO_TEST("user-aliases2", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI); + + if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) + virFileDeleteTree(fakerootdir); +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-aliases-for-IDE-bus.patch b/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-aliases-for-IDE-bus.patch new file mode 100644 index 0000000..6f4f6e6 --- /dev/null +++ b/SOURCES/libvirt-qemuBuildDriveDevStr-Prefer-default-aliases-for-IDE-bus.patch @@ -0,0 +1,67 @@ +From 60d285eca3ab7003a7ebd03e3610616e0a657942 Mon Sep 17 00:00:00 2001 +Message-Id: <60d285eca3ab7003a7ebd03e3610616e0a657942@dist-git> +From: Michal Privoznik +Date: Mon, 20 Nov 2017 11:08:51 +0100 +Subject: [PATCH] qemuBuildDriveDevStr: Prefer default aliases for IDE bus + +https://bugzilla.redhat.com/show_bug.cgi?id=1434451 + +When testing user aliases it was discovered that for 440fx +machine type which has default IDE bus builtin, domain cannot +start if IDE controller has the user provided alias. This is +because for 440fx we don't put the IDE controller onto the +command line (since it is builtin) and therefore any device that +is plugged onto the bus must use the default alias. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 9324f67a572f9b32f25bc088fb9f34e736edc612) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_command.c | 14 +++++++++++--- + tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args | 4 ++-- + 2 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index aa7079229f..272ef610a3 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -1947,9 +1947,17 @@ qemuBuildDriveDevStr(const virDomainDef *def, + virBufferAddLit(&opt, "ide-drive"); + } + +- if (!(contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_IDE, +- disk->info.addr.drive.controller))) +- goto error; ++ /* When domain has builtin IDE controller we don't put it onto cmd ++ * line. Therefore we can't set its alias. In that case, use the ++ * default one. */ ++ if (qemuDomainHasBuiltinIDE(def)) { ++ contAlias = "ide"; ++ } else { ++ if (!(contAlias = virDomainControllerAliasFind(def, ++ VIR_DOMAIN_CONTROLLER_TYPE_IDE, ++ disk->info.addr.drive.controller))) ++ goto error; ++ } + virBufferAsprintf(&opt, ",bus=%s.%d,unit=%d", + contAlias, + disk->info.addr.drive.bus, +diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args +index 62fbd567b1..1719c1bc88 100644 +--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args ++++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args +@@ -44,8 +44,8 @@ id=drive-ua-myEncryptedDisk1 \ + id=ua-myEncryptedDisk1 \ + -drive file=/home/zippy/tmp/install-amd64-minimal-20140619.iso,format=raw,\ + if=none,media=cdrom,id=drive-ua-WhatAnAwesomeCDROM,readonly=on,cache=none \ +--device ide-drive,bus=ua-DoesAnybodyStillUseIDE.1,unit=0,\ +-drive=drive-ua-WhatAnAwesomeCDROM,id=ua-WhatAnAwesomeCDROM \ ++-device ide-drive,bus=ide.1,unit=0,drive=drive-ua-WhatAnAwesomeCDROM,\ ++id=ua-WhatAnAwesomeCDROM \ + -device virtio-net-pci,vlan=0,id=ua-CheckoutThisNIC,mac=52:54:00:d6:c0:0b,\ + bus=pci.0,addr=0x3 \ + -net tap,fd=3,vlan=0,name=hostua-CheckoutThisNIC \ +-- +2.15.0 + diff --git a/SOURCES/libvirt-qemuDomainAttachDeviceMknodHelper-Remove-symlink-before-creating-it.patch b/SOURCES/libvirt-qemuDomainAttachDeviceMknodHelper-Remove-symlink-before-creating-it.patch new file mode 100644 index 0000000..8c2c606 --- /dev/null +++ b/SOURCES/libvirt-qemuDomainAttachDeviceMknodHelper-Remove-symlink-before-creating-it.patch @@ -0,0 +1,67 @@ +From 6c4c780eda082ef395b70af89b8b8942b9ad4a9d Mon Sep 17 00:00:00 2001 +Message-Id: <6c4c780eda082ef395b70af89b8b8942b9ad4a9d@dist-git> +From: Michal Privoznik +Date: Mon, 8 Jan 2018 10:16:19 +0100 +Subject: [PATCH] qemuDomainAttachDeviceMknodHelper: Remove symlink before + creating it + +https://bugzilla.redhat.com/show_bug.cgi?id=1528502 + +So imagine you have /dev/blah symlink which points to /dev/sda. +You attach /dev/blah as disk to your domain. Libvirt correctly +creates the /dev/blah -> /dev/sda symlink in the qemu namespace. +However, then you detach the disk, change the symlink so that it +points to /dev/sdb and tries to attach the disk again. This time, +however, the attach fails (well, qemu attaches wrong disk) +because the code assumes that symlinks don't change. Well they +do. + +This is inspired by test fix written by Eduardo Habkost. + +Signed-off-by: Michal Privoznik +Reviewed-by: Andrea Bolognani +(cherry picked from commit db98e7f67ea0d7699410f514f01947cef5128a6c) +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +Reviewed-by: Andrea Bolognani +--- + src/qemu/qemu_domain.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c +index 8967f2774d..b0c78cc7c4 100644 +--- a/src/qemu/qemu_domain.c ++++ b/src/qemu/qemu_domain.c +@@ -9559,13 +9559,23 @@ qemuDomainAttachDeviceMknodHelper(pid_t pid ATTRIBUTE_UNUSED, + + if (isLink) { + VIR_DEBUG("Creating symlink %s -> %s", data->file, data->target); ++ ++ /* First, unlink the symlink target. Symlinks change and ++ * therefore we have no guarantees that pre-existing ++ * symlink is still valid. */ ++ if (unlink(data->file) < 0 && ++ errno != ENOENT) { ++ virReportSystemError(errno, ++ _("Unable to remove symlink %s"), ++ data->file); ++ goto cleanup; ++ } ++ + if (symlink(data->target, data->file) < 0) { +- if (errno != EEXIST) { +- virReportSystemError(errno, +- _("Unable to create symlink %s"), +- data->target); +- goto cleanup; +- } ++ virReportSystemError(errno, ++ _("Unable to create symlink %s (pointing to %s)"), ++ data->file, data->target); ++ goto cleanup; + } else { + delDevice = true; + } +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemuDomainAttachDeviceMknodRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch b/SOURCES/libvirt-qemuDomainAttachDeviceMknodRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch deleted file mode 100644 index 6c60f16..0000000 --- a/SOURCES/libvirt-qemuDomainAttachDeviceMknodRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch +++ /dev/null @@ -1,276 +0,0 @@ -From c5e142b3b9bc25ed508b8b7b62907ed99daba84d Mon Sep 17 00:00:00 2001 -Message-Id: -From: Michal Privoznik -Date: Thu, 11 May 2017 15:38:40 +0200 -Subject: [PATCH] qemuDomainAttachDeviceMknodRecursive: Don't try to create - devices under preserved mount points - -https://bugzilla.redhat.com/show_bug.cgi?id=1449510 - -Just like in previous commit, this fixes the same issue for -hotplug. - -Signed-off-by: Michal Privoznik -Reviewed-by: Cedric Bosdonnat -(cherry picked from commit b3418f36be75eb4bdecd6aa37cda7a268519ee46) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 114 ++++++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 98 insertions(+), 16 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 9217747d5..671569f6f 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -8314,6 +8314,8 @@ static int - qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver, - virDomainObjPtr vm, - const char *file, -+ char * const *devMountsPath, -+ size_t ndevMountsPath, - unsigned int ttl) - { - struct qemuDomainAttachDeviceMknodData data; -@@ -8391,20 +8393,36 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver, - #endif - - if (STRPREFIX(file, DEVPREFIX)) { -- if (qemuSecurityPreFork(driver->securityManager) < 0) -- goto cleanup; -+ size_t i; - -- if (virProcessRunInMountNamespace(vm->pid, -- qemuDomainAttachDeviceMknodHelper, -- &data) < 0) { -- qemuSecurityPostFork(driver->securityManager); -- goto cleanup; -+ for (i = 0; i < ndevMountsPath; i++) { -+ if (STREQ(devMountsPath[i], "/dev")) -+ continue; -+ if (STRPREFIX(file, devMountsPath[i])) -+ break; -+ } -+ -+ if (i == ndevMountsPath) { -+ if (qemuSecurityPreFork(driver->securityManager) < 0) -+ goto cleanup; -+ -+ if (virProcessRunInMountNamespace(vm->pid, -+ qemuDomainAttachDeviceMknodHelper, -+ &data) < 0) { -+ qemuSecurityPostFork(driver->securityManager); -+ goto cleanup; -+ } -+ qemuSecurityPostFork(driver->securityManager); -+ } else { -+ VIR_DEBUG("Skipping dev %s because of %s mount point", -+ file, devMountsPath[i]); - } -- qemuSecurityPostFork(driver->securityManager); - } - - if (isLink && -- qemuDomainAttachDeviceMknodRecursive(driver, vm, target, ttl -1) < 0) -+ qemuDomainAttachDeviceMknodRecursive(driver, vm, target, -+ devMountsPath, ndevMountsPath, -+ ttl -1) < 0) - goto cleanup; - - ret = 0; -@@ -8421,11 +8439,15 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverPtr driver, - static int - qemuDomainAttachDeviceMknod(virQEMUDriverPtr driver, - virDomainObjPtr vm, -- const char *file) -+ const char *file, -+ char * const *devMountsPath, -+ size_t ndevMountsPath) - { - long symloop_max = sysconf(_SC_SYMLOOP_MAX); - -- return qemuDomainAttachDeviceMknodRecursive(driver, vm, file, symloop_max); -+ return qemuDomainAttachDeviceMknodRecursive(driver, vm, file, -+ devMountsPath, ndevMountsPath, -+ symloop_max); - } - - -@@ -8465,6 +8487,9 @@ qemuDomainNamespaceSetupDisk(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - virStorageSourcePtr next; - struct stat sb; - int ret = -1; -@@ -8472,6 +8497,12 @@ qemuDomainNamespaceSetupDisk(virQEMUDriverPtr driver, - if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) - return 0; - -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ - for (next = src; next; next = next->backingStore) { - if (virStorageSourceIsEmpty(next) || - !virStorageSourceIsLocalStorage(next)) { -@@ -8490,12 +8521,15 @@ qemuDomainNamespaceSetupDisk(virQEMUDriverPtr driver, - - if (qemuDomainAttachDeviceMknod(driver, - vm, -- next->path) < 0) -+ next->path, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - } - - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8520,6 +8554,9 @@ qemuDomainNamespaceSetupHostdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - char **path = NULL; - size_t i, npaths = 0; -@@ -8530,10 +8567,17 @@ qemuDomainNamespaceSetupHostdev(virQEMUDriverPtr driver, - if (qemuDomainGetHostdevPath(NULL, hostdev, false, &npaths, &path, NULL) < 0) - goto cleanup; - -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ - for (i = 0; i < npaths; i++) { - if (qemuDomainAttachDeviceMknod(driver, - vm, -- path[i]) < 0) -+ path[i], -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - } - -@@ -8542,6 +8586,8 @@ qemuDomainNamespaceSetupHostdev(virQEMUDriverPtr driver, - for (i = 0; i < npaths; i++) - VIR_FREE(path[i]); - VIR_FREE(path); -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8581,6 +8627,9 @@ qemuDomainNamespaceSetupMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - - if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM) -@@ -8589,10 +8638,19 @@ qemuDomainNamespaceSetupMemory(virQEMUDriverPtr driver, - if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) - return 0; - -- if (qemuDomainAttachDeviceMknod(driver, vm, mem->nvdimmPath) < 0) -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainAttachDeviceMknod(driver, vm, mem->nvdimmPath, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8623,6 +8681,9 @@ qemuDomainNamespaceSetupChardev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - const char *path; - int ret = -1; - -@@ -8634,12 +8695,21 @@ qemuDomainNamespaceSetupChardev(virQEMUDriverPtr driver, - - path = chr->source->data.file.path; - -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ - if (qemuDomainAttachDeviceMknod(driver, - vm, -- path) < 0) -+ path, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8674,6 +8744,9 @@ qemuDomainNamespaceSetupRNG(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - const char *path = NULL; - int ret = -1; - -@@ -8691,12 +8764,21 @@ qemuDomainNamespaceSetupRNG(virQEMUDriverPtr driver, - goto cleanup; - } - -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ - if (qemuDomainAttachDeviceMknod(driver, - vm, -- path) < 0) -+ path, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemuDomainBuildNamespace-Move-dev-mountpoints-later.patch b/SOURCES/libvirt-qemuDomainBuildNamespace-Move-dev-mountpoints-later.patch deleted file mode 100644 index e821e4a..0000000 --- a/SOURCES/libvirt-qemuDomainBuildNamespace-Move-dev-mountpoints-later.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 2cc49072ced64daa446a90b802191496b4d28e69 Mon Sep 17 00:00:00 2001 -Message-Id: <2cc49072ced64daa446a90b802191496b4d28e69@dist-git> -From: Michal Privoznik -Date: Thu, 11 May 2017 15:38:37 +0200 -Subject: [PATCH] qemuDomainBuildNamespace: Move /dev/* mountpoints later - -https://bugzilla.redhat.com/show_bug.cgi?id=1449510 - -When setting up mount namespace for a qemu domain the following -steps are executed: - -1) get list of mountpoints under /dev/ -2) move them to /var/run/libvirt/qemu/$domName.ext -3) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev -4) move the mountpoint of the new device tree to /dev -5) restore original mountpoints from step 2) - -Note the problem with this approach is that if some device in step -3) requires access to a mountpoint from step 2) it will fail as -the mountpoint is not there anymore. For instance consider the -following domain disk configuration: - - - - - -
      - - -In this case operation fails as we are unable to create vhostmd0 -in the new device tree because after step 2) there is no /dev/shm -anymore. Leave aside fact that we shouldn't try to create devices -living in other mountpoints. That's a separate bug that will be -addressed later. - -Currently, the order described above is rearranged to: - -1) get list of mountpoints under /dev/ -2) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev -3) move them to /var/run/libvirt/qemu/$domName.ext -4) move the mountpoint of the new device tree to /dev -5) restore original mountpoints from step 3) - -Signed-off-by: Michal Privoznik -Reviewed-by: Cedric Bosdonnat -(cherry picked from commit a7cc039dc796f541793955598377807af48341fb) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 48 ++++++++++++++++++++++++------------------------ - 1 file changed, 24 insertions(+), 24 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 2790d7e74..fbb65fab4 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -8026,6 +8026,30 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - if (qemuDomainSetupDev(cfg, mgr, vm, devPath) < 0) - goto cleanup; - -+ if (qemuDomainSetupAllDisks(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllHostdevs(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllMemories(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllChardevs(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupTPM(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllGraphics(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllInputs(cfg, vm, devPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainSetupAllRNGs(cfg, vm, devPath) < 0) -+ goto cleanup; -+ - /* Save some mount points because we want to share them with the host */ - for (i = 0; i < ndevMountsPath; i++) { - struct stat sb; -@@ -8053,30 +8077,6 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - goto cleanup; - } - -- if (qemuDomainSetupAllDisks(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllHostdevs(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllMemories(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllChardevs(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupTPM(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllGraphics(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllInputs(cfg, vm, devPath) < 0) -- goto cleanup; -- -- if (qemuDomainSetupAllRNGs(cfg, vm, devPath) < 0) -- goto cleanup; -- - if (virFileMoveMount(devPath, "/dev") < 0) - goto cleanup; - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch b/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch deleted file mode 100644 index 1202ff0..0000000 --- a/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-Don-t-try-to-create-devices-under-preserved-mount-points.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 09f7d1ef473ec3e1f21c62abff77d55d79817704 Mon Sep 17 00:00:00 2001 -Message-Id: <09f7d1ef473ec3e1f21c62abff77d55d79817704@dist-git> -From: Michal Privoznik -Date: Thu, 11 May 2017 15:38:39 +0200 -Subject: [PATCH] qemuDomainCreateDeviceRecursive: Don't try to create devices - under preserved mount points - -https://bugzilla.redhat.com/show_bug.cgi?id=1449510 - -While the code allows devices to already be there (by some -miracle), we shouldn't try to create devices that don't belong to -us. For instance, we shouldn't try to create /dev/shm/file -because /dev/shm is a mount point that is preserved. Therefore if -a file is created there from an outside (e.g. by mgmt application -or some other daemon running on the system like vhostmd), it -exists in the qemu namespace too as the mount point is the same. -It's only /dev and /dev only that is different. The same -reasoning applies to all other preserved mount points. - -Signed-off-by: Michal Privoznik -Reviewed-by: Cedric Bosdonnat -(cherry picked from commit e30dbf35a1a9e86934272aeef803f91b36d8cbce) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 39 ++++++++++++++++++++++++++++++--------- - 1 file changed, 30 insertions(+), 9 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index bbf865e12..9217747d5 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -7415,6 +7415,8 @@ qemuDomainGetPreservedMounts(virQEMUDriverConfigPtr cfg, - - struct qemuDomainCreateDeviceData { - const char *path; /* Path to temp new /dev location */ -+ char * const *devMountsPath; -+ size_t ndevMountsPath; - }; - - -@@ -7468,17 +7470,34 @@ qemuDomainCreateDeviceRecursive(const char *device, - * For now, lets hope callers play nice. - */ - if (STRPREFIX(device, DEVPREFIX)) { -- if (virAsprintf(&devicePath, "%s/%s", -- data->path, device + strlen(DEVPREFIX)) < 0) -- goto cleanup; -+ size_t i; - -- if (virFileMakeParentPath(devicePath) < 0) { -- virReportSystemError(errno, -- _("Unable to create %s"), -- devicePath); -- goto cleanup; -+ for (i = 0; i < data->ndevMountsPath; i++) { -+ if (STREQ(data->devMountsPath[i], "/dev")) -+ continue; -+ if (STRPREFIX(device, data->devMountsPath[i])) -+ break; -+ } -+ -+ if (i == data->ndevMountsPath) { -+ /* Okay, @device is in /dev but not in any mount point under /dev. -+ * Create it. */ -+ if (virAsprintf(&devicePath, "%s/%s", -+ data->path, device + strlen(DEVPREFIX)) < 0) -+ goto cleanup; -+ -+ if (virFileMakeParentPath(devicePath) < 0) { -+ virReportSystemError(errno, -+ _("Unable to create %s"), -+ devicePath); -+ goto cleanup; -+ } -+ VIR_DEBUG("Creating dev %s", device); -+ create = true; -+ } else { -+ VIR_DEBUG("Skipping dev %s because of %s mount point", -+ device, data->devMountsPath[i]); - } -- create = true; - } - - if (isLink) { -@@ -8027,6 +8046,8 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - } - - data.path = devPath; -+ data.devMountsPath = devMountsPath; -+ data.ndevMountsPath = ndevMountsPath; - - if (virProcessSetupPrivateMountNS() < 0) - goto cleanup; --- -2.13.0 - diff --git a/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-pass-a-structure-instead-of-bare-path.patch b/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-pass-a-structure-instead-of-bare-path.patch deleted file mode 100644 index b3c811c..0000000 --- a/SOURCES/libvirt-qemuDomainCreateDeviceRecursive-pass-a-structure-instead-of-bare-path.patch +++ /dev/null @@ -1,434 +0,0 @@ -From 382795a4ab74f29b1a5bdf3ea3aa33d17d2add56 Mon Sep 17 00:00:00 2001 -Message-Id: <382795a4ab74f29b1a5bdf3ea3aa33d17d2add56@dist-git> -From: Michal Privoznik -Date: Thu, 11 May 2017 15:38:38 +0200 -Subject: [PATCH] qemuDomainCreateDeviceRecursive: pass a structure instead of - bare path - -https://bugzilla.redhat.com/show_bug.cgi?id=1449510 - -Currently, all we need to do in qemuDomainCreateDeviceRecursive() is to -take given @device, get all kinds of info on it (major & minor numbers, -owner, seclabels) and create its copy at a temporary location @path -(usually /var/run/libvirt/qemu/$domName.dev), if @device live under -/dev. This is, however, very loose condition, as it also means -/dev/shm/* is created too. Therefor, we will need to pass more arguments -into the function for better decision making (e.g. list of mount points -under /dev). Instead of adding more arguments to all the functions (not -easily reachable because some functions are callback with strictly -defined type), lets just turn this one 'const char *' into a 'struct *'. -New "arguments" can be then added at no cost. - -Signed-off-by: Michal Privoznik -Reviewed-by: Cedric Bosdonnat -(cherry picked from commit 26c14be8d64bc9e3c23b95fff65affc2bf7c86bc) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 106 ++++++++++++++++++++++++++----------------------- - 1 file changed, 57 insertions(+), 49 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index fbb65fab4..bbf865e12 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -7413,9 +7413,14 @@ qemuDomainGetPreservedMounts(virQEMUDriverConfigPtr cfg, - } - - -+struct qemuDomainCreateDeviceData { -+ const char *path; /* Path to temp new /dev location */ -+}; -+ -+ - static int - qemuDomainCreateDeviceRecursive(const char *device, -- const char *path, -+ const struct qemuDomainCreateDeviceData *data, - bool allow_noent, - unsigned int ttl) - { -@@ -7464,7 +7469,7 @@ qemuDomainCreateDeviceRecursive(const char *device, - */ - if (STRPREFIX(device, DEVPREFIX)) { - if (virAsprintf(&devicePath, "%s/%s", -- path, device + strlen(DEVPREFIX)) < 0) -+ data->path, device + strlen(DEVPREFIX)) < 0) - goto cleanup; - - if (virFileMakeParentPath(devicePath) < 0) { -@@ -7525,7 +7530,7 @@ qemuDomainCreateDeviceRecursive(const char *device, - tmp = NULL; - } - -- if (qemuDomainCreateDeviceRecursive(target, path, -+ if (qemuDomainCreateDeviceRecursive(target, data, - allow_noent, ttl - 1) < 0) - goto cleanup; - } else { -@@ -7609,12 +7614,12 @@ qemuDomainCreateDeviceRecursive(const char *device, - - static int - qemuDomainCreateDevice(const char *device, -- const char *path, -+ const struct qemuDomainCreateDeviceData *data, - bool allow_noent) - { - long symloop_max = sysconf(_SC_SYMLOOP_MAX); - -- return qemuDomainCreateDeviceRecursive(device, path, -+ return qemuDomainCreateDeviceRecursive(device, data, - allow_noent, symloop_max); - } - -@@ -7622,7 +7627,7 @@ qemuDomainCreateDevice(const char *device, - static int - qemuDomainPopulateDevices(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm ATTRIBUTE_UNUSED, -- const char *path) -+ const struct qemuDomainCreateDeviceData *data) - { - const char *const *devices = (const char *const *) cfg->cgroupDeviceACL; - size_t i; -@@ -7632,7 +7637,7 @@ qemuDomainPopulateDevices(virQEMUDriverConfigPtr cfg, - devices = defaultDeviceACL; - - for (i = 0; devices[i]; i++) { -- if (qemuDomainCreateDevice(devices[i], path, true) < 0) -+ if (qemuDomainCreateDevice(devices[i], data, true) < 0) - goto cleanup; - } - -@@ -7646,7 +7651,7 @@ static int - qemuDomainSetupDev(virQEMUDriverConfigPtr cfg, - virSecurityManagerPtr mgr, - virDomainObjPtr vm, -- const char *path) -+ const struct qemuDomainCreateDeviceData *data) - { - char *mount_options = NULL; - char *opts = NULL; -@@ -7668,10 +7673,10 @@ qemuDomainSetupDev(virQEMUDriverConfigPtr cfg, - "mode=755,size=65536%s", mount_options) < 0) - goto cleanup; - -- if (virFileSetupDev(path, opts) < 0) -+ if (virFileSetupDev(data->path, opts) < 0) - goto cleanup; - -- if (qemuDomainPopulateDevices(cfg, vm, path) < 0) -+ if (qemuDomainPopulateDevices(cfg, vm, data) < 0) - goto cleanup; - - ret = 0; -@@ -7685,7 +7690,7 @@ qemuDomainSetupDev(virQEMUDriverConfigPtr cfg, - static int - qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainDiskDefPtr disk, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - virStorageSourcePtr next; - char *dst = NULL; -@@ -7697,7 +7702,7 @@ qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - continue; - } - -- if (qemuDomainCreateDevice(next->path, devPath, false) < 0) -+ if (qemuDomainCreateDevice(next->path, data, false) < 0) - goto cleanup; - } - -@@ -7711,7 +7716,7 @@ qemuDomainSetupDisk(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupAllDisks(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - VIR_DEBUG("Setting up disks"); -@@ -7719,7 +7724,7 @@ qemuDomainSetupAllDisks(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->ndisks; i++) { - if (qemuDomainSetupDisk(cfg, - vm->def->disks[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - -@@ -7731,7 +7736,7 @@ qemuDomainSetupAllDisks(virQEMUDriverConfigPtr cfg, - static int - qemuDomainSetupHostdev(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainHostdevDefPtr dev, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - int ret = -1; - char **path = NULL; -@@ -7741,7 +7746,7 @@ qemuDomainSetupHostdev(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - goto cleanup; - - for (i = 0; i < npaths; i++) { -- if (qemuDomainCreateDevice(path[i], devPath, false) < 0) -+ if (qemuDomainCreateDevice(path[i], data, false) < 0) - goto cleanup; - } - -@@ -7757,7 +7762,7 @@ qemuDomainSetupHostdev(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupAllHostdevs(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - -@@ -7765,7 +7770,7 @@ qemuDomainSetupAllHostdevs(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->nhostdevs; i++) { - if (qemuDomainSetupHostdev(cfg, - vm->def->hostdevs[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - VIR_DEBUG("Setup all hostdevs"); -@@ -7776,19 +7781,19 @@ qemuDomainSetupAllHostdevs(virQEMUDriverConfigPtr cfg, - static int - qemuDomainSetupMemory(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainMemoryDefPtr mem, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM) - return 0; - -- return qemuDomainCreateDevice(mem->nvdimmPath, devPath, false); -+ return qemuDomainCreateDevice(mem->nvdimmPath, data, false); - } - - - static int - qemuDomainSetupAllMemories(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - -@@ -7796,7 +7801,7 @@ qemuDomainSetupAllMemories(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->nmems; i++) { - if (qemuDomainSetupMemory(cfg, - vm->def->mems[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - VIR_DEBUG("Setup all memories"); -@@ -7809,26 +7814,26 @@ qemuDomainSetupChardev(virDomainDefPtr def ATTRIBUTE_UNUSED, - virDomainChrDefPtr dev, - void *opaque) - { -- const char *devPath = opaque; -+ const struct qemuDomainCreateDeviceData *data = opaque; - - if (dev->source->type != VIR_DOMAIN_CHR_TYPE_DEV) - return 0; - -- return qemuDomainCreateDevice(dev->source->data.file.path, devPath, false); -+ return qemuDomainCreateDevice(dev->source->data.file.path, data, false); - } - - - static int - qemuDomainSetupAllChardevs(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - VIR_DEBUG("Setting up chardevs"); - - if (virDomainChrDefForeach(vm->def, - true, - qemuDomainSetupChardev, -- (void *) devPath) < 0) -+ (void *) data) < 0) - return -1; - - VIR_DEBUG("Setup all chardevs"); -@@ -7839,7 +7844,7 @@ qemuDomainSetupAllChardevs(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupTPM(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - virDomainTPMDefPtr dev = vm->def->tpm; - -@@ -7851,7 +7856,7 @@ qemuDomainSetupTPM(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - switch (dev->type) { - case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH: - if (qemuDomainCreateDevice(dev->data.passthrough.source.data.file.path, -- devPath, false) < 0) -+ data, false) < 0) - return -1; - break; - -@@ -7868,7 +7873,7 @@ qemuDomainSetupTPM(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupGraphics(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainGraphicsDefPtr gfx, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - const char *rendernode = gfx->data.spice.rendernode; - -@@ -7877,14 +7882,14 @@ qemuDomainSetupGraphics(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - !rendernode) - return 0; - -- return qemuDomainCreateDevice(rendernode, devPath, false); -+ return qemuDomainCreateDevice(rendernode, data, false); - } - - - static int - qemuDomainSetupAllGraphics(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - -@@ -7892,7 +7897,7 @@ qemuDomainSetupAllGraphics(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->ngraphics; i++) { - if (qemuDomainSetupGraphics(cfg, - vm->def->graphics[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - -@@ -7904,13 +7909,13 @@ qemuDomainSetupAllGraphics(virQEMUDriverConfigPtr cfg, - static int - qemuDomainSetupInput(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainInputDefPtr input, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - int ret = -1; - - switch ((virDomainInputType) input->type) { - case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: -- if (qemuDomainCreateDevice(input->source.evdev, devPath, false) < 0) -+ if (qemuDomainCreateDevice(input->source.evdev, data, false) < 0) - goto cleanup; - break; - -@@ -7931,7 +7936,7 @@ qemuDomainSetupInput(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupAllInputs(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - -@@ -7939,7 +7944,7 @@ qemuDomainSetupAllInputs(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->ninputs; i++) { - if (qemuDomainSetupInput(cfg, - vm->def->inputs[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - VIR_DEBUG("Setup all inputs"); -@@ -7950,11 +7955,11 @@ qemuDomainSetupAllInputs(virQEMUDriverConfigPtr cfg, - static int - qemuDomainSetupRNG(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - virDomainRNGDefPtr rng, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - switch ((virDomainRNGBackend) rng->backend) { - case VIR_DOMAIN_RNG_BACKEND_RANDOM: -- if (qemuDomainCreateDevice(rng->source.file, devPath, false) < 0) -+ if (qemuDomainCreateDevice(rng->source.file, data, false) < 0) - return -1; - - case VIR_DOMAIN_RNG_BACKEND_EGD: -@@ -7970,7 +7975,7 @@ qemuDomainSetupRNG(virQEMUDriverConfigPtr cfg ATTRIBUTE_UNUSED, - static int - qemuDomainSetupAllRNGs(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, -- const char *devPath) -+ const struct qemuDomainCreateDeviceData *data) - { - size_t i; - -@@ -7978,7 +7983,7 @@ qemuDomainSetupAllRNGs(virQEMUDriverConfigPtr cfg, - for (i = 0; i < vm->def->nrngs; i++) { - if (qemuDomainSetupRNG(cfg, - vm->def->rngs[i], -- devPath) < 0) -+ data) < 0) - return -1; - } - -@@ -7992,6 +7997,7 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - virSecurityManagerPtr mgr, - virDomainObjPtr vm) - { -+ struct qemuDomainCreateDeviceData data; - char *devPath = NULL; - char **devMountsPath = NULL, **devMountsSavePath = NULL; - size_t ndevMountsPath = 0, i; -@@ -8020,34 +8026,36 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - goto cleanup; - } - -+ data.path = devPath; -+ - if (virProcessSetupPrivateMountNS() < 0) - goto cleanup; - -- if (qemuDomainSetupDev(cfg, mgr, vm, devPath) < 0) -+ if (qemuDomainSetupDev(cfg, mgr, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllDisks(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllDisks(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllHostdevs(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllHostdevs(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllMemories(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllMemories(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllChardevs(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllChardevs(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupTPM(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupTPM(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllGraphics(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllGraphics(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllInputs(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllInputs(cfg, vm, &data) < 0) - goto cleanup; - -- if (qemuDomainSetupAllRNGs(cfg, vm, devPath) < 0) -+ if (qemuDomainSetupAllRNGs(cfg, vm, &data) < 0) - goto cleanup; - - /* Save some mount points because we want to share them with the host */ --- -2.13.0 - diff --git a/SOURCES/libvirt-qemuDomainDetachDeviceUnlink-Don-t-unlink-files-we-haven-t-created.patch b/SOURCES/libvirt-qemuDomainDetachDeviceUnlink-Don-t-unlink-files-we-haven-t-created.patch deleted file mode 100644 index 630c82a..0000000 --- a/SOURCES/libvirt-qemuDomainDetachDeviceUnlink-Don-t-unlink-files-we-haven-t-created.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 8767eb1b444bcd825f382f150cd064171fdcba81 Mon Sep 17 00:00:00 2001 -Message-Id: <8767eb1b444bcd825f382f150cd064171fdcba81@dist-git> -From: Michal Privoznik -Date: Thu, 11 May 2017 15:38:41 +0200 -Subject: [PATCH] qemuDomainDetachDeviceUnlink: Don't unlink files we haven't - created - -https://bugzilla.redhat.com/show_bug.cgi?id=1449510 - -Even though there are several checks before calling this function -and for some scenarios we don't call it at all (e.g. on disk hot -unplug), it may be possible to sneak in some weird files (e.g. if -domain would have RNG with /dev/shm/some_file as its backend). No -matter how improbable, we shouldn't unlink it as we would be -unlinking a file from the host which we haven't created in the -first place. - -Signed-off-by: Michal Privoznik -Reviewed-by: Cedric Bosdonnat -(cherry picked from commit 2f0b3b103b329b0b9656ac4fc8b5f94a5c2fa051) -Signed-off-by: Michal Privoznik -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_domain.c | 86 ++++++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 76 insertions(+), 10 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 671569f6f..5ef3d0577 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -8471,14 +8471,32 @@ qemuDomainDetachDeviceUnlinkHelper(pid_t pid ATTRIBUTE_UNUSED, - static int - qemuDomainDetachDeviceUnlink(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainObjPtr vm, -- const char *file) -+ const char *file, -+ char * const *devMountsPath, -+ size_t ndevMountsPath) - { -- if (virProcessRunInMountNamespace(vm->pid, -- qemuDomainDetachDeviceUnlinkHelper, -- (void *)file) < 0) -- return -1; -+ int ret = -1; -+ size_t i; - -- return 0; -+ if (STRPREFIX(file, DEVPREFIX)) { -+ for (i = 0; i < ndevMountsPath; i++) { -+ if (STREQ(devMountsPath[i], "/dev")) -+ continue; -+ if (STRPREFIX(file, devMountsPath[i])) -+ break; -+ } -+ -+ if (i == ndevMountsPath) { -+ if (virProcessRunInMountNamespace(vm->pid, -+ qemuDomainDetachDeviceUnlinkHelper, -+ (void *)file) < 0) -+ goto cleanup; -+ } -+ } -+ -+ ret = 0; -+ cleanup: -+ return ret; - } - - -@@ -8597,6 +8615,9 @@ qemuDomainNamespaceTeardownHostdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - char **path = NULL; - size_t i, npaths = 0; -@@ -8608,8 +8629,15 @@ qemuDomainNamespaceTeardownHostdev(virQEMUDriverPtr driver, - &npaths, &path, NULL) < 0) - goto cleanup; - -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ - for (i = 0; i < npaths; i++) { -- if (qemuDomainDetachDeviceUnlink(driver, vm, path[i]) < 0) -+ if (qemuDomainDetachDeviceUnlink(driver, vm, path[i], -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - } - -@@ -8618,6 +8646,8 @@ qemuDomainNamespaceTeardownHostdev(virQEMUDriverPtr driver, - for (i = 0; i < npaths; i++) - VIR_FREE(path[i]); - VIR_FREE(path); -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8660,6 +8690,9 @@ qemuDomainNamespaceTeardownMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - - if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM) -@@ -8668,10 +8701,19 @@ qemuDomainNamespaceTeardownMemory(virQEMUDriverPtr driver, - if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) - return 0; - -- if (qemuDomainDetachDeviceUnlink(driver, vm, mem->nvdimmPath) < 0) -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainDetachDeviceUnlink(driver, vm, mem->nvdimmPath, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8719,6 +8761,9 @@ qemuDomainNamespaceTeardownChardev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - const char *path = NULL; - -@@ -8730,11 +8775,20 @@ qemuDomainNamespaceTeardownChardev(virQEMUDriverPtr driver, - - path = chr->source->data.file.path; - -- if (qemuDomainDetachDeviceUnlink(driver, vm, path) < 0) -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainDetachDeviceUnlink(driver, vm, path, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - -@@ -8788,6 +8842,9 @@ qemuDomainNamespaceTeardownRNG(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng) - { -+ virQEMUDriverConfigPtr cfg = NULL; -+ char **devMountsPath = NULL; -+ size_t ndevMountsPath = 0; - int ret = -1; - const char *path = NULL; - -@@ -8805,11 +8862,20 @@ qemuDomainNamespaceTeardownRNG(virQEMUDriverPtr driver, - goto cleanup; - } - -- if (qemuDomainDetachDeviceUnlink(driver, vm, path) < 0) -+ cfg = virQEMUDriverGetConfig(driver); -+ if (qemuDomainGetPreservedMounts(cfg, vm, -+ &devMountsPath, NULL, -+ &ndevMountsPath) < 0) -+ goto cleanup; -+ -+ if (qemuDomainDetachDeviceUnlink(driver, vm, path, -+ devMountsPath, ndevMountsPath) < 0) - goto cleanup; - - ret = 0; - cleanup: -+ virStringListFreeCount(devMountsPath, ndevMountsPath); -+ virObjectUnref(cfg); - return ret; - } - --- -2.13.0 - diff --git a/SOURCES/libvirt-qemuDomainRemoveMemoryDevice-unlink-memory-backing-file.patch b/SOURCES/libvirt-qemuDomainRemoveMemoryDevice-unlink-memory-backing-file.patch new file mode 100644 index 0000000..b568c9f --- /dev/null +++ b/SOURCES/libvirt-qemuDomainRemoveMemoryDevice-unlink-memory-backing-file.patch @@ -0,0 +1,96 @@ +From 9c5a70bc8c9332de2e769226efe81cb95b1ce2a4 Mon Sep 17 00:00:00 2001 +Message-Id: <9c5a70bc8c9332de2e769226efe81cb95b1ce2a4@dist-git> +From: Michal Privoznik +Date: Fri, 2 Feb 2018 11:12:36 +0100 +Subject: [PATCH] qemuDomainRemoveMemoryDevice: unlink() memory backing file + +https://bugzilla.redhat.com/show_bug.cgi?id=1461214 + +Since fec8f9c49af we try to use predictable file names for +'memory-backend-file' objects. But that made us provide full path +to qemu when hot plugging the object while previously we provided +merely a directory. But this makes qemu behave differently. If +qemu sees a path terminated with a directory it calls mkstemp() +and unlinks the file immediately. But if it sees full path it +just calls open(path, O_CREAT ..); and never unlinks the file. +Therefore it's up to libvirt to unlink the file and not leave it +behind. + +Signed-off-by: Michal Privoznik +(cherry picked from commit 4d83a6722f5b9c10ee85d5a5ffee364ac0e7b8af) +Signed-off-by: Michal Privoznik +--- + src/qemu/qemu_hotplug.c | 3 +++ + src/qemu/qemu_process.c | 26 ++++++++++++++++++++++++++ + src/qemu/qemu_process.h | 4 ++++ + 3 files changed, 33 insertions(+) + +diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c +index f1056627f2..831e014d9c 100644 +--- a/src/qemu/qemu_hotplug.c ++++ b/src/qemu/qemu_hotplug.c +@@ -3803,6 +3803,9 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver, + if (qemuDomainNamespaceTeardownMemory(driver, vm, mem) < 0) + VIR_WARN("Unable to remove memory device from /dev"); + ++ if (qemuProcessDestroyMemoryBackingPath(driver, vm, mem) < 0) ++ VIR_WARN("Unable to destroy memory backing path"); ++ + virDomainMemoryDefFree(mem); + + /* fix the balloon size */ +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index caf967dac5..3853112924 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -3491,6 +3491,32 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, + } + + ++int ++qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainMemoryDefPtr mem) ++{ ++ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); ++ char *path = NULL; ++ int ret = -1; ++ ++ if (qemuGetMemoryBackingPath(vm->def, cfg, mem->info.alias, &path) < 0) ++ goto cleanup; ++ ++ if (unlink(path) < 0 && ++ errno != ENOENT) { ++ virReportSystemError(errno, _("Unable to remove %s"), path); ++ goto cleanup; ++ } ++ ++ ret = 0; ++ cleanup: ++ VIR_FREE(path); ++ virObjectUnref(cfg); ++ return ret; ++} ++ ++ + static int + qemuProcessVNCAllocatePorts(virQEMUDriverPtr driver, + virDomainGraphicsDefPtr graphics, +diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h +index b383ff309b..8d210282f8 100644 +--- a/src/qemu/qemu_process.h ++++ b/src/qemu/qemu_process.h +@@ -43,6 +43,10 @@ int qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, + virDomainMemoryDefPtr mem, + bool build); + ++int qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr driver, ++ virDomainObjPtr vm, ++ virDomainMemoryDefPtr mem); ++ + void qemuProcessAutostartAll(virQEMUDriverPtr driver); + void qemuProcessReconnectAll(virConnectPtr conn, virQEMUDriverPtr driver); + +-- +2.16.1 + diff --git a/SOURCES/libvirt-qemuStateInitialize-Don-t-leak-memoryBackingPath.patch b/SOURCES/libvirt-qemuStateInitialize-Don-t-leak-memoryBackingPath.patch new file mode 100644 index 0000000..8d460f7 --- /dev/null +++ b/SOURCES/libvirt-qemuStateInitialize-Don-t-leak-memoryBackingPath.patch @@ -0,0 +1,43 @@ +From 05c1435a164d9ada81d5159302f5b531b871efdf Mon Sep 17 00:00:00 2001 +Message-Id: <05c1435a164d9ada81d5159302f5b531b871efdf@dist-git> +From: Michal Privoznik +Date: Fri, 1 Dec 2017 15:48:39 +0100 +Subject: [PATCH] qemuStateInitialize: Don't leak @memoryBackingPath + +==899== 39 bytes in 1 blocks are definitely lost in loss record 732 of 1,003 +==899== at 0x4C2AEDF: malloc (vg_replace_malloc.c:299) +==899== by 0x8B68CE7: vasprintf (in /lib64/libc-2.25.so) +==899== by 0x55498D2: virVasprintfInternal (virstring.c:708) +==899== by 0x55499E7: virAsprintfInternal (virstring.c:729) +==899== by 0x2BECFFF0: qemuGetMemoryBackingBasePath (qemu_conf.c:1757) +==899== by 0x2BF23225: qemuStateInitialize (qemu_driver.c:893) +==899== by 0x563073D: virStateInitialize (libvirt.c:770) +==899== by 0x124CC4: daemonRunStateInit (libvirtd.c:834) +==899== by 0x55521CD: virThreadHelper (virthread.c:206) +==899== by 0x88D9686: start_thread (in /lib64/libpthread-2.25.so) +==899== by 0x8BEAEFE: clone (in /lib64/libc-2.25.so) + +Signed-off-by: Michal Privoznik +(cherry picked from commit 3eb840904a088a89d05821d975ed4624962431f3) + +https://bugzilla.redhat.com/show_bug.cgi?id=1519759 +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_driver.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index d0d29747cf..fa73fc30d6 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -904,6 +904,7 @@ qemuStateInitialize(bool privileged, + virFileUpdatePerm(memoryBackingPath, + 0, S_IXGRP | S_IXOTH) < 0) + goto error; ++ VIR_FREE(memoryBackingPath); + + if (!(qemu_driver->closeCallbacks = virCloseCallbacksNew())) + goto error; +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu_capabilities-Introcude-QEMU_CAPS_NUMA_DIST.patch b/SOURCES/libvirt-qemu_capabilities-Introcude-QEMU_CAPS_NUMA_DIST.patch new file mode 100644 index 0000000..035b91e --- /dev/null +++ b/SOURCES/libvirt-qemu_capabilities-Introcude-QEMU_CAPS_NUMA_DIST.patch @@ -0,0 +1,115 @@ +From 92a9394006873d494610bad839255363c36e65c3 Mon Sep 17 00:00:00 2001 +Message-Id: <92a9394006873d494610bad839255363c36e65c3@dist-git> +From: Michal Privoznik +Date: Mon, 4 Dec 2017 13:38:51 +0100 +Subject: [PATCH] qemu_capabilities: Introcude QEMU_CAPS_NUMA_DIST + +https://bugzilla.redhat.com/show_bug.cgi?id=1454889 + +This capability says if qemu is capable of specifying distances +between NUMA nodes on the command line. Unfortunately, there's no +real way to check this and thus we have to go with version check. +QEMU introduced this in 0f203430dd8 (and friend) which was +released in 2.10.0. + +Signed-off-by: Michal Privoznik +Reviewed-by: John Ferlan +(cherry picked from commit 13e148ebda9ef0a064aa811aa14bcbb35c157ceb) +Signed-off-by: Michal Privoznik + + Conflicts: + src/qemu/qemu_capabilities.c + src/qemu/qemu_capabilities.h + tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml + + - Context as some capabilities are not backported. + +Signed-off-by: Michal Privoznik +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_capabilities.c | 6 +++++- + src/qemu/qemu_capabilities.h | 2 +- + tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 + + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + + 5 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c +index ae5448eaaa..d1677144b7 100644 +--- a/src/qemu/qemu_capabilities.c ++++ b/src/qemu/qemu_capabilities.c +@@ -449,7 +449,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, + + /* 275 */ + "sclplmconsole", +- ++ "numa.dist", + "disk-share-rw", + + "isa-serial", +@@ -4808,6 +4808,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); + } + ++ /* no way to query for -numa dist */ ++ if (qemuCaps->version >= 2010000) ++ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NUMA_DIST); ++ + if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) + goto cleanup; + +diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h +index c809f83404..3e016b7c79 100644 +--- a/src/qemu/qemu_capabilities.h ++++ b/src/qemu/qemu_capabilities.h +@@ -435,7 +435,7 @@ typedef enum { + + /* 275 */ + QEMU_CAPS_DEVICE_SCLPLMCONSOLE, /* -device sclplmconsole */ +- ++ QEMU_CAPS_NUMA_DIST, /* -numa dist */ + QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */ + + QEMU_CAPS_DEVICE_ISA_SERIAL, /* -device isa-serial */ +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +index 23356f4092..09cce92067 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml +@@ -179,6 +179,7 @@ + + + ++ + + + 2010000 +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +index 463c30c77a..00fe1cffa7 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +@@ -142,6 +142,7 @@ + + + ++ + + 2010000 + 0 +diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +index e04e530b95..2417251678 100644 +--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml ++++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +@@ -224,6 +224,7 @@ + + + ++ + + + 2010000 +-- +2.15.1 + diff --git a/SOURCES/libvirt-qemu_domain-use-correct-default-USB-controller-on-ppc64.patch b/SOURCES/libvirt-qemu_domain-use-correct-default-USB-controller-on-ppc64.patch deleted file mode 100644 index 578cd7b..0000000 --- a/SOURCES/libvirt-qemu_domain-use-correct-default-USB-controller-on-ppc64.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 48c13aa1bbd505a96af170d9efe0e0540efd5b59 Mon Sep 17 00:00:00 2001 -Message-Id: <48c13aa1bbd505a96af170d9efe0e0540efd5b59@dist-git> -From: Pavel Hrdina -Date: Thu, 20 Apr 2017 09:16:21 +0200 -Subject: [PATCH] qemu_domain: use correct default USB controller on ppc64 - -The history of USB controller for ppc64 guest is complex and goes -back to libvirt 1.3.1 where the fun started. - -Prior Libvirt 1.3.1 if no model for USB controller was specified -we've simply passed "-usb" on QEMU command line. - -Since Libvirt 1.3.1 there is a patch (8156493d8db) that fixes this -issue by using "-device pci-ohci,..." but it breaks migration with -older Libvirts which was agreed that's acceptable. However this -patch didn't reflect this change in the domain XML and the model -was still missing. - -Since Libvirt 2.2.0 there is a patch (f55eaccb0c5) that fixes the -issue with not setting the USB model into domain XML which we need -to know about to not break the migration and since the default -model was *pci-ohci* it was used as default in this patch as well. - -This patch tries to take all the previous changes into account and -also change the default for newly defined domains that don't specify -any model for USB controller. - -The VIR_DOMAIN_DEF_PARSE_ABI_UPDATE is set only if new domain is -defined or new device is added into a domain which means that in -all other cases we will use the old *pci-ohci* model instead of the -better and not broken *nec-usb-xhci* model. - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373184 - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 90acbc76ece8b94cfd5e5d2ebb675f7692ce7afd) -Signed-off-by: Pavel Hrdina ---- - src/qemu/qemu_domain.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 3150e8760..c43ff3d63 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -3110,7 +3110,8 @@ qemuDomainShmemDefPostParse(virDomainShmemDefPtr shm) - static int - qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - const virDomainDef *def, -- virQEMUCapsPtr qemuCaps) -+ virQEMUCapsPtr qemuCaps, -+ unsigned int parseFlags) - { - switch ((virDomainControllerType)cont->type) { - case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: -@@ -3138,9 +3139,16 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, - * address is found */ - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE; - } else if (ARCH_IS_PPC64(def->os.arch)) { -- /* Default USB controller for ppc64 is pci-ohci */ -- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) -+ /* To not break migration we need to set default USB controller -+ * for ppc64 to pci-ohci if we cannot change ABI of the VM. -+ * The nec-usb-xhci controller is used as default only for -+ * newly defined domains or devices. */ -+ if ((parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) && -+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI)) { -+ cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI; -+ } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) { - cont->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; -+ } - } else { - /* Default USB controller for anything else is piix3-uhci */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) -@@ -3339,7 +3347,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, - - if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER && - qemuDomainControllerDefPostParse(dev->data.controller, def, -- qemuCaps) < 0) -+ qemuCaps, parseFlags) < 0) - goto cleanup; - - if (dev->type == VIR_DOMAIN_DEVICE_SHMEM && --- -2.12.2 - diff --git a/SOURCES/libvirt-qemuxml2argvtest-add-virtio-options-test-case.patch b/SOURCES/libvirt-qemuxml2argvtest-add-virtio-options-test-case.patch deleted file mode 100644 index 70cd767..0000000 --- a/SOURCES/libvirt-qemuxml2argvtest-add-virtio-options-test-case.patch +++ /dev/null @@ -1,96 +0,0 @@ -From ea26b477bbb8d6f93af2b12840ac6ff0b0deca17 Mon Sep 17 00:00:00 2001 -Message-Id: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:49:08 +0200 -Subject: [PATCH] qemuxml2argvtest: add virtio-options test case -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a test case to demonstrate the addition of new command line options - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit 56a28fbb57daa96fc7fe8f0516c8ee937ec3b39b) -Signed-off-by: Ján Tomko - -Conflicts: - Downstream still normalizes machine names. -Signed-off-by: Jiri Denemark ---- - .../qemuxml2argv-virtio-options.args | 41 ++++++++++++++++++++++ - tests/qemuxml2argvtest.c | 9 +++++ - 2 files changed, 50 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -new file mode 100644 -index 0000000000..f9f3c2cbad ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.args -@@ -0,0 +1,41 @@ -+LC_ALL=C \ -+PATH=/bin \ -+HOME=/home/test \ -+USER=test \ -+LOGNAME=test \ -+QEMU_AUDIO_DRV=none \ -+/usr/bin/qemu-system-x86_64 \ -+-name QEMUGuest1 \ -+-S \ -+-M pc-0.11 \ -+-m 214 \ -+-smp 1,sockets=1,cores=1,threads=1 \ -+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -+-nographic \ -+-nodefaults \ -+-monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \ -+-no-acpi \ -+-boot c \ -+-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x8 \ -+-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x9 \ -+-usb \ -+-drive file=/var/lib/libvirt/images/img1,format=raw,if=none,\ -+id=drive-virtio-disk0 \ -+-device virtio-blk-pci,bus=pci.0,addr=0xa,drive=drive-virtio-disk0,\ -+id=virtio-disk0 \ -+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \ -+-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.0,addr=0x3 \ -+-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\ -+path=/export/fs2 \ -+-device virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,bus=pci.0,addr=0x4 \ -+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6 \ -+-net user,vlan=0,name=hostnet0 \ -+-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe \ -+-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10 \ -+-device virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11 \ -+-device virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,\ -+addr=0x12 \ -+-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \ -+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc \ -+-object rng-random,id=objrng0,filename=/dev/random \ -+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.0,addr=0xd -diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c -index bff32200d7..c186780ef1 100644 ---- a/tests/qemuxml2argvtest.c -+++ b/tests/qemuxml2argvtest.c -@@ -2550,6 +2550,15 @@ mymain(void) - QEMU_CAPS_DEVICE_INTEL_IOMMU); - - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); -+ DO_TEST("virtio-options", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_VIRTIO_KEYBOARD, -+ QEMU_CAPS_VIRTIO_MOUSE, QEMU_CAPS_VIRTIO_TABLET, -+ QEMU_CAPS_VIRTIO_INPUT_HOST, -+ QEMU_CAPS_FSDEV, QEMU_CAPS_FSDEV_WRITEOUT, -+ QEMU_CAPS_DEVICE_VIRTIO_GPU, -+ QEMU_CAPS_VIRTIO_GPU_VIRGL, -+ QEMU_CAPS_DEVICE_VIRTIO_RNG, -+ QEMU_CAPS_OBJECT_RNG_RANDOM, -+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY); - - DO_TEST("fd-memory-numa-topology", QEMU_CAPS_MEM_PATH, QEMU_CAPS_OBJECT_MEMORY_FILE, - QEMU_CAPS_KVM); --- -2.13.1 - diff --git a/SOURCES/libvirt-qemuxml2xmltest-add-virtio-options-test.patch b/SOURCES/libvirt-qemuxml2xmltest-add-virtio-options-test.patch deleted file mode 100644 index 7da9710..0000000 --- a/SOURCES/libvirt-qemuxml2xmltest-add-virtio-options-test.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 5c213cb256cbe66c368c2978b2ff41ab45dd0e44 Mon Sep 17 00:00:00 2001 -Message-Id: <5c213cb256cbe66c368c2978b2ff41ab45dd0e44@dist-git> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Fri, 9 Jun 2017 12:48:58 +0200 -Subject: [PATCH] qemuxml2xmltest: add virtio-options test -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add a test case with all the virtio devices we know to demonstrate -the addition of new options. - -https://bugzilla.redhat.com/show_bug.cgi?id=1283251 - -Reviewed-by: Pavel Hrdina -(cherry picked from commit 15911ab8201f46b99352eea818c798828b6e4ff1) -Signed-off-by: Ján Tomko -Signed-off-by: Jiri Denemark ---- - .../qemuxml2argv-virtio-options.xml | 81 ++++++++++++++++++++++ - .../qemuxml2xmlout-virtio-options.xml | 1 + - tests/qemuxml2xmltest.c | 1 + - 3 files changed, 83 insertions(+) - create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml - create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-options.xml - -diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -new file mode 100644 -index 0000000000..c88cf649b1 ---- /dev/null -+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml -@@ -0,0 +1,81 @@ -+ -+ QEMUGuest1 -+ c7a5fdbd-edaf-9455-926a-d65c16db1809 -+ 219136 -+ 219136 -+ 1 -+ -+ hvm -+ -+ -+ -+ destroy -+ restart -+ destroy -+ -+ /usr/bin/qemu-system-x86_64 -+ -+ -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+ -+
      -+ -+ -+ -+ -+ -+
      -+ -+ -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+
      -+ -+ -+ -+
      -+ -+ -+ -+