[libvirt PATCH 0/2] meson: Detect and reject invalid rst2html5 command
by Andrea Bolognani
Previous attempt at solving this issue:
https://listman.redhat.com/archives/libvir-list/2021-June/msg00097.html
The solution presented here should be way more future-proof, though
there's of course always the risk that the format used to report
version information will change in a way that causes our detection to
trip over...
Andrea Bolognani (2):
meson: Use 'rst2html5' instead of 'rst2html' everywhere
meson: Detect and reject invalid rst2html5 command
docs/go/meson.build | 2 +-
docs/kbase/meson.build | 2 +-
docs/manpages/meson.build | 2 +-
docs/meson.build | 8 ++++----
meson.build | 30 +++++++++++++++++++++++++++++-
5 files changed, 36 insertions(+), 8 deletions(-)
--
2.31.1
3 years
[PATCH 0/9] Configurable policy for handling unstable interfaces
by Markus Armbruster
Option -compat lets you configure what to do when deprecated
interfaces get used. This series extends this to unstable interfaces.
Works the same way. Intended for testing users of the management
interfaces. It is experimental.
To make it possible, I replace the "x-" naming convention by special
feature flag "unstable". See PATCH 1 for rationale.
Based on my "[PATCH v4 0/5] qapi: Add feature flags to enum members"
Based-on: Message-Id: <20211025042405.3762351-1-armbru(a)redhat.com>
Markus Armbruster (9):
qapi: New special feature flag "unstable"
qapi: Mark unstable QMP parts with feature 'unstable'
qapi: Eliminate QCO_NO_OPTIONS for a slight simplification
qapi: Tools for sets of special feature flags in generated code
qapi: Generalize struct member policy checking
qapi: Generalize command policy checking
qapi: Generalize enum member policy checking
qapi: Factor out compat_policy_input_ok()
qapi: Extend -compat to set policy for unstable interfaces
docs/devel/qapi-code-gen.rst | 9 +-
qapi/block-core.json | 123 +++++++++++++++++-------
qapi/compat.json | 6 +-
qapi/migration.json | 35 +++++--
qapi/misc.json | 6 +-
qapi/qom.json | 11 ++-
include/qapi/compat-policy.h | 7 ++
include/qapi/qmp/dispatch.h | 6 +-
include/qapi/util.h | 8 +-
include/qapi/visitor-impl.h | 6 +-
include/qapi/visitor.h | 17 +++-
monitor/misc.c | 7 +-
qapi/qapi-forward-visitor.c | 16 +--
qapi/qapi-visit-core.c | 41 ++++----
qapi/qmp-dispatch.c | 57 ++++++++---
qapi/qmp-registry.c | 4 +-
qapi/qobject-input-visitor.c | 22 ++---
qapi/qobject-output-visitor.c | 13 ++-
storage-daemon/qemu-storage-daemon.c | 3 +-
qapi/trace-events | 4 +-
qemu-options.hx | 20 +++-
scripts/qapi/commands.py | 12 +--
scripts/qapi/events.py | 10 +-
scripts/qapi/gen.py | 13 +++
scripts/qapi/schema.py | 11 ++-
scripts/qapi/types.py | 22 +++--
scripts/qapi/visit.py | 14 +--
tests/qapi-schema/qapi-schema-test.json | 7 +-
tests/qapi-schema/qapi-schema-test.out | 5 +
29 files changed, 353 insertions(+), 162 deletions(-)
--
2.31.1
3 years
[PATCH v2 0/8] qemu: QAPI-schema: Add support for enum value 'features'
by Peter Krempa
Patches 2-8 were already reviewed by Michal. 1/8 is new as the qemu
functionality was just merged upstream.
Peter Krempa (8):
qemucapabilitiestest: Update capability probe for qemu-6.2 on x86_64
virQEMUQAPISchemaTraverseEnum: Move helper variables into loop
virQEMUQAPISchemaTraverseEnum: Use the modern 'members' array
virQEMUQAPISchemaTraverseEnum: Allow query of enume type features
testQEMUSchemaValidateEnum: Refactor logic to simplify switching to
new QMP schema format
testQEMUSchemaValidateEnum: Use new 'members' for 'enum' meta type
testQEMUSchemaValidateDeprecated: Move to the top
testQEMUSchemaValidateEnum: Validate deprecated members
src/qemu/qemu_qapi.c | 46 +-
.../caps_6.2.0.x86_64.replies | 3513 +++++++++++++++--
.../caps_6.2.0.x86_64.xml | 2 +-
tests/testutilsqemuschema.c | 130 +-
4 files changed, 3214 insertions(+), 477 deletions(-)
--
2.31.1
3 years
[PATCH v2] qemu_block: Refactor qemuBlockExportAddNBD()
by Kristina Hanicova
This is v2 of: https://listman.redhat.com/archives/libvir-list/2021-October/msg01035.html
Diff to v1:
* negation of 'if' with switched body (proposed by Peter)
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/qemu_block.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 34fdec2c4b..b8e70f6a83 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3592,28 +3592,21 @@ qemuBlockExportAddNBD(virDomainObj *vm,
const char *bitmap)
{
qemuDomainObjPrivate *priv = vm->privateData;
+ g_autoptr(virJSONValue) nbdprops = NULL;
+ const char *bitmaps[2] = { bitmap, NULL };
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD)) {
- g_autoptr(virJSONValue) nbdprops = NULL;
- const char *bitmaps[2] = { bitmap, NULL };
+ /* older qemu versions didn't support configuring the exportname and
+ * took the 'drivealias' as the export name */
+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
+ return qemuMonitorNBDServerAdd(priv->mon, drivealias, NULL, writable, NULL);
- if (!(nbdprops = qemuBlockExportGetNBDProps(src->nodeformat,
- exportname,
- writable,
- bitmaps)))
- return -1;
+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD))
+ return qemuMonitorNBDServerAdd(priv->mon, src->nodeformat,
+ exportname, writable, bitmap);
- return qemuMonitorBlockExportAdd(priv->mon, &nbdprops);
- } else {
- return qemuMonitorNBDServerAdd(priv->mon, src->nodeformat,
- exportname, writable, bitmap);
- }
- } else {
- /* older qemu versions didn't support configuring the exportname and
- * took the 'drivealias' as the export name */
- return qemuMonitorNBDServerAdd(priv->mon, drivealias, NULL, writable, NULL);
- }
+ if (!(nbdprops = qemuBlockExportGetNBDProps(src->nodeformat, exportname,
+ writable, bitmaps)))
+ return -1;
- return 0;
+ return qemuMonitorBlockExportAdd(priv->mon, &nbdprops);
}
--
2.31.1
3 years
[PATCH] virsh: Fix ambiguous output in metadata-change event
by Han Han
When you set metadata with type element like the following:
dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT, "<test/>", 'abc', "HAHAH", 0)
Then for `virsh event --all`, then it will output this message:
event 'metadata-change' for domain 'rhel9': element HAHAH
The message is ambiguous since it looks like the params for
metadata-change event is the element HAHAH. Actually that means the type is
element while the url is HAHAH. Let's make it more clear.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 7f3356a536..d454075dfc 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13317,7 +13317,7 @@ virshEventMetadataChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': %s %s\n"),
+ virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': type %s, uri %s\n"),
virDomainGetName(dom),
UNKNOWNSTR(virshEventMetadataChangeTypeTypeToString(type)),
NULLSTR(nsuri));
--
2.33.1
3 years
[PATCH] ch_driver: Drop needless fwd declaration
by Michal Privoznik
In ch_driver.c there are two forward declarations that are not
needed. Drop them.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/ch/ch_driver.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
index 1824d2fd16..9eaf3ee499 100644
--- a/src/ch/ch_driver.c
+++ b/src/ch/ch_driver.c
@@ -47,11 +47,6 @@
VIR_LOG_INIT("ch.ch_driver");
-static int chStateInitialize(bool privileged,
- const char *root,
- virStateInhibitCallback callback,
- void *opaque);
-static int chStateCleanup(void);
virCHDriver *ch_driver = NULL;
static virDomainObj *
--
2.32.0
3 years
[PATCH 0/2] lib: Drop retval check for virCapabilitiesAddGuest{, Domain)()
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (2):
lib: Don't check for virCapabilitiesAddGuest() retval
lib: Don't check for virCapabilitiesAddGuestDomain() retval
src/bhyve/bhyve_capabilities.c | 13 ++++-----
src/ch/ch_conf.c | 20 +++-----------
src/esx/esx_driver.c | 14 +++-------
src/hyperv/hyperv_driver.c | 12 +++------
src/libxl/libxl_capabilities.c | 34 +++++++++---------------
src/lxc/lxc_conf.c | 38 ++++++---------------------
src/openvz/openvz_conf.c | 19 +++-----------
src/qemu/qemu_capabilities.c | 31 +++++-----------------
src/security/virt-aa-helper.c | 23 +++-------------
src/test/test_driver.c | 19 +++-----------
src/vbox/vbox_common.c | 18 +++----------
src/vmware/vmware_conf.c | 26 ++++++------------
src/vz/vz_driver.c | 8 +++---
tests/testutils.c | 41 ++++++++++++-----------------
tests/testutilslxc.c | 26 +++++++-----------
tests/testutilsqemu.c | 30 ++++++---------------
tests/testutilsxen.c | 48 +++++++++++++++-------------------
tests/vmx2xmltest.c | 38 +++++++--------------------
tests/xml2vmxtest.c | 39 +++++++--------------------
19 files changed, 147 insertions(+), 350 deletions(-)
--
2.32.0
3 years
[PATCH] qemu: tpm: Enable creation of certs for TPM 1.2 in non-privileged mode
by Stefan Berger
When 'swtpm_setup --print-capabilities' shows the 'tpm12-not-need-root'
flag, then it is possible to create certificates for the TPM 1.2 also
in non-privileged mode since swtpm_setup doesn't need tcsd anymore.
Check for this flag and create the certificates if this flag is found.
Signed-off-by: Stefan Berger <stefanb(a)linux.ibm.com>
---
src/qemu/qemu_tpm.c | 5 ++++-
src/util/virtpm.c | 1 +
src/util/virtpm.h | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
index e1b08a66c5..91e21ae646 100644
--- a/src/qemu/qemu_tpm.c
+++ b/src/qemu/qemu_tpm.c
@@ -463,11 +463,14 @@ qemuTPMEmulatorRunSetup(const char *storagepath,
if (!swtpm_setup)
return -1;
- if (!privileged && tpmversion == VIR_DOMAIN_TPM_VERSION_1_2)
+ if (!privileged && tpmversion == VIR_DOMAIN_TPM_VERSION_1_2 &&
+ !virTPMSwtpmSetupCapsGet(
+ VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT)) {
return virFileWriteStr(logfile,
_("Did not create EK and certificates since "
"this requires privileged mode for a "
"TPM 1.2\n"), 0600);
+ }
if (!privileged && qemuTPMCreateConfigFiles(swtpm_setup) < 0)
return -1;
diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index 0f50de866c..40d9272e66 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -46,6 +46,7 @@ VIR_ENUM_IMPL(virTPMSwtpmSetupFeature,
VIR_TPM_SWTPM_SETUP_FEATURE_LAST,
"cmdarg-pwdfile-fd",
"cmdarg-create-config-files",
+ "tpm12-not-need-root",
);
/**
diff --git a/src/util/virtpm.h b/src/util/virtpm.h
index 3bb03b3b33..b75eb84f31 100644
--- a/src/util/virtpm.h
+++ b/src/util/virtpm.h
@@ -39,6 +39,7 @@ typedef enum {
typedef enum {
VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD,
VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_CREATE_CONFIG_FILES,
+ VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT,
VIR_TPM_SWTPM_SETUP_FEATURE_LAST
} virTPMSwtpmSetupFeature;
--
2.31.1
3 years
[PATCH] qemu: support kvm-pv-ipi off
by zhenwei pi
QEMU version 3.1 introduced PV_SEND_IPI CPUID feature bit under
commit 7f710c32bb8 (target-i386: adds PV_SEND_IPI CPUID feature bit).
This patch adds a new KVM feature 'pv-ipi' to disable this feature
(enabled by default). Newer CPU platform (Ex, AMD Zen2) supports
hardware accelation for IPI in guest, to use this feature to get
better performance in some scenarios. Detailed about the discussion:
https://lkml.org/lkml/2021/10/20/423
To disable kvm-pv-ipi and have libvirt add "-cpu host,kvm-pv-ipi=off"
to the QEMU command line, the following XML code needs to be added to the
guest's domain description:
<features>
<kvm>
<pv-ipi state='off'/>
</kvm>
</features>
Signed-off-by: zhenwei pi <pizhenwei(a)bytedance.com>
---
docs/formatdomain.rst | 2 ++
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 3 +++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 5 +++++
5 files changed, 16 insertions(+)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 58768f7e5e..8ff833bbd2 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -1842,6 +1842,7 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off.
<hidden state='on'/>
<hint-dedicated state='on'/>
<poll-control state='on'/>
+ <pv-ipi state='off'/>
</kvm>
<xen>
<e820_host state='on'/>
@@ -1930,6 +1931,7 @@ are:
hidden Hide the KVM hypervisor from standard MSR based discovery on, off :since:`1.2.8 (QEMU 2.1.0)`
hint-dedicated Allows a guest to enable optimizations when running on dedicated vCPUs on, off :since:`5.7.0 (QEMU 2.12.0)`
poll-control Decrease IO completion latency by introducing a grace period of busy waiting on, off :since:`6.10.0 (QEMU 4.2)`
+ pv-ipi Paravirtualized send IPIs on, off :since:`7.10.0 (QEMU 3.1)`
============== ============================================================================ ======= ============================
``xen``
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index f71e375a33..67df13d90d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -7177,6 +7177,11 @@
<ref name="featurestate"/>
</element>
</optional>
+ <optional>
+ <element name="pv-ipi">
+ <ref name="featurestate"/>
+ </element>
+ </optional>
</interleave>
</element>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 48c6ee9865..c8868de577 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -204,6 +204,7 @@ VIR_ENUM_IMPL(virDomainKVM,
"hidden",
"hint-dedicated",
"poll-control",
+ "pv-ipi",
);
VIR_ENUM_IMPL(virDomainXen,
@@ -21789,6 +21790,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src,
case VIR_DOMAIN_KVM_HIDDEN:
case VIR_DOMAIN_KVM_DEDICATED:
case VIR_DOMAIN_KVM_POLLCONTROL:
+ case VIR_DOMAIN_KVM_PVIPI:
if (src->kvm_features[i] != dst->kvm_features[i]) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of KVM feature '%s' differs: "
@@ -27821,6 +27823,7 @@ virDomainDefFormatFeatures(virBuffer *buf,
case VIR_DOMAIN_KVM_HIDDEN:
case VIR_DOMAIN_KVM_DEDICATED:
case VIR_DOMAIN_KVM_POLLCONTROL:
+ case VIR_DOMAIN_KVM_PVIPI:
if (def->kvm_features[j])
virBufferAsprintf(&childBuf, "<%s state='%s'/>\n",
virDomainKVMTypeToString(j),
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f4be5c84f0..cb6d8975b8 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2073,6 +2073,7 @@ typedef enum {
VIR_DOMAIN_KVM_HIDDEN = 0,
VIR_DOMAIN_KVM_DEDICATED,
VIR_DOMAIN_KVM_POLLCONTROL,
+ VIR_DOMAIN_KVM_PVIPI,
VIR_DOMAIN_KVM_LAST
} virDomainKVM;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7374b2beca..f7c19246d8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6848,6 +6848,11 @@ qemuBuildCpuCommandLine(virCommand *cmd,
virBufferAddLit(&buf, ",kvm-poll-control=on");
break;
+ case VIR_DOMAIN_KVM_PVIPI:
+ if (def->kvm_features[i] == VIR_TRISTATE_SWITCH_OFF)
+ virBufferAddLit(&buf, ",kvm-pv-ipi=off");
+ break;
+
case VIR_DOMAIN_KVM_LAST:
break;
}
--
2.25.1
3 years
[PATCH v2] qemu_agent: remove unused code
by Kristina Hanicova
This is v2 of: https://listman.redhat.com/archives/libvir-list/2021-October/msg01064.html
Diff to v1:
* I forgot to delete another part of the unused code which
belonged together (noticed by Jano)
This section of code was left unused ever since it was introduced
ten years ago. I think we can safely remove it.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/qemu_agent.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 5f421be6f6..f319b881fc 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -60,17 +60,6 @@ VIR_LOG_INIT("qemu.qemu_agent");
*/
#define QEMU_AGENT_MAX_RESPONSE (10 * 1024 * 1024)
-/* When you are the first to uncomment this,
- * don't forget to uncomment the corresponding
- * part in qemuAgentIOProcessEvent as well.
- *
-static struct {
- const char *type;
- void (*handler)(qemuAgent *agent, virJSONValue *data);
-} eventHandlers[] = {
-};
-*/
-
typedef struct _qemuAgentMessage qemuAgentMessage;
struct _qemuAgentMessage {
char *txBuffer;
@@ -237,17 +226,6 @@ qemuAgentIOProcessEvent(qemuAgent *agent,
return -1;
}
-/*
- for (i = 0; i < G_N_ELEMENTS(eventHandlers); i++) {
- if (STREQ(eventHandlers[i].type, type)) {
- virJSONValue *data = virJSONValueObjectGet(obj, "data");
- VIR_DEBUG("handle %s handler=%p data=%p", type,
- eventHandlers[i].handler, data);
- (eventHandlers[i].handler)(agent, data);
- break;
- }
- }
-*/
return 0;
}
--
2.31.1
3 years