[libvirt PATCH] NEWS: fix even more typos
by Ján Tomko
From: Ján Tomko <jtomko(a)redhat.com>
The 'editting one' was:
Reported-by: Martin Kletzander <mkletzan(a)redhat.com>
I found the rest myself.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
NEWS.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/NEWS.rst b/NEWS.rst
index 484333e55a..6ab34aa756 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -31,7 +31,7 @@ v11.2.0 (unreleased)
* qemu: Add support for multiple iothreads for ``virtio-scsi`` controller
- It's now possible to map multiple iotreads to the ``virtio-scsi`` controller
+ It's now possible to map multiple iothreads to the ``virtio-scsi`` controller
or even map them to specific virtqueues similarly to the ``virtio-blk``
device allowing for better performance in certain scenarios.
@@ -45,10 +45,10 @@ v11.2.0 (unreleased)
a host shutdown has been requested. It will initiate the chosen action on
running guests immediately, allowing shutdown inhibitors to be released
sooner. The new solution is also able to iteratively try multiple actions
- until one of them succeeeds in shutting down the VM.
+ until one of them succeeds in shutting down the VM.
Since it must be mutually exclusive with the libvirt-guests script, this
- feature currently requires an manual opt-in through editting of the
+ feature currently requires an manual opt-in through editing of the
/etc/libvirt/qemu.conf configuration file. The libvirt-guests script must
be disabled before doing this.
--
2.49.0
1 week, 4 days
[PATCH 0/8] qemu: Improve guest agent corner case errors
by Peter Krempa
This series introduces two new error codes aimed to help management
applications to better in deciding when corner cases of guest agent
interaction are encountered.
Peter Krempa (8):
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_TIMEOUT'
qemu: agent: Differentiate timeouts when syncing from command timeout
qemuAgentCommandFull: Use VIR_ERR_AGENT_COMMAND_TIMEOUT when agent
disappears
docs: Point to VIR_ERR_AGENT_COMMAND_TIMEOUT when setting timeout
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_FAILED'
qemuAgentCheckError: Use 'VIR_ERR_AGENT_COMMAND_FAILED'
qemuAgentCheckError: Rewort error if neither return nor error is found
NEWS: Mention guest agent error code improvements
NEWS.rst | 10 ++++++++++
docs/manpages/virsh.rst | 3 +++
include/libvirt/virterror.h | 4 ++++
src/libvirt-domain.c | 4 ++++
src/qemu/qemu_agent.c | 32 +++++++++++++++++++++-----------
src/util/virerror.c | 6 ++++++
6 files changed, 48 insertions(+), 11 deletions(-)
--
2.48.1
1 week, 4 days
[PATCH] NEWS: Mention support for mapped-ram
by Jim Fehlig
Add a 'New features' entry for mapped-ram itself, and another
for the parallel save/restore feature built on top.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
NEWS.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 484333e55a..76f7ea65b1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -52,6 +52,21 @@ v11.2.0 (unreleased)
/etc/libvirt/qemu.conf configuration file. The libvirt-guests script must
be disabled before doing this.
+ * qemu: Add 'sparse' as a new save image format
+
+ QEMU's ``file`` migration has been supplemented with the new stream format
+ ``mapped-ram``, where RAM pages are mapped directly to offsets in the
+ migration file. ``mapped-ram`` is now supported by augmenting the existing
+ save image formats with the ``sparse`` format.
+
+ * qemu: Add support for parallel save/restore
+
+ The ``sparse`` image format can support reading and writing by multiple
+ channels. ``virDomainSaveParams`` and ``virDomainRestoreParams`` now
+ support specifying the number of IO channels used for parallel save and
+ restore. Using multiple channels can reduce the time required to save
+ and restore domains.
+
* **Improvements**
* **Bug fixes**
--
2.43.0
1 week, 4 days
[PATCH 0/2] qemu: Build fixes following merge of mapped-ram
by Jim Fehlig
Patches to fix the recent build failures caused by merging the mapped-ram
series. They get a green light from a CI run in my fork
https://gitlab.com/jfehlig/libvirt/-/pipelines/1727301916
I would push them as build-breakers, but the first one does raise a
question that should be answered beforehand IMO. See the individual
patches for more commentary. Also, feel free to push if the patches
are fine and it's outside of MDT timezone working hours :-).
Jim Fehlig (2):
qemu: Fix CLang build
qemu: Fix build on 32-bit platforms
src/qemu/qemu_migration_params.c | 2 +-
src/qemu/qemu_monitor.c | 4 ++--
src/qemu/qemu_process.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--
2.43.0
1 week, 4 days
[PATCH] Add NEWS item for auto-shutdown feature
by Daniel P. Berrangé
From: Daniel P. Berrangé <berrange(a)redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
NEWS.rst | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 98ca838642..45d48c1485 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -35,6 +35,23 @@ v11.2.0 (unreleased)
or even map them to specific virtqueues similarly to the ``virtio-blk``
device allowing for better performance in certain scenarios.
+ * qemu: integrate support for VM shutdown on host shutdown
+
+ It is now possible to instruct the QEMU driver to automatically perform
+ managed save, graceful shutdown, or hard poweroff on running VMs, when a
+ host shutdown is requested. This feature is intended to eventually replace
+ usage of the libvirt-guests script. The new approach improves on the
+ libvirt-guests script, by proactively monitor logind for a signal that a
+ host shutdown has been requested. It will initiate the chosen action on
+ running guests immediately, allowing shutdown inhibitors to be released
+ sooner. The new solution is also able to iteratively try multiple actions
+ until one of them succeeeds in shutting down the VM.
+
+ Since it must be mutually exclusive with the libvirt-guests script, this
+ feature currently requires an manual opt-in through editting of the
+ /etc/libvirt/qemu.conf configuration file. The libvirt-guests script must
+ be disabled before doing this.
+
* **Improvements**
* **Bug fixes**
--
2.48.1
1 week, 4 days
[PATCH] virsh: make virshPrintJobProgress tty-aware
by Vincent Caron
virshPrintJobProgress pretty-prints a migration progress indicator on
stderr presuming it's tied to a tty, which is not always true.
In the case without the tty, I still find the progress indication useful
(for instance it ends in a timestamped log, which is useful for
debug/perf analysis). And most log processings are line-buffered, thus
it won't properly work until every progress update ends with a newline.
I had a quick glance and did not find any other place in virsh code
where a tty was assumed, thus I thought this tty-awareness could be
narrowed to this single function.
This was originally submited as
https://gitlab.com/libvirt/libvirt/-/issues/756
Signed-off-by: Vincent Caron <vcaron(a)bearstech.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 1bee969824..577ab57158 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2108,7 +2108,7 @@ virshPrintJobProgress(const char *label, unsigned long long remaining,
/* see comments in vshError about why we must flush */
fflush(stdout);
/* avoid auto-round-off of double by keeping only 2 decimals */
- fprintf(stderr, "\r%s: [%5.2f %%]", label, (int)(progress*100)/100.0);
+ fprintf(stderr, isatty(STDERR_FILENO) ? "\r%s: [%5.2f %%]" : "%s: [%5.2f %%]\n", label, (int)(progress*100)/100.0);
fflush(stderr);
}
--
2.39.5
1 week, 5 days
[PATCH v9 reviewed 00/17] qemu: block: Support block disk along with throttle filters
by Peter Krempa
v9 of the throttle filtering series with my reviews and R-b tags
applied.
Requires
[PATCH 0/5] qemu: Two block job fixes
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/T...
to be applied to work properly.
Posting for tracking and possibly final review of API. I'll push it
before the freeze if there won't be further comments.
Changes (most recorded in commit messages):
- removed leftover code after deletion of some of the APIs
- fixed numerous memleaks
- simplified virsh code
- dropped test driver pach
Chun Feng Wu (16):
schema: Add new domain elements to support multiple throttle groups
schema: Add new domain elements to support multiple throttle filters
config: Introduce ThrottleGroup and corresponding XML parsing
config: Introduce ThrottleFilter and corresponding XML parsing
qemu: monitor: Add support for ThrottleGroup operations
tests: Test qemuMonitorJSONGetThrottleGroup and
qemuMonitorJSONUpdateThrottleGroup
remote: New APIs for ThrottleGroup lifecycle management
qemu: Refactor qemuDomainSetBlockIoTune to extract common methods
qemu: Implement qemu driver for throttle API
qemu: helper: throttle filter nodename and preparation processing
qemu: block: Support block disk along with throttle filters
config: validate: Verify iotune, throttle group and filter
qemuxmlconftest: Add 'throttlefilter' tests
virsh: Refactor iotune options for re-use
virsh: Add support for throttle group operations
virsh: Add option "throttle-groups" to "attach_disk"
Harikumar Rajkumar (1):
qemustatusxml2xmldata: Add 'throttlefilter' tests
docs/formatdomain.rst | 47 ++
docs/manpages/virsh.rst | 137 +++-
include/libvirt/libvirt-domain.h | 14 +
src/conf/domain_conf.c | 409 +++++++++++
src/conf/domain_conf.h | 47 ++
src/conf/domain_validate.c | 124 +++-
src/conf/schemas/domaincommon.rng | 293 ++++----
src/conf/virconftypes.h | 4 +
src/driver-hypervisor.h | 14 +
src/libvirt-domain.c | 122 +++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_block.c | 136 ++++
src/qemu/qemu_block.h | 49 ++
src/qemu/qemu_command.c | 171 +++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 77 +-
src/qemu/qemu_driver.c | 467 +++++++++---
src/qemu/qemu_hotplug.c | 16 +
src/qemu/qemu_monitor.c | 21 +
src/qemu/qemu_monitor.h | 9 +
src/qemu/qemu_monitor_json.c | 61 ++
src/qemu/qemu_monitor_json.h | 9 +
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 31 +-
src/remote_protocol-structs | 16 +
tests/qemumonitorjsontest.c | 51 ++
.../throttlefilter-in.xml | 392 ++++++++++
.../throttlefilter-out.xml | 393 ++++++++++
tests/qemuxmlactivetest.c | 1 +
.../throttlefilter-invalid.x86_64-latest.err | 1 +
.../throttlefilter-invalid.xml | 89 +++
.../throttlefilter.x86_64-latest.args | 56 ++
.../throttlefilter.x86_64-latest.xml | 105 +++
tests/qemuxmlconfdata/throttlefilter.xml | 95 +++
tests/qemuxmlconftest.c | 2 +
tools/virsh-completer-domain.c | 63 ++
tools/virsh-completer-domain.h | 14 +
tools/virsh-domain.c | 695 ++++++++++++++----
39 files changed, 3845 insertions(+), 408 deletions(-)
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-in.xml
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-out.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml
--
2.48.1
1 week, 5 days
[PATCH] qemu/dbus: Allow connections from root to the dbus-daemon
by Martin Kletzander
From: Martin Kletzander <mkletzan(a)redhat.com>
In commit dbfb96d18c04 libvirt started connecting to the daemon to set
RDP credentials, but our configuration file did not allow connections
from the root user, so the connection failed and the VM failed to start.
In order to avoid such issue allow root to connect if the daemon is
running privileged.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_dbus.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c
index a9e2fb0fe231..625884ad467f 100644
--- a/src/qemu/qemu_dbus.c
+++ b/src/qemu/qemu_dbus.c
@@ -116,7 +116,7 @@ qemuDBusConnect(virQEMUDriver *driver,
static int
-qemuDBusWriteConfig(const char *filename, const char *path)
+qemuDBusWriteConfig(const char *filename, const char *path, bool privileged)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autofree char *config = NULL;
@@ -138,6 +138,9 @@ qemuDBusWriteConfig(const char *filename, const char *path)
virBufferAddLit(&buf, "<allow eavesdrop='true'/>\n");
virBufferAddLit(&buf, "<!-- Allow anyone to own anything -->\n");
virBufferAddLit(&buf, "<allow own='*'/>\n");
+ if (privileged)
+ virBufferAddLit(&buf, "<allow user='root'/>\n");
+
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</policy>\n");
@@ -242,7 +245,7 @@ qemuDBusStart(virQEMUDriver *driver,
configfile = qemuDBusCreateConfPath(cfg, shortName);
sockpath = qemuDBusCreateSocketPath(cfg, shortName);
- if (qemuDBusWriteConfig(configfile, sockpath) < 0) {
+ if (qemuDBusWriteConfig(configfile, sockpath, driver->privileged) < 0) {
virReportSystemError(errno, _("Failed to write '%1$s'"), configfile);
return -1;
}
--
2.48.1
1 week, 5 days
[PATCH v2] virsh: Introduce new hypervisor-cpu-models command
by Collin Walling
From: David Judkovics <djudkovi(a)linux.ibm.com>
Add new virsh command 'hypervisor-cpu-models'. Command pulls from the
existing domcapabilities XML and uses xpath to parse CPU model strings.
By default, only models reported as usable by the hypervisor on the
host system are printed. User may specify "--all" to also print
models which are not supported on the host.
Signed-off-by: David Judkovics <djudkovi(a)linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Signed-off-by: Collin Walling <walling(a)linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Changelog:
v2
- Corrected virsh.rst documentation
- Removed unwanted_positional from emulator option
- Adjusted xpath string based on feedback
---
docs/manpages/virsh.rst | 25 ++++++++++++++
tools/virsh-host.c | 75 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index baced15dec..612c567ff4 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -1034,6 +1034,31 @@ listed in the XML description. If *--migratable* is specified, features that
block migration will not be included in the resulting CPU.
+hypervisor-cpu-models
+---------------------
+
+**Syntax:**
+
+::
+
+ hypervisor-cpu-models [--virttype virttype] [--emulator emulator]
+ [--arch arch] [--machine machine] [--all]
+
+Print the list of CPU models known by the hypervisor for the specified architecture.
+It is not guaranteed that a listed CPU will run on the host. To determine CPU
+model compatibility with the host, see ``virsh hypervisor-cpu-baseline`` and
+``virsh hypervisor-cpu-compare``.
+
+The *virttype* option specifies the virtualization type (usable in the 'type'
+attribute of the <domain> top level element from the domain XML). *emulator*
+specifies the path to the emulator, *arch* specifies the CPU architecture, and
+*machine* specifies the machine type.
+
+By default, only the models that are claimed to be "usable" by the hypervisor
+on the host are reported. The option *--all* will report every CPU model known
+to the hypervisor, including ones that are not supported on the hypervisor (e.g.
+newer generation models).
+
DOMAIN COMMANDS
===============
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 9e8f542c96..f4e34fb146 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -1766,6 +1766,75 @@ cmdHypervisorCPUBaseline(vshControl *ctl,
}
+/*
+ * "hypervisor-cpu-models" command
+ */
+static const vshCmdInfo info_hypervisor_cpu_models = {
+ .help = N_("Hypervisor reported CPU models"),
+ .desc = N_("Get the CPU models reported by the hypervisor."),
+};
+
+static const vshCmdOptDef opts_hypervisor_cpu_models[] = {
+ {.name = "virttype",
+ .type = VSH_OT_STRING,
+ .completer = virshDomainVirtTypeCompleter,
+ .help = N_("virtualization type (/domain/@type)"),
+ },
+ {.name = "emulator",
+ .type = VSH_OT_STRING,
+ .help = N_("path to emulator binary (/domain/devices/emulator)"),
+ },
+ {.name = "arch",
+ .type = VSH_OT_STRING,
+ .completer = virshArchCompleter,
+ .help = N_("CPU architecture (/domain/os/type/@arch)"),
+ },
+ {.name = "machine",
+ .type = VSH_OT_STRING,
+ .help = N_("machine type (/domain/os/type/@machine)"),
+ },
+ {.name = "all",
+ .type = VSH_OT_BOOL,
+ .help = N_("include all CPU models known to the hypervisor for the architecture")
+ },
+ {.name = NULL}
+};
+
+static bool
+cmdHypervisorCPUModelNames(vshControl *ctl,
+ const vshCmd *cmd)
+{
+ g_autofree char *caps_xml = NULL;
+ const char *virttype = NULL;
+ const char *emulator = NULL;
+ const char *arch = NULL;
+ const char *machine = NULL;
+ const char *xpath = NULL;
+ virshControl *priv = ctl->privData;
+
+ if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulator", &emulator) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0)
+ return false;
+
+ if (vshCommandOptBool(cmd, "all"))
+ xpath = "//cpu//model[@usable]/text()";
+ else
+ xpath = "//cpu//model[@usable='yes']/text()";
+
+ caps_xml = virConnectGetDomainCapabilities(priv->conn, emulator, arch,
+ machine, virttype, 0);
+
+ if (!caps_xml) {
+ vshError(ctl, "%s", _("failed to get hypervisor CPU model names"));
+ return false;
+ }
+
+ return virshDumpXML(ctl, caps_xml, "domcapabilities", xpath, false);
+}
+
+
const vshCmdDef hostAndHypervisorCmds[] = {
{.name = "allocpages",
.handler = cmdAllocpages,
@@ -1833,6 +1902,12 @@ const vshCmdDef hostAndHypervisorCmds[] = {
.info = &info_hypervisor_cpu_compare,
.flags = 0
},
+ {.name = "hypervisor-cpu-models",
+ .handler = cmdHypervisorCPUModelNames,
+ .opts = opts_hypervisor_cpu_models,
+ .info = &info_hypervisor_cpu_models,
+ .flags = 0
+ },
{.name = "maxvcpus",
.handler = cmdMaxvcpus,
.opts = opts_maxvcpus,
--
2.47.1
1 week, 5 days
Questions regarding potential resize implementation in libvirt
by Maximilian Immanuel Brandtner
I've been working on an RFC patch-set to implement resizing for
consoles in QEMU. Now that the patch-set is in review I've turned my
attention to bringing this feature to libvirt.
With the QEMU patch-set there are two ways to resize a pty chardev.
1. send a TIOCSWINSZ ioctl
2. send a QMP msg
The first approach doesn't work under Libvirt. Pty chardevs are proxied
over a FIFO meaning the ioctl wouldn't get to libvirt. Furthermore,
this approach is incompatible with remote management which libvirt
seems to go to great lengths to support.
Sending a QMP message is a QEMU specific feature. It seems to me that
adding a new handle (something like domainResizeConsole) would have to
be added to the virHypervisorDriver struct. It would be really nifty if
the resize handle could be implemented in the virStream, however it
seems that all the virStreamDriver handlers are common code (aka shared
across all hypervisors). From what I've seen it seems that the only way
to switch from common code to hypervisor specific code would be over
the virHypervisorDriver. As it stands it seems to me that the best
course of action would be adding a new handle to the
virHypervisorDriver, but I'm unsure whether that's really the right
call.
Furthermore, if we don't want to broadcast a QMP message to every
chardev, the handle needs to determine the alias with which the chardev
can be adressed in QMP. in qemuDomainOpenConsole the alias for the
console is set and added as the callback argument for the internal
close function. There doesn't seem to be a way to get the alias of a
console from virStream. It seems that I need to add an alias string
field to the virStream or the virStreamFDData. I could however be
mistaken and there is already a way to get the alias for a virStream,
hence this email
TLDR I have the following 2 questions:
- Should the resize handle be implemented in the virHypervisorDriver
directly or in the virStreamDriver?
- Is there a way to get the QMP alias of a chardev from a virStream?
Thanks in advance
Max
1 week, 5 days