[libvirt PATCH 0/2] qemu: Always check nodeset provided to numatune
by Andrea Bolognani
Behave more consistently when presented with an invalid configuration.
Andrea Bolognani (2):
tests: Add cases for numatune with unavailable nodes
qemu: Always check nodeset provided to numatune
src/qemu/qemu_command.c | 6 ++++--
...-unavailable-restrictive.x86_64-latest.err | 1 +
...matune-memnode-unavailable-restrictive.xml | 20 +++++++++++++++++++
...mnode-unavailable-strict.x86_64-latest.err | 1 +
.../numatune-memnode-unavailable-strict.xml | 20 +++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
6 files changed, 48 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.xml
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.xml
--
2.39.0
1 year, 10 months
[PATCH] qemu: fix several codecheck in qemu_monitor.c
by Jiang Jiacheng
1.clear passwd in debug log
2.alignment
3.use the same variable name for function definition and declaration
Signed-off-by: Jiang Jiacheng <jiangjiacheng(a)huawei.com>
---
src/qemu/qemu_monitor.c | 8 ++++----
src/qemu/qemu_monitor.h | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 80f262cec7..de9a1b26f6 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -943,7 +943,7 @@ qemuMonitorInitBalloonObjectPath(qemuMonitor *mon,
case VIR_DOMAIN_MEMBALLOON_MODEL_XEN:
case VIR_DOMAIN_MEMBALLOON_MODEL_NONE:
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("invalid model for virtio-balloon-pci"));
+ _("invalid model for virtio-balloon-pci"));
return;
case VIR_DOMAIN_MEMBALLOON_MODEL_LAST:
default:
@@ -2053,8 +2053,8 @@ qemuMonitorSetPassword(qemuMonitor *mon,
if (!protocol)
return -1;
- VIR_DEBUG("protocol=%s, password=%p, action_if_connected=%s",
- protocol, password, action_if_connected);
+ VIR_DEBUG("protocol=%s, action_if_connected=%s",
+ protocol, action_if_connected);
QEMU_CHECK_MONITOR(mon);
@@ -3485,7 +3485,7 @@ qemuMonitorBlockExportAdd(qemuMonitor *mon,
int
qemuMonitorGetTPMModels(qemuMonitor *mon,
- char ***tpmmodels)
+ char ***tpmmodels)
{
VIR_DEBUG("tpmmodels=%p", tpmmodels);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index c690fc3655..7278f2e706 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -627,8 +627,8 @@ struct _qemuMonitorCPUInfo {
};
typedef struct _qemuMonitorCPUInfo qemuMonitorCPUInfo;
-void qemuMonitorCPUInfoFree(qemuMonitorCPUInfo *list,
- size_t nitems);
+void qemuMonitorCPUInfoFree(qemuMonitorCPUInfo *cpus,
+ size_t ncpus);
int qemuMonitorGetCPUInfo(qemuMonitor *mon,
qemuMonitorCPUInfo **vcpus,
size_t maxvcpus,
@@ -1184,7 +1184,7 @@ int qemuMonitorNBDServerAdd(qemuMonitor *mon,
const char *export,
bool writable,
const char *bitmap);
-int qemuMonitorNBDServerStop(qemuMonitor *);
+int qemuMonitorNBDServerStop(qemuMonitor *mon);
int qemuMonitorBlockExportAdd(qemuMonitor *mon,
virJSONValue **props);
--
2.33.0
1 year, 10 months
[PATCH] qemu: Fix Commnad -> Command typo
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as 'trivial'.
src/qemu/qemu_command.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ee2e873b9562..74069587bfea 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9843,11 +9843,11 @@ typedef enum {
QEMU_COMMAND_DEPRECATION_BEHAVIOR_CRASH,
QEMU_COMMAND_DEPRECATION_BEHAVIOR_LAST
-} qemuCommnadDeprecationBehavior;
+} qemuCommandDeprecationBehavior;
-VIR_ENUM_DECL(qemuCommnadDeprecationBehavior);
-VIR_ENUM_IMPL(qemuCommnadDeprecationBehavior,
+VIR_ENUM_DECL(qemuCommandDeprecationBehavior);
+VIR_ENUM_IMPL(qemuCommandDeprecationBehavior,
QEMU_COMMAND_DEPRECATION_BEHAVIOR_LAST,
"none",
"omit",
@@ -9863,7 +9863,7 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd,
g_autoptr(virJSONValue) props = NULL;
g_autofree char *propsstr = NULL;
qemuDomainXmlNsDef *nsdata = def->namespaceData;
- qemuCommnadDeprecationBehavior behavior = QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE;
+ qemuCommandDeprecationBehavior behavior = QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE;
const char *behaviorStr = cfg->deprecationBehavior;
int tmp;
const char *deprecatedOutput = NULL;
@@ -9872,7 +9872,7 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd,
if (nsdata && nsdata->deprecationBehavior)
behaviorStr = nsdata->deprecationBehavior;
- if ((tmp = qemuCommnadDeprecationBehaviorTypeFromString(behaviorStr)) < 0) {
+ if ((tmp = qemuCommandDeprecationBehaviorTypeFromString(behaviorStr)) < 0) {
VIR_WARN("Unsupported deprecation behavior '%s' for VM '%s'",
behaviorStr, def->name);
return;
--
2.39.0
1 year, 10 months
[PATCH 0/3] fix some coding issues
by Jiang Jiacheng
Jiang Jiacheng (3):
qemu:fix a misspelling in log
remote: fix misspelling in the documation of
'daemonCreateClientStream'
storage/util: replace unnecessary while loop by if
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_stream.c | 4 ++--
src/storage/storage_util.c | 4 +---
src/util/virutil.c | 6 +-----
4 files changed, 5 insertions(+), 11 deletions(-)
--
2.33.0
1 year, 10 months
[PATCH 0/9] use g_autofree
by Jiang Jiacheng
Use g_autofree more often and remove unnecessary cleanup/error
labels.
Jiang Jiacheng (9):
conf: use g_autofree and remove unnecessary label
interface: use g_autofree and remove unnecessary label
locking: use g_autofree and remove unnecessary label
remote: use g_autofree and remove unnecessary label
rpc: use g_autofree and remove unnecessary label
security: use g_autofree and remove unnecessary label
util: use g_autofree and remove unnecessary label
vmware: use g_autofree and remove unnecessary label
vz: use g_autofree and remove unnecessary label
src/conf/domain_audit.c | 121 ++++++++-----------------
src/conf/node_device_util.c | 49 ++++------
src/conf/nwfilter_conf.c | 51 ++++-------
src/conf/virnetworkobj.c | 85 ++++++-----------
src/conf/virnetworkportdef.c | 12 +--
src/conf/virnwfilterbindingobj.c | 22 ++---
src/conf/virnwfilterobj.c | 14 +--
src/conf/virstorageobj.c | 23 ++---
src/interface/interface_backend_udev.c | 22 ++---
src/locking/lock_driver_lockd.c | 36 +++-----
src/locking/lock_driver_sanlock.c | 46 ++++------
src/remote/remote_driver.c | 22 ++---
src/rpc/virnetclientprogram.c | 6 +-
src/rpc/virnettlscontext.c | 16 +---
src/security/security_apparmor.c | 91 +++++++------------
src/util/virconf.c | 27 ++----
src/vmware/vmware_conf.c | 28 ++----
src/vz/vz_utils.c | 18 ++--
18 files changed, 237 insertions(+), 452 deletions(-)
--
2.33.0
1 year, 10 months
[PATCH] qemu_namespace: Move umount() call into #fdef __linux__
by Michal Privoznik
In a recent commit I've introduced an umount() call. But the
function where the call lives is compiled on all OSes, not just
Linux. But umount() is Linux specific. Other OSes have unmount
(FreeBSD), or maybe something else. But since namespaces are
Linux specific, we can wrap the call in #ifdef __linux__ and not
care about other OSes.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_namespace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c
index fc348c043e..5769a4dfe0 100644
--- a/src/qemu/qemu_namespace.c
+++ b/src/qemu/qemu_namespace.c
@@ -776,10 +776,12 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
goto cleanup;
}
+#if defined(__linux__)
if (umount("/dev") < 0) {
virReportSystemError(errno, "%s", _("failed to umount devfs on /dev"));
return -1;
}
+#endif /* !defined(__linux__) */
if (virFileMoveMount(devPath, "/dev") < 0)
goto cleanup;
--
2.38.2
1 year, 10 months
[PATCH v2] virQEMUDriverGetDomainCapabilities: Validate arguments
by Michal Privoznik
When calling virConnectGetDomainCapabilities() (exposed as virsh
domcapabilities) users have option to specify whatever sub-set of
{ emulatorbin, arch, machine, virttype } they want. Then we have
a logic (hidden in virQEMUCapsCacheLookupDefault()) that picks
qemuCaps that satisfy values passed by user. And whatever was not
specified is then set to the default value as specified by picked
qemuCaps. For instance: if no machine type was provided but
emulatorbin was, then the machine type is set to the default one
as defined by the emulatorbin.
Or, when just virttype was set then the remaining three values
are set to their respective defaults. Except, we have a crasher
in this case:
# virsh domcapabilities --virttype hvf
error: Disconnected from qemu:///system due to end of file
error: failed to get emulator capabilities
error: End of file while reading data: Input/output error
This is because for 'hvf' virttype (at least my) QEMU does not
have any machine type. Therefore, @machine is set to NULL and the
rest of the code does not expect that.
What we can do about this is to validate all arguments. Well,
except for the emulatorbin which is obtained from passed
qemuCaps. This also fixes the issue when domcapabilities for a
virttype of a different driver are requested, or a different
arch.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v2 of:
https://listman.redhat.com/archives/libvir-list/2022-December/236460.html
diff to v1:
- validate @arch, @virttype as well, not just @machine
src/qemu/qemu_conf.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index ae5bbcd138..6760bef14c 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1454,6 +1454,27 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriver *driver,
g_autoptr(virDomainCaps) domCaps = NULL;
const char *path = virQEMUCapsGetBinary(qemuCaps);
+ if (!virQEMUCapsIsArchSupported(qemuCaps, arch)) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Emulator '%s' does not support arch '%s'"),
+ path, virArchToString(arch));
+ return NULL;
+ }
+
+ if (!virQEMUCapsIsVirtTypeSupported(qemuCaps, virttype)) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Emulator '%s' does not support virt type '%s'"),
+ path, virDomainVirtTypeToString(virttype));
+ return NULL;
+ }
+
+ if (!virQEMUCapsIsMachineSupported(qemuCaps, virttype, machine)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Emulator '%s' does not support machine type '%s'"),
+ path, NULLSTR(machine));
+ return NULL;
+ }
+
if (!(domCaps = virDomainCapsNew(path, machine, arch, virttype)))
return NULL;
--
2.38.2
1 year, 10 months
[PATCH v2 0/7] qemu_capabilities: Report Hyper-V Enlightenments in domcapabilities
by Michal Privoznik
v2 of:
https://listman.redhat.com/archives/libvir-list/2022-December/236464.html
diff to v1:
- Merged some cleanup patches from v1
- Store capabilities in cache
- More cleanup patches
Michal Prívozník (7):
virDomainCapsEnumFormat: Switch to virXMLFormatElement()
virDomainCapsEnumFormat: Retrun void
domain_capabilities: Expose Hyper-V Enlightenments
qemuMonitorJSONMakeCPUModel: Introduce @hv_passthrough argument
qemuMonitorJSONGetCPUModelExpansion: Introduce @hv_passthrough
argument
qemu_capabilities: Query for Hyper-V Enlightenments
qemu_capabilities: Report Hyper-V Enlightenments in domcapabilities
docs/formatdomaincaps.rst | 15 +
src/conf/domain_capabilities.c | 38 +-
src/conf/domain_capabilities.h | 8 +
src/conf/schemas/domaincaps.rng | 10 +
src/qemu/qemu_capabilities.c | 178 ++++++-
src/qemu/qemu_driver.c | 3 +-
src/qemu/qemu_monitor.c | 5 +-
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 21 +-
src/qemu/qemu_monitor_json.h | 1 +
tests/cputest.c | 2 +-
tests/domaincapsdata/empty.xml | 1 +
tests/domaincapsdata/libxl-xenfv.xml | 1 +
tests/domaincapsdata/libxl-xenpv.xml | 1 +
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 +
.../qemu_4.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 1 +
.../qemu_5.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 +
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 1 +
.../qemu_5.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 1 +
.../qemu_6.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 1 +
.../qemu_6.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 +
.../qemu_7.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_7.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 18 +
.../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 18 +
tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 18 +
.../caps_4.2.0.aarch64.replies | 45 ++
.../caps_4.2.0.aarch64.xml | 1 +
.../caps_4.2.0.x86_64.replies | 317 ++++++++++++
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.replies | 46 ++
.../caps_5.0.0.aarch64.xml | 1 +
.../caps_5.0.0.x86_64.replies | 318 ++++++++++++
.../caps_5.0.0.x86_64.xml | 1 +
.../caps_5.1.0.x86_64.replies | 323 ++++++++++++
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.aarch64.replies | 47 ++
.../caps_5.2.0.aarch64.xml | 1 +
.../caps_5.2.0.x86_64.replies | 324 +++++++++++++
.../caps_5.2.0.x86_64.xml | 1 +
.../caps_6.0.0.aarch64.replies | 47 ++
.../caps_6.0.0.aarch64.xml | 1 +
.../caps_6.0.0.x86_64.replies | 336 +++++++++++++
.../caps_6.0.0.x86_64.xml | 1 +
.../caps_6.1.0.x86_64.replies | 338 +++++++++++++
.../caps_6.1.0.x86_64.xml | 1 +
.../caps_6.2.0.aarch64.replies | 47 ++
.../caps_6.2.0.aarch64.xml | 1 +
.../caps_6.2.0.x86_64.replies | 348 +++++++++++++
.../caps_6.2.0.x86_64.xml | 1 +
.../caps_7.0.0.aarch64.replies | 48 ++
.../caps_7.0.0.aarch64.xml | 1 +
.../caps_7.0.0.x86_64.replies | 352 ++++++++++++++
.../caps_7.0.0.x86_64.xml | 1 +
.../caps_7.1.0.x86_64.replies | 353 ++++++++++++++
.../caps_7.1.0.x86_64.xml | 1 +
.../caps_7.2.0.x86_64.replies | 353 ++++++++++++++
.../caps_7.2.0.x86_64.xml | 1 +
.../caps_8.0.0.x86_64.replies | 458 ++++++++++++++++++
.../caps_8.0.0.x86_64.xml | 16 +
103 files changed, 4495 insertions(+), 28 deletions(-)
--
2.38.2
1 year, 10 months
Plans for the next release
by Jiri Denemark
We are getting close to the next release of libvirt. To aim for the
release on Jan 16 I suggest entering the freeze on Tuesday Jan 10 and
tagging RC2 on Thursday Jan 12.
I hope this works for everyone.
Jirka
1 year, 10 months
[PATCH] virQEMUCapsLoadCache: Parse <selfvers/> properly
by Michal Privoznik
In a recent commit, when ditching virXPathULong() the parsing of
<selfvers/> was changed. But it was changed to virXMLPropUInt()
which is not correct because the value we're interested in is not
in an attribute but element itself.
Fixes: a3c7426839df25f4026707c5877be75f2461f5e9
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e6024a2d75..0c16366f21 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4533,8 +4533,8 @@ virQEMUCapsLoadCache(virArch hostArch,
}
qemuCaps->libvirtCtime = (time_t)l;
- if (virXMLPropUInt(ctxt->node, "selfvers", 10, VIR_XML_PROP_NONE,
- &qemuCaps->libvirtVersion) < 0)
+ if (virXPathUInt("string(./selfvers)", ctxt,
+ &qemuCaps->libvirtVersion) < 0)
return -1;
if (!skipInvalidation &&
--
2.38.2
1 year, 10 months