[PATCH 0/9] Introduce instant memory snapshots
by Nikolay Shirokovskiy
Hi, everyone.
The details for instant snapshot are given in main patch "qemu: support
instant snapshots". Here I only want to mention two moments.
First as instant snapshot API is synchronous we need to add an event
that snapshot moment in time is passed so that client is free to make
changes to guest. This way client can make use of instant snapshot while
memory is still being written to disk.
Second there is work in progress on adding asynchronous revert to
snapshot [1]. The idea is to write memory during snapshot in such a way
that it is possible to do a revert to snapshot in background. Namely
start guest on revert with only minimal amount of memory restored from
disk and then restore memory in background in postcopy migration
fashion. In order to make it possible snapshot memory should be written to
disk not just as plain migration stream. Thus the [1] patch adds
a special tool to write the migration stream during snapshot.
So if/when patch [1] will be merged I plan to add 'instant revert' mode
to snapshot too.
[1] [RFC PATCH v2 0/7] migration/snapshot: External snapshot utility
https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg03619.html
Nikolay Shirokovskiy (9):
qemu: make snap possibility check before pausing CPUS
qemu: snapshot: remove redundant flag setting
qemu: don't bother saving ret code from qemuDomainSaveMemory
qemu: move virQEMUSaveDataFree auto decl to header
qemu: factor out qemuDomainSnapshotSaveMemory
qemu: introduce qemuMigrationParamsSetCapability
qemu: support instant mode in qemuMigrationSrcToFile
qemu: support instant snapshots
virsh: add --instant flag to snapshot-create
docs/manpages/virsh.rst | 8 +-
include/libvirt/libvirt-domain-snapshot.h | 2 +
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_migration.c | 20 ++-
src/qemu/qemu_migration.h | 1 +
src/qemu/qemu_migration_params.c | 13 ++
src/qemu/qemu_migration_params.h | 5 +
src/qemu/qemu_saveimage.c | 4 +-
src/qemu/qemu_saveimage.h | 2 +
src/qemu/qemu_snapshot.c | 158 +++++++++++++++-------
tools/virsh-snapshot.c | 6 +
11 files changed, 162 insertions(+), 61 deletions(-)
--
2.27.0
3 years
[PATCH] virt-xml-validate: Add support for cpu and domaincheckpoint
by Han Han
Signed-off-by: Han Han <hhan(a)redhat.com>
---
tools/virt-xml-validate.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in
index 249bcf7eef..a818e2c3a5 100644
--- a/tools/virt-xml-validate.in
+++ b/tools/virt-xml-validate.in
@@ -77,6 +77,9 @@ if [ -z "$TYPE" ]; then
*domainsnapshot*) # Must come first, since *domain* is a substring
TYPE="domainsnapshot"
;;
+ *domaincheckpoint*)
+ TYPE="domaincheckpoint"
+ ;;
*domain*)
TYPE="domain"
;;
@@ -110,6 +113,9 @@ if [ -z "$TYPE" ]; then
*interface*)
TYPE="interface"
;;
+ *cpu*)
+ TYPE="cpu"
+ ;;
*)
echo "$0: cannot determine schema type for $XMLFILE" >&2
exit 3
--
2.33.1
3 years
[libvirt PATCH 00/13] cgroup and thread management in ch driver.
by Vineeth Pillai
This patchset adds support for cgroup management of ch threads. This version
correctly manages cgroups for vcpu and emulator threads created by ch. cgroup
management for iothreads is not yet supported.
Along with cgroup management, this patchset also enables support for pinning
vcpu and emulator threads to selected host cpus.
Praveen K Paladugu (2):
ch_process: Setup emulator and iothread settings
ch_driver: emulator threadinfo & pinning callbacks
Vineeth Pillai (11):
util: Helper functions to get process info
ch: Explicitly link to virt_util_lib
ch_domain: add virCHDomainGetMonitor helper method
ch_domain: add methods to manage private vcpu data
ch_driver,ch_domain: vcpu info getter callbacks
ch_driver: domainGetVcpuPinInfo and nodeGetCPUMap
ch_monitor: Get nicindexes in prep for cgroup mgmt
ch_cgroup: methods for cgroup mgmt in ch driver
ch_driver,ch_domain: vcpupin callback in ch driver
ch_driver: enable typed param string for numatune
ch_driver: add numatune callbacks for CH driver
po/POTFILES.in | 1 +
src/ch/ch_cgroup.c | 457 ++++++++++++++++++++++++
src/ch/ch_cgroup.h | 45 +++
src/ch/ch_conf.c | 2 +
src/ch/ch_conf.h | 9 +-
src/ch/ch_domain.c | 170 ++++++++-
src/ch/ch_domain.h | 32 +-
src/ch/ch_driver.c | 810 +++++++++++++++++++++++++++++++++++++++++-
src/ch/ch_monitor.c | 254 ++++++++++++-
src/ch/ch_monitor.h | 60 +++-
src/ch/ch_process.c | 368 ++++++++++++++++++-
src/ch/ch_process.h | 3 +
src/ch/meson.build | 6 +
src/util/virprocess.c | 136 +++++++
src/util/virprocess.h | 5 +
15 files changed, 2329 insertions(+), 29 deletions(-)
create mode 100644 src/ch/ch_cgroup.c
create mode 100644 src/ch/ch_cgroup.h
--
2.27.0
3 years
[PATCH 0/2] DEVICE_UNPLUG_GUEST_ERROR support
by Daniel Henrique Barboza
Hi,
This small series adds support to a new QMP event called
DEVICE_UNPLUG_GUEST_SUPPORT introduced recently in upstream QEMU.
This event is emitted when a device removal error is detected in the guest
side. Libvirt can use this event to to abort the removal operation
immediately instead of waiting for the operation to timeout.
Upstream QEMU is emitting this event in the following cases:
- memory removal errors in ACPI and pseries guests
- CPU removal errors in pseries guests
Adding support to DEVICE_UNPLUG_GUEST_ERROR will allow Libvirt to
detect all device removal errors that QEMU might add in the future.
The patches were tested using a common scenario where CPU removal will
fail everytime in a pseries guest:
- start a pseries guest with 1 CPU
- add one CPU
- offline vcpu0 in the guest kernel
- try to remove the recently added CPU (vcpu1). The kernel will refuse the
unplug because vcpu1 is the last online CPU
This test case will cause 'setvcpus' to hang until the timeout is fired:
[danielhb@ltc-boston118 build]$ sudo ./run tools/virsh setvcpus f34 1
error: Timed out during operation: vcpu unplug request timed out. Unplug result must be manually inspected in the domain
With this series applied, 'setvcpus' will report the error as soon as
the DEVICE_UNPLUG_GUEST_ERROR event is received:
[danielhb@ltc-boston118 build]$ sudo ./run tools/virsh setvcpus f34 1
error: operation failed: unplug of device was rejected by the guest
I haven't add any documentation because I didn't find a good place to
document this change, and I'm not sure if this is necessary either since
this doesn't change user ABI. If this requires a doc change please let
me know.
Daniel Henrique Barboza (2):
tests: update QEMU and domain ppc64 capabilities for qemu 6.2
qemu: add DEVICE_UNPLUG_GUEST_ERROR event support
src/qemu/qemu_monitor.c | 12 +
src/qemu/qemu_monitor.h | 9 +
src/qemu/qemu_monitor_json.c | 19 +
src/qemu/qemu_process.c | 37 +
tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 138 +
.../caps_6.2.0.ppc64.replies | 31062 ++++++++++++++++
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1167 +
...default-video-type-ppc64.ppc64-latest.args | 13 +-
...ault-cpu-kvm-pseries-2.7.ppc64-latest.args | 13 +-
...ault-cpu-kvm-pseries-3.1.ppc64-latest.args | 13 +-
...ault-cpu-kvm-pseries-4.2.ppc64-latest.args | 13 +-
...ault-cpu-tcg-pseries-2.7.ppc64-latest.args | 13 +-
...ault-cpu-tcg-pseries-3.1.ppc64-latest.args | 13 +-
...ault-cpu-tcg-pseries-4.2.ppc64-latest.args | 13 +-
.../ppc64-pseries-graphics.ppc64-latest.args | 29 +-
.../ppc64-pseries-headless.ppc64-latest.args | 23 +-
.../ppc64-tpmproxy-single.ppc64-latest.args | 11 +-
.../ppc64-tpmproxy-with-tpm.ppc64-latest.args | 13 +-
.../tpm-emulator-spapr.ppc64-latest.args | 19 +-
19 files changed, 32531 insertions(+), 99 deletions(-)
create mode 100644 tests/domaincapsdata/qemu_6.2.0.ppc64.xml
create mode 100644 tests/qemucapabilitiesdata/caps_6.2.0.ppc64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml
--
2.31.1
3 years
[PATCH 0/4] Misc style cleanups
by Michal Privoznik
This is all done in preparation for dropping needless labels such as:
cleanup:
return ret;
I'll post that patch as soon as these are merged.
Michal Prívozník (4):
virNetDevVPortProfileParse: Use g_autofree
examples/dommigrate: Don't set retval in usage()
examples/dommigrate: Make retval portable
virsh: Remove unnecessary else branches
examples/c/domain/dommigrate.c | 11 +++++-----
src/conf/netdev_vport_profile_conf.c | 30 +++++++++-----------------
tools/virsh-nodedev.c | 5 ++---
tools/virsh-volume.c | 32 +++++++++++++---------------
4 files changed, 32 insertions(+), 46 deletions(-)
--
2.32.0
3 years
[libvirt PATCH] [RFC] scripts: Check spelling
by Tim Wiederhake
This is a wrapper for codespell [1], a spell checker for source code.
Codespell does not compare words to a dictionary, but rather works by
checking words against a list of common typos, making it produce fewer
false positives than other solutions.
The script in this patch works around the lack of per-directory ignore
lists and some oddities regarding capitalization in ignore lists.
[1] (https://github.com/codespell-project/codespell/)
RFC:
Is there interest in having something like this in CI?
Examples of spelling mistakes that were found using codespell:
4ad3c95f4bef5c7c9657de470fb74a4d14c8a331,
785a11cec8693de7df024aae68975dd1799b646a,
1452317b5c727eb17178942012f57f0c37631ae4.
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
scripts/check-spelling.py | 115 ++++++++++++++++++++++++++++++++++++++
1 file changed, 115 insertions(+)
create mode 100755 scripts/check-spelling.py
diff --git a/scripts/check-spelling.py b/scripts/check-spelling.py
new file mode 100755
index 0000000000..01371c0d1e
--- /dev/null
+++ b/scripts/check-spelling.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python3
+
+import argparse
+import re
+import subprocess
+import os
+
+
+IGNORE_LIST = [
+ # ignore all translation files
+ ("/po/", []),
+
+ # ignore this script
+ ("/scripts/check-spelling.py", []),
+
+ # 3rd-party: keycodemapdb
+ ("/src/keycodemapdb/", []),
+
+ # 3rd-party: VirtualBox SDK
+ ("/src/vbox/vbox_CAPI", [
+ "aAdd",
+ "aCount",
+ "aLocation",
+ "aNumber",
+ "aParent",
+ "progess"]),
+
+ # 3rd-party: qemu
+ ("/tests/qemucapabilitiesdata/caps_", "encyption"),
+
+ # other
+ ("/", ["msdos", "MSDOS", "wan", "WAN", "hda", "HDA", "inout"]),
+ ("/NEWS.rst", ["crashers"]),
+ ("/docs/gitdm/companies/others", "Archiv"),
+ ("/docs/glib-adoption.rst", ["preferrable"]),
+ ("/docs/js/main.js", "whats"),
+ ("/examples/polkit/libvirt-acl.rules", ["userA", "userB", "userC"]),
+ ("/src/libvirt-domain.c", "PTD"),
+ ("/src/libxl/libxl_logger.c", ["purposedly"]),
+ ("/src/nwfilter/nwfilter_dhcpsnoop.c", "ether"),
+ ("/src/nwfilter/nwfilter_ebiptables_driver.c", "parm"),
+ ("/src/nwfilter/nwfilter_learnipaddr.c", "ether"),
+ ("/src/qemu/qemu_agent.c", "crypted"),
+ ("/src/qemu/qemu_agent.h", "crypted"),
+ ("/src/security/apparmor/libvirt-lxc", "devic"),
+ ("/src/security/apparmor/libvirt-qemu", "readby"),
+ ("/src/storage_file/storage_file_probe.c", "conectix"),
+ ("/src/util/virnetdevmacvlan.c", "calld"),
+ ("/src/util/virtpm.c", "parm"),
+ ("/tests/qemuagenttest.c", "IST"),
+ ("/tests/storagepoolxml2xml", "cant"),
+ ("/tests/sysinfodata/", ["sie"]),
+ ("/tests/testutils.c", ["nIn"]),
+ ("/tests/vircgroupdata/ovirt-node-6.6.mounts", "hald"),
+ ("/tests/virhostcpudata/", ["sie"]),
+ ("/tools/virt-host-validate-common.c", ["sie"]),
+]
+
+
+def check_spelling(directory):
+ """Returns list of tuple(filename, line number, word, suggestion)."""
+ process = subprocess.run(
+ ["codespell", directory],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ universal_newlines=True)
+
+ if process.returncode not in (0, 65):
+ exit("error: unexpected returncode %s" % process.returncode)
+
+ if process.stderr:
+ exit("error: unexpected output to stderr: \"%s\"" % process.stderr)
+
+ line_pattern = re.compile("^(.*):(.*): (.*) ==> (.*)$")
+ for line in process.stdout.split("\n"):
+ line = line.strip().replace(directory, "")
+ if not line:
+ continue
+ match = line_pattern.match(line)
+ if not match:
+ exit("error: unexpected line: \"%s\"" % line)
+ yield match.groups()
+
+
+def ignore(filename, linenumber, word, suggestion):
+ # Ignore abbreviations and ad-hoc variable names
+ if len(word) <= 2:
+ return True
+
+ for f, w in IGNORE_LIST:
+ if not filename.startswith(f):
+ continue
+ if word in w or not w:
+ return True
+ return False
+
+
+def main():
+ parser = argparse.ArgumentParser(description="Check spelling")
+ parser.add_argument(
+ "dir",
+ help="Path to source directory",
+ type=os.path.realpath)
+ args = parser.parse_args()
+
+ findings = [f for f in check_spelling(args.dir) if not ignore(*f)]
+ if findings:
+ template = "(\"{0}\", \"{2}\"),\t# line {1}, \"{3}\"?"
+ for finding in findings:
+ print(template.format(*finding))
+ exit("error: %s spelling errors" % len(findings))
+
+
+if __name__ == "__main__":
+ main()
--
2.31.1
3 years
[PATCH 0/4] qemu_agent: Rework domain object handling in open
by Michal Privoznik
The most important patch is the first one because it fixes a race
condition. The rest is just a cleanup I've noticed while looking at the
code.
Michal Prívozník (4):
qemu_agent: Rework domain object locking when opening agent
qemuAgentOpen: Rework domain object refcounting
qemu_agent: Drop destroy callback
qemuMonitorOpen: Rework domain object refcounting
src/qemu/qemu_agent.c | 17 ++++++++---------
src/qemu/qemu_agent.h | 2 --
src/qemu/qemu_monitor.c | 5 -----
src/qemu/qemu_process.c | 20 --------------------
4 files changed, 8 insertions(+), 36 deletions(-)
--
2.32.0
3 years
[libvirt PATCH 0/2] improve audio device compat handling on migration
by Daniel P. Berrangé
Avoid being over-eager in stripping <audio> elements.
This still isn't ideal, because if a user happened to provide an audio
config that *exactly* matches the libvirt historical default we'll
still strip it.
Thinking that maybe libvirt should advertize feature flags in te
migration cookies.
eg if the QEMU driver on the target host reports "explicit-audiodev",
then te source host knows it doesn't need to strip it out to migrate
to this host. If it doesn't report it, then it knows it must be an
older libvirt version pre-dating audiodev.
Daniel P. Berrangé (2):
conf: add helper for comparing virDomainAudioDef objects
qemu: don't strip audio elements with user config present
src/conf/domain_conf.c | 144 +++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 72 +++++++++++---------
4 files changed, 188 insertions(+), 32 deletions(-)
--
2.31.1
3 years
[PATCH v2 0/3] Add virt-pki-query-dn binary
by Martin Kletzander
v2:
- do not use err*() functions
- fix missing include dir in meson.build
Patches 2 and 3 are reviewed.
Martin Kletzander (3):
tools: Add virt-pki-query-dn binary
Add suggestions for virt-pki-query-dn usage
news: Mention the addition of virt-pki-query-dn binary
NEWS.rst | 6 ++
docs/remote.html.in | 4 +
libvirt.spec.in | 1 +
po/POTFILES.in | 1 +
src/remote/libvirtd.conf.in | 5 ++
src/rpc/virnettlscontext.c | 2 +-
tests/virconfdata/libvirtd.conf | 4 +
tests/virconfdata/libvirtd.out | 4 +
tools/meson.build | 27 ++++++
tools/virt-pki-query-dn.c | 140 ++++++++++++++++++++++++++++++++
10 files changed, 193 insertions(+), 1 deletion(-)
create mode 100644 tools/virt-pki-query-dn.c
--
2.33.1
3 years
[PATCH 0/6] Add virt-pki-query-dn binary
by Martin Kletzander
*** BLURB HERE ***
Martin Kletzander (6):
rpc: Resize dname for longer DN from TLS certs
tools: Add virt-pki-query-dn binary
docs: Simplify explanation of tls_allowed_dn_list wildcards
Remove needless space
Add suggestions for virt-pki-query-dn usage
news: Mention the addition of virt-pki-query-dn binary
NEWS.rst | 6 ++
docs/remote.html.in | 8 +-
libvirt.spec.in | 1 +
po/POTFILES.in | 1 +
src/remote/libvirtd.conf.in | 7 +-
src/rpc/virnettlscontext.c | 22 ++---
tests/virconfdata/libvirtd.conf | 9 ++-
tests/virconfdata/libvirtd.out | 9 ++-
tools/meson.build | 26 ++++++
tools/virt-pki-query-dn.c | 137 ++++++++++++++++++++++++++++++++
10 files changed, 207 insertions(+), 19 deletions(-)
create mode 100644 tools/virt-pki-query-dn.c
--
2.33.1
3 years