[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
8 months, 3 weeks
[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
8 months, 3 weeks
[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
8 months, 3 weeks
[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
8 months, 3 weeks
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.
8 months, 3 weeks
[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
8 months, 4 weeks
[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
8 months, 4 weeks
[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
8 months, 4 weeks
[PATCH (pushed)] qemucapabilitiesdata: Final update of capability test data for qemu-8.1.0 release
by Peter Krempa
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed as trivial.
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies | 6 +++---
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies
index e6cc5da1c4..c28073c16c 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.replies
@@ -17,11 +17,11 @@
{
"return": {
"qemu": {
- "micro": 94,
- "minor": 0,
+ "micro": 0,
+ "minor": 1,
"major": 8
},
- "package": "v8.1.0-rc4"
+ "package": "v8.1.0"
},
"id": "libvirt-2"
}
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
index 313af6a00e..0a9b5d3b46 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
@@ -204,9 +204,9 @@
<flag name='rbd-encryption-luks-any'/>
<flag name='qcow2-discard-no-unref'/>
<flag name='run-with.async-teardown'/>
- <version>8000094</version>
+ <version>8001000</version>
<microcodeVersion>43100245</microcodeVersion>
- <package>v8.1.0-rc4</package>
+ <package>v8.1.0</package>
<arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'>
<property name='avx-ne-convert' type='boolean' value='false'/>
--
2.41.0
8 months, 4 weeks