[PATCH] meson: Replace meson.source_root() with meson.project_source_root()
by Michal Privoznik
The source_root() method is deprecated in 0.56.0 and we're
recommended to use project_source_root() instead.
This is similar to commit v8.9.0-rc1~70 but somehow, the old
method sneaked in.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index c1a2e6eadb..f8eff99e2c 100644
--- a/meson.build
+++ b/meson.build
@@ -17,7 +17,7 @@ endif
i18n = import('i18n')
-po_dir = meson.source_root() / 'po'
+po_dir = meson.project_source_root() / 'po'
# figure out if we are building from git
--
2.45.2
3 weeks, 1 day
[PATCH] access: fix po_check when polkit is disabled
by Daniel P. Berrangé
The generated org.libvirt.api.policy.in file was recently added to the
POTFILES list as it contains translatable messages.
It is only generated when WITH_POLKIT && WITH_LIBVIRTD is satisfied
though, resulting in the 'po_check' syntax rule failing if either of
those conditions are not met.
It is harmless to unconditionally generate this file, as a separate
rule takes care of of installing it, and the latter remains under
the build conditions.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/access/meson.build | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/access/meson.build b/src/access/meson.build
index 0cc9cf2b79..d1336c0093 100644
--- a/src/access/meson.build
+++ b/src/access/meson.build
@@ -63,19 +63,22 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
)
endforeach
+# Generated outside the WITH_POLKIT / WITH_LIBVIRTD condition
+# because syntax-check/po_check requires this to exist
+polgen = custom_target(
+ 'org.libvirt.api.policy.in',
+ input: access_perm_h,
+ output: 'org.libvirt.api.policy.in',
+ command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ],
+ capture: true,
+ build_by_default: true,
+)
+access_generated += polgen
+
if conf.has('WITH_POLKIT')
access_sources += access_polkit_sources
if conf.has('WITH_LIBVIRTD')
- polgen = custom_target(
- 'org.libvirt.api.policy.in',
- input: access_perm_h,
- output: 'org.libvirt.api.policy.in',
- command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ],
- capture: true,
- build_by_default: true,
- )
- access_generated += polgen
i18n.merge_file(
input: polgen,
--
2.47.1
3 weeks, 1 day
[PATCH] qemu: support vlan change for linux host bridge during update-device
by Laine Stump
Since we previously only supported vlan tagging for interfaces
connected to an OVS bridge [*], the code in qemuChangeNet() (used by
the update-device API) assumed an interface with modified vlan config
was on an OVS bridge, and would call the OVS-specific
virNetDevOpenvswitchUpdateVlan().
Now that we support vlan tagging for interfaces connected to a
standard Linux host bridge, we must check the type of connection and
only call the OVS function when connected to an OVS bridge *both
before and after the update*. Otherwise we just set the flag to
re-connect to the bridge, which has the side effect of redoing the
vlan setup.
([*] or an SRIOV VF assigned using VFIO, but we don't support *any
runtime changes to that type of netdev so it's irrelevant here.)
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
I'm fine with this going in either before or after the 11.0.0 release
(would prefer before since it is a bugfix), but if it's going into the
release I'd rather it be included with RC2 rather than only in the
final release. For that reason, if someone ACKs the patch and agrees
that it's safe to go in, please push it for me (since Jiri will almost
certainly tag RC2 before I'm conscious on Monday morning)
src/qemu/qemu_hotplug.c | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index de0777d330..5a7e6c3b12 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4144,8 +4144,13 @@ qemuDomainChangeNet(virQEMUDriver *driver,
* they don't apply to a particular type.
*/
- if (!virNetDevVlanEqual(virDomainNetGetActualVlan(olddev),
- virDomainNetGetActualVlan(newdev))) {
+ /* since attaching to a new bridge will re-do the vlan setup,
+ * we don't need to separately do that in the case that we're
+ * already switching to a different bridge
+ */
+ if (!(needBridgeChange ||
+ virNetDevVlanEqual(virDomainNetGetActualVlan(olddev),
+ virDomainNetGetActualVlan(newdev)))) {
needVlanUpdate = true;
}
@@ -4215,6 +4220,23 @@ qemuDomainChangeNet(virQEMUDriver *driver,
needReplaceDevDef = true;
}
+ if (needVlanUpdate) {
+ if (virDomainNetDefIsOvsport(olddev) && virDomainNetDefIsOvsport(newdev)) {
+ /* optimization if we're attached to an OVS bridge. This
+ * will redo vlan setup without needing to re-attach the
+ * tap device to the bridge
+ */
+ if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, &newdev->vlan) < 0)
+ goto cleanup;
+ } else {
+ /* vlan setup is done as a part of reconnecting the tap
+ * device to a new bridge (either OVS or Linux host bridge).
+ */
+ needBridgeChange = true;
+ }
+ needReplaceDevDef = true;
+ }
+
if (needBridgeChange) {
if (qemuDomainChangeNetBridge(vm, olddev, newdev) < 0)
goto cleanup;
@@ -4266,12 +4288,6 @@ qemuDomainChangeNet(virQEMUDriver *driver,
goto cleanup;
}
- if (needVlanUpdate) {
- if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, &newdev->vlan) < 0)
- goto cleanup;
- needReplaceDevDef = true;
- }
-
if (needReplaceDevDef) {
/* the changes above warrant replacing olddev with newdev in
* the domain's nets list.
--
2.47.1
3 weeks, 1 day
[PATCH 0/2] news: add a couple items before release
by Laine Stump
This adds a "new feature" for the VLAN tagging support on Linux host
bridges added by Leigh Brown, and an "improvement" (migration between
mdev<->SRIOV vGPUs) by me.
Feel free to push this for me so it can be included in RC2.
*** BLURB HERE ***
Laine Stump (2):
news: note addition of vlan tagging support for Linux host bridges
news: document support for mdev <-> SRIOV VF vGPU live migration
NEWS.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
--
2.47.1
3 weeks, 2 days
[PATCH] qemu_migration: Do not consider post-copy active in postcopy-recover
by Jiri Denemark
The postcopy-recover migration state in QEMU means a connection for the
migration stream was established. Depending on the schedulers on both
hosts a relative timing of the corresponding MIGRATION event on the
source host and the destination host may differ. Specifically it's
possible that the source sees postcopy-recover while the destination is
still in postcopy-paused.
Currently the Perform phase on the source host ends when we get
postcopy-recover event and the Finish phase on the destination host is
called. If this is fast enough we can still see postcopy-paused state
when the Finish phase starts waiting for migration to complete. This is
interpreted as a failure and reported back to the caller. Even though
the recovery may actually start just a few moments later.
To avoid this race we now don't consider post-copy migration active in
postcopy-recover state and keep waiting for postcopy-active event (in
the success path). Thus the Finish phase is entered only after the
migration switches to postcopy-active. In this state QEMU guarantees the
destination already switched at least to postcopy-recover and we won't
be confused be seeing an old postcopy-failed state.
https://issues.redhat.com/browse/RHEL-73085
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 50e350b0c4..1582a738a3 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1872,11 +1872,11 @@ qemuMigrationUpdateJobType(virDomainJobData *jobData)
switch ((qemuMonitorMigrationStatus) priv->stats.mig.status) {
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
- case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY;
break;
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
+ case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER;
break;
--
2.47.1
3 weeks, 2 days
[PATCH] conf: Do not parse hyperv features with passthrough mode
by Martin Kletzander
The schema does not allow that anyway and we then format them all back
which leads to libvirt producing an invalid XML.
Resolves: https://issues.redhat.com/browse/RHEL-70656
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/domain_conf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e658b68c48b6..3f88a77a8fea 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16643,6 +16643,9 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def,
def->features[VIR_DOMAIN_FEATURE_HYPERV] = mode;
+ if (mode == VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH)
+ return 0;
+
node = xmlFirstElementChild(node);
while (node != NULL) {
int feature;
--
2.47.1
3 weeks, 2 days
Virtual manager error
by Domenico Panella
Hi everyone,
when i try to run a VM through virt-manager application (Slackware 15),
I get the following error:
*Errore nell'avvio del dominio: internal error: unknown architecture
'loongarch64'**
**
**Traceback (most recent call last):**
** File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in
cb_wrapper**
** callback(asyncjob, *args, **kwargs)**
** File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in
tmpcb**
** callback(*args, **kwargs)**
** File "/usr/share/virt-manager/virtManager/object/libvirtobject.py",
line 57, in newfn**
** ret = fn(self, *args, **kwargs)**
** File "/usr/share/virt-manager/virtManager/object/domain.py", line
1402, in startup**
** self._backend.create()**
** File "/usr/lib64/python3.9/site-packages/libvirt.py", line 1373, in
create**
** raise libvirtError('virDomainCreate() failed')**
**libvirt.libvirtError: internal error: unknown architecture 'loongarch64'*
How can i fix it?
Cordially
Domenico
3 weeks, 2 days
[PATCH v4 0/4] iproute2 bridge vlan support
by Leigh Brown
I have incorporated Laine's feedback and added Reviewed-by tags. I also
noticed that I hadn't updated the patch series description, so I updated
it to reflect the change to using netlink, for posterity.
Description
-----------
The iproute2 bridge command supports the capability for VLAN filtering
that allows each interface connected to a standard linux bridge to be
configured to use one or more VLANs. For simple setups, this capability
is enough to allow virtual machines or containers to be put onto
separate VLANs without creating multiple bridges and VLANs on the host.
The first patch adds a new function virNetDevBridgeVlanFilterSet that
allows a VLAN filter to be added or removed from an interface associated
with a bridge.
The second patch adds virNetDevBridgeSetupVlans that will, given a
virNetDevVlan structure, call virNetDevBridgeVlanFilterSet to apply the
required VLAN filtering for the given interface.
The third patch adjusts the domain and network validation to permit
standard linux bridges to allow VLAN configuration and updates calls to
virNetDevBridgeAddPort to pass the VLAN configuration.
The fourth patch updates documentation to match the new capability.
Changes since v3
----------------
- Update patch series description.
- Fix coding style.
- Add G_GNUC_UNUSED annotation to virNetDevBridgeAddPort for MacOS.
Changes since v2
----------------
- Convert to use netlink rather than executing bridge vlan commands.
- Add unsupported on this platform error message on FreeBSD.
Changes since v1
----------------
- Fix bug in virNetDevSetupVlans where bridge port has no native vlan.
- Update bridge network validation to permit vlan configuration.
- Update documentation to match the functionality.
- Tweak some of the commit descriptions for clarity.
Usage example
-------------
Configure the host with systemd-networkd as follows:
/etc/systemd/network/br0.netdev (br0.network not shown)
[NetDev]
Name=br0
Kind=bridge
MACAddress=xx:xx:xx:xx:xx:xx
[Bridge]
VLANFiltering=on
/etc/systemd/network/eno1.network
[Match]
Name=eno1
[Network]
Bridge=br0
[Link]
MTUBytes=9000
[BridgeVLAN]
VLAN=40
[BridgeVLAN]
VLAN=60
Then add <vlan> tags into the lxc or qemu config:
lxc interface definition:
<interface type='bridge'>
<mac address='xx:xx:xx:xx:xx:xx'/>
<source bridge='br0'/>
<vlan>
<tag id='40'/>
</vlan>
</interface>
qemu interface definition:
<interface type='network'>
<mac address='xx:xx:xx:xx:xx:xx'/>
<source network='br0'/>
<vlan>
<tag id='60'/>
</vlan>
<model type='virtio'/>
<address type='pci' domain='0x0000'
bus='0x01' slot='0x00' function='0x0'/>
</interface>
Then, after starting them, you will see the following
$ sudo bridge vlan
port vlan-id
eno1 1 PVID Egress Untagged
40
60
br0 1 PVID Egress Untagged
vnet0 60 PVID Egress Untagged
vnet1 40 PVID Egress Untagged
Regards,
Leigh Brown (4):
util: add netlink bridge vlan filtering
util: Add vlan support to virNetDevBridgeAddPort
Enable vlan support for standard linux bridges
docs: standard linux bridges now support vlans
docs/formatdomain.rst | 37 +++++++++---------
docs/formatnetwork.rst | 45 +++++++++++-----------
src/conf/domain_validate.c | 3 +-
src/lxc/lxc_process.c | 2 +-
src/network/bridge_driver.c | 13 ++++---
src/util/virnetdevbridge.c | 75 +++++++++++++++++++++++++++++++++++--
src/util/virnetdevbridge.h | 4 +-
src/util/virnetdevtap.c | 2 +-
src/util/virnetlink.c | 66 ++++++++++++++++++++++++++++++++
src/util/virnetlink.h | 7 ++++
10 files changed, 201 insertions(+), 53 deletions(-)
--
2.39.5
3 weeks, 4 days
[libvirt PATCH] qemu: snapshot: delete disk image only if parent snapshot is external
by Pavel Hrdina
When we are deleting external snapshot that is not active we only need
to delete overlay disk image of the parent snapshot. This works
correctly even if parent snapshot is external and active as it will have
another overlay created when user reverted to that snapshot.
In case the parent snapshot is internal there are no overlay disk images
created as everything is stored internally within the disk image. In
this case we would delete the actual disk image storing internal
snapshots and most likely the original disk image as well resulting in
data loss once the VM is shutoff.
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/734
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 18b2e478f6..80cd54bf33 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -3144,6 +3144,8 @@ qemuSnapshotDeleteExternalPrepareData(virDomainObj *vm,
return -1;
}
+ data->parentSnap = qemuSnapshotFindParentSnapForDisk(snap, data->snapDisk);
+
if (data->merge) {
virStorageSource *snapDiskSrc = NULL;
@@ -3185,8 +3187,6 @@ qemuSnapshotDeleteExternalPrepareData(virDomainObj *vm,
qemuSnapshotGetDisksWithBackingStore(vm, snap, data);
}
- data->parentSnap = qemuSnapshotFindParentSnapForDisk(snap, data->snapDisk);
-
if (data->parentSnap && !virDomainSnapshotIsExternal(data->parentSnap)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("deleting external snapshot that has internal snapshot as parent not supported"));
@@ -3642,10 +3642,12 @@ qemuSnapshotDiscardExternal(virDomainObj *vm,
if (!data->job)
goto error;
} else {
- if (virStorageSourceInit(data->parentDomDisk->src) < 0 ||
- virStorageSourceUnlink(data->parentDomDisk->src) < 0) {
- VIR_WARN("Failed to remove snapshot image '%s'",
- data->snapDisk->name);
+ if (data->parentSnap && virDomainSnapshotIsExternal(data->parentSnap)) {
+ if (virStorageSourceInit(data->parentDomDisk->src) < 0 ||
+ virStorageSourceUnlink(data->parentDomDisk->src) < 0) {
+ VIR_WARN("Failed to remove snapshot image '%s'",
+ data->snapDisk->name);
+ }
}
}
}
--
2.47.1
3 weeks, 4 days
[PATCH 0/1] RFC: Add Arm CCA support for getting capability information and running Realm VM
by Akio Kakuno
Hi, all.
- This patch adds Arm CCA support to qemu driver for aarch64 system.
CCA is an abbreviation for Arm Confidential Compute Architecture feature,
it enhances the virtualization capabilities of the platform by separating
the management of resources from access to those resources.
- We are not yet at the stage where we can merge this patch as host
linux/qemu suppor is no yet merged, but I would like to receive reviews
and comments on the overall direction.
[summary]
- At this stage, all you can do is getting the CCA capability with the virsh
domcapabilities command and start the CCA VM with the virsh create command.
- capability info uses qemu QMP to query qemu options. The option that
exists now is for selecting a hash algorithm.
[Capability example]
- Execution results of 'virsh domcapability" on qemu
<domaincapabilities>
...
<features>
...
</sgx>
<cca supported='yes'>
<enum name='measurement-algo'>
<value>sha256</value>
<value>sha512</value>
</enum>
</cca>
<hyperv supported='yes'>
...
</features>
</domaincapabilities>
[XML example]
<domain>
...
<launchsecurity type='cca'>
<measurement-algo>sha256</measurement-algo>
</launchsecurity>
...
</domain>
[limitations/tests]
- To obtain capability info, it is necessary to support the qemu QMP command,
which qemu does not yet support. Therefore, I put a hack in the code at
hand and only confirmed the communication. Also, I think we should check
whether CPUFW supports CCA or not in qemu_firmware.c, but it is not yet
implemented.
- Verified that the CCA VM can be started from virsh create command.
[software version]
- I followed the steps in Linaro's blog below.
https://linaro.atlassian.net/wiki/spaces/QEMU/pages/29051027459/Building+...
- The Qemu used was based on Linaro's qemu(9.1.91).
https://git.codelinaro.org/linaro/dcap/qemu/-/tree/cca/v3?ref_type=heads
Signed-off-by: Akio Kakuno <fj3333bs(a)fujitsu.com>
Best Regards.
Akio Kakuno (1):
RFC: Add Arm CCA support for getting capability information and
running Realm VM
docs/formatdomain.rst | 28 ++++++
docs/formatdomaincaps.rst | 26 ++++-
src/conf/domain_capabilities.c | 41 ++++++++
src/conf/domain_capabilities.h | 12 +++
src/conf/domain_conf.c | 13 +++
src/conf/domain_conf.h | 7 ++
src/conf/schemas/domaincaps.rng | 14 +++
src/conf/schemas/domaincommon.rng | 14 +++
src/conf/virconftypes.h | 2 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 156 ++++++++++++++++++++++++++++++
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_cgroup.c | 2 +
src/qemu/qemu_command.c | 32 ++++++
src/qemu/qemu_driver.c | 2 +
src/qemu/qemu_monitor.c | 10 ++
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 104 ++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 4 +
src/qemu/qemu_namespace.c | 2 +
src/qemu/qemu_process.c | 4 +
src/qemu/qemu_validate.c | 7 ++
22 files changed, 487 insertions(+), 1 deletion(-)
--
2.34.1
3 weeks, 5 days