[PATCH v2 00/11] Enabling logging for ch guests
by Praveen K Paladugu
LogContext management is now moved from Qemu driver to hypervisor. After
migrating Qemu to use domain_logcontext, I extended ch driver to use also use
domain_logcontext to capture early boot failures within domain specific log
files.
Changes in V2:
* refactored the patches to ensure all of them build.
* ch driver will use virtlogd to consolidate logs from hypervisor and its
domains.
Praveen K Paladugu (11):
hypervisor: copy qemu log context mgmt to hypervisor
hypervisor: rename reference to qemu in domain_logcontext
hypervisor: drop qemu specific args in domainLogContextNew
hypervisor: Build domain_logcontext
libvirt_private: export symbols from domain_logcontext
qemu: Modify qemu driver to use domainLogContext
qemu: delete qemu_logcontext files
ch: Enable logging for ch domains
ch: move curl_data and curl_callback definitions
ch: Enable logging curl responses from ch
ch: configure ch driver to use virlogd
po/POTFILES | 2 +-
src/ch/ch_conf.c | 1 +
src/ch/ch_conf.h | 2 +
src/ch/ch_monitor.c | 84 ++++++++++++-------
src/ch/ch_monitor.h | 6 +-
src/ch/ch_process.c | 36 ++++++--
.../domain_logcontext.c} | 78 +++++++++--------
src/hypervisor/domain_logcontext.h | 45 ++++++++++
src/hypervisor/meson.build | 1 +
src/libvirt_private.syms | 6 ++
src/qemu/meson.build | 1 -
src/qemu/qemu_domain.c | 28 +++----
src/qemu/qemu_domain.h | 12 +--
src/qemu/qemu_logcontext.h | 41 ---------
src/qemu/qemu_nbdkit.c | 12 ++-
src/qemu/qemu_process.c | 45 +++++-----
16 files changed, 236 insertions(+), 164 deletions(-)
rename src/{qemu/qemu_logcontext.c => hypervisor/domain_logcontext.c} (79%)
create mode 100644 src/hypervisor/domain_logcontext.h
delete mode 100644 src/qemu/qemu_logcontext.h
--
2.47.0
1 month, 2 weeks
[PATCH] qemu_capabilities: Avoid memleak in virQEMUCapsProbeFullDeprecatedProperties()
by Michal Privoznik
As one of its arguments, the
virQEMUCapsProbeFullDeprecatedProperties() gets a pointer to
GStrv (a string list), which it may eventually replace. It's
single caller (virQEMUCapsProbeQMPHostCPU()) passes a string list
indeed. Now, when replacing one string list with another plain
g_free() is not enough as we need to free individual strings too.
==13573== 34 bytes in 8 blocks are definitely lost in loss record 271 of 576
==13573== at 0x4844878: malloc (vg_replace_malloc.c:446)
==13573== by 0x51789D1: g_malloc (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573== by 0x5193E82: g_strdup (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573== by 0x4997F73: g_strdup_inline (gstrfuncs.h:321)
==13573== by 0x4997F73: virJSONValueArrayToStringList (virjson.c:1296)
==13573== by 0x5027CF7: qemuMonitorJSONParseCPUModelExpansion (qemu_monitor_json.c:5139)
==13573== by 0x50281C9: qemuMonitorJSONGetCPUModelExpansion (qemu_monitor_json.c:5245)
==13573== by 0x501044F: qemuMonitorGetCPUModelExpansion (qemu_monitor.c:3261)
==13573== by 0x4F190D0: virQEMUCapsProbeQMPHostCPU (qemu_capabilities.c:3227)
==13573== by 0x4F2145E: virQEMUCapsInitQMPMonitor (qemu_capabilities.c:5758)
==13573== by 0x10FFF8: testQemuCaps (qemucapabilitiestest.c:111)
==13573== by 0x110B53: virTestRun (testutils.c:143)
==13573== by 0x11063E: doCapsTest (qemucapabilitiestest.c:200)
Fixes: 51c098347d7f2af9b4386ac0adc4431997d06f3d
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
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 eda3e6a4df..27a283cff6 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3176,7 +3176,7 @@ virQEMUCapsProbeFullDeprecatedProperties(qemuMonitor *mon,
return -1;
if (propsInfo && propsInfo->deprecated_props) {
- g_free(*props);
+ g_strfreev(*props);
*props = g_steal_pointer(&propsInfo->deprecated_props);
}
--
2.45.2
1 month, 2 weeks
[PATCH 0/3] src: fix virtnetworkd blocking (delaying) system shutdown
by Daniel P. Berrangé
We recently wired up inhibitors in the network driver to prevent
auto-shutdown of libvirtd/virtnetworkd when virtual networks are
active. This is to prevent the repeated re-creation of firewall
rules which happens on daemon startup.
Unfortunately we forgot that an inhibition on libvirt daemon
shutdown *also* gets unconditionally turned into an inhibition
on OS shutdown :-(
In fixing this I realized this is actually the second such
mistakes, because a few years ago we made the virtsecretd daemon
inhibit when ephemeral secrets are present, and that really has
no justification for blocking system shutdown either.
Daniel P. Berrangé (3):
util: introduce object for holding a system inhibitor lock
src: convert drivers over to new virInhibitor APIs
rpc: remove logind support for virNetDaemon
po/POTFILES | 1 +
src/libvirt_private.syms | 7 +
src/libxl/libxl_conf.h | 9 +-
src/libxl/libxl_domain.c | 6 +-
src/libxl/libxl_driver.c | 15 ++-
src/lxc/lxc_conf.h | 9 +-
src/lxc/lxc_driver.c | 13 +-
src/lxc/lxc_process.c | 9 +-
src/network/bridge_driver.c | 20 +--
src/network/bridge_driver_conf.h | 9 +-
src/qemu/qemu_conf.h | 9 +-
src/qemu/qemu_driver.c | 12 +-
src/qemu/qemu_process.c | 9 +-
src/rpc/virnetdaemon.c | 78 -----------
src/secret/secret_driver.c | 46 +++----
src/util/meson.build | 1 +
src/util/virinhibitor.c | 214 +++++++++++++++++++++++++++++++
src/util/virinhibitor.h | 58 +++++++++
18 files changed, 361 insertions(+), 164 deletions(-)
create mode 100644 src/util/virinhibitor.c
create mode 100644 src/util/virinhibitor.h
--
2.46.0
1 month, 2 weeks
[PATCH] qemu: Enable I/O APIC even more frequently
by Michal Privoznik
In my previous commit v10.10.0-48-g2d222ecf6e I've made us enable
I/O APIC when there is an IOMMU with EIM. This works well. What
does not work is case when there's just an IOMMU without EIM but
with 256+ vCPUS. Problem is that post parsing happens in two
stages: general domain post parse (where
qemuDomainDefEnableDefaultFeatures() is called) and then per
device post parse (where qemuDomainIOMMUDefPostParse() is
called). Now, in aforementioned case it is the device post parse
phase where EIM is enabled but the code that would enable
VIR_DOMAIN_FEATURE_IOAPIC has already run.
To resolve this, make the domain post parse callback "foresee"
the future enabling of EIM so that it can turn on I/O APIC
beforehand.
Resolves: https://issues.redhat.com/browse/RHEL-65844
Fixes: 2d222ecf6e73614a400b830ac56e9aaa1bc55ecc
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_postparse.c | 21 +++++++++---
...m-autoadd-v2.x86_64-latest.abi-update.args | 1 +
...im-autoadd-v2.x86_64-latest.abi-update.xml | 1 +
.../intel-iommu-eim-autoadd-v2.xml | 32 +++++++++++++++++++
tests/qemuxmlconftest.c | 1 +
5 files changed, 51 insertions(+), 5 deletions(-)
create mode 120000 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args
create mode 120000 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml
create mode 100644 tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml
diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c
index 4fbd849ebf..34b95ece1b 100644
--- a/src/qemu/qemu_postparse.c
+++ b/src/qemu/qemu_postparse.c
@@ -783,6 +783,15 @@ qemuDomainPstoreDefPostParse(virDomainPstoreDef *pstore,
}
+static bool
+qemuDomainNeedsIOMMUWithEIM(const virDomainDef *def)
+{
+ return ARCH_IS_X86(def->os.arch) &&
+ virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM &&
+ qemuDomainIsQ35(def);
+}
+
+
static int
qemuDomainIOMMUDefPostParse(virDomainIOMMUDef *iommu,
const virDomainDef *def,
@@ -793,9 +802,7 @@ qemuDomainIOMMUDefPostParse(virDomainIOMMUDef *iommu,
* (EIM) is not explicitly turned off, let's enable it. If we didn't then
* guest will have troubles with interrupts. */
if (parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE &&
- ARCH_IS_X86(def->os.arch) &&
- virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM &&
- qemuDomainIsQ35(def) &&
+ qemuDomainNeedsIOMMUWithEIM(def) &&
iommu && iommu->model == VIR_DOMAIN_IOMMU_MODEL_INTEL) {
/* eim requires intremap. */
@@ -1548,9 +1555,13 @@ qemuDomainDefEnableDefaultFeatures(virDomainDef *def,
def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON;
}
- /* IOMMU with intremap requires split I/O APIC */
+ /* IOMMU with intremap requires split I/O APIC. But it may happen that
+ * domain already has IOMMU without inremap. This will be fixed in
+ * qemuDomainIOMMUDefPostParse() but there domain definition can't be
+ * modified so change it now. */
if (def->iommu &&
- def->iommu->intremap == VIR_TRISTATE_SWITCH_ON &&
+ (def->iommu->intremap == VIR_TRISTATE_SWITCH_ON ||
+ qemuDomainNeedsIOMMUWithEIM(def)) &&
def->features[VIR_DOMAIN_FEATURE_IOAPIC] == VIR_DOMAIN_IOAPIC_NONE) {
def->features[VIR_DOMAIN_FEATURE_IOAPIC] = VIR_DOMAIN_IOAPIC_QEMU;
}
diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args
new file mode 120000
index 0000000000..a7fdee3d71
--- /dev/null
+++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.args
@@ -0,0 +1 @@
+intel-iommu-eim-autoadd.x86_64-latest.abi-update.args
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml
new file mode 120000
index 0000000000..928ea1b4c8
--- /dev/null
+++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.x86_64-latest.abi-update.xml
@@ -0,0 +1 @@
+intel-iommu-eim-autoadd.x86_64-latest.abi-update.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml
new file mode 100644
index 0000000000..b39ee55786
--- /dev/null
+++ b/tests/qemuxmlconfdata/intel-iommu-eim-autoadd-v2.xml
@@ -0,0 +1,32 @@
+<domain type='kvm'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>288</vcpu>
+ <os>
+ <type arch='x86_64' machine='q35'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <iommu model="intel"/>
+ <audio id='1' type='none'/>
+ <watchdog model='itco' action='reset'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 23f1d9eab7..21b56dc94e 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2774,6 +2774,7 @@ mymain(void)
DO_TEST_CAPS_LATEST("intel-iommu-dma-translation");
DO_TEST_CAPS_LATEST_PARSE_ERROR("intel-iommu-wrong-machine");
DO_TEST_CAPS_LATEST_ABI_UPDATE("intel-iommu-eim-autoadd");
+ DO_TEST_CAPS_LATEST_ABI_UPDATE("intel-iommu-eim-autoadd-v2");
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64");
DO_TEST_CAPS_LATEST("virtio-iommu-x86_64");
DO_TEST_CAPS_VER_PARSE_ERROR("virtio-iommu-x86_64", "6.1.0");
--
2.45.2
1 month, 2 weeks
[PATCH 0/7] Add missing CPU features and GraniteRapids-v2 model supported by QEMU 9.2.0
by Jiri Denemark
Jiri Denemark (7):
cpu_map: Add avx10* CPU features
cpu_map: Add GraniteRapids-v2 CPU model
cpu_map: Add sha512, sm3, and sm4 CPU features
cpu_map: Add fdp-excptn-only CPU feature
cpu_map: Add zero-fcs-fds CPU feature
cpu_map: Add ibpb-brtype CPU feature
cpu_map: Add missing CPU features
src/cpu_map/index.xml | 1 +
src/cpu_map/meson.build | 1 +
src/cpu_map/x86_GraniteRapids-v2.xml | 206 ++++++++++++++++++
src/cpu_map/x86_features.xml | 70 ++++++
.../x86_64-cpuid-Atom-P5362-disabled.xml | 2 +-
.../x86_64-cpuid-Atom-P5362-guest.xml | 2 +
.../x86_64-cpuid-Atom-P5362-host.xml | 2 +
.../x86_64-cpuid-Cooperlake-disabled.xml | 2 +-
.../x86_64-cpuid-Cooperlake-guest.xml | 2 +
.../x86_64-cpuid-Cooperlake-host.xml | 2 +
.../x86_64-cpuid-Core-i5-4670T-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i5-4670T-guest.xml | 1 +
.../x86_64-cpuid-Core-i5-4670T-host.xml | 1 +
.../x86_64-cpuid-Core-i5-6600-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i5-6600-guest.xml | 1 +
.../x86_64-cpuid-Core-i5-6600-host.xml | 1 +
.../x86_64-cpuid-Core-i7-4510U-disabled.xml | 1 +
.../x86_64-cpuid-Core-i7-4510U-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-4510U-host.xml | 1 +
.../x86_64-cpuid-Core-i7-4600U-disabled.xml | 1 +
.../x86_64-cpuid-Core-i7-4600U-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-4600U-host.xml | 1 +
...6_64-cpuid-Core-i7-5600U-arat-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-5600U-arat-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-5600U-arat-host.xml | 1 +
.../x86_64-cpuid-Core-i7-5600U-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-5600U-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-5600U-host.xml | 1 +
...6_64-cpuid-Core-i7-5600U-ibrs-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-5600U-ibrs-host.xml | 1 +
.../x86_64-cpuid-Core-i7-7600U-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-7600U-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-7600U-host.xml | 1 +
.../x86_64-cpuid-Core-i7-7700-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-7700-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-7700-host.xml | 1 +
.../x86_64-cpuid-Core-i7-8550U-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-8550U-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-8550U-host.xml | 1 +
.../x86_64-cpuid-Core-i7-8700-disabled.xml | 2 +-
.../x86_64-cpuid-Core-i7-8700-guest.xml | 1 +
.../x86_64-cpuid-Core-i7-8700-host.xml | 1 +
.../x86_64-cpuid-Ice-Lake-Server-disabled.xml | 2 +-
.../x86_64-cpuid-Ice-Lake-Server-guest.xml | 2 +
.../x86_64-cpuid-Ice-Lake-Server-host.xml | 2 +
.../x86_64-cpuid-Xeon-E3-1225-v5-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E3-1225-v5-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E3-1225-v5-host.xml | 1 +
.../x86_64-cpuid-Xeon-E3-1245-v5-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E3-1245-v5-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E3-1245-v5-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2609-v3-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2609-v3-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2623-v4-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2623-v4-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2630-v3-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2630-v3-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2630-v3-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2630-v4-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2630-v4-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2630-v4-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2650-v3-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2650-v3-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2650-v3-host.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2650-v4-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E5-2650-v4-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E5-2650-v4-host.xml | 1 +
.../x86_64-cpuid-Xeon-E7-8890-v3-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-E7-8890-v3-guest.xml | 1 +
.../x86_64-cpuid-Xeon-E7-8890-v3-host.xml | 1 +
.../x86_64-cpuid-Xeon-Gold-5115-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-Gold-5115-guest.xml | 2 +
.../x86_64-cpuid-Xeon-Gold-5115-host.xml | 2 +
.../x86_64-cpuid-Xeon-Gold-6130-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-Gold-6130-guest.xml | 2 +
.../x86_64-cpuid-Xeon-Gold-6130-host.xml | 2 +
.../x86_64-cpuid-Xeon-Gold-6148-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-Gold-6148-guest.xml | 2 +
.../x86_64-cpuid-Xeon-Gold-6148-host.xml | 2 +
...6_64-cpuid-Xeon-Platinum-8268-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-Platinum-8268-guest.xml | 2 +
.../x86_64-cpuid-Xeon-Platinum-8268-host.xml | 2 +
...6_64-cpuid-Xeon-Platinum-9242-disabled.xml | 2 +-
.../x86_64-cpuid-Xeon-Platinum-9242-guest.xml | 2 +
.../x86_64-cpuid-Xeon-Platinum-9242-host.xml | 2 +
.../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 58 +++++
.../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 47 ++++
tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 58 +++++
...host-model-fallback-kvm.x86_64-latest.args | 2 +-
...cpu-host-model-features.x86_64-latest.args | 2 +-
.../cpu-host-model-kvm.x86_64-latest.args | 2 +-
...st-model-nofallback-kvm.x86_64-latest.args | 2 +-
95 files changed, 545 insertions(+), 30 deletions(-)
create mode 100644 src/cpu_map/x86_GraniteRapids-v2.xml
--
2.47.1
1 month, 2 weeks
[PATCH 0/3] qemu: Call migrate-incoming with exit-on-error=false
by Jiri Denemark
See 3/3 for details.
Jiri Denemark (3):
qemu: Detect exit-on-error argument of migrate-incoming
qemu: Replace qemuDomainCheckMonitor with qemuMigrationJobCheckStatus
qemu: Call migrate-incoming with exit-on-error=false
src/qemu/qemu_capabilities.c | 4 ++++
src/qemu/qemu_capabilities.h | 3 +++
src/qemu/qemu_domain.c | 18 ------------------
src/qemu/qemu_domain.h | 3 ---
src/qemu/qemu_migration.c | 16 ++++++++++++----
src/qemu/qemu_monitor.c | 16 +++++-----------
src/qemu/qemu_monitor.h | 4 ++--
src/qemu/qemu_monitor_json.c | 4 +++-
src/qemu/qemu_monitor_json.h | 3 ++-
.../caps_9.1.0_riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_9.1.0_s390x.xml | 1 +
.../qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 1 +
.../qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 +
14 files changed, 36 insertions(+), 40 deletions(-)
--
2.47.1
1 month, 2 weeks
[PATCH] src: drop obsolete checks for virDomainConfigFile failure
by Daniel P. Berrangé
This cannot ever return NULL
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/bhyve/bhyve_driver.c | 6 ++----
src/conf/domain_conf.c | 7 ++-----
src/conf/virdomainobjlist.c | 9 +++------
src/libxl/libxl_driver.c | 6 ++----
src/lxc/lxc_controller.c | 4 +---
src/lxc/lxc_driver.c | 10 ++--------
src/qemu/qemu_driver.c | 22 ++++++----------------
7 files changed, 18 insertions(+), 46 deletions(-)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 2bd1e4c387..8f97ac032c 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -364,10 +364,8 @@ bhyveDomainSetAutostart(virDomainPtr domain, int autostart)
autostart = (autostart != 0);
if (vm->autostart != autostart) {
- if ((configFile = virDomainConfigFile(BHYVE_CONFIG_DIR, vm->def->name)) == NULL)
- goto cleanup;
- if ((autostartLink = virDomainConfigFile(BHYVE_AUTOSTART_DIR, vm->def->name)) == NULL)
- goto cleanup;
+ configFile = virDomainConfigFile(BHYVE_CONFIG_DIR, vm->def->name);
+ autostartLink = virDomainConfigFile(BHYVE_AUTOSTART_DIR, vm->def->name);
if (autostart) {
if (g_mkdir_with_parents(BHYVE_AUTOSTART_DIR, 0777) < 0) {
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4ad8289b89..cae5ba9df1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29060,11 +29060,8 @@ virDomainDeleteConfig(const char *configDir,
g_autofree char *configFile = NULL;
g_autofree char *autostartLink = NULL;
- if ((configFile = virDomainConfigFile(configDir, dom->def->name)) == NULL)
- return -1;
- if ((autostartLink = virDomainConfigFile(autostartDir,
- dom->def->name)) == NULL)
- return -1;
+ configFile = virDomainConfigFile(configDir, dom->def->name);
+ autostartLink = virDomainConfigFile(autostartDir, dom->def->name);
/* Not fatal if this doesn't work */
unlink(autostartLink);
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index 166bbc5cfd..72207450c5 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -492,16 +492,14 @@ virDomainObjListLoadConfig(virDomainObjList *doms,
int autostart;
g_autoptr(virDomainDef) oldDef = NULL;
- if ((configFile = virDomainConfigFile(configDir, name)) == NULL)
- return NULL;
+ configFile = virDomainConfigFile(configDir, name);
if (!(def = virDomainDefParseFile(configFile, xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL)))
return NULL;
- if ((autostartLink = virDomainConfigFile(autostartDir, name)) == NULL)
- return NULL;
+ autostartLink = virDomainConfigFile(autostartDir, name);
autostart = virFileLinkPointsTo(autostartLink, configFile);
@@ -529,8 +527,7 @@ virDomainObjListLoadStatus(virDomainObjList *doms,
virDomainObj *obj = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- if ((statusFile = virDomainConfigFile(statusDir, name)) == NULL)
- goto error;
+ statusFile = virDomainConfigFile(statusDir, name);
if (!(obj = virDomainObjParseFile(statusFile, xmlopt,
VIR_DOMAIN_DEF_PARSE_STATUS |
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index e72553603d..b8f721351c 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4651,10 +4651,8 @@ libxlDomainSetAutostart(virDomainPtr dom, int autostart)
autostart = (autostart != 0);
if (vm->autostart != autostart) {
- if (!(configFile = virDomainConfigFile(cfg->configDir, vm->def->name)))
- goto endjob;
- if (!(autostartLink = virDomainConfigFile(cfg->autostartDir, vm->def->name)))
- goto endjob;
+ configFile = virDomainConfigFile(cfg->configDir, vm->def->name);
+ autostartLink = virDomainConfigFile(cfg->autostartDir, vm->def->name);
if (autostart) {
if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 7b432a1160..fb7f8e0bc2 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -196,9 +196,7 @@ static virLXCController *virLXCControllerNew(const char *name)
if (!(driver = virLXCControllerDriverNew()))
goto error;
- if ((configFile = virDomainConfigFile(LXC_STATE_DIR,
- ctrl->name)) == NULL)
- goto error;
+ configFile = virDomainConfigFile(LXC_STATE_DIR, ctrl->name);
if ((ctrl->vm = virDomainObjParseFile(configFile,
driver->xmlopt,
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 2488940feb..b1a355794c 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2430,14 +2430,8 @@ static int lxcDomainSetAutostart(virDomainPtr dom,
goto endjob;
}
- configFile = virDomainConfigFile(cfg->configDir,
- vm->def->name);
- if (configFile == NULL)
- goto endjob;
- autostartLink = virDomainConfigFile(cfg->autostartDir,
- vm->def->name);
- if (autostartLink == NULL)
- goto endjob;
+ configFile = virDomainConfigFile(cfg->configDir, vm->def->name);
+ autostartLink = virDomainConfigFile(cfg->autostartDir, vm->def->name);
if (autostart) {
if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 672b42b44e..72d6b627f9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7784,12 +7784,8 @@ static int qemuDomainSetAutostart(virDomainPtr dom,
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
goto cleanup;
- if (!(configFile = virDomainConfigFile(cfg->configDir, vm->def->name)))
- goto endjob;
-
- if (!(autostartLink = virDomainConfigFile(cfg->autostartDir,
- vm->def->name)))
- goto endjob;
+ configFile = virDomainConfigFile(cfg->configDir, vm->def->name);
+ autostartLink = virDomainConfigFile(cfg->autostartDir, vm->def->name);
if (autostart) {
if (g_mkdir_with_parents(cfg->autostartDir, 0777) < 0) {
@@ -18339,21 +18335,15 @@ qemuDomainRenameCallback(virDomainObj *vm,
new_dom_name = g_strdup(new_name);
- if (!(new_dom_cfg_file = virDomainConfigFile(cfg->configDir,
- new_dom_name)) ||
- !(old_dom_cfg_file = virDomainConfigFile(cfg->configDir,
- vm->def->name)))
- return -1;
+ new_dom_cfg_file = virDomainConfigFile(cfg->configDir, new_dom_name);
+ old_dom_cfg_file = virDomainConfigFile(cfg->configDir, vm->def->name);
if (qemuDomainNamePathsCleanup(cfg, new_name, false) < 0)
goto cleanup;
if (vm->autostart) {
- if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
- new_dom_name)) ||
- !(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
- vm->def->name)))
- return -1;
+ new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir, new_dom_name);
+ old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir, vm->def->name);
if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) {
virReportSystemError(errno,
--
2.46.0
1 month, 2 weeks
[PATCH 0/3] Addng POWER11 cpu support
by Narayana Murty N
This patch series includes the changes needed to
support POWER11 cpu and POWER11 host on libvirt.
Patch also adds and updates the qemu caps with
the latest qemu for the caps tests to include POWER11.
Patch 0001: Add POWER11 cpu model support.
Patch 0002: Add POWER11 host model support.
Patch 0003: Add qemu and domain test capabilities test support.
The respective patches for linux kernel and qemu
already in upstream and links are provided below.
Linux kernel patches:
1. Linux P11 support: commit id c2ed087ed35c ("powerpc: Add Power11 architected and raw mode")
2. Linux P11 KVM support: commit id 96e266e3bcd6 ("KVM: PPC: Book3S HV: Add Power11 capability support for Nested PAPR guests")
Qemu patches:
3. Qemu P11 support: commit id 273db89bcaf4 ("ppc/pseries: Add Power11 cpu type)
4. Qemu P11 DD02.0 support: commit id c0d964076c3e (target/ppc: Add Power11 DD2.0 processor)
Signed-off-by: Narayana Murty N <nnmlinux(a)linux.vnet.ibm.com>
Narayana Murty N (3):
cpu_map: Add POWER11 cpu model support
cpu_ppc64: Add POWER11 host-model support
tests: Qemu and domain capabilities tests for Power11
src/cpu/cpu_ppc64.c | 8 +-
src/cpu_map/index.xml | 1 +
src/cpu_map/meson.build | 1 +
src/cpu_map/ppc64_POWER11.xml | 6 +
tests/domaincapsdata/qemu_9.2.0.ppc64.xml | 183 +
.../caps_9.2.0_ppc64.replies | 38704 ++++++++++++++++
.../qemucapabilitiesdata/caps_9.2.0_ppc64.xml | 1077 +
...eries-cpu-compat-power11.ppc64-latest.args | 31 +
...series-cpu-compat-power11.ppc64-latest.err | 1 +
...series-cpu-compat-power11.ppc64-latest.xml | 29 +
.../pseries-cpu-compat-power11.xml | 19 +
tests/qemuxmlconftest.c | 4 +
tests/testutilshostcpus.h | 11 +
tests/testutilsqemu.c | 4 +
tests/testutilsqemu.h | 1 +
15 files changed, 40076 insertions(+), 4 deletions(-)
create mode 100644 src/cpu_map/ppc64_POWER11.xml
create mode 100644 tests/domaincapsdata/qemu_9.2.0.ppc64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_ppc64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_ppc64.xml
create mode 100644 tests/qemuxmlconfdata/pseries-cpu-compat-power11.ppc64-latest.args
create mode 100644 tests/qemuxmlconfdata/pseries-cpu-compat-power11.ppc64-latest.err
create mode 100644 tests/qemuxmlconfdata/pseries-cpu-compat-power11.ppc64-latest.xml
create mode 100644 tests/qemuxmlconfdata/pseries-cpu-compat-power11.xml
--
2.47.1
1 month, 2 weeks
[PATCH v3 0/7] Allow Guest CPU Model with Deprecated Features Disabled
by Collin Walling
# Changelog
v3
- added reviewed-by's on appropriate patches
- split patch #4 into three:
- domain API (libvirt-domain: introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES)
- qemu (qemu_capabilities: filter deprecated features if requested)
- virsh (virsh: add --disable-deprecated-features flag to domcapabilities)
- Note: no functional change, patches were split based on changes to certain files
- @Jiri, let me know if this is what you had in mind, I found it difficult to find a good reference
- fixed deprecated_props array missing +1 in qemuJSONMonitor* functions
- condensed cputypes schema for deprecated_features
- added validation in qemu_process to check if QEMU cap is present
- added qemuxmlconf tests
- updated version tags to 11.0.0
v2
- rebased on latest master changes
# Description
Add support for libvirt to query and cache an array of deprecated CPU features
(aka CPU properties) for the host-model. This data is queried via a full
query-cpu-model-expansion and cached in the QEMU capabilities file. This
model expansion will depend on the availability of the "deprecated-props" field
resulting from a query-cpu-model-expansion command. Currently, only s390x
supports this field.
The purpose of these patches is to make it easy for users to create guests with
a CPU model that will be compatible & migratable with future hardware.
An updated host CPU model with deprecated features paired with the policy "disable"
may be visable via an update to the virsh domcapabilities command with the
--disable-deprecated-features flag. An example is shown below.
Note: other CPU model queries (e.g. baseline and comparison) currently do not
consider deprecated features, as their outputs do not consider feature policy.
If implementation is desired, it will require a discussion on how these
commands should report policies.
Examples:
virsh domcapabilities --disable-deprecated-features
e.g. output (trimmed):
<mode name='host-model' supported='yes'>
<model fallback='forbid'>z14.2-base</model>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
<feature policy='require' name='aefsi'/>
<feature policy='require' name='diag318'/>
<feature policy='require' name='mepoch'/>
<feature policy='require' name='msa8'/>
<feature policy='require' name='msa7'/>
<feature policy='require' name='msa6'/>
<feature policy='require' name='msa5'/>
<feature policy='require' name='msa4'/>
<feature policy='require' name='msa3'/>
<feature policy='require' name='msa2'/>
<feature policy='require' name='msa1'/>
<feature policy='require' name='sthyi'/>
<feature policy='require' name='edat'/>
<feature policy='require' name='ri'/>
<feature policy='require' name='edat2'/>
<feature policy='require' name='etoken'/>
<feature policy='require' name='vx'/>
<feature policy='require' name='ipter'/>
<feature policy='require' name='mepochptff'/>
<feature policy='require' name='ap'/>
<feature policy='require' name='vxeh'/>
<feature policy='require' name='vxpd'/>
<feature policy='require' name='esop'/>
<feature policy='require' name='apqi'/>
<feature policy='require' name='apft'/>
<feature policy='require' name='els'/>
<feature policy='require' name='iep'/>
<feature policy='require' name='apqci'/>
<feature policy='disable' name='cte'/>
<feature policy='require' name='ais'/>
<feature policy='disable' name='bpb'/>
<feature policy='require' name='ctop'/>
<feature policy='require' name='gs'/>
<feature policy='require' name='ppa15'/>
<feature policy='require' name='zpci'/>
<feature policy='require' name='sea_esop2'/>
<feature policy='disable' name='te'/>
<feature policy='require' name='cmm'/>
<feature policy='disable' name='csske'/>
</mode>
A domain may be defined with a new <cpu> XML attribute, deprecated_features='on|off':
<cpu mode='host-model' check='partial' deprecated_features='off'/>
e.g. after guest has started (trimmed):
<cpu mode='custom' match='exact' check='partial' deprecated_features='off'>
<model fallback='forbid'>z14.2-base</model>
<feature policy='require' name='aen'/>
<feature policy='require' name='cmmnt'/>
<feature policy='require' name='aefsi'/>
<feature policy='require' name='diag318'/>
<feature policy='require' name='mepoch'/>
<feature policy='require' name='msa8'/>
<feature policy='require' name='msa7'/>
<feature policy='require' name='msa6'/>
<feature policy='require' name='msa5'/>
<feature policy='require' name='msa4'/>
<feature policy='require' name='msa3'/>
<feature policy='require' name='msa2'/>
<feature policy='require' name='msa1'/>
<feature policy='require' name='sthyi'/>
<feature policy='require' name='edat'/>
<feature policy='require' name='ri'/>
<feature policy='require' name='edat2'/>
<feature policy='require' name='etoken'/>
<feature policy='require' name='vx'/>
<feature policy='require' name='ipter'/>
<feature policy='require' name='mepochptff'/>
<feature policy='require' name='ap'/>
<feature policy='require' name='vxeh'/>
<feature policy='require' name='vxpd'/>
<feature policy='require' name='esop'/>
<feature policy='require' name='apqi'/>
<feature policy='require' name='apft'/>
<feature policy='require' name='els'/>
<feature policy='require' name='iep'/>
<feature policy='require' name='apqci'/>
<feature policy='disable' name='cte'/>
<feature policy='require' name='ais'/>
<feature policy='disable' name='bpb'/>
<feature policy='require' name='ctop'/>
<feature policy='require' name='gs'/>
<feature policy='require' name='ppa15'/>
<feature policy='require' name='zpci'/>
<feature policy='require' name='sea_esop2'/>
<feature policy='disable' name='te'/>
<feature policy='require' name='cmm'/>
<feature policy='disable' name='csske'/>
</cpu>
Collin Walling (7):
qemuMonitorJSONGetCPUModelExpansion: refactor parsing functions
qemu: parse deprecated-props from query-cpu-model-expansion response
qemu_capabilities: query deprecated features for host-model
libvirt-domain: introduce
VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES
qemu_capabilities: filter deprecated features if requested
virsh: add --disable-deprecated-features flag to domcapabilities
conf: add deprecated_features attribute
docs/manpages/virsh.rst | 6 +
include/libvirt/libvirt-domain.h | 12 +
src/conf/cpu_conf.c | 11 +
src/conf/cpu_conf.h | 1 +
src/conf/schemas/cputypes.rng | 5 +
src/libvirt-domain.c | 2 +-
src/qemu/qemu_capabilities.c | 89 +++++
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_driver.c | 8 +-
src/qemu/qemu_monitor.c | 7 +
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 64 +++-
src/qemu/qemu_process.c | 11 +
.../caps_9.1.0_s390x.replies | 348 +++++++++++++++++-
.../qemucapabilitiesdata/caps_9.1.0_s390x.xml | 13 +
.../caps_9.2.0_s390x.replies | 348 +++++++++++++++++-
.../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 13 +
...el-deprecated-features-off.s390x-8.2.0.err | 1 +
...el-deprecated-features-off.s390x-8.2.0.xml | 25 ++
...-deprecated-features-off.s390x-latest.args | 32 ++
...l-deprecated-features-off.s390x-latest.xml | 25 ++
.../cpu-model-deprecated-features-off.xml | 15 +
tests/qemuxmlconftest.c | 3 +
tools/virsh-host.c | 9 +-
24 files changed, 1039 insertions(+), 14 deletions(-)
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.err
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-8.2.0.xml
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.args
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.s390x-latest.xml
create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-off.xml
--
2.47.1
1 month, 2 weeks
[PATCH] Fix a few typos in error messages
by Jiri Denemark
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/722
Reported-by: Göran Uddeborg <goeran(a)uddeborg.se>
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/esx/esx_vi.c | 2 +-
src/network/bridge_driver_conf.c | 2 +-
src/qemu/qemu_postparse.c | 2 +-
src/security/security_apparmor.c | 2 +-
src/vz/vz_sdk.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 3ecd406e1d..e2589aa69a 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -370,7 +370,7 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content,
*/
if (*length > INT32_MAX / 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Download length it too large"));
+ _("Download length is too large"));
return -1;
}
diff --git a/src/network/bridge_driver_conf.c b/src/network/bridge_driver_conf.c
index 4e40286ee3..738652390f 100644
--- a/src/network/bridge_driver_conf.c
+++ b/src/network/bridge_driver_conf.c
@@ -97,7 +97,7 @@ virNetworkLoadDriverConfig(virNetworkDriverConfig *cfg G_GNUC_UNUSED,
if (fwBackends[0] < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unrecognized 'firewall_backend = '%1$s' set in network driver config file %2$s"),
+ _("unrecognized firewall_backend = '%1$s' set in network driver config file %2$s"),
fwBackendStr, filename);
return -1;
}
diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c
index f48f172c37..4fbd849ebf 100644
--- a/src/qemu/qemu_postparse.c
+++ b/src/qemu/qemu_postparse.c
@@ -1643,7 +1643,7 @@ qemuDomainDefVcpusPostParse(virDomainDef *def)
/* they can be ordered only at the beginning */
if (prevvcpu->hotpluggable == VIR_TRISTATE_BOOL_YES) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("online non-hotpluggable vcpus need to be ordered prior to hotplugable vcpus"));
+ _("online non-hotpluggable vcpus need to be ordered prior to hotpluggable vcpus"));
return -1;
}
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 07e95ec81d..c8e77c6cd2 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -374,7 +374,7 @@ AppArmorGenSecurityLabel(virSecurityManager *mgr G_GNUC_UNUSED,
if (secdef->baselabel) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("Cannot set a base label with AppArmour"));
+ "%s", _("Cannot set a base label with AppArmor"));
return -1;
}
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index ce4586a3f5..b20d454fb8 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2703,7 +2703,7 @@ static int prlsdkCheckVideoUnsupportedParams(virDomainDef *def)
return 0;
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Video adapters are not supported int containers."));
+ _("Video adapters are not supported in containers."));
return -1;
}
} else {
--
2.47.1
1 month, 2 weeks