How do we specify disk device names for non-Linux VMs in XML?
by Motohiro Kawahito
The XML parser (or verifier) in libvirt seems to support only Linux device
names for a disk, such as hda, sda and vda.
Can anyone let us know how libvirt supports disk device names for
non-Linux VMs?
We are developing a new hypervisor driver for a non-Linux VM, which uses a
different device naming convention from Linux, something like 0A80. 0A81,
0A82.
Thank you so much.
Motohiro Kawahito, Commercial Systems, IBM Research - Tokyo
19-21 Nihonbashi, Hakozaki-cho Chuo-ku, Tokyo 103-8510, Japan
3 years, 5 months
[PATCH] qemu: migration: Use correct flag when preparing block dirty bitmaps
by Jim Fehlig
qemuMigrationSrcRunPrepareBlockDirtyBitmaps receives the flags parameter
from qemuMigrationSrcRun, where flags are based on the main API enum
values. Similar to commit f58349c9c6, use the main API enum instead of
internal driver enum when checking flags in
qemuMigrationSrcRunPrepareBlockDirtyBitmaps.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Noticed by visiual inspection while investigating a bug report similar to
https://bugzilla.redhat.com/show_bug.cgi?id=1978526
src/qemu/qemu_migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 2ec7b7c48b..ba8c0bd2d0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3972,7 +3972,7 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmaps(virDomainObj *vm,
* directly, otherwise we must create merged bitmaps from the whole
* chain */
- if (!(flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC) &&
+ if (!(flags & VIR_MIGRATE_NON_SHARED_INC) &&
qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(vm, mig) < 0)
return -1;
--
2.31.1
3 years, 5 months
[PATCH] qemu: Fix error returned value in qemuGetProcessInfo when fscanf execute failed
by Yi Wang
From: Long YunJian <long.yunjian(a)zte.com.cn>
If fscanf execute failed, qemuGetProcessInfo shuld return -1,
but it return 0 at the end. Zero means success for the caller,
so we shuld return -1 in the case of failure.
Signed-off-by: Long YunJian <long.yunjian(a)zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
src/qemu/qemu_driver.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index df44c3fbd0..4c3785fa36 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1442,11 +1442,13 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
return -1;
pidinfo = fopen(proc, "r");
+ if (!pidinfo) {
+ return -1;
+ }
/* See 'man proc' for information about what all these fields are. We're
* only interested in a very few of them */
- if (!pidinfo ||
- fscanf(pidinfo,
+ if (fscanf(pidinfo,
/* pid -> stime */
"%*d (%*[^)]) %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu"
/* cutime -> endcode */
@@ -1455,6 +1457,8 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
"%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
&usertime, &systime, &rss, &cpu) != 4) {
VIR_WARN("cannot parse process status data");
+ VIR_FORCE_FCLOSE(pidinfo);
+ return -1;
}
/* We got jiffies
--
2.18.1
3 years, 5 months
[PATCH 9/9] docs/deprecated: deprecate passing plugin args through `arg=`
by Mahmoud Mandour
Signed-off-by: Mahmoud Mandour <ma.mandourr(a)gmail.com>
---
docs/system/deprecated.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index e2e0090878..aaf0ee5777 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -126,6 +126,12 @@ other options have been processed. This will either have no effect (if
if they were not given. The property is therefore useless and should not be
specified.
+Plugin argument passing through ``arg=<string>`` (since 6.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Passing arguments through ``arg=`` is redundant is makes the command-line less
+readable, especially when the argument itself consist of a name and a value,
+e.g. ``arg="arg_name=arg_value"``. Therefore, the usage of ``arg`` is redundant.
QEMU Machine Protocol (QMP) commands
------------------------------------
--
2.25.1
3 years, 5 months
[PATCH v2 0/3] domstats:add haltpolling time statistic interface
by Yang Fei
This series add the ability to statistic the halt polling time when
VM execute HLT(arm is WFI).
v1:
https://listman.redhat.com/archives/libvir-list/2021-July/msg00029.html
changes from v1:
- Move virGetCgroupValueRaw to utils.c and rename it virGetValueRaw. So
that we can call it to obtain halt polling time.
- Helper function virGetCpuHaltPollTime and virGetDebugFsKvmValue are
added in a separate patch
- Use STRPREFIX to match the path prefix.
- Fix the logic that domstats will break when platform is non-linux,
debugfs isn't mounted and so on.
Yang Fei (3):
util: Move virGetCgroupValueRaw to vircgroup.c and rename it
virGetValueRaw
util: Add virGetCpuHaltPollTime and virGetDebugFsKvmValue
qemu: Introduce qemuDomainGetStatsCpuHaltPollTime
src/libvirt_private.syms | 2 +
src/qemu/qemu_driver.c | 28 +++++++++++
src/util/vircgroup.c | 29 +----------
src/util/vircgrouppriv.h | 3 --
src/util/vircgroupv1.c | 5 +-
src/util/vircgroupv2.c | 5 +-
src/util/virutil.c | 101 +++++++++++++++++++++++++++++++++++++++
src/util/virutil.h | 12 +++++
8 files changed, 151 insertions(+), 34 deletions(-)
--
2.23.0
3 years, 5 months
[libvirt PATCH 0/2] Tiny misc clean-ups
by Martin Kletzander
Some whitespaces were wrong and one debug message was confusing to newcomers.
Martin Kletzander (2):
util: Make one debug message nicer
whitespace clean-ups
docs/schemas/capability.rng | 10 +++++-----
src/conf/capabilities.c | 2 +-
src/util/virresctrl.c | 4 ++--
.../vircaps-x86_64-resctrl-fake-feature.xml | 4 ++--
tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
--
2.32.0
3 years, 5 months
[PATCH v2] nodedev: fix internal error when no defined mdevs exist
by Boris Fiuczynski
Commit e9b534905f4 introduced an error when parsing an empty list
returned from mdevctl.
This occurs e.g. if nodedev-undefine is used to undefine the last
defined mdev which cuases the following error messages
libvirtd[33143]: internal error: Unexpected format for mdevctl response
libvirtd[33143]: internal error: failed to query mdevs from mdevctl:
libvirtd[33143]: mdevctl failed to updated mediated devices
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
src/node_device/node_device_driver.c | 5 +++++
tests/nodedevmdevctldata/mdevctl-list-empty.json | 1 +
tests/nodedevmdevctldata/mdevctl-list-empty.out.xml | 0
tests/nodedevmdevctltest.c | 1 +
4 files changed, 7 insertions(+)
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-empty.json
create mode 100644 tests/nodedevmdevctldata/mdevctl-list-empty.out.xml
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index b4dd57e5f4..b16b05f9b2 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -1120,6 +1120,11 @@ nodeDeviceParseMdevctlJSON(const char *jsonstring,
goto error;
}
+ if (virJSONValueArraySize(json_devicelist) == 0) {
+ *devs = outdevs;
+ return 0;
+ }
+
/* mdevctl list --dumpjson produces an output that is an array that
* contains only a single object which contains a property for each parent
* device */
diff --git a/tests/nodedevmdevctldata/mdevctl-list-empty.json b/tests/nodedevmdevctldata/mdevctl-list-empty.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/tests/nodedevmdevctldata/mdevctl-list-empty.json
@@ -0,0 +1 @@
+[]
diff --git a/tests/nodedevmdevctldata/mdevctl-list-empty.out.xml b/tests/nodedevmdevctldata/mdevctl-list-empty.out.xml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c
index 8ba1d2da70..e246de4d87 100644
--- a/tests/nodedevmdevctltest.c
+++ b/tests/nodedevmdevctltest.c
@@ -360,6 +360,7 @@ mymain(void)
DO_TEST_LIST_DEFINED();
+ DO_TEST_PARSE_JSON("mdevctl-list-empty");
DO_TEST_PARSE_JSON("mdevctl-list-multiple");
DO_TEST_DEFINE("mdev_d069d019_36ea_4111_8f0a_8c9a70e21366");
--
2.31.1
3 years, 5 months
[PATCH 0/2] domcaps: Add support for 'memoryBacking' element
by Kristina Hanicova
virt-manager needs to know if memfd memory source type is supported in
order to use virtiofs.
Regarding:
https://listman.redhat.com/archives/virt-tools-list/2021-July/msg00000.html
Kristina Hanicova (2):
conf: domcaps: Report <memoryBacking>
qemu: capabilities: fill in domcaps <memoryBacking>
docs/formatdomaincaps.html.in | 28 +++++++++++++++++++
docs/schemas/domaincaps.rng | 10 +++++++
src/conf/domain_capabilities.c | 14 ++++++++++
src/conf/domain_capabilities.h | 8 ++++++
src/qemu/qemu_capabilities.c | 22 +++++++++++++++
src/qemu/qemu_capabilities.h | 3 ++
.../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 6 ++++
.../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml | 6 ++++
tests/domaincapsdata/qemu_2.11.0.s390x.xml | 6 ++++
tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 6 ++++
.../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 7 +++++
.../qemu_2.12.0-virt.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_2.12.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_3.0.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 7 +++++
.../qemu_4.0.0-virt.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_4.0.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 7 +++++
.../qemu_4.2.0-virt.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 7 +++++
.../qemu_5.0.0-virt.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_5.1.0.sparc.xml | 7 +++++
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 7 +++++
.../qemu_5.2.0-virt.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 7 +++++
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 7 +++++
tests/domaincapsdata/qemu_5.2.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_6.0.0.s390x.xml | 7 +++++
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 7 +++++
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 7 +++++
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 7 +++++
67 files changed, 508 insertions(+)
--
2.31.1
3 years, 5 months
[PATCH] ci: refresh cirrus variables for FreeBSD python rename
by Daniel P. Berrangé
All the python packages got renamed from py37- to py38-
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/cirrus/freebsd-12.vars | 4 ++--
ci/cirrus/freebsd-13.vars | 4 ++--
ci/cirrus/freebsd-current.vars | 4 ++--
ci/cirrus/macos-11.vars | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ci/cirrus/freebsd-12.vars b/ci/cirrus/freebsd-12.vars
index 40a19b5773..914ad417b9 100644
--- a/ci/cirrus/freebsd-12.vars
+++ b/ci/cirrus/freebsd-12.vars
@@ -2,7 +2,7 @@
#
# $ lcitool variables freebsd-12 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/1d4e10a04c6a0d29302003244a...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/a47008f1a77f92176b30729480...
PACKAGING_COMMAND='pkg'
CCACHE='/usr/local/bin/ccache'
@@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PYTHON='/usr/local/bin/python3'
PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
+PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py38-docutils py38-flake8 python3 qemu radvd readline yajl'
diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars
index f0270c70a4..58c18a2f36 100644
--- a/ci/cirrus/freebsd-13.vars
+++ b/ci/cirrus/freebsd-13.vars
@@ -2,7 +2,7 @@
#
# $ lcitool variables freebsd-13 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/1d4e10a04c6a0d29302003244a...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/a47008f1a77f92176b30729480...
PACKAGING_COMMAND='pkg'
CCACHE='/usr/local/bin/ccache'
@@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PYTHON='/usr/local/bin/python3'
PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
+PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py38-docutils py38-flake8 python3 qemu radvd readline yajl'
diff --git a/ci/cirrus/freebsd-current.vars b/ci/cirrus/freebsd-current.vars
index e4de22b302..1a5ac52cf9 100644
--- a/ci/cirrus/freebsd-current.vars
+++ b/ci/cirrus/freebsd-current.vars
@@ -2,7 +2,7 @@
#
# $ lcitool variables freebsd-current libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/1d4e10a04c6a0d29302003244a...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/a47008f1a77f92176b30729480...
PACKAGING_COMMAND='pkg'
CCACHE='/usr/local/bin/ccache'
@@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PYTHON='/usr/local/bin/python3'
PIP3='/usr/local/bin/pip-3.7'
-PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py37-docutils py37-flake8 python3 qemu radvd readline yajl'
+PKGS='augeas avahi bash-completion ca_root_nss ccache cppi curl cyrus-sasl dbus diffutils diskscrub dnsmasq fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py38-docutils py38-flake8 python3 qemu radvd readline yajl'
diff --git a/ci/cirrus/macos-11.vars b/ci/cirrus/macos-11.vars
index a723cdf927..73402bab8f 100644
--- a/ci/cirrus/macos-11.vars
+++ b/ci/cirrus/macos-11.vars
@@ -2,7 +2,7 @@
#
# $ lcitool variables macos-11 libvirt
#
-# https://gitlab.com/libvirt/libvirt-ci/-/commit/1d4e10a04c6a0d29302003244a...
+# https://gitlab.com/libvirt/libvirt-ci/-/commit/a47008f1a77f92176b30729480...
PACKAGING_COMMAND='brew'
CCACHE='/usr/local/bin/ccache'
--
2.31.1
3 years, 5 months
[PATCH v2 0/3] Do not erase duplicate devices from namespace
by Kristina Hanicova
This is v2 of:
https://listman.redhat.com/archives/libvir-list/2021-July/msg00129.html
Changes since v1 (suggested by Michal and Jano):
* change of int variable to one-word bool
* isolate changes outside of qemu to separate patch
* rewritten assignment of return value
* slight change of documentation
* extension of use to all devices, not just input
* @created variable is set in one core function instead of setting it in
each device function separately
Kristina Hanicova (3):
qemu: Check for existing file in namespace
virprocess: Return retval of the child on success, not 0
qemu: Do not erase duplicate devices from namespace if error occurs
src/qemu/qemu_domain.c | 4 +--
src/qemu/qemu_hotplug.c | 27 +++++----------
src/qemu/qemu_namespace.c | 71 +++++++++++++++++++++++++--------------
src/qemu/qemu_namespace.h | 18 ++++++----
src/qemu/qemu_process.c | 2 +-
src/util/virprocess.c | 12 ++++---
6 files changed, 75 insertions(+), 59 deletions(-)
--
2.31.1
3 years, 5 months