[PATCH] docs: add table showing guest IP/DNS/gateway settings when using SLIRP
by Laine Stump
When using the default SLIRP backend for <interface type='user'>, the
<ip address='blah' prefix='blur'/> setting doesn't behave as might be
expected (i.e. it doesn't set the guest interface IP/prefix to exactly
the provided values). This *should* have created questions when users
originally encountered it, but instead it has become more apparent as
people are contemplating switching from using the SLIRP backend to
using passt instead (with passt, the <ip> settings do behave "as
expected").
In order to make this difference in behavior less mysterious, Yalan
Zhang kindly took the time to test and document the effect of various
representative <ip> settings on guest interface config when SLIRP is
used (see https://issues.redhat.com/browse/RHEL-46601); this patch
adds that same table to libvirt's documentation.
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
docs/formatdomain.rst | 69 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 58 insertions(+), 11 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index aae58fab60..a6d0660135 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -5239,15 +5239,7 @@ network address by including an ``ip`` element specifying an IPv4
address in its one mandatory attribute, ``address``. Optionally, a
second ``ip`` element with a ``family`` attribute set to "ipv6" can be
specified to add an IPv6 address to the interface. ``address``.
-Optionally, an address ``prefix`` can be specified. These settings are
-surprisingly **not** used by SLIRP to set the exact IP address;
-instead they are used to determine what network/subnet the guest's IP
-address should be on, and the guest will be given an address in that
-subnet, but the host portion of the address will still be "2.15". In
-the example below, for example, the guest will be given the IP address
-172.17.2.15 (**note that the '1.1' in the host portion of the address
-has been ignored**), default route of 172.17.2.2, and DNS server
-172.17.2.3.
+Optionally, an address ``prefix`` can be specified.
::
@@ -5263,6 +5255,59 @@ has been ignored**), default route of 172.17.2.2, and DNS server
</devices>
...
+These settings are surprisingly **not** used by SLIRP to set the exact
+IP address; instead they are used to determine what **network/subnet**
+the guest's IP address should be on, and the guest will be given an
+address in that subnet, but the host portion of the address will still
+be the host portion of "10.0.2.15" (based on the configured prefix (or
+a prefix of 24 if no prefix is specified). The DNS and default gateway
+addresses given to the guest will be similarly based on the network
+portion of the configuration-provided <ip> combined with the host
+portion of SLIRPs default settings for DNS/gateway
+(10.0.2.3/10.0.2.2). To help resolve the confusion of the previous
+sentences, the table below shows examples of the settings that will be
+provided to the guest (via a DHCP response) to use for its interface
+config (ip/prefix, DNS, default gateway) for various settings of <ip>
+element address and prefix in libvirt's <interface type='user'>
+config:
+
+.. list-table::
+ :header-rows: 1
+
+ * - libvirt <ip> element
+ - guest ip/prefix
+ - guest DNS
+ - guest default gateway
+
+ * - (unspecified)
+ - 10.0.2.15/24
+ - 10.0.2.3
+ - 10.0.2.2
+
+ * - address='172.17.1.1'
+ prefix='16'
+ - 172.17.2.15/16
+ - 172.17.2.3
+ - 172.17.2.2
+
+ * - address='172.17.1.1'
+ prefix='24'
+ - 172.17.1.15/24
+ - 172.17.1.3
+ - 172.17.1.2
+
+ * - address='172.17.1.1'
+ prefix='8'
+ - 172.0.2.15/16
+ - 172.0.2.3
+ - 172.0.2.2
+
+ * - address='172.17.1.1'
+ prefix='23'
+ - 172.17.0.15/23
+ - 172.17.0.3
+ - 172.17.0.2
+
Userspace connection using passt
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -5304,8 +5349,10 @@ any conflict).
Also different from SLIRP's behavior: if you do specify IP
address(es), the exact address and netmask/prefix you specify will be
provided to the guest (i.e. passt doesn't interpret the <ip> settings
-as a network address like SLIRP does, but as a host address). In
-example given above, the guest IP would be set to exactly 172.17.1.1.
+as a network address like SLIRP does, but as a host address). In the
+table of examples given above, the guest IP would be set to exactly
+172.17.1.1 in all cases (the DNS and default gateway will be set
+the same as they are on the host).
Just as with SLIRP, though, once traffic from the guest leaves the
host towards the rest of the network, it will always appear as if it
--
2.48.1
2 months
[libvirt PATCH] qemu_driver: Fix virDomainSaveImageDefineXML
by Pavel Hrdina
From: Pavel Hrdina <phrdina(a)redhat.com>
Commit 28a06215280b99708ed8dc2d183f62ba7b34ccf8 added support to restore
sparse images but changed the boolean that controls if we open the file
as read-only or read-write. Editing XML in the save image resulted in
following error message:
failed to write header to domain save file '/data/images/fedora40.save': Bad file descriptor
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3cf21380ed..056a9e579d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5945,7 +5945,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
if (qemuSaveImageGetMetadata(driver, NULL, path, &def, &data) < 0)
goto cleanup;
- fd = qemuSaveImageOpen(driver, path, false, false, NULL, false);
+ fd = qemuSaveImageOpen(driver, path, false, false, NULL, true);
if (fd < 0)
goto cleanup;
--
2.49.0
2 months
[libvirt PATCH 0/6] cleanup and fixes of the mapped-ram feature
by Pavel Hrdina
Pavel Hrdina (6):
tools: remove --parallel from virsh restore command
tools: remote --parallel from virsh save command
qemu: remove VIR_DOMAIN_SAVE_PARALLEL flag
tools: use virDomainRestoreParams only when necessary
tools: use virDomainSaveParams only when necessary
virsh: add --image-format option to the save command
docs/manpages/virsh.rst | 24 +++++----
include/libvirt/libvirt-domain.h | 1 -
src/qemu/qemu_driver.c | 6 +--
src/qemu/qemu_migration_params.c | 34 ++++++------
tools/virsh-domain.c | 93 ++++++++++++++++----------------
5 files changed, 80 insertions(+), 78 deletions(-)
--
2.48.1
2 months, 1 week
[PATCH] NEWS: hotplug virtio-mem device
by Boris Fiuczynski
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
NEWS.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 484333e55a..1de0231c57 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -56,6 +56,12 @@ v11.2.0 (unreleased)
* **Bug fixes**
+ * qemu: attach virtio-mem with CCW address
+
+ Attaching a virtio-mem device on s390 without an address type now gets a
+ default type CCW address assigned. A specified CCW address is now used for
+ the virtio-mem device instead of getting overwritten by a PCI address.
+
v11.1.0 (2025-03-03)
====================
--
2.47.0
2 months, 1 week
[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
2 months, 1 week
[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
2 months, 1 week
[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
2 months, 1 week
[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
2 months, 1 week
[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
2 months, 1 week