[libvirt PATCH v7 00/35] Use nbdkit for http/ftp/ssh network drives in libvirt
by Jonathon Jongsma
This is the seventh version of this patch series. See
https://bugzilla.redhat.com/show_bug.cgi?id=2016527 for more information.
Note that testing this requires selinux policy changes which are not fully
done, but there is a new policy in development that has allowed me to run with
selinux in enforcing mode for the common cases. See
https://bugzilla.redhat.com/show_bug.cgi?id=2182505 for more information. The
following scenarios should work now with selinux enabled using the selinux
policy from that bug:
- http/https disks
- ssh disks with password authentication
- ssh disks with passwordless keyfile
The one major thing that doesn't work and is difficult to get working with
selinux enabled is the ssh-agent. This is because there doesn't seem to be any
selinux policy for ssh-agent, so by default the ssh-agent socket is labeled
unconfined_t. We cannot allow access from the libvirt/qemu to unconfined_t
because that would open up access to just about anything on the host. So
additional work will likely be necessary for ssh-agent/libvirt interaction in
the future. Fortunately ssh-agent is something that never was really supported
with the old qemu block driver either, so I think we could potentially merge
this patchset either without the ssh-agent patches or with a note that
ssh-agent won't work with selinux enabled.
Note also that gitlab CI will not work for this series without changes to the
ci definitions due to the addition of libnbd dependency.
Changes in v7:
- rebased to latest master
- moved restarting of nbdkit process to per-domain event thread
- a few other smaller changes suggested by Peter in v6
Jonathon Jongsma (35):
schema: allow 'ssh' as a protocol for network disks
qemu: Add functions for determining nbdkit availability
qemu: expand nbdkit capabilities
util: Allow virFileCache data to be any GObject
qemu: implement basic virFileCache for nbdkit caps
qemu: implement persistent file cache for nbdkit caps
qemu: use file cache for nbdkit caps
qemu: Add qemuNbdkitProcess
qemu: query nbdkit module dir from binary
qemu: add functions to start and stop nbdkit
Generalize qemuDomainLogContextNew()
qemu: Extract qemuDomainLogContext into a new file
qemu: move qemuProcessReadLog() to qemuLogContext
qemu: log error output from nbdkit
tests: add ability to test various nbdkit capabilities
qemu: split qemuDomainSecretStorageSourcePrepare
qemu: include nbdkit state in private xml
util: secure erase virCommand send buffers
qemu: pass sensitive data to nbdkit via pipe
qemu: use nbdkit to serve network disks if available
util: make virCommandSetSendBuffer testable
tests: add tests for nbdkit invocation
qemu: add test for authenticating a https network disk
qemu: Monitor nbdkit process for exit
qemu: Taint domain if nbdkit restart fails
qemu: try to connect to nbdkit early to detect errors
schema: add password configuration for ssh disk
qemu: implement password auth for ssh disks with nbdkit
schema: add configuration for host verification of ssh disks
qemu: implement knownHosts for ssh disks with nbdkit
schema: add keyfile configuration for ssh disks
qemu: implement keyfile auth for ssh disks with nbdkit
schema: add ssh-agent configuration for ssh disks
qemu: implement ssh-agent auth for ssh disks with nbdkit
rpm: update spec file for for nbdkit support
build-aux/syntax-check.mk | 2 +-
docs/formatdomain.rst | 45 +-
libvirt.spec.in | 8 +
meson.build | 14 +
meson_options.txt | 1 +
po/POTFILES | 2 +
src/conf/domain_conf.c | 38 +
src/conf/domain_conf.h | 1 +
src/conf/schemas/domaincommon.rng | 55 +
src/conf/storage_source_conf.c | 6 +
src/conf/storage_source_conf.h | 6 +-
src/libvirt_private.syms | 1 +
src/qemu/meson.build | 3 +
src/qemu/qemu_block.c | 162 ++-
src/qemu/qemu_conf.c | 22 +
src/qemu/qemu_conf.h | 6 +
src/qemu/qemu_domain.c | 436 +++---
src/qemu/qemu_domain.h | 31 +-
src/qemu/qemu_driver.c | 21 +
src/qemu/qemu_extdevice.c | 62 +
src/qemu/qemu_hotplug.c | 7 +
src/qemu/qemu_logcontext.c | 329 +++++
src/qemu/qemu_logcontext.h | 41 +
src/qemu/qemu_nbdkit.c | 1277 +++++++++++++++++
src/qemu/qemu_nbdkit.h | 119 ++
src/qemu/qemu_nbdkitpriv.h | 31 +
src/qemu/qemu_process.c | 122 +-
src/qemu/qemu_process.h | 3 +
src/util/vircommand.c | 19 +-
src/util/vircommand.h | 8 +
src/util/vircommandpriv.h | 4 +
src/util/virfilecache.c | 14 +-
src/util/virfilecache.h | 2 +-
tests/meson.build | 1 +
tests/qemublocktest.c | 2 +-
...w2-invalid.json => network-ssh-qcow2.json} | 0
...cow2-invalid.xml => network-ssh-qcow2.xml} | 0
.../disk-cdrom-network.args.disk0 | 6 +
.../disk-cdrom-network.args.disk1 | 8 +
.../disk-cdrom-network.args.disk1.pipe.778 | 1 +
.../disk-cdrom-network.args.disk2 | 8 +
.../disk-cdrom-network.args.disk2.pipe.780 | 1 +
.../disk-network-http.args.disk0 | 6 +
.../disk-network-http.args.disk1 | 5 +
.../disk-network-http.args.disk2 | 6 +
.../disk-network-http.args.disk2.pipe.778 | 1 +
.../disk-network-http.args.disk3 | 7 +
.../disk-network-http.args.disk3.pipe.780 | 1 +
...work-source-curl-nbdkit-backing.args.disk0 | 7 +
...ce-curl-nbdkit-backing.args.disk0.pipe.778 | 1 +
.../disk-network-source-curl.args.disk0 | 7 +
...sk-network-source-curl.args.disk0.pipe.778 | 1 +
.../disk-network-source-curl.args.disk1 | 9 +
...sk-network-source-curl.args.disk1.pipe.780 | 1 +
...sk-network-source-curl.args.disk1.pipe.782 | 1 +
.../disk-network-source-curl.args.disk2 | 7 +
...sk-network-source-curl.args.disk2.pipe.782 | 1 +
...sk-network-source-curl.args.disk2.pipe.784 | 1 +
.../disk-network-source-curl.args.disk3 | 6 +
.../disk-network-source-curl.args.disk4 | 6 +
.../disk-network-ssh-key.args.disk0 | 9 +
.../disk-network-ssh-key.args.disk1 | 9 +
.../disk-network-ssh-password.args.disk0 | 9 +
...k-network-ssh-password.args.disk0.pipe.778 | 1 +
.../disk-network-ssh.args.disk0 | 7 +
.../disk-network-ssh.args.disk1 | 8 +
.../disk-network-ssh.args.disk1.pipe.778 | 1 +
.../disk-network-ssh.args.disk2 | 9 +
tests/qemunbdkittest.c | 310 ++++
tests/qemustatusxml2xmldata/modern-in.xml | 4 +
...sk-cdrom-network-nbdkit.x86_64-latest.args | 42 +
.../disk-cdrom-network-nbdkit.xml | 1 +
...isk-network-http-nbdkit.x86_64-latest.args | 44 +
.../disk-network-http-nbdkit.xml | 1 +
...rce-curl-nbdkit-backing.x86_64-latest.args | 37 +
...isk-network-source-curl-nbdkit-backing.xml | 45 +
...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 | 74 +
.../qemuxml2argvdata/disk-network-ssh-key.xml | 44 +
...disk-network-ssh-nbdkit.x86_64-latest.args | 35 +
.../disk-network-ssh-nbdkit.xml | 1 +
...sk-network-ssh-password.x86_64-latest.args | 35 +
.../disk-network-ssh-password.xml | 35 +
.../disk-network-ssh.x86_64-latest.args | 35 +
tests/qemuxml2argvdata/disk-network-ssh.xml | 32 +
tests/qemuxml2argvtest.c | 19 +
tests/testutilsqemu.c | 26 +
tests/testutilsqemu.h | 4 +
90 files changed, 3507 insertions(+), 472 deletions(-)
create mode 100644 src/qemu/qemu_logcontext.c
create mode 100644 src/qemu/qemu_logcontext.h
create mode 100644 src/qemu/qemu_nbdkit.c
create mode 100644 src/qemu/qemu_nbdkit.h
create mode 100644 src/qemu/qemu_nbdkitpriv.h
rename tests/qemublocktestdata/imagecreate/{network-ssh-qcow2-invalid.json => network-ssh-qcow2.json} (100%)
rename tests/qemublocktestdata/imagecreate/{network-ssh-qcow2-invalid.xml => network-ssh-qcow2.xml} (100%)
create mode 100644 tests/qemunbdkitdata/disk-cdrom-network.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-cdrom-network.args.disk1
create mode 100644 tests/qemunbdkitdata/disk-cdrom-network.args.disk1.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-cdrom-network.args.disk2
create mode 100644 tests/qemunbdkitdata/disk-cdrom-network.args.disk2.pipe.780
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk1
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk2
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk2.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk3
create mode 100644 tests/qemunbdkitdata/disk-network-http.args.disk3.pipe.780
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl-nbdkit-backing.args.disk0.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk0.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk1
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.780
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk1.pipe.782
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk2
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.782
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk2.pipe.784
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk3
create mode 100644 tests/qemunbdkitdata/disk-network-source-curl.args.disk4
create mode 100644 tests/qemunbdkitdata/disk-network-ssh-key.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-ssh-key.args.disk1
create mode 100644 tests/qemunbdkitdata/disk-network-ssh-password.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-ssh-password.args.disk0.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-network-ssh.args.disk0
create mode 100644 tests/qemunbdkitdata/disk-network-ssh.args.disk1
create mode 100644 tests/qemunbdkitdata/disk-network-ssh.args.disk1.pipe.778
create mode 100644 tests/qemunbdkitdata/disk-network-ssh.args.disk2
create mode 100644 tests/qemunbdkittest.c
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-backing.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-source-curl-nbdkit-backing.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
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh-key.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh-nbdkit.x86_64-latest.args
create mode 120000 tests/qemuxml2argvdata/disk-network-ssh-nbdkit.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh-password.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh-password.xml
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-ssh.xml
--
2.41.0
1 year, 2 months
[PATCH] NEWS: Announcing Network Metadata APIs
by K Shiva Kiran
Ref to patchset implementing the above:
https://listman.redhat.com/archives/libvir-list/2023-August/241250.html
Signed-off-by: K Shiva Kiran <shiva_kr(a)riseup.net>
---
NEWS.rst | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 73571f0019..01df22ef03 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,32 @@ v9.7.0 (unreleased)
* **New features**
+ * network: Support for `<title>` and `<metadata>` fields in Network XML
+
+ The `<title>` attribute can hold a short title defined by the user
+ and cannot contain newlines.
+ The `<description>` attribute holds any documentation that the user
+ wants to store.
+
+ * network: Support to view and modify User defined metadata
+
+ Two new APIs `virNetworkGetMetadata()` and `virNetworkSetMetadata()`
+ have been introduced. These allow users to view and modify the
+ contents of `<title>`, `<description>` and `<metadata>`.
+
+ * virsh: Introduces new commands `net-desc` and `net-metadata`
+
+ `net-desc` can be used to view and modify the Network's title and
+ description attributes.
+ `net-metadata` can be used to define or modify the custom metadata
+ attribute of the Network object.
+
+ * virsh: Adds `--title` option to the `net-list` command
+
+ This option prints the <title> attribute of the network in
+ an extra column. This option is usable only with the default
+ `--table` output.
+
* **Improvements**
* **Bug fixes**
--
2.42.0
1 year, 2 months
[PATCH] REFACTOR: Eliminate newlines in messages and fixes a typo
by K Shiva Kiran
Removes newlines of error message strings in metadata unit tests,
libvirt-domain.c and libvirt-network.c
Fixes a minor typo in libvirt-domain.c
Signed-off-by: K Shiva Kiran <shiva_kr(a)riseup.net>
---
include/libvirt/libvirt-domain.h | 2 +-
src/libvirt-domain.c | 3 +--
src/libvirt-network.c | 3 +--
tests/metadatatest.c | 9 +++------
tests/networkmetadatatest.c | 9 +++------
5 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index a1902546bb..ea36805aa3 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -5184,7 +5184,7 @@ typedef void (*virConnectDomainEventDeviceRemovalFailedCallback)(virConnectPtr c
* virConnectDomainEventMetadataChangeCallback:
* @conn: connection object
* @dom: domain on which the event occurred
- * @type: a value from virDomainMetadataTypea
+ * @type: a value from virDomainMetadataType
* @nsuri: XML namespace URI
* @opaque: application specified data
*
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index ec42bb9a53..80a554a530 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8585,8 +8585,7 @@ virDomainSetMetadata(virDomainPtr domain,
case VIR_DOMAIN_METADATA_TITLE:
if (metadata && strchr(metadata, '\n')) {
virReportInvalidArg(metadata, "%s",
- _("metadata title can't contain "
- "newlines"));
+ _("metadata title can't contain newlines"));
goto error;
}
G_GNUC_FALLTHROUGH;
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index c0daea3a60..ef17a8a04d 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -1974,8 +1974,7 @@ virNetworkSetMetadata(virNetworkPtr network,
case VIR_NETWORK_METADATA_TITLE:
if (metadata && strchr(metadata, '\n')) {
virReportInvalidArg(metadata, "%s",
- _("metadata title can't contain "
- "newlines"));
+ _("metadata title can't contain newlines"));
goto error;
}
G_GNUC_FALLTHROUGH;
diff --git a/tests/metadatatest.c b/tests/metadatatest.c
index b56428fde5..7136730e6a 100644
--- a/tests/metadatatest.c
+++ b/tests/metadatatest.c
@@ -113,8 +113,7 @@ verifyMetadata(virDomainPtr dom,
if (STRNEQ(metadataAPI, expectAPI)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML metadata in API doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML metadata in API doesn't match expected metadata: expected:\n[%s]\ngot:\n[%s]",
expectAPI, metadataAPI);
return false;
}
@@ -136,8 +135,7 @@ verifyMetadata(virDomainPtr dom,
if (STRNEQ(metadataXML, expectXML)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML in dump doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML in dump doesn't match expected metadata: expected:\n[%s]\ngot:\n[%s]",
expectXML, metadataXML);
return false;
}
@@ -219,8 +217,7 @@ testTextMetadata(const void *data)
if (STRNEQ_NULLABLE(test->expect, actual)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "expected metadata doesn't match actual: "
- "expected:'%s'\ngot: '%s'",
+ "expected metadata doesn't match actual: expected:'%s'\ngot: '%s'",
NULLSTR(test->data), NULLSTR(actual));
return -1;
}
diff --git a/tests/networkmetadatatest.c b/tests/networkmetadatatest.c
index c309fb29b0..7a1bca4f73 100644
--- a/tests/networkmetadatatest.c
+++ b/tests/networkmetadatatest.c
@@ -113,8 +113,7 @@ verifyMetadata(virNetworkPtr net,
if (STRNEQ(metadataAPI, expectAPI)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML metadata in API doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML metadata in API doesn't match expected metadata: expected:\n[%s]\ngot:\n[%s]",
expectAPI, metadataAPI);
return false;
}
@@ -136,8 +135,7 @@ verifyMetadata(virNetworkPtr net,
if (STRNEQ(metadataXML, expectXML)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "XML in dump doesn't match expected metadata: "
- "expected:\n[%s]\ngot:\n[%s]",
+ "XML in dump doesn't match expected metadata: expected:\n[%s]\ngot:\n[%s]",
expectXML, metadataXML);
return false;
}
@@ -219,8 +217,7 @@ testTextMetadata(const void *data)
if (STRNEQ_NULLABLE(test->expect, actual)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "expected metadata doesn't match actual: "
- "expected:'%s'\ngot: '%s'",
+ "expected metadata doesn't match actual: expected:'%s'\ngot: '%s'",
NULLSTR(test->data), NULLSTR(actual));
return -1;
}
--
2.42.0
1 year, 2 months
[libvirt PATCH] ci: lcitool: Add libvirt-tck+runtime deps list
by Erik Skultety
This change was supposed to be part of commit 120a674f , but was
proposed against the libvirt TCK project instead. Since we're running
the TCK test suite as part of this project, this is the right place for
the TCK runtime deps list config.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
ci/lcitool/projects/libvirt-tck+runtime.yml | 32 +++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 ci/lcitool/projects/libvirt-tck+runtime.yml
diff --git a/ci/lcitool/projects/libvirt-tck+runtime.yml b/ci/lcitool/projects/libvirt-tck+runtime.yml
new file mode 100644
index 0000000000..6872cb8c2c
--- /dev/null
+++ b/ci/lcitool/projects/libvirt-tck+runtime.yml
@@ -0,0 +1,32 @@
+---
+packages:
+ - bc
+ - libguestfs-tools
+ - perl
+ - perl-Archive-Tar
+ - perl-Digest
+ - perl-Digest-MD5
+ - perl-File-Slurp
+ - perl-IO-Compress-Bzip2
+ - perl-IO-Interface
+ - perl-IO-String
+ - perl-Module-Build
+ - perl-Net-OpenSSH
+ - perl-NetAddr-IP
+ - perl-Sub-Uplevel
+ - perl-TAP-Formatter-HTML
+ - perl-TAP-Formatter-JUnit
+ - perl-TAP-Harness-Archive
+ - perl-Test-Exception
+ - perl-Test-LWP-UserAgent
+ - perl-Test-Pod
+ - perl-Test-Pod-Coverage
+ - perl-Test-Simple
+ - perl-XML-Twig
+ - perl-XML-Writer
+ - perl-XML-XPath
+ - perl-YAML
+ - perl-accessors
+ - perl-generators
+ - rpmbuild
+ - tcpdump
--
2.41.0
1 year, 2 months
[RFC] Adding timestamp to guest's serial console log
by Shaleen Bathla
Hi,
Need some comments regarding the following feature :
Addition of timestamp support for serial console logs of a guest.
We can implement it as a configurable attribute in xml.
For example :
<serial type='pty'>
<log file='$PATH/$GUESTNAME-serial0.log' append='on' timestamp="on/off"/>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
We can add a timestamp after every '\n' character received from qemu.
Can I have some comments regarding this change like what I should keep
in mind while implementing, whether it is a welcome addition or not,
issues I might face, any qemu changes required.
Thanks and Regards,
Shaleen Bathla
1 year, 2 months
CPU pinning implementation through libvirt
by xtec@trimaso.com.mx
I'll be direct.
After learning that QEMU itself has never officially implemented options
such as "-vcpu", "-vcpupin", or similar, remaining only as unimplemented
commits at their mailing lists, I felt the need of asking here once and
for all:
How does libvirt actually implements CPU pinning under the hood?
There's the xml with the cputune section and all the vcpupins, but does
libvirt translates this to QEMU native commands, or what else does it
do?
Thanks.
1 year, 2 months
[libvirt PATCH v2 0/7] Introduce new Metadata fields for Network object with corresponding APIs
by K Shiva Kiran
This commit adds the following:
- Introduction of <title> and <description> fields to the Network Object.
- Introduction of Get and Set Public APIs for the aforementioned fields.
- virsh exposure of the aforementioned Public APIs.
- Adds implementation in test driver along with a testcase.
- Implementation in bridge driver.
This is a v2 of:
https://listman.redhat.com/archives/libvir-list/2023-July/240828.html
Diff to v1:
- Corrected placement of structs in remote_protocol-structs.
- Removed redundant call to virNetworkObjSetDefTransient() in
virNetworkConfigChangeSetup().
- Removed redundant logic in networkUpdate(), substituted by call to
newly introduced virNetworkObjUpdateModificationImpact().
- Added virsh exposure of the APIs.
- Added bridge driver implementation.
Signed-off-by: K Shiva Kiran <shiva_kr(a)riseup.net>
K Shiva Kiran (7):
Add <title> and <description> for Network Objects
Adding Public Get and Set APIs for Network Metadata
Implementing Remote Protocol for Network Metadata
virsh exposure of Network Metadata APIs
Add virNetworkObj Get and Set Methods for Metadata
Add Test driver and testcase for Network Metadata change APIs
Added bridge driver implementation
docs/formatnetwork.rst | 11 +
docs/manpages/virsh.rst | 77 ++++++
include/libvirt/libvirt-network.h | 29 +++
include/libvirt/virterror.h | 1 +
src/conf/network_conf.c | 21 ++
src/conf/network_conf.h | 2 +
src/conf/schemas/basictypes.rng | 15 ++
src/conf/schemas/domaincommon.rng | 15 --
src/conf/schemas/network.rng | 10 +
src/conf/virnetworkobj.c | 329 +++++++++++++++++++++++-
src/conf/virnetworkobj.h | 21 ++
src/driver-network.h | 16 ++
src/libvirt-network.c | 167 ++++++++++++
src/libvirt_private.syms | 3 +
src/libvirt_public.syms | 6 +
src/network/bridge_driver.c | 78 +++++-
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 36 ++-
src/remote_protocol-structs | 19 ++
src/test/test_driver.c | 83 +++++-
src/util/virerror.c | 3 +
tests/meson.build | 1 +
tests/networkmetadatatest.c | 297 +++++++++++++++++++++
tools/virsh-network.c | 411 +++++++++++++++++++++++++++++-
tools/virsh-util.c | 25 ++
tools/virsh-util.h | 9 +
26 files changed, 1624 insertions(+), 63 deletions(-)
create mode 100644 tests/networkmetadatatest.c
--
2.41.0
1 year, 2 months
[PATCH v3 0/2] add support for discard_granularity
by Kristina Hanicova
v3 of:
https://listman.redhat.com/archives/libvir-list/2023-August/241452.html
diff to v2 (suggested by Peter):
* added note to the first commit
* enabled qemuxml2xmltest for blockio
* moved one hunk to the first commit
Kristina Hanicova (2):
conf: add support for discard_granularity
qemu: add support for discard_granularity
docs/formatdomain.rst | 6 ++-
src/conf/domain_conf.c | 19 +++++++-
src/conf/domain_conf.h | 1 +
src/conf/domain_validate.c | 3 +-
src/conf/schemas/domaincommon.rng | 5 ++
src/qemu/qemu_command.c | 2 +
src/qemu/qemu_domain.c | 2 +
src/vz/vz_utils.c | 3 +-
.../disk-blockio.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-blockio.xml | 2 +-
.../disk-blockio.x86_64-latest.xml | 48 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
12 files changed, 88 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2xmloutdata/disk-blockio.x86_64-latest.xml
--
2.41.0
1 year, 2 months
[PATCH] docs: Improve documentation of <disk type='dir'>
by Peter Krempa
Note the implications and caveats of <disk type='dir'>.
Closes: https://gitlab.com/libvirt/libvirt/-/issues/519
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/formatdomain.rst | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index cd9cb02bf8..9787933d4d 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -2634,6 +2634,12 @@ paravirtualized driver is specified via the ``disk`` element.
</source>
<target dev='sdb' bus='scsi'/>
</disk>
+ <disk type='dir' device='floppy'>
+ <driver name='qemu' type='fat'/>
+ <source dir='/var/somefiles'>
+ <target dev='fda'/>
+ <readonly/>
+ </disk>
<disk type='volume' device='disk'>
<driver name='qemu' type='raw'/>
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
@@ -2757,6 +2763,18 @@ paravirtualized driver is specified via the ``disk`` element.
``dir``
The ``dir`` attribute specifies the fully-qualified path to the directory
to use as the disk. :since:`Since 0.7.5`
+
+ Note that most hypervisors that support ``dir`` disks do that by exposing
+ an emulated block device with an emulated filesystem populated with
+ contents of the configured directory. As guest operating system may cache
+ the filesystem metadata, outside changes to the directory may not appear
+ in the guest and/or may result in corrupted data being observable from
+ the VM.
+
+ The format of the emulated filesystem is controlled by the ``format``
+ attribute of the ``<driver>`` driver element. Currently only the ``fat``
+ format is supported. Hypervisors may only support ``<readonly/>`` mode.
+
``network``
The ``protocol`` attribute specifies the protocol to access to the
requested image. Possible values are "nbd", "iscsi", "rbd", "sheepdog",
--
2.41.0
1 year, 2 months