[libvirt] [PATCH] qemu: Refresh capabilities when creating resctrl allocation
by Martin Kletzander
Since one of the things in capabilities (info from resctrl updated with data
about caches) can be change on the system by remounting the /sys/fs/resctrl with
different options, the capabilities need to be refreshed. There is a better fix
in the works, but it's going to be way bigger than this (hence the XXX note
there), so for the time being let's workaround this. And in order not to slow
down the domain starting, only get the capabilities if there are any cachetunes.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1540780
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_process.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index bcd4ac8ad699..6cdb9ebc7fce 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2514,9 +2514,15 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver,
{
int ret = -1;
size_t i = 0;
- virCapsPtr caps = virQEMUDriverGetCapabilities(driver, false);
+ virCapsPtr caps = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
+ if (!vm->def->ncachetunes)
+ return 0;
+
+ /* Force capability refresh since resctrl info can change
+ * XXX: move cache info into virresctrl so caps are not needed */
+ caps = virQEMUDriverGetCapabilities(driver, true);
if (!caps)
return -1;
--
2.16.1
6 years, 10 months
[libvirt] [PATCH 0/3] Misc util/ fixes plus tests
by Martin Kletzander
Yay!!! \o/ Patches!
Martin Kletzander (3):
util: Fix possible leak in virResctrlAllocMasksAssign
util: Clear unused part of the map in virBitmapShrink
tests: Add test for properly removing cachetune entries
src/util/virbitmap.c | 13 +++++++++
src/util/virresctrl.c | 4 +--
.../genericxml2xmlindata/cachetune-extra-tunes.xml | 33 ++++++++++++++++++++++
.../cachetune-extra-tunes.xml | 30 ++++++++++++++++++++
tests/genericxml2xmltest.c | 1 +
tests/virbitmaptest.c | 5 ++++
6 files changed, 84 insertions(+), 2 deletions(-)
create mode 100644 tests/genericxml2xmlindata/cachetune-extra-tunes.xml
create mode 100644 tests/genericxml2xmloutdata/cachetune-extra-tunes.xml
--
2.16.1
6 years, 10 months
[libvirt] [PATCH v2 00/15] Misc build refactoring / isolation work
by Daniel P. Berrangé
This was triggered by the recent Fedora change to add '-z defs' to RPM
builds by default which breaks libvirt. Various make rule changes can
fix much of the problem, but it also requires source refactoring to get
rid of places where virt drivers directly call into the storage/network
drivers. Co-incidentally this work will also be useful in allowing us to
separate out drivers to distinct daemons.
In v2:
- Fixed header file name comment
- Resolve conflicts
- Fix unit tests
- Fix bisectable build by moving libvirt_lxc build patch earlier
- Update syntax check header include rule
Daniel P. Berrangé (15):
storage: extract storage file backend from main storage driver backend
storage: move storage file backend framework into util directory
rpc: don't link in second copy of RPC code to libvirtd & lockd plugin
build: link libvirt_lxc against libvirt.so
conf: introduce callback registration for domain net device allocation
conf: expand network device callbacks to cover bandwidth updates
qemu: replace networkGetNetworkAddress with public API calls
conf: expand network device callbacks to cover resolving NIC type
network: remove conditional declarations
conf: move virStorageTranslateDiskSourcePool into domain conf
storage: export virStoragePoolLookupByTargetPath as a public API
build: explicitly link all modules with libvirt.so
build: provide a AM_FLAGS_MOD for loadable modules
build: passing the "-z defs" linker flag to prevent undefined symbols
cfg: forbid includes of headers in network and storage drivers again
cfg.mk | 2 +-
configure.ac | 1 +
daemon/Makefile.am | 3 +-
include/libvirt/libvirt-storage.h | 2 +
m4/virt-linker-no-undefined.m4 | 32 ++
po/POTFILES.in | 2 +-
src/Makefile.am | 142 ++++----
src/bhyve/bhyve_command.c | 7 +-
src/conf/domain_conf.c | 355 +++++++++++++++++++
src/conf/domain_conf.h | 71 ++++
src/driver-storage.h | 5 +
src/libvirt-storage.c | 40 +++
src/libvirt_private.syms | 29 ++
src/libvirt_public.syms | 6 +
src/libvirt_remote.syms | 11 +-
src/libxl/libxl_domain.c | 5 +-
src/libxl/libxl_driver.c | 7 +-
src/lxc/lxc_driver.c | 5 +-
src/lxc/lxc_process.c | 7 +-
src/network/bridge_driver.c | 144 ++------
src/network/bridge_driver.h | 72 ----
src/qemu/qemu_alias.c | 3 +-
src/qemu/qemu_command.c | 1 -
src/qemu/qemu_domain.c | 3 -
src/qemu/qemu_domain_address.c | 3 +-
src/qemu/qemu_driver.c | 15 +-
src/qemu/qemu_hotplug.c | 18 +-
src/qemu/qemu_migration.c | 3 +-
src/qemu/qemu_process.c | 115 +++++-
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 17 +-
src/remote_protocol-structs | 7 +
src/security/virt-aa-helper.c | 2 -
src/storage/storage_backend.c | 66 ----
src/storage/storage_backend.h | 75 ----
src/storage/storage_backend_fs.c | 8 +-
src/storage/storage_backend_gluster.c | 4 +-
src/storage/storage_driver.c | 256 +-------------
src/storage/storage_driver.h | 3 -
src/storage/storage_source.c | 645 ----------------------------------
src/storage/storage_source.h | 59 ----
src/util/virstoragefile.c | 609 +++++++++++++++++++++++++++++++-
src/util/virstoragefile.h | 32 ++
src/util/virstoragefilebackend.c | 108 ++++++
src/util/virstoragefilebackend.h | 104 ++++++
src/vz/vz_sdk.c | 1 -
tests/Makefile.am | 4 +-
tests/qemuxml2argvtest.c | 4 +
tests/virstoragetest.c | 1 -
tools/Makefile.am | 1 +
50 files changed, 1675 insertions(+), 1441 deletions(-)
create mode 100644 m4/virt-linker-no-undefined.m4
delete mode 100644 src/storage/storage_source.c
delete mode 100644 src/storage/storage_source.h
create mode 100644 src/util/virstoragefilebackend.c
create mode 100644 src/util/virstoragefilebackend.h
--
2.14.3
6 years, 10 months
[libvirt] [PATCH] qemuDomainRemoveMemoryDevice: unlink() memory backing file
by Michal Privoznik
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 <mprivozn(a)redhat.com>
---
Zack, can you please check if this patch is suitable for your use cases?
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 6dc16a105..f26e2ca60 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3894,6 +3894,9 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
if (qemuDomainNamespaceTeardownMemory(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 1a0923af3..73624eefe 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3467,6 +3467,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 cd9a72031..3fc7d6c85 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.13.6
6 years, 10 months
[libvirt] [PATCH] qemu: migration: Refresh device information after transferring state
by Peter Krempa
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.
---
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 1854900c9a..ea8b275601 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5373,6 +5373,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 bcd4ac8ad6..fe12d94d37 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6084,7 +6084,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)
@@ -6125,9 +6125,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,
@@ -6231,11 +6228,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.15.0
6 years, 10 months
[libvirt] [PATCH v3 00/11] Implement query-dump command
by John Ferlan
v2: https://www.redhat.com/archives/libvir-list/2018-January/msg00636.html
Summary of changes since v2:
* Generate a dump stats extraction helper in order to share with the
DUMP_COMPLETED event and the query-dump command. Additionally add the
error string from Qemu to be processed later
* When processing DUMP_COMPLETED event implementation, use the returned
stats buffer and copy any error message for the waiting completion to
process properly.
NB: Was able to test this by altering the guest memory size larger
than the space to store the dump memory and got the following error:
error: operation failed: memory-only dump failed: dump: failed to save memory
* As suggested during review - alter the jobInfo @stats to be part of
a union. Took the liberty to rename the fields as well.
* The point raised in patch 5 regarding mirrorStats being collect for a
non-migration (e.g. save and dump) was handled by creating a new type
which will use the migStats only to collect data and avoid the mirrorStats.
When converting to a JobInfo, only the migStats will then be used.
* Patches 6 and 7 are new. One for the union and one to separate migrate
and save/dump style migration jobs.
* Former patch 6 (now 8) is altered to handle the union separation
* Former patch 8 (now 10) is altered mainly to handle the data in
buffers from the DUMP_COMPLETED event (either data or error).
NB: Comment from former patch 8:
"We should update job.completed at this point."
I believe that's handled because qemuDomainObjResetAsyncJob will
reset the dumpCompleted back to false. Unless there's a specific
reason to do it there...
NB: Formerly ACK'd patches 4 and 7 (now 9) did not change.
John Ferlan (11):
qemu: Add support for DUMP_COMPLETED event
qemu: Introduce qemuProcessHandleDumpCompleted
qemu: Introduce qemuMonitor[JSON]QueryDump
qemu: Add new parameter to qemuMonitorDumpToFd
qemu: Introduce qemuDomainGetJobInfoMigrationStats
qemu: Convert jobInfo stats into a union
qemu: Introduce QEMU_DOMAIN_JOB_STATS_TYPE_SAVEDUMP
qemu: Introduce qemuDomainGetJobInfoDumpStats
qemu: Add dump completed event to the capabilities
qemu: Allow showing the dump progress for memory only dump
docs: Add news article for query memory-only dump processing
percentage
docs/news.xml | 11 ++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 130 +++++++++++++--
src/qemu/qemu_domain.h | 18 +-
src/qemu/qemu_driver.c | 183 ++++++++++++++++++---
src/qemu/qemu_migration.c | 13 +-
src/qemu/qemu_migration_cookie.c | 4 +-
src/qemu/qemu_monitor.c | 45 ++++-
src/qemu/qemu_monitor.h | 36 +++-
src/qemu/qemu_monitor_json.c | 106 +++++++++++-
src/qemu/qemu_monitor_json.h | 6 +-
src/qemu/qemu_process.c | 34 +++-
.../caps_2.10.0-gicv2.aarch64.xml | 1 +
.../caps_2.10.0-gicv3.aarch64.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 +
.../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/qemumonitorjsontest.c | 3 +-
30 files changed, 553 insertions(+), 55 deletions(-)
--
2.13.6
6 years, 10 months
[libvirt] [PATCH v3 0/5] Introduce VIR_ERR_DEVICE_MISSING
by Chen Hanxiao
Use Introduce VIR_ERR_DEVICE_MISSING for hotplug and detach device
error message.
Chen Hanxiao (5):
qemu: Add some more details for hotplug errors when device not found
qemu: Introduce VIR_ERR_DEVICE_MISSING
qemu: Use VIR_ERR_DEVICE_MISSING for various hotplug messages
qemu: Use VIR_ERR_DEVICE_MISSING for various DetachDeviceConfig
messages
news: Add VIR_ERR_DEVICE_MISSING change as improvements
docs/news.xml | 5 +++++
include/libvirt/virterror.h | 1 +
src/conf/domain_conf.c | 8 ++++----
src/libvirt_private.syms | 2 ++
src/qemu/qemu_driver.c | 20 +++++++++----------
src/qemu/qemu_hotplug.c | 47 ++++++++++++++++++++++++++++-----------------
src/util/virerror.c | 6 ++++++
7 files changed, 57 insertions(+), 32 deletions(-)
--
2.14.3
6 years, 10 months
[libvirt] [PATCH 0/3] Misc RPC fixes
by Daniel P. Berrangé
Misc fixes pointed out by John after coverity had a fit :-)
Daniel P. Berrangé (3):
tests: validate private data / pre / post exec hooks for RPC APIs
rpc: assume private data callbacks are always non-NULL
rpc: fix non-NULL annotations when GNUTLS is disabled
src/rpc/virnetserverclient.c | 47 +++++++-------
src/rpc/virnetserverclient.h | 4 ++
.../virnetdaemondata/input-data-admin-nomdns.json | 12 ++--
.../input-data-admin-server-names.json | 12 ++--
.../virnetdaemondata/input-data-anon-clients.json | 6 +-
.../input-data-client-auth-pending-failure.json | 3 +-
.../input-data-client-auth-pending.json | 6 +-
tests/virnetdaemondata/input-data-client-ids.json | 6 +-
.../input-data-client-timestamp.json | 6 +-
.../input-data-initial-nomdns.json | 6 +-
tests/virnetdaemondata/input-data-initial.json | 6 +-
.../input-data-no-keepalive-required.json | 12 ++--
.../virnetdaemondata/output-data-admin-nomdns.json | 12 ++--
.../output-data-admin-server-names.json | 12 ++--
.../virnetdaemondata/output-data-anon-clients.json | 6 +-
.../output-data-client-auth-pending.json | 6 +-
tests/virnetdaemondata/output-data-client-ids.json | 6 +-
.../output-data-client-timestamp.json | 6 +-
.../output-data-initial-nomdns.json | 6 +-
tests/virnetdaemondata/output-data-initial.json | 6 +-
.../output-data-no-keepalive-required.json | 12 ++--
tests/virnetdaemontest.c | 71 +++++++++++++++++++---
tests/virnetserverclienttest.c | 22 ++++++-
23 files changed, 208 insertions(+), 83 deletions(-)
--
2.14.3
6 years, 10 months
[libvirt] [PATCH] qemu: Add USB and memory balloon by default for aarch64/virt guests
by Andrea Bolognani
Basically all existing guest types, regardless of the architectur,
get both a USB controller and a virtio memory balloon by default.
s390 guests are an exception, for the very good reason that they
don't support USB at all; the other exception is aarch64/virt
guests, but in the latter case isn't a compelling reason for them
to deviate from the widely adopted convention, especially since:
* x86/q35 guests, which aarch64/virt guests are for the most
part identical to, add these devices by default;
* it's trivial to opt out of both default devices by setting
model='none';
* higher level applications such as Nova expect at least the
USB controller to be present.
So add it by default for newly-defined guests. Existing guests
will, of course, be left unchanged.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1538637
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_domain.c | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6b4bd3cca..f1c3b3d1e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2630,7 +2630,8 @@ qemuDomainDefAddImplicitInputDevice(virDomainDef *def)
static int
qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
- virQEMUCapsPtr qemuCaps)
+ virQEMUCapsPtr qemuCaps,
+ unsigned int parseFlags)
{
bool addDefaultUSB = true;
int usbModel = -1; /* "default for machinetype" */
@@ -2680,10 +2681,33 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
case VIR_ARCH_ARMV7L:
case VIR_ARCH_AARCH64:
- addDefaultUSB = false;
- addDefaultMemballoon = false;
- if (qemuDomainIsVirt(def))
+ if (qemuDomainIsVirt(def)) {
+ /* All mach-virt guests get a PCIe Root, if supported by
+ * the QEMU binary */
addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
+ }
+
+ if (qemuDomainIsVirt(def) &&
+ parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) {
+ /* In addition to PCIe Root, newly-defined mach-virt guests
+ * also get a couple more devices so that they're more similar
+ * to guests on other architectures, notably x86/q35:
+ *
+ * 1) a USB3 controller, if supported by the QEMU binary;
+ * 2) a virtio memory balloon, as per the defaults defined
+ * above.
+ */
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
+ usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
+ else
+ addDefaultUSB = false;
+ } else {
+ /* Other ARM guests (and existing mach-virt guests, in order
+ * to preserve guest ABI compatibility) don't get a PCIe Root,
+ * a USB controller or a memory balloon */
+ addDefaultUSB = false;
+ addDefaultMemballoon = false;
+ }
break;
case VIR_ARCH_PPC64:
@@ -3187,7 +3211,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
goto cleanup;
}
- if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0)
+ if (qemuDomainDefAddDefaultDevices(def, qemuCaps, parseFlags) < 0)
goto cleanup;
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
--
2.14.3
6 years, 10 months
[libvirt] [PATCH v6 00/14] Move qemu command line controller checks to qemuDomainDeviceDefValidateController* checks
by John Ferlan
v5: https://www.redhat.com/archives/libvir-list/2018-January/msg00188.html
Although each was ACK'd in v5, that was before alter the post parse
callbacks to ensure SCSI controller model's were filled in.
I post again mainly because some things do change slightly and well
for sanity and being "correct".
Unless there's an objection, I'll push some time on Friday.
Andrea Bolognani (1):
qemu: Add missing checks for pcie-root-port options
John Ferlan (12):
qemu: Introduce qemuDomainDeviceDefValidateControllerAttributes
qemu: Move and rename qemuBuildCheckSCSIControllerModel
qemu: Adjust SCSI controller switch in qemuBuildControllerDevStr
qemu: Add check for iothread attribute in validate controller
qemu: Introduce qemuDomainDeviceDefValidateControllerSCSI
qemu: Introduce qemuDomainDeviceDefValidateControllerPCI
qemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr
qemu: Move PCI command modelName check to controller def validate
qemu: Move PCI command modelName TypeToString to controller def
validate
qemu: Move PCI more command checks to controller def validate
qemu: Complete PCI command checks to controller def validate
qemu: Introduce qemuDomainDeviceDefValidateControllerSATA
Marc Hartmayer (1):
qemu: Use switch statement for address types in
qemuBuildControllerDevStr
src/qemu/qemu_command.c | 505 +++++-------------------------------------------
src/qemu/qemu_domain.c | 478 ++++++++++++++++++++++++++++++++++++++++++++-
tests/qemumemlocktest.c | 14 ++
tests/qemuxml2xmltest.c | 5 +-
4 files changed, 545 insertions(+), 457 deletions(-)
--
2.13.6
6 years, 10 months