[PATCH] NEWS: Document my contributions for the upcoming release
by Michal Privoznik
There are couple of features/improvements/bugfixes I contributed
into the upcoming release. Include those worth mentioning in the
NEWS.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
NEWS.rst | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 9a92fb4fcb..bb8d9a89b1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -27,10 +27,40 @@ v8.5.0 (unreleased)
A new ``VIR_MIGRATE_POSTCOPY_RESUME`` flag (``virsh migrate --postcopy-resume``)
was introduced for recovering from a failed post-copy migration.
+ * Introduce thread_pool_min and thread_pool_max attributes to IOThread
+
+ New attributes ``thread_pool_min`` and ``thread_pool_max`` were introduced
+ to ``<iothread/>`` as well as new ``<defaultiothread/>`` element with the
+ same attributes. This way it's possible to instruct QEMU to spawn enough
+ worker threads for an IOThread upfront, resulting in predictable time
+ needed to process an I/O requests.
+
* **Improvements**
+ * Define a TFTP server without a DHCP server in network configuration
+
+ It's now possible to define a network with no DHCP server but with a TFTP
+ server. This may be useful when DHCP service is provided by other entity on
+ the network than libvirt spawned dnsmasq.
+
* **Bug fixes**
+ * qemu: Restore label to temp file in qemuDomainScreenshot()
+
+ When virDomainScreenshot() is called, libvirt instructs QEMU to save the
+ screenshot into a temporary file. This file needs to be labelled correctly,
+ so that QEMU can access it. And since the file is temporary (it's deleted
+ after the screenshot was taken) the corresponding label restore was
+ missing. This proven to be problematic for profile based models, like
+ AppArmor, where the temporary files were added into the profile but never
+ removed, which resulted in longer profile recalculation times.
+
+ * qemuBuildInterfaceConnect: Initialize @tapfd array
+
+ Due to an uninitialized array, unsuccessful attempt to start a guest with
+ an ``<interface/>`` might have resulted in closing of a random FD and thus
+ sudden disconnect of a client or other random failures.
+
v8.4.0 (2022-06-01)
===================
--
2.35.1
2 years, 4 months
[libvirt PATCH] qemu_migration: Avoid mem.hard_limit > 0 check
by Jiri Denemark
My original commit v8.4.0-288-gf01fc4d119 accidentally forgot to fix
both instances of the same problem. While it fixed the destination side
of migration, the source one remained broken.
However, that commit was also wrong in saying the issue could have
caused unlimited memory locking to be allowed for QEMU when RDMA
migration was used. It could not, because the code would refuse to even
think about starting RDMA migration if hard_limit was not set. But
avoiding the "mem.hard_limit > 0" check is useful anyway.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
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 2a6b7b7819..9a10ce4abe 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4623,7 +4623,7 @@ qemuMigrationSrcStart(virDomainObj *vm,
switch (spec->destType) {
case MIGRATION_DEST_HOST:
if (STREQ(spec->dest.host.protocol, "rdma") &&
- vm->def->mem.hard_limit > 0 &&
+ virMemoryLimitIsSet(vm->def->mem.hard_limit) &&
qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
&priv->preMigrationMemlock) < 0) {
return -1;
--
2.35.1
2 years, 4 months
[libvirt PATCH 0/3] RFC: using nbdkit for network drives in libvirt
by Jonathon Jongsma
Hi guys,
I've been working on adding support for nbdkit to libvirt for network
storage sources like http and ssh. See
https://bugzilla.redhat.com/show_bug.cgi?id=2016527 for more
information, but the summary is that RHEL does not want to ship the qemu
storage plugins for curl and ssh. Handling them outside of the qemu
process provides several advantages such as reduced attack surface and
stability.
I have something that works for me, but as I have not dealt with the
storage stuff much before, I have a feeling that I'm missing some
things.
A quick summary of the code:
- at startup I query to see whether nbdkit exists on the host and if
so, I query which plugins/filters are installed. This is stored as
qemuNbdkitCaps on the qemu driver
- When the driver prepares the domain, we go through each disk source
and determine whether the nbdkit capabilities allow us to support
this disk via nbdkit, and if so, we allocate a qemuNbdkitProcess
object and stash it in the private data of the virStorageSource.
- The presence or absence of this qemuNbdkitProcess data then indicates
whether this disk will be served to qemu indirectly via nbdkit or not
- When we launch the qemuProcess, as part of the "external device
start" step, I launch a ndkit process for each disk that is supported
by nbdkit. I also optionally fork a child process to communicate
authentication details and cookies to the nbdkit process via a unix
socket.
- for devices which are served by the ndkit process, I change the qemu
commandline in the following ways:
- I no longer pass auth/cookie secrets to qemu (those are handled by
nbdkit)
- I replace the actual network URL of the remote disk source with the
path to the nbdkit unix socket
Known shortcomings
- I don't yet re-query for nbdkit / nbdkit caps, so need to restart libvirt to
pick up newly-installed nbdkit or additional capabilities
- testing is pretty limited at the moment
- selinux not working yet
- creating disks isn't supported, though Rich has added some support
for that upstream in the nbdkit ssh plugin.
I'd appreciate feedback on what i've got so far.
Jonathon Jongsma (3):
docs: clarify 'readahead' and 'timeout' for disks
schema: Be more flexible for diskSourceNetworkProtocolPropsCommon
WIP: use nbdkit for remote disk sources
docs/formatdomain.rst | 10 +-
include/libvirt/virterror.h | 1 +
po/POTFILES | 1 +
src/conf/schemas/domaincommon.rng | 34 +-
src/qemu/meson.build | 1 +
src/qemu/qemu_block.c | 64 +-
src/qemu/qemu_block.h | 1 +
src/qemu/qemu_command.c | 26 +-
src/qemu/qemu_conf.c | 19 +
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_domain.c | 110 ++-
src/qemu/qemu_domain.h | 5 +
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_extdevice.c | 25 +
src/qemu/qemu_nbdkit.c | 629 ++++++++++++++++++
src/qemu/qemu_nbdkit.h | 89 +++
src/qemu/qemu_validate.c | 22 +-
src/qemu/qemu_validate.h | 4 +-
src/util/virerror.c | 1 +
tests/qemublocktest.c | 8 +-
tests/qemustatusxml2xmldata/modern-in.xml | 1 -
...sk-cdrom-network-nbdkit.x86_64-latest.args | 42 ++
.../disk-cdrom-network-nbdkit.xml | 1 +
...isk-network-http-nbdkit.x86_64-latest.args | 45 ++
.../disk-network-http-nbdkit.xml | 1 +
...work-source-curl-nbdkit.x86_64-latest.args | 49 ++
.../disk-network-source-curl-nbdkit.xml | 1 +
...isk-network-source-curl.x86_64-latest.args | 53 ++
.../disk-network-source-curl.xml | 71 ++
tests/qemuxml2argvtest.c | 12 +
tests/testutilsqemu.c | 16 +
tests/testutilsqemu.h | 4 +
32 files changed, 1302 insertions(+), 53 deletions(-)
create mode 100644 src/qemu/qemu_nbdkit.c
create mode 100644 src/qemu/qemu_nbdkit.h
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-nbdkit.x86_64-latest.args
create mode 120000 tests/qemuxml2argvdata/disk-cdrom-network-nbdkit.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-http-nbdkit.x86_64-latest.args
create mode 120000 tests/qemuxml2argvdata/disk-network-http-nbdkit.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-source-curl-nbdkit.x86_64-latest.args
create mode 120000 tests/qemuxml2argvdata/disk-network-source-curl-nbdkit.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-source-curl.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-source-curl.xml
--
2.35.3
2 years, 4 months
[PATCH] storage: pool: Allow more intricate nfs protocol versions
by Peter Krempa
Treat the 'protocolVer' field as a string so that e.g. '4.1' can be
used.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/schemas/storagepool.rng | 4 +---
src/conf/storage_conf.c | 14 +++-----------
src/conf/storage_conf.h | 2 +-
src/storage/storage_util.c | 4 ++--
.../pool-netfs-protocol-ver-linux.argv | 2 +-
.../pool-netfs-protocol-ver.xml | 2 +-
.../pool-netfs-protocol-ver.xml | 2 +-
7 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/src/conf/schemas/storagepool.rng b/src/conf/schemas/storagepool.rng
index bd24b8b8d0..d81ead532a 100644
--- a/src/conf/schemas/storagepool.rng
+++ b/src/conf/schemas/storagepool.rng
@@ -577,9 +577,7 @@
<ref name="sourcefmtnetfs"/>
<optional>
<element name="protocol">
- <attribute name="ver">
- <ref name="unsignedInt"/>
- </attribute>
+ <attribute name="ver"/>
</element>
</optional>
<optional>
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 5da0bf20dd..251fb9f0a2 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -483,6 +483,7 @@ virStoragePoolSourceClear(virStoragePoolSource *source)
virStorageAuthDefFree(source->auth);
VIR_FREE(source->vendor);
VIR_FREE(source->product);
+ VIR_FREE(source->protocolVer);
}
@@ -526,7 +527,6 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
virStoragePoolOptions *options;
int n;
g_autoptr(virStorageAuthDef) authdef = NULL;
- g_autofree char *ver = NULL;
g_autofree xmlNodePtr *nodeset = NULL;
g_autofree char *sourcedir = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@@ -634,7 +634,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
}
/* Option protocol version string (NFSvN) */
- if ((ver = virXPathString("string(./protocol/@ver)", ctxt))) {
+ if ((source->protocolVer = virXPathString("string(./protocol/@ver)", ctxt))) {
if ((source->format != VIR_STORAGE_POOL_NETFS_NFS) &&
(source->format != VIR_STORAGE_POOL_NETFS_AUTO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -643,12 +643,6 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
virStoragePoolFormatFileSystemNetTypeToString(source->format));
return -1;
}
- if (virStrToLong_uip(ver, NULL, 0, &source->protocolVer) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("storage pool protocol ver '%s' is malformed"),
- ver);
- return -1;
- }
}
source->vendor = virXPathString("string(./vendor/@name)", ctxt);
@@ -1099,9 +1093,7 @@ virStoragePoolSourceFormat(virBuffer *buf,
if (src->auth)
virStorageAuthDefFormat(buf, src->auth);
- if (src->protocolVer)
- virBufferAsprintf(buf, "<protocol ver='%u'/>\n", src->protocolVer);
-
+ virBufferEscapeString(buf, "<protocol ver='%s'/>\n", src->protocolVer);
virBufferEscapeString(buf, "<vendor name='%s'/>\n", src->vendor);
virBufferEscapeString(buf, "<product name='%s'/>\n", src->product);
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index de39c3f294..a1bf243935 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -213,7 +213,7 @@ struct _virStoragePoolSource {
int format;
/* Protocol version value for netfs */
- unsigned int protocolVer;
+ char *protocolVer;
};
typedef struct _virStoragePoolTarget virStoragePoolTarget;
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 6ed2078b65..3871718b09 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -4201,8 +4201,8 @@ virStorageBackendFileSystemMountCmd(const char *cmdstr,
virCommand *cmd = NULL;
g_autofree char *nfsVers = NULL;
- if (def->type == VIR_STORAGE_POOL_NETFS && def->source.protocolVer > 0)
- nfsVers = g_strdup_printf("nfsvers=%u", def->source.protocolVer);
+ if (def->type == VIR_STORAGE_POOL_NETFS && def->source.protocolVer)
+ nfsVers = g_strdup_printf("nfsvers=%s", def->source.protocolVer);
cmd = virCommandNew(cmdstr);
if (netauto)
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
index dac46a074f..da3e0c5927 100644
--- a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
+++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
@@ -1,5 +1,5 @@
mount \
--o nodev,nosuid,noexec,nfsvers=3 \
+-o nodev,nosuid,noexec,nfsvers=4.1 \
-t nfs \
localhost:/var/lib/libvirt/images \
/mnt
diff --git a/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml b/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
index 40f3f94e41..f35992e3c8 100644
--- a/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
+++ b/tests/storagepoolxml2xmlin/pool-netfs-protocol-ver.xml
@@ -8,7 +8,7 @@
<host name='localhost'/>
<dir path='/var/lib/libvirt/images'/>
<format type='nfs'/>
- <protocol ver='3'/>
+ <protocol ver='4.1'/>
</source>
<target>
<path>/mnt</path>
diff --git a/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml b/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
index 5fcad1305b..74c2f5edfe 100644
--- a/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
+++ b/tests/storagepoolxml2xmlout/pool-netfs-protocol-ver.xml
@@ -8,7 +8,7 @@
<host name='localhost'/>
<dir path='/var/lib/libvirt/images'/>
<format type='nfs'/>
- <protocol ver='3'/>
+ <protocol ver='4.1'/>
</source>
<target>
<path>/mnt</path>
--
2.36.1
2 years, 4 months
[libvirt PATCH 0/7] qemu: Add support for zero-copy migration
by Jiri Denemark
This series also fixes a few issues around memory locking limit in
migration code which I found while implementing the feature.
Jiri Denemark (7):
qemu: Add qemuDomainSetMaxMemLock helper
qemu_migration: Use qemuDomainSetMaxMemLock
qemu_migration: Restore original memory locking limit
qemu_migration: Don't set unlimited memlock limit for RDMA
Add VIR_MIGRATE_ZEROCOPY flag
virsh: Add support for VIR_MIGRATE_ZEROCOPY flag
qemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag
docs/manpages/virsh.rst | 7 +-
include/libvirt/libvirt-domain.h | 9 +++
src/qemu/qemu_domain.c | 107 ++++++++++++++++++++-----------
src/qemu/qemu_domain.h | 6 ++
src/qemu/qemu_migration.c | 34 ++++++++--
src/qemu/qemu_migration.h | 1 +
src/qemu/qemu_migration_params.c | 6 ++
src/qemu/qemu_migration_params.h | 1 +
tools/virsh-domain.c | 7 ++
9 files changed, 136 insertions(+), 42 deletions(-)
--
2.35.1
2 years, 4 months
[libvirt PATCH] conf: virDomainDefParseMemory: remove pointless assignment
by Ján Tomko
Evaluate the XPath as a boolean, instead of trying to get a node
out of it.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9fe930a5d8..709ca53790 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -19184,7 +19184,7 @@ virDomainDefParseMemory(virDomainDef *def,
}
}
- if ((node = virXPathNode("./memoryBacking/nosharepages", ctxt)))
+ if (virXPathBoolean("boolean(./memoryBacking/nosharepages)", ctxt))
def->mem.nosharepages = true;
if (virXPathBoolean("boolean(./memoryBacking/locked)", ctxt))
--
2.34.1
2 years, 4 months
[libvirt PATCH] docs: update links to listman
by Ján Tomko
The mailman for mailing lists hosted by Red Hat seems to have moved
to listman.redhat.com. While the old links still seem to work,
point our docs to the new location to avoid the redirect.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
docs/bindings.rst | 2 +-
docs/contact.rst | 12 ++++++------
docs/submitting-patches.rst | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/bindings.rst b/docs/bindings.rst
index 81a4a67067..522d443d50 100644
--- a/docs/bindings.rst
+++ b/docs/bindings.rst
@@ -57,6 +57,6 @@ For information on using libvirt on **Windows** `please see the Windows
support page <windows.html>`__.
Support, requests or help for libvirt bindings are welcome on the
-`mailing list <https://www.redhat.com/mailman/listinfo/libvir-list/>`__,
+`mailing list <https://listman.redhat.com/mailman/listinfo/libvir-list/>`__,
as usual try to provide enough background information and make sure you
use recent version, see the `help page <bugs.html>`__.
diff --git a/docs/contact.rst b/docs/contact.rst
index f8f7e806b3..f20801e895 100644
--- a/docs/contact.rst
+++ b/docs/contact.rst
@@ -21,9 +21,9 @@ There are three mailing-lists:
**libvir-list(a)redhat.com** (for development)
Archives
- https://www.redhat.com/archives/libvir-list
+ https://listman.redhat.com/archives/libvir-list
List info
- https://www.redhat.com/mailman/listinfo/libvir-list
+ https://listman.redhat.com/mailman/listinfo/libvir-list
This is a high volume mailing list. It is a place for discussions about the
**development** of libvirt.
@@ -37,9 +37,9 @@ There are three mailing-lists:
**libvirt-users(a)redhat.com** (for users)
Archives
- https://www.redhat.com/archives/libvirt-users
+ https://listman.redhat.com/archives/libvirt-users
List info
- https://www.redhat.com/mailman/listinfo/libvirt-users
+ https://listman.redhat.com/mailman/listinfo/libvirt-users
This is a moderate volume mailing list. It is a place for discussions
involving libvirt **users**.
@@ -53,9 +53,9 @@ There are three mailing-lists:
**libvirt-announce(a)redhat.com** (for release notices)
Archives
- https://www.redhat.com/archives/libvirt-announce
+ https://listman.redhat.com/archives/libvirt-announce
List info
- https://www.redhat.com/mailman/listinfo/libvirt-announce
+ https://listman.redhat.com/mailman/listinfo/libvirt-announce
This is a low volume mailing list, with restricted posting, for announcements
of new libvirt releases.
diff --git a/docs/submitting-patches.rst b/docs/submitting-patches.rst
index 7cb5c2e172..7bc22323ee 100644
--- a/docs/submitting-patches.rst
+++ b/docs/submitting-patches.rst
@@ -68,7 +68,7 @@ particularly bad at this.
If everything went well, your patch should show up on the
`libvir-list
-archives <https://www.redhat.com/archives/libvir-list/>`__ in a
+archives <https://listman.redhat.com/archives/libvir-list/>`__ in a
matter of minutes; if you still can't find it on there after an
hour or so, you should double-check your setup. **Note that, if
you are not already a subscriber, your very first post to the
--
2.34.1
2 years, 4 months
[libvirt PATCHv2] storagefile: set size field of ploop to 8
by Ján Tomko
For all file formats, the length of the size field is assumed
and hardcoded to be 8 bytes.
Fix the length for the ploop format - since we specify the offset,
we read 8 bytes of the length, not 0.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/storage_file/storage_file_probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage_file/storage_file_probe.c b/src/storage_file/storage_file_probe.c
index 54e095ffd3..9465af5d96 100644
--- a/src/storage_file/storage_file_probe.c
+++ b/src/storage_file/storage_file_probe.c
@@ -296,7 +296,7 @@ static struct FileTypeInfo const fileTypeInfo[] = {
[VIR_STORAGE_FILE_VHD] = { 0, NULL, LV_LITTLE_ENDIAN,
-1, 0, {0}, 0, 0, 0, NULL, NULL, NULL, NULL },
[VIR_STORAGE_FILE_PLOOP] = { 0, "WithouFreSpacExt", LV_LITTLE_ENDIAN,
- -2, 0, {0}, PLOOP_IMAGE_SIZE_OFFSET, 0,
+ -2, 0, {0}, PLOOP_IMAGE_SIZE_OFFSET, 8,
PLOOP_SIZE_MULTIPLIER, NULL, NULL, NULL, NULL },
/* All formats with a backing store probe below here */
--
2.34.1
2 years, 4 months
[PATCH] Add support for network backed NVRAM
by Rohit Kumar
Signed-off-by: Rohit Kumar <rohit.kumar3(a)nutanix.com>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 9a8624a97e..9766dbe1df 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,11 @@ v8.5.0 (unreleased)
* **New features**
+ * qemu: Introduce support for network backed NVRAM
+
+ Users can now use remote store NVRAM image by specifying attribute
+ `type='network'` with `<nvram>` element.
+
* qemu: Add support for post-copy migration recovery
A new ``VIR_MIGRATE_POSTCOPY_RESUME`` flag (``virsh migrate --postcopy-resume``)
--
2.25.1
2 years, 4 months
[libvirt PATCH 0/6] Use virURIFree less (glib chronicles)
by Ján Tomko
Ján Tomko (6):
Use g_auto for virURI almost everywhere
tests: remove pointless label in testURIParse
vz: refactor testURIParse
vmx: use g_autofree in virVMXParseSerial
qemu: remove cleanup label from qemuMigrationSrcGraphicsRelocate
libxl: remove cleanup label from libxlDomainMigrationSrcPerform
src/esx/esx_driver.c | 3 +--
src/libxl/libxl_migration.c | 17 ++++++-----------
src/qemu/qemu_migration.c | 30 ++++++++++++------------------
src/vmx/vmx.c | 13 ++++---------
src/vz/vz_driver.c | 3 +--
src/vz/vz_sdk.c | 31 +++++++++++--------------------
tests/viruritest.c | 14 +++++---------
7 files changed, 40 insertions(+), 71 deletions(-)
--
2.34.1
2 years, 4 months