[libvirt PATCH] cpu-data.py: Query hyperv enlightenments
by Tim Wiederhake
Reporting hv-* properties properly requires hv to be enabled,
see qemu commit 071ce4b03b.
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
tests/cputestdata/cpu-data.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py
index d8a89ebc2a..0200db7a78 100755
--- a/tests/cputestdata/cpu-data.py
+++ b/tests/cputestdata/cpu-data.py
@@ -216,12 +216,19 @@ def gather_model(args):
"id": "model-expansion"
}])
+ version = 0, 0
static_model = None
for o in output:
if o.get("id") == "model-expansion":
static_model = o["return"]["model"]
+ if "QMP" in o:
+ version = o["QMP"]["version"]["qemu"]
+ version = version["major"], version["minor"]
if static_model:
+ if version[0] > 6 or (version[0] == 6 and version[1] >= 1):
+ static_model["props"]["hv-passthrough"] = True
+
return call_qemu(args.path_to_qemu, [
{
"execute": "query-cpu-model-expansion",
--
2.31.1
2 years, 8 months
[PATCH v2] virProcessGetStatInfo: add a comment describing why we can not report error
by Ani Sinha
virProcessGetStatInfo() currently is unable to report error conditions because
that breaks libvirt's public best effort APIs. We add a comment in the function
to indicate this. Adding comment here prevents others from going down the path
of reporting error conditions in this functions in the future. It also reminds
us that at some point in the future we need to fix the code so that this
limitations no longer exists.
Please also see commit
105dace22cc7 ("Revert "report error when virProcessGetStatInfo() is unable to parse data"")
Signed-off-by: Ani Sinha <ani(a)anisinha.ca>
---
src/util/virprocess.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index b559a4257e..9422829b8b 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -1784,6 +1784,12 @@ virProcessGetStatInfo(unsigned long long *cpuTime,
virStrToLong_ullp(proc_stat[VIR_PROCESS_STAT_STIME], NULL, 10, &systime) < 0 ||
virStrToLong_l(proc_stat[VIR_PROCESS_STAT_RSS], NULL, 10, &rss) < 0 ||
virStrToLong_i(proc_stat[VIR_PROCESS_STAT_PROCESSOR], NULL, 10, &cpu) < 0) {
+ /* This function can not report error at present. Reporting error here
+ * causes some of libvirt's best effort public APIs to fail. This
+ * resuts in external API behavior change. Until we can fix this in
+ * a way so that public API behavior remains unchanged, we can only
+ * write a warning log here.
+ */
VIR_WARN("cannot parse process status data");
}
--
2.25.1
2 years, 8 months
[PATCH 0/3] src: use virDomainJobData
by Kristina Hanicova
This series is the continued rewriting of the jobs functions with more
to come in the future.
Kristina Hanicova (3):
qemu: use generalized virDomainJobData instead of qemuDomainJobInfo
qemu: make separate function for setting statsType of privateData
libxl: use virDomainJobData instead of virDomainJobInfo
src/hypervisor/domain_job.c | 78 +++++++++++
src/hypervisor/domain_job.h | 72 ++++++++++
src/hypervisor/meson.build | 1 +
src/libvirt_private.syms | 7 +
src/libxl/libxl_domain.c | 10 +-
src/libxl/libxl_domain.h | 3 +-
src/libxl/libxl_driver.c | 14 +-
src/qemu/qemu_backup.c | 40 +++---
src/qemu/qemu_backup.h | 4 +-
src/qemu/qemu_domain.c | 8 ++
src/qemu/qemu_domain.h | 3 +
src/qemu/qemu_domainjob.c | 227 +++++++++++++++----------------
src/qemu/qemu_domainjob.h | 54 ++------
src/qemu/qemu_driver.c | 109 ++++++++-------
src/qemu/qemu_migration.c | 187 +++++++++++++------------
src/qemu/qemu_migration.h | 4 +-
src/qemu/qemu_migration_cookie.c | 60 ++++----
src/qemu/qemu_migration_cookie.h | 2 +-
src/qemu/qemu_process.c | 23 ++--
src/qemu/qemu_snapshot.c | 3 +-
20 files changed, 539 insertions(+), 370 deletions(-)
create mode 100644 src/hypervisor/domain_job.c
create mode 100644 src/hypervisor/domain_job.h
--
2.34.1
2 years, 8 months
[libvirt PATCH] include: Fix documentation for various VIR_*_LAST values
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
include/libvirt/libvirt-domain.h | 6 +++---
include/libvirt/libvirt-secret.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 4da1a63a14..374859fdff 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -62,7 +62,7 @@ typedef enum {
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_LAST
/*
- * NB: this enum value will increase over time as new events are
+ * NB: this enum value will increase over time as new states are
* added to the libvirt API. It reflects the last state supported
* by this version of the libvirt API.
*/
@@ -696,7 +696,7 @@ typedef enum {
VIR_DOMAIN_CORE_DUMP_FORMAT_LAST
/*
* NB: this enum value will increase over time as new formats are
- * added to the libvirt API. It reflects the last state supported
+ * added to the libvirt API. It reflects the last format supported
* by this version of the libvirt API.
*/
# endif
@@ -2909,7 +2909,7 @@ typedef enum {
# ifdef VIR_ENUM_SENTINELS
VIR_KEYCODE_SET_LAST
/*
- * NB: this enum value will increase over time as new events are
+ * NB: this enum value will increase over time as new keycode sets are
* added to the libvirt API. It reflects the last keycode set supported
* by this version of the libvirt API.
*/
diff --git a/include/libvirt/libvirt-secret.h b/include/libvirt/libvirt-secret.h
index a75abc832a..82e18b8611 100644
--- a/include/libvirt/libvirt-secret.h
+++ b/include/libvirt/libvirt-secret.h
@@ -48,9 +48,9 @@ typedef enum {
# ifdef VIR_ENUM_SENTINELS
VIR_SECRET_USAGE_TYPE_LAST
/*
- * NB: this enum value will increase over time as new events are
- * added to the libvirt API. It reflects the last secret owner ID
- * supported by this version of the libvirt API.
+ * NB: this enum value will increase over time as new usage types are
+ * added to the libvirt API. It reflects the last usage type supported
+ * by this version of the libvirt API.
*/
# endif
} virSecretUsageType;
--
2.34.1
2 years, 8 months
Backend memory object creation - query
by M, Shivakumar
Hello,
For our use-case with Libvirt we want to create the Memory backend object ,
Expected QEMU args would be
-object memory-backend-memfd,id=mem1,size=4096M
Request you to please help us to specify this arg in the libvirt XML.
Thanks,
Shiv
2 years, 8 months
[PATCH v2 0/3] Fix hotplug of unassigned hostdevs
by Michal Privoznik
v2 of:
https://listman.redhat.com/archives/libvir-list/2022-January/msg01111.html
Patches 1/3 and 2/3 were ACKed but I'm sending them for completeness.
diff to v1:
- Reworked patch 3/3
Michal Prívozník (3):
domain_validate: Refuse VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED
qemuDomainAttachHostPCIDevice: Handle hostevs with unassigned type of
address
qemuDomainDetachDeviceLive: Handle hostevs with unassigned type of
address
src/conf/domain_validate.c | 45 ++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_hotplug.c | 11 ++++++++++
2 files changed, 56 insertions(+)
--
2.34.1
2 years, 8 months
[libvirt PATCH 0/5] meson: Fixes and improvements to handling of qemu_user and qemu_group
by Andrea Bolognani
Mostly reported/suggested by Olaf.
Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/456827585
Ignore the macOS failure, which is caused by a transient network
error on GitLab's part. I have verified manually that the default
values are still the ones we expect.
Andrea Bolognani (5):
meson: Don't require /etc/os-release to be present
meson: Check for os-release's ID_LIKE in addition to ID
meson: Don't check whether qemu_user and qemu_group exist
meson: Require that both qemu_user and qemu_group are provided
meson: Optimize handling of qemu_user and qemu_group
meson.build | 68 ++++++++++++++++++++++-------------------------------
1 file changed, 28 insertions(+), 40 deletions(-)
--
2.34.1
2 years, 8 months
[PATCH v2 0/6] support mode option for dirtyrate calculation
by huangy81@chinatelecom.cn
From: Hyman Huang(黄勇) <huangy81(a)chinatelecom.cn>
v2:
Rebase master and fix confilicts with commit
"Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_PREALLOC"
Thanks !
v1:
This patchset introduce mode option as the supplement of
qemuDomainStartDirtyRateCalc api, add calc_mode for dirtyrate
statistics correspondingly.
Qemu add mode parameter for calc-dirty-rate command since >= 6.2.0,
either of these three mode "page-sampling, dirty-bitmap, dirty-ring"
can be specified when calculating dirty page rate.
Page sampling is the original mode and used as default mode.
Dirty bitmap mode use kvm log sync api to fetch the dirty-bitmap
and count the increased 1 bits number during measurement, thus,
calculate the dirty page rate.
Dirty ring mode use the dirty-ring mechanism implemented in Qemu
which can count the increased dirty page on virtual cpu granularity,
thus, calculate the per-vcpu dirty page rate.
These three calculation mode can be used in different scenarios, and
the dirty-bitmap, dirty-ring mode may be more accurate to a certain
degree. So maybe it's time to support the mode option for dirtyrate
calculation.
This series make main modifications as the following:
1. introduce QEMU_CAPS_CALC_DIRTY_RATE capability to probe
calc-dirty-rate command in case of failure since it just
introduced since >= 5.2.0
2. introduce QEMU_CAPS_DIRTYRATE_MODE capability to probe
mode option of calc-dirty-rate command in case of failure, same
as 1.
3. implement mode option support for dirtyrate calculation.
Please review, thanks !
Best Regards !
Hyman Huang(黄勇) (6):
qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability
qemu_driver: Probe capability before calculating dirty page rate
qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability
qemu_driver: Add mode option for qemuDomainStartDirtyRateCalc
virsh: Extend domdirtyrate-calc virsh api
qemu_driver: Add calc_mode for dirtyrate statistics
docs/manpages/virsh.rst | 7 +-
include/libvirt/libvirt-domain.h | 13 ++++
src/libvirt-domain.c | 17 ++++-
src/qemu/qemu_capabilities.c | 4 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_driver.c | 59 ++++++++++++++++-
src/qemu/qemu_monitor.c | 5 +-
src/qemu/qemu_monitor.h | 20 +++++-
src/qemu/qemu_monitor_json.c | 78 +++++++++++++++++++++--
src/qemu/qemu_monitor_json.h | 3 +-
tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml | 2 +
tools/virsh-domain.c | 28 +++++++-
25 files changed, 239 insertions(+), 15 deletions(-)
--
1.8.3.1
2 years, 8 months
[PATCH v1 0/6] support mode option for dirtyrate calculation
by huangy81@chinatelecom.cn
From: Hyman Huang(黄勇) <huangy81(a)chinatelecom.cn>
v1:
This patchset introduce mode option as the supplement of
qemuDomainStartDirtyRateCalc api, add calc_mode for dirtyrate
statistics correspondingly.
Qemu add mode parameter for calc-dirty-rate command since >= 6.2.0,
either of these three mode "page-sampling, dirty-bitmap, dirty-ring"
can be specified when calculating dirty page rate.
Page sampling is the original mode and used as default mode.
Dirty bitmap mode use kvm log sync api to fetch the dirty-bitmap
and count the increased 1 bits number during measurement, thus,
calculate the dirty page rate.
Dirty ring mode use the dirty-ring mechanism implemented in Qemu
which can count the increased dirty page on virtual cpu granularity,
thus, calculate the per-vcpu dirty page rate.
These three calculation mode can be used in different scenarios, and
the dirty-bitmap, dirty-ring mode may be more accurate to a certain
degree. So maybe it's time to support the mode option for dirtyrate
calculation.
This series make main modifications as the following:
1. introduce QEMU_CAPS_CALC_DIRTY_RATE capability to probe
calc-dirty-rate command in case of failure since it just
introduced since >= 5.2.0
2. introduce QEMU_CAPS_DIRTYRATE_MODE capability to probe
mode option of calc-dirty-rate command in case of failure, same
as 1.
3. implement mode option support for dirtyrate calculation.
Please review, thanks !
Best Regards !
Hyman Huang(黄勇) (6):
qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability
qemu_driver: Probe capability before calculating dirty page rate
qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability
qemu_driver: Add mode option for qemuDomainStartDirtyRateCalc
virsh: Extend domdirtyrate-calc virsh api
qemu_driver: Add calc_mode for dirtyrate statistics
docs/manpages/virsh.rst | 7 +-
include/libvirt/libvirt-domain.h | 13 ++++
src/libvirt-domain.c | 17 ++++-
src/qemu/qemu_capabilities.c | 4 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_driver.c | 59 ++++++++++++++++-
src/qemu/qemu_monitor.c | 5 +-
src/qemu/qemu_monitor.h | 20 +++++-
src/qemu/qemu_monitor_json.c | 78 +++++++++++++++++++++--
src/qemu/qemu_monitor_json.h | 3 +-
tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_6.2.0.x86_64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 +
tests/qemucapabilitiesdata/caps_7.0.0.x86_64.xml | 2 +
tools/virsh-domain.c | 28 +++++++-
25 files changed, 239 insertions(+), 15 deletions(-)
--
1.8.3.1
2 years, 8 months
[libvirt PATCH] virsh: domsetlaunchsecstate: mark options as mandatory
by Ján Tomko
We exit if they are not present.
Let the virsh option parser do the checking instead of checking
it manually. Change the type to OT_DATA (i.e. a mandatory string),
mark them as required and remove VSH_OFLAG_REQ_OPT so that the
header file and the secret file can be specified without the option
names.
https://bugzilla.redhat.com/show_bug.cgi?id=2046024
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
tools/virsh-domain.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b56f6a90f5..d279af68b2 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9587,13 +9587,13 @@ static const vshCmdInfo info_domsetlaunchsecstate[] = {
static const vshCmdOptDef opts_domsetlaunchsecstate[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "secrethdr",
- .type = VSH_OT_STRING,
- .flags = VSH_OFLAG_REQ_OPT,
+ .type = VSH_OT_DATA,
+ .flags = VSH_OFLAG_REQ,
.help = N_("path to file containing the secret header"),
},
{.name = "secret",
- .type = VSH_OT_STRING,
- .flags = VSH_OFLAG_REQ_OPT,
+ .type = VSH_OT_DATA,
+ .flags = VSH_OFLAG_REQ,
.help = N_("path to file containing the secret"),
},
{.name = "set-address",
@@ -9627,9 +9627,6 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshCmd * cmd)
if (vshCommandOptStringReq(ctl, cmd, "secret", &secfile) < 0)
return false;
- if (sechdrfile == NULL || secfile == NULL)
- return false;
-
if (virFileReadAll(sechdrfile, 1024*64, &sechdr) < 0) {
vshSaveLibvirtError();
return false;
--
2.31.1
2 years, 8 months