Devel
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
September 2026
- 31 participants
- 69 discussions
Extended Destination ID is an alternative to interrupt remapping in
IOMMU enabled in QEMU by default when kernel-irqchip=split is used.
Signed-off-by: Anton Gerasimov <agerasimov(a)nebius.com>
---
src/qemu/qemu_validate.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index e946f55351..c8af25828b 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -954,10 +954,12 @@ qemuValidateDomainVCpuTopology(const virDomainDef *def, virQEMUCaps *qemuCaps)
QEMU_MAX_VCPUS_WITHOUT_X2APIC);
return -1;
}
- if (!def->iommus || (def->iommus[0]->eim != VIR_TRISTATE_SWITCH_ON &&
- def->iommus[0]->xtsup != VIR_TRISTATE_SWITCH_ON)) {
+ if ((def->features[VIR_DOMAIN_FEATURE_IOAPIC] != VIR_DOMAIN_IOAPIC_QEMU) &&
+ (!def->iommus ||
+ (def->iommus[0]->eim != VIR_TRISTATE_SWITCH_ON &&
+ def->iommus[0]->xtsup != VIR_TRISTATE_SWITCH_ON))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("more than %1$d vCPUs require EIM or XTSup mode enabled on the iommu device"),
+ _("more than %1$d vCPUs require either IOAPIC in QEMU or an iommu device with EIM or XTSup mode enabled"),
QEMU_MAX_VCPUS_WITHOUT_X2APIC);
return -1;
}
--
2.43.0
2
1
Bhyve supports two types of fwcfg interfaces: 'bhyve' and 'qemu'. The
default one is 'bhyve', but it's very limited, and it only reports the
CPU count to the guest firmware.
So switch to the more feature-rich and popular 'qemu' interface.
As this change is unconditional for every domain, it's important to
note the support status. This feature is supported by bhyve
in FreeBSD 13.x releases starting with 13.3-RELEASE, and by every major
release after that. So it covers every currently supported FreeBSD
release and even provides a fairly good margin for the outdated
releases.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
src/bhyve/bhyve_command.c | 1 +
.../x86_64/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-firmware-efi.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args | 2 +-
.../bhyvexml2argv-uefi-nvram-template-and-source-set.args | 2 +-
.../x86_64/bhyvexml2argv-uefi-nvram-template-set.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-autoport.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-password.args | 2 +-
.../bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-resolution.args | 2 +-
.../bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-io.args | 2 +-
.../bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-off.args | 2 +-
.../bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-on.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait-no.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait.args | 2 +-
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc.args | 2 +-
17 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index f0a87cffea..ba7e7e29cb 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -1245,6 +1245,7 @@ virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def,
virBufferAsprintf(&buf, "bootrom,%s", def->os.loader->path);
if (def->os.loader->nvram && def->os.loader->nvram->path)
virBufferAsprintf(&buf, ",%s", def->os.loader->nvram->path);
+ virBufferAddStr(&buf, ",fwcfg=qemu");
virCommandAddArgList(cmd, "-l", virBufferCurrentContent(&buf), NULL);
} else {
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
index 8517c0d06a..290afc988d 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 2:0,lpc \
-s 3:0,ahci,hd:/tmp/freebsd.img \
-s 1:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-firmware-efi.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-firmware-efi.args
index 16b9c50535..b8d9c9b17a 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-firmware-efi.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-firmware-efi.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,fakefirmwaredir/BHYVE_UEFI.fd,fakenvramdir/bhyve_VARS.fd \
+-l bootrom,fakefirmwaredir/BHYVE_UEFI.fd,fakenvramdir/bhyve_VARS.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args
index 15efd1c357..00dc61551b 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-numa.args
@@ -7,7 +7,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,fakefirmwaredir/BHYVE_UEFI.fd,fakenvramdir/bhyve_VARS.fd \
+-l bootrom,fakefirmwaredir/BHYVE_UEFI.fd,fakenvramdir/bhyve_VARS.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-and-source-set.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-and-source-set.args
index 05a9e8df2c..87df1d82e5 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-and-source-set.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-and-source-set.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd,/path/to/nvram/guest_VARS.fd \
+-l bootrom,/path/to/test.fd,/path/to/nvram/guest_VARS.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-set.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-set.args
index 0d367e99f1..89cdb831eb 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-set.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram-template-set.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd,fakenvramdir/bhyve_VARS.fd \
+-l bootrom,/path/to/test.fd,fakenvramdir/bhyve_VARS.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram.args
index 0d367e99f1..89cdb831eb 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi-nvram.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd,fakenvramdir/bhyve_VARS.fd \
+-l bootrom,/path/to/test.fd,fakenvramdir/bhyve_VARS.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi.args
index 479712967d..d7e0fc534a 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-uefi.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-autoport.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-autoport.args
index 3991f9fc16..e094952962 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-autoport.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-autoport.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-password.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-password.args
index dfd3b0a285..8a257e3c48 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-password.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-password.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-resolution.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-resolution.args
index 52cae37f76..18833b0538 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-resolution.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-resolution.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,fbuf,tcp=127.0.0.1:5904,w=1920,h=1080 \
bhyve
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-io.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-io.args
index 80e2bd7223..d15683cb5b 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-io.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-io.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-off.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-off.args
index 1975fdc4d7..09fad5a4e2 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-off.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-off.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-on.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-on.args
index e62dfff239..7e649472e6 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-on.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-vgaconf-on.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait-no.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait-no.args
index 049e65227d..11d8ef0c72 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait-no.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait-no.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait.args
index 4394bdfb4b..352102c161 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc-wait.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
diff --git a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc.args b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc.args
index 049e65227d..11d8ef0c72 100644
--- a/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc.args
+++ b/tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-vnc.args
@@ -5,7 +5,7 @@ bhyve \
-H \
-P \
-s 0:0,hostbridge \
--l bootrom,/path/to/test.fd \
+-l bootrom,/path/to/test.fd,fwcfg=qemu \
-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--
2.55.0
2
2
Add virNetDevBridgePort{Get,Set}Isolated implementation for FreeBSD.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
src/util/virnetdevbridge.c | 138 ++++++++++++++++++++++++++++++-------
1 file changed, 115 insertions(+), 23 deletions(-)
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 4b804e4faa..4d7052d6f5 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -289,29 +289,6 @@ virNetDevBridgePortSetUnicastFlood(const char *brname,
}
-int
-virNetDevBridgePortGetIsolated(const char *brname,
- const char *ifname,
- bool *enable)
-{
- unsigned long value;
-
- if (virNetDevBridgePortGet(brname, ifname, "isolated", &value) < 0)
- return -1;
-
- *enable = !!value;
- return 0;
-}
-
-
-int
-virNetDevBridgePortSetIsolated(const char *brname,
- const char *ifname,
- bool enable)
-{
- return virNetDevBridgePortSet(brname, ifname, "isolated", enable ? 1 : 0);
-}
-
static int
virNetDevBridgeSetupVlans(const char *ifname, const virNetDevVlan *virtVlan)
{
@@ -416,8 +393,123 @@ virNetDevBridgePortSetUnicastFlood(const char *brname G_GNUC_UNUSED,
_("Unable to set bridge port unicast_flood on this platform"));
return -1;
}
+#endif
+
+#if defined(__linux__)
+int
+virNetDevBridgePortGetIsolated(const char *brname,
+ const char *ifname,
+ bool *enable)
+{
+ unsigned long value;
+
+ if (virNetDevBridgePortGet(brname, ifname, "isolated", &value) < 0)
+ return -1;
+
+ *enable = !!value;
+ return 0;
+}
+
+
+int
+virNetDevBridgePortSetIsolated(const char *brname,
+ const char *ifname,
+ bool enable)
+{
+ return virNetDevBridgePortSet(brname, ifname, "isolated", enable ? 1 : 0);
+}
+
+#elif defined(WITH_BSD_BRIDGE_MGMT) && defined(IFBIF_PRIVATE)
+static int
+virNetDevBridgePortGet(const char *brname,
+ const char *ifname,
+ uint32_t flag,
+ unsigned long *value)
+{
+ struct ifbreq req = { 0 };
+
+ if (virStrcpyStatic(req.ifbr_ifsname, ifname) < 0) {
+ virReportSystemError(ERANGE,
+ _("Network interface name '%1$s' is too long"),
+ ifname);
+ return -1;
+ }
+
+ if (virNetDevBridgeCmd(brname, BRDGGIFFLGS, &req, sizeof(req), false) < 0) {
+ virReportSystemError(errno,
+ _("Unable to get bridge %1$s port %2$s flags"),
+ brname, ifname);
+ return -1;
+ }
+
+ *value = req.ifbr_ifsflags & flag;
+
+ return 0;
+}
+
+
+static int
+virNetDevBridgePortSet(const char *brname,
+ const char *ifname,
+ uint32_t flag,
+ unsigned long value)
+{
+ struct ifbreq req = { 0 };
+
+ if (virStrcpyStatic(req.ifbr_ifsname, ifname) < 0) {
+ virReportSystemError(ERANGE,
+ _("Network interface name '%1$s' is too long"),
+ ifname);
+ return -1;
+ }
+
+ if (virNetDevBridgeCmd(brname, BRDGGIFFLGS, &req, sizeof(req), false) < 0) {
+ virReportSystemError(errno,
+ _("Unable to get bridge %1$s port %2$s flags"),
+ brname, ifname);
+ return -1;
+ }
+
+ if (value)
+ req.ifbr_ifsflags |= flag;
+ else
+ req.ifbr_ifsflags &= ~flag;
+
+ if (virNetDevBridgeCmd(brname, BRDGSIFFLGS, &req, sizeof(req), true) < 0) {
+ virReportSystemError(errno,
+ _("Unable to set bridge %1$s port %2$s flags"),
+ brname, ifname);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int
+virNetDevBridgePortGetIsolated(const char *brname,
+ const char *ifname,
+ bool *enable)
+{
+ unsigned long value;
+
+ if (virNetDevBridgePortGet(brname, ifname, IFBIF_PRIVATE, &value) < 0)
+ return -1;
+
+ *enable = !!value;
+ return 0;
+}
+int
+virNetDevBridgePortSetIsolated(const char *brname,
+ const char *ifname,
+ bool enable)
+{
+ return virNetDevBridgePortSet(brname, ifname, IFBIF_PRIVATE, enable);
+}
+
+#else
int
virNetDevBridgePortGetIsolated(const char *brname G_GNUC_UNUSED,
const char *ifname G_GNUC_UNUSED,
--
2.55.0
2
1
From: Michal Privoznik <mprivozn(a)redhat.com>
Reflect libselinux package change name on Debian, and allow
docker images to fetch arch specific images.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Green pipeline:
https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/2874965579
ci/buildenv/debian-13-cross-aarch64.sh | 2 +-
ci/buildenv/debian-13-cross-armv6l.sh | 2 +-
ci/buildenv/debian-13-cross-armv7l.sh | 2 +-
ci/buildenv/debian-13-cross-i686.sh | 2 +-
ci/buildenv/debian-13-cross-ppc64le.sh | 2 +-
ci/buildenv/debian-13-cross-riscv64.sh | 2 +-
ci/buildenv/debian-13-cross-s390x.sh | 2 +-
ci/buildenv/debian-13.sh | 2 +-
ci/buildenv/debian-sid-cross-aarch64.sh | 2 +-
ci/buildenv/debian-sid-cross-armv6l.sh | 2 +-
ci/buildenv/debian-sid-cross-armv7l.sh | 2 +-
ci/buildenv/debian-sid-cross-i686.sh | 2 +-
ci/buildenv/debian-sid-cross-ppc64le.sh | 2 +-
ci/buildenv/debian-sid-cross-riscv64.sh | 2 +-
ci/buildenv/debian-sid-cross-s390x.sh | 2 +-
ci/buildenv/debian-sid.sh | 2 +-
ci/buildenv/ubuntu-2404.sh | 2 +-
ci/buildenv/ubuntu-2604.sh | 2 +-
ci/containers/debian-13-cross-aarch64.Dockerfile | 4 ++--
ci/containers/debian-13-cross-armv6l.Dockerfile | 4 ++--
ci/containers/debian-13-cross-armv7l.Dockerfile | 4 ++--
ci/containers/debian-13-cross-i686.Dockerfile | 4 ++--
ci/containers/debian-13-cross-ppc64le.Dockerfile | 4 ++--
ci/containers/debian-13-cross-riscv64.Dockerfile | 4 ++--
ci/containers/debian-13-cross-s390x.Dockerfile | 4 ++--
ci/containers/debian-13.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-aarch64.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-armv6l.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-armv7l.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-i686.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-ppc64le.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-riscv64.Dockerfile | 4 ++--
ci/containers/debian-sid-cross-s390x.Dockerfile | 4 ++--
ci/containers/debian-sid.Dockerfile | 4 ++--
ci/containers/ubuntu-2404.Dockerfile | 2 +-
ci/containers/ubuntu-2604.Dockerfile | 2 +-
36 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/ci/buildenv/debian-13-cross-aarch64.sh b/ci/buildenv/debian-13-cross-aarch64.sh
index 31486c93fc..39cbe16569 100644
--- a/ci/buildenv/debian-13-cross-aarch64.sh
+++ b/ci/buildenv/debian-13-cross-aarch64.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
- libselinux1-dev:arm64 \
+ libselinux-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
diff --git a/ci/buildenv/debian-13-cross-armv6l.sh b/ci/buildenv/debian-13-cross-armv6l.sh
index cad3f59aca..f8325959c8 100644
--- a/ci/buildenv/debian-13-cross-armv6l.sh
+++ b/ci/buildenv/debian-13-cross-armv6l.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
- libselinux1-dev:armel \
+ libselinux-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
diff --git a/ci/buildenv/debian-13-cross-armv7l.sh b/ci/buildenv/debian-13-cross-armv7l.sh
index 87a93b1866..cdc0dc8218 100644
--- a/ci/buildenv/debian-13-cross-armv7l.sh
+++ b/ci/buildenv/debian-13-cross-armv7l.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
- libselinux1-dev:armhf \
+ libselinux-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
diff --git a/ci/buildenv/debian-13-cross-i686.sh b/ci/buildenv/debian-13-cross-i686.sh
index 729f32540a..c46ac5ad45 100644
--- a/ci/buildenv/debian-13-cross-i686.sh
+++ b/ci/buildenv/debian-13-cross-i686.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
- libselinux1-dev:i386 \
+ libselinux-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
diff --git a/ci/buildenv/debian-13-cross-ppc64le.sh b/ci/buildenv/debian-13-cross-ppc64le.sh
index 40a0aa5e25..6c1948bb59 100644
--- a/ci/buildenv/debian-13-cross-ppc64le.sh
+++ b/ci/buildenv/debian-13-cross-ppc64le.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
- libselinux1-dev:ppc64el \
+ libselinux-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
diff --git a/ci/buildenv/debian-13-cross-riscv64.sh b/ci/buildenv/debian-13-cross-riscv64.sh
index 7e1cc85ffe..46ed10097e 100644
--- a/ci/buildenv/debian-13-cross-riscv64.sh
+++ b/ci/buildenv/debian-13-cross-riscv64.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:riscv64 \
libsanlock-dev:riscv64 \
libsasl2-dev:riscv64 \
- libselinux1-dev:riscv64 \
+ libselinux-dev:riscv64 \
libssh-dev:riscv64 \
libssh2-1-dev:riscv64 \
libtirpc-dev:riscv64 \
diff --git a/ci/buildenv/debian-13-cross-s390x.sh b/ci/buildenv/debian-13-cross-s390x.sh
index 38ebd83560..0f35644285 100644
--- a/ci/buildenv/debian-13-cross-s390x.sh
+++ b/ci/buildenv/debian-13-cross-s390x.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
- libselinux1-dev:s390x \
+ libselinux-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
diff --git a/ci/buildenv/debian-13.sh b/ci/buildenv/debian-13.sh
index b9bbabfc94..8b02411105 100644
--- a/ci/buildenv/debian-13.sh
+++ b/ci/buildenv/debian-13.sh
@@ -53,7 +53,7 @@ function install_buildenv() {
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/buildenv/debian-sid-cross-aarch64.sh b/ci/buildenv/debian-sid-cross-aarch64.sh
index 31486c93fc..39cbe16569 100644
--- a/ci/buildenv/debian-sid-cross-aarch64.sh
+++ b/ci/buildenv/debian-sid-cross-aarch64.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
- libselinux1-dev:arm64 \
+ libselinux-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
diff --git a/ci/buildenv/debian-sid-cross-armv6l.sh b/ci/buildenv/debian-sid-cross-armv6l.sh
index cad3f59aca..f8325959c8 100644
--- a/ci/buildenv/debian-sid-cross-armv6l.sh
+++ b/ci/buildenv/debian-sid-cross-armv6l.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
- libselinux1-dev:armel \
+ libselinux-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
diff --git a/ci/buildenv/debian-sid-cross-armv7l.sh b/ci/buildenv/debian-sid-cross-armv7l.sh
index 87a93b1866..cdc0dc8218 100644
--- a/ci/buildenv/debian-sid-cross-armv7l.sh
+++ b/ci/buildenv/debian-sid-cross-armv7l.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
- libselinux1-dev:armhf \
+ libselinux-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
diff --git a/ci/buildenv/debian-sid-cross-i686.sh b/ci/buildenv/debian-sid-cross-i686.sh
index 729f32540a..c46ac5ad45 100644
--- a/ci/buildenv/debian-sid-cross-i686.sh
+++ b/ci/buildenv/debian-sid-cross-i686.sh
@@ -72,7 +72,7 @@ function install_buildenv() {
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
- libselinux1-dev:i386 \
+ libselinux-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
diff --git a/ci/buildenv/debian-sid-cross-ppc64le.sh b/ci/buildenv/debian-sid-cross-ppc64le.sh
index 40a0aa5e25..6c1948bb59 100644
--- a/ci/buildenv/debian-sid-cross-ppc64le.sh
+++ b/ci/buildenv/debian-sid-cross-ppc64le.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
- libselinux1-dev:ppc64el \
+ libselinux-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
diff --git a/ci/buildenv/debian-sid-cross-riscv64.sh b/ci/buildenv/debian-sid-cross-riscv64.sh
index 7e1cc85ffe..46ed10097e 100644
--- a/ci/buildenv/debian-sid-cross-riscv64.sh
+++ b/ci/buildenv/debian-sid-cross-riscv64.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:riscv64 \
libsanlock-dev:riscv64 \
libsasl2-dev:riscv64 \
- libselinux1-dev:riscv64 \
+ libselinux-dev:riscv64 \
libssh-dev:riscv64 \
libssh2-1-dev:riscv64 \
libtirpc-dev:riscv64 \
diff --git a/ci/buildenv/debian-sid-cross-s390x.sh b/ci/buildenv/debian-sid-cross-s390x.sh
index 38ebd83560..0f35644285 100644
--- a/ci/buildenv/debian-sid-cross-s390x.sh
+++ b/ci/buildenv/debian-sid-cross-s390x.sh
@@ -74,7 +74,7 @@ function install_buildenv() {
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
- libselinux1-dev:s390x \
+ libselinux-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
diff --git a/ci/buildenv/debian-sid.sh b/ci/buildenv/debian-sid.sh
index b9bbabfc94..8b02411105 100644
--- a/ci/buildenv/debian-sid.sh
+++ b/ci/buildenv/debian-sid.sh
@@ -53,7 +53,7 @@ function install_buildenv() {
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/buildenv/ubuntu-2404.sh b/ci/buildenv/ubuntu-2404.sh
index 459a306061..41ec137294 100644
--- a/ci/buildenv/ubuntu-2404.sh
+++ b/ci/buildenv/ubuntu-2404.sh
@@ -54,7 +54,7 @@ function install_buildenv() {
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/buildenv/ubuntu-2604.sh b/ci/buildenv/ubuntu-2604.sh
index 459a306061..41ec137294 100644
--- a/ci/buildenv/ubuntu-2604.sh
+++ b/ci/buildenv/ubuntu-2604.sh
@@ -54,7 +54,7 @@ function install_buildenv() {
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/containers/debian-13-cross-aarch64.Dockerfile b/ci/containers/debian-13-cross-aarch64.Dockerfile
index 6293715d29..91256f62c4 100644
--- a/ci/containers/debian-13-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-13-cross-aarch64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
- libselinux1-dev:arm64 \
+ libselinux-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
diff --git a/ci/containers/debian-13-cross-armv6l.Dockerfile b/ci/containers/debian-13-cross-armv6l.Dockerfile
index 8c54391915..c5fdcd4a7d 100644
--- a/ci/containers/debian-13-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-13-cross-armv6l.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
- libselinux1-dev:armel \
+ libselinux-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
diff --git a/ci/containers/debian-13-cross-armv7l.Dockerfile b/ci/containers/debian-13-cross-armv7l.Dockerfile
index fd54af8649..e3c2c100a0 100644
--- a/ci/containers/debian-13-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-13-cross-armv7l.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
- libselinux1-dev:armhf \
+ libselinux-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
diff --git a/ci/containers/debian-13-cross-i686.Dockerfile b/ci/containers/debian-13-cross-i686.Dockerfile
index 3cb098e30f..91aa940293 100644
--- a/ci/containers/debian-13-cross-i686.Dockerfile
+++ b/ci/containers/debian-13-cross-i686.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
- libselinux1-dev:i386 \
+ libselinux-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
diff --git a/ci/containers/debian-13-cross-ppc64le.Dockerfile b/ci/containers/debian-13-cross-ppc64le.Dockerfile
index e18dcc9356..b39fb3353a 100644
--- a/ci/containers/debian-13-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-13-cross-ppc64le.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
- libselinux1-dev:ppc64el \
+ libselinux-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
diff --git a/ci/containers/debian-13-cross-riscv64.Dockerfile b/ci/containers/debian-13-cross-riscv64.Dockerfile
index 1901c8996c..cb2b0cba57 100644
--- a/ci/containers/debian-13-cross-riscv64.Dockerfile
+++ b/ci/containers/debian-13-cross-riscv64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:riscv64 \
libsanlock-dev:riscv64 \
libsasl2-dev:riscv64 \
- libselinux1-dev:riscv64 \
+ libselinux-dev:riscv64 \
libssh-dev:riscv64 \
libssh2-1-dev:riscv64 \
libtirpc-dev:riscv64 \
diff --git a/ci/containers/debian-13-cross-s390x.Dockerfile b/ci/containers/debian-13-cross-s390x.Dockerfile
index 99f55321b6..d24b139807 100644
--- a/ci/containers/debian-13-cross-s390x.Dockerfile
+++ b/ci/containers/debian-13-cross-s390x.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
- libselinux1-dev:s390x \
+ libselinux-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
diff --git a/ci/containers/debian-13.Dockerfile b/ci/containers/debian-13.Dockerfile
index c07fd4fac1..25aed078fb 100644
--- a/ci/containers/debian-13.Dockerfile
+++ b/ci/containers/debian-13.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:13-slim
+FROM docker.io/amd64/debian:13-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -55,7 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/containers/debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile
index ceaafbc41d..bc35a0f289 100644
--- a/ci/containers/debian-sid-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-sid-cross-aarch64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
- libselinux1-dev:arm64 \
+ libselinux-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
diff --git a/ci/containers/debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile
index 3112f69a61..4d39cdc96c 100644
--- a/ci/containers/debian-sid-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv6l.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
- libselinux1-dev:armel \
+ libselinux-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
diff --git a/ci/containers/debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile
index 9aa194be53..0a595b98c5 100644
--- a/ci/containers/debian-sid-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv7l.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
- libselinux1-dev:armhf \
+ libselinux-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
diff --git a/ci/containers/debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile
index 0dc2dbba6e..22b2c9aef4 100644
--- a/ci/containers/debian-sid-cross-i686.Dockerfile
+++ b/ci/containers/debian-sid-cross-i686.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -83,7 +83,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
- libselinux1-dev:i386 \
+ libselinux-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
diff --git a/ci/containers/debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
index 0f5c2e749a..16ecb3ce96 100644
--- a/ci/containers/debian-sid-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
- libselinux1-dev:ppc64el \
+ libselinux-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
diff --git a/ci/containers/debian-sid-cross-riscv64.Dockerfile b/ci/containers/debian-sid-cross-riscv64.Dockerfile
index 77ca513dfd..5dc7205561 100644
--- a/ci/containers/debian-sid-cross-riscv64.Dockerfile
+++ b/ci/containers/debian-sid-cross-riscv64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:riscv64 \
libsanlock-dev:riscv64 \
libsasl2-dev:riscv64 \
- libselinux1-dev:riscv64 \
+ libselinux-dev:riscv64 \
libssh-dev:riscv64 \
libssh2-1-dev:riscv64 \
libtirpc-dev:riscv64 \
diff --git a/ci/containers/debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile
index 71588cd829..0364884e52 100644
--- a/ci/containers/debian-sid-cross-s390x.Dockerfile
+++ b/ci/containers/debian-sid-cross-s390x.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -85,7 +85,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
- libselinux1-dev:s390x \
+ libselinux-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile
index fd23cb16ac..6a92894e99 100644
--- a/ci/containers/debian-sid.Dockerfile
+++ b/ci/containers/debian-sid.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM docker.io/library/debian:sid-slim
+FROM docker.io/amd64/debian:sid-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@@ -55,7 +55,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/containers/ubuntu-2404.Dockerfile b/ci/containers/ubuntu-2404.Dockerfile
index bb487d7a64..135cc21550 100644
--- a/ci/containers/ubuntu-2404.Dockerfile
+++ b/ci/containers/ubuntu-2404.Dockerfile
@@ -56,7 +56,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
diff --git a/ci/containers/ubuntu-2604.Dockerfile b/ci/containers/ubuntu-2604.Dockerfile
index a631af360f..c0c296f20d 100644
--- a/ci/containers/ubuntu-2604.Dockerfile
+++ b/ci/containers/ubuntu-2604.Dockerfile
@@ -56,7 +56,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
- libselinux1-dev \
+ libselinux-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
--
2.55.0
3
3
[PATCH 0/2] remote: fix a daemon self-deadlock on the stream error path
by Denis V. Lunev 23 Sep '26
by Denis V. Lunev 23 Sep '26
23 Sep '26
daemonStreamEvent() holds priv->lock across its whole body and closes
the client from every error path. The close hook runs in the same
thread and takes priv->lock again, so the daemon main loop deadlocks
against itself and the host stops answering RPC entirely while its
guests keep running. Only a restart of the daemon recovers.
We hit this in the field on 9.5.0, and current master is affected the
same way. Getting there needs a client already marked wantClose while
one of its streams still delivers events, which is presumably why it
has gone unnoticed since 9.2.0.
Patch 1 closes the client after the lock guard has gone out of scope.
Patch 2 adds a test for it, which needs remote_daemon_stream.c compiled
into a test binary; that is the only build change and it pulls in the
generated protocol headers via remote_daemon.h. The test deadlocks
without patch 1 and passes with it.
Signed-off-by: Denis V. Lunev <den(a)openvz.org>
Denis V. Lunev (2):
remote: fix daemon deadlock when a stream event closes its client
tests: add daemonstreamtest covering the stream close deadlock
src/remote/meson.build | 7 +-
src/remote/remote_daemon_stream.c | 58 ++++----
tests/daemonstreamtest.c | 212 ++++++++++++++++++++++++++++++
tests/meson.build | 9 ++
4 files changed, 262 insertions(+), 24 deletions(-)
create mode 100644 tests/daemonstreamtest.c
base-commit: 91d4618734bd6d02174b909aadb7d84a99560ebe
--
2.53.0
2
3
From: Davide Marro <dmarro(a)redhat.com>
QEMU uses uint64 values for block latency histogram boundaries, while
libvirt currently stores and parses them as unsigned int values.
This limits histogram boundaries to UINT32_MAX nanoseconds and prevents
using larger values supported by QEMU.
Use unsigned long long for latency histogram boundaries throughout the
domain configuration and QEMU monitor code. Update the XML schema and
parser accordingly, and serialize the values using the 64-bit JSON
number helper.
Extend the XML and QEMU monitor tests with a 5000000000 nanosecond
boundary to verify values above UINT32_MAX are preserved.
Resolves: https://gitlab.com/libvirt/libvirt/-/work_items/919
Signed-off-by: Davide Marro <dmarro(a)redhat.com>
---
src/conf/domain_conf.c | 12 ++---
src/conf/domain_conf.h | 10 ++--
src/conf/schemas/domaincommon.rng | 2 +-
src/qemu/qemu_monitor.c | 10 ++--
src/qemu/qemu_monitor.h | 10 ++--
src/qemu/qemu_monitor_json.c | 14 +++---
src/qemu/qemu_monitor_json.h | 10 ++--
tests/qemumonitorjsontest.c | 46 ++++++++++++++++---
...isk-statistics-intervals.x86_64-latest.xml | 1 +
.../disk-statistics-intervals.xml | 1 +
10 files changed, 75 insertions(+), 41 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1327793b0a..94a1f8bd8e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8427,7 +8427,7 @@ virDomainDiskDefDriverParseXMLHistogramOne(virDomainDiskDef *def,
xmlNodePtr cur)
{
g_autofree char *histogram_type = NULL;
- unsigned int **histogram_config = NULL;
+ unsigned long long **histogram_config = NULL;
g_autoptr(GPtrArray) binNodes = virXMLNodeGetSubelementList(cur, "bin");
size_t nbins = 0;
size_t i;
@@ -8463,12 +8463,12 @@ virDomainDiskDefDriverParseXMLHistogramOne(virDomainDiskDef *def,
return -1;
}
- *histogram_config = g_new0(unsigned int, binNodes->len + 1);
+ *histogram_config = g_new0(unsigned long long, binNodes->len + 1);
for (i = 0; i < binNodes->len; i++) {
- unsigned int val;
+ unsigned long long val;
- if (virXMLPropUInt(g_ptr_array_index(binNodes, i),
+ if (virXMLPropULongLong(g_ptr_array_index(binNodes, i),
"start", 10,
VIR_XML_PROP_REQUIRED,
&val) < 0)
@@ -24571,7 +24571,7 @@ virDomainDiskDefFormatThrottleFilters(virBuffer *buf,
static void
virDomainDiskDefFormatDriverHistogram(virBuffer *buf,
const char *type,
- unsigned int *bins)
+ unsigned long long *bins)
{
g_auto(virBuffer) histogramAttrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) histogramChildBuf = VIR_BUFFER_INIT_CHILD(buf);
@@ -24586,7 +24586,7 @@ virDomainDiskDefFormatDriverHistogram(virBuffer *buf,
virBufferAddLit(&histogramChildBuf, "<bin start='0'/>\n");
for (; *bins > 0; bins++)
- virBufferAsprintf(&histogramChildBuf, "<bin start='%u'/>\n", *bins);
+ virBufferAsprintf(&histogramChildBuf, "<bin start='%llu'/>\n", *bins);
virXMLFormatElement(buf, "latency-histogram", &histogramAttrBuf, &histogramChildBuf);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f7cbe7bf1d..eadb5a49a4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -599,11 +599,11 @@ struct _virDomainDiskDef {
unsigned int *statistics; /* Optional, zero terminated list of intervals to
collect statistics for */
/* optional zero terminated lists of bin boundaries for latency histograms */
- unsigned int *histogram_boundaries;
- unsigned int *histogram_boundaries_read;
- unsigned int *histogram_boundaries_write;
- unsigned int *histogram_boundaries_zone;
- unsigned int *histogram_boundaries_flush;
+ unsigned long long *histogram_boundaries;
+ unsigned long long *histogram_boundaries_read;
+ unsigned long long *histogram_boundaries_write;
+ unsigned long long *histogram_boundaries_zone;
+ unsigned long long *histogram_boundaries_flush;
virDomainDiskDetectZeroes detect_zeroes;
virTristateSwitch discard_no_unref;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 0c0a3597a9..d1b10c1c5f 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -2845,7 +2845,7 @@
<oneOrMore>
<element name='bin'>
<attribute name='start'>
- <ref name="unsignedInt"/>
+ <ref name="unsignedLong"/>
</attribute>
</element>
</oneOrMore>
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 21df06ebd8..2c86cd1971 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4558,11 +4558,11 @@ qemuMonitorBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush)
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush)
{
QEMU_CHECK_MONITOR(mon);
VIR_DEBUG("id='%s'", id);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index e560618bf4..e9b6a25f0c 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1988,11 +1988,11 @@ qemuMonitorBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush);
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush);
int
qemuMonitorAnnounceSelf(qemuMonitor *mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7e3249cd47..8e88dc9442 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -9176,7 +9176,7 @@ qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
static virJSONValue *
-qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
+qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned long long *bound)
{
g_autoptr(virJSONValue) ret = virJSONValueNewArray();
@@ -9184,7 +9184,7 @@ qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
return NULL;
for (; *bound > 0; bound++) {
- g_autoptr(virJSONValue) val = virJSONValueNewNumberUint(*bound);
+ g_autoptr(virJSONValue) val = virJSONValueNewNumberUlong(*bound);
/* the only error is if the first argument is not an array */
ignore_value(virJSONValueArrayAppend(ret, &val));
@@ -9197,11 +9197,11 @@ qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
int
qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush)
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 3b7b04a11d..63eded7ecb 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -818,11 +818,11 @@ qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush);
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush);
int
qemuMonitorJSONAnnounceSelf(qemuMonitor *mon,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 70f03afb81..a963029c69 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1130,13 +1130,45 @@ GEN_TEST_FUNC(qemuMonitorJSONSetAction,
GEN_TEST_FUNC(qemuMonitorJSONSetLaunchSecurityState, "sev_secret_header",
"sev_secret", 0, true)
-unsigned int testHistogramBoundaries[] = {10, 30, 50, 0};
-GEN_TEST_FUNC(qemuMonitorJSONBlockLatencyHistogramSet, "devid",
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries)
+static int
+testQemuMonitorJSONqemuMonitorJSONBlockLatencyHistogramSet(const void *opaque)
+{
+ const testQemuMonitorJSONSimpleFuncData *data = opaque;
+ virDomainXMLOption *xmlopt = data->xmlopt;
+ unsigned long long boundaries[] = {10, 30, 5000000000ULL, 0};
+ g_autoptr(qemuMonitorTest) test = NULL;
+
+ if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
+ return -1;
+
+ if (qemuMonitorTestAddItemVerbatim(test,
+ "{"
+ "\"execute\":\"block-latency-histogram-set\","
+ "\"arguments\":{"
+ "\"id\":\"devid\","
+ "\"boundaries\":[10,30,5000000000],"
+ "\"boundaries-read\":[10,30,5000000000],"
+ "\"boundaries-write\":[10,30,5000000000],"
+ "\"boundaries-zap\":[10,30,5000000000],"
+ "\"boundaries-flush\":[10,30,5000000000]"
+ "},"
+ "\"id\":\"libvirt-1\""
+ "}",
+ NULL,
+ "{\"return\":{}}") < 0)
+ return -1;
+
+ if (qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitorTestGetMonitor(test),
+ "devid",
+ boundaries,
+ boundaries,
+ boundaries,
+ boundaries,
+ boundaries) < 0)
+ return -1;
+
+ return 0;
+}
static int
testQemuMonitorJSONqemuMonitorJSONNBDServerStart(const void *opaque)
diff --git a/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml b/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
index d02f954073..d245eedb5b 100644
--- a/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
@@ -26,6 +26,7 @@
<bin start='0'/>
<bin start='20'/>
<bin start='30'/>
+ <bin start='5000000000'/>
</latency-histogram>
</statistics>
</driver>
diff --git a/tests/qemuxmlconfdata/disk-statistics-intervals.xml b/tests/qemuxmlconfdata/disk-statistics-intervals.xml
index 5f9e9470d7..8b1e7481b2 100644
--- a/tests/qemuxmlconfdata/disk-statistics-intervals.xml
+++ b/tests/qemuxmlconfdata/disk-statistics-intervals.xml
@@ -23,6 +23,7 @@
<bin start='0'/>
<bin start='20'/>
<bin start='30'/>
+ <bin start='5000000000'/>
</latency-histogram>
</statistics>
</driver>
--
2.54.0 (Apple Git-157)
3
2
[PATCH] node_device_udev: Don't hold the object lock while joining the udev thread
by Yifan Li 22 Sep '26
by Yifan Li 22 Sep '26
22 Sep '26
We found libvirt has a race condition bug and it causes systemd
timeout during system shutdown. This issue does not exist on
libvirt 10.0.0 with Ubuntu 24.04 but found in Ubuntu 26.04 which
uses libvirt 12.0.0.
nodeStateShutdownWait() joins the udev event thread while holding
@priv's object lock:
VIR_WITH_OBJECT_LOCK_GUARD(priv) {
if (priv->udevThread)
virThreadJoin(priv->udevThread);
}
but udevEventHandleThread() needs that same lock to make progress. Its
only clean exit path is
VIR_WITH_OBJECT_LOCK_GUARD(priv) {
while (!priv->udevDataReady && !priv->udevThreadQuit) {
if (virCondWait(&priv->udevThreadCond, &priv->parent.lock))
...
}
if (priv->udevThreadQuit)
return;
so the thread has to re-acquire the lock - either on return from
virCondWait() or to re-enter the guard at the top of its loop - before
it can observe @priv->udevThreadQuit and return.
nodeStateShutdownPrepare() sets udevThreadQuit, signals the condition
and drops the lock. Which thread grabs the lock next then decides the
outcome:
- the udev thread wins: it sees udevThreadQuit, returns, and the
subsequent join completes immediately.
- nodeStateShutdownWait() wins: it takes the lock and blocks in
virThreadJoin(), so the udev thread can never re-acquire the lock,
never observes udevThreadQuit and never returns. Both threads are
then stuck for good.
Holding the lock across the join serves no purpose - udevThreadQuit has
already been published by nodeStateShutdownPrepare(), @priv->udevThread
is only assigned in nodeStateInitialize() and released by
udevEventDataDispose(), and the udev thread holds a reference to @priv.
Join outside the lock guard instead, which also restores the ordering
nodeStateCleanup() used before commit e89d39f5b8f3 ("node_device_udev:
Introduce and use `stateShutdownPrepare` and `stateShutdownWait`"):
signal under the lock, release it, then join.
Fixes: e89d39f5b8f30f0b3284ed2bd71cee1a8a3d707d
Signed-off-by: Yifan Li <yifan2.li(a)intel.com>
Signed-off-by: Jianfeng Gao <jianfeng.gao(a)intel.com>
Signed-off-by: Lili Li <lili.li(a)intel.com>
---
How found: shutdown on Ubuntu 26.04 with libvirt 12.0.0(monolithic
libvirtd, socket activated), found it was killed by systemd due to
timeout. In our testing(repeated S5 cycles), it is about 4% hit rate.
State of a hung daemon:
tid comm wchan
14039 libvirtd poll_schedule_timeout
14108 udev-event futex_do_wait
14165 daemon-shutdown futex_do_wait
Thread "daemon-shutdown" (LWP 14165):
#5 __pthread_clockjoin_ex ()
#6 libvirt_driver_nodedev.so
#7 virStateShutdownWait () from libvirt.so.0
Thread "udev-event" (LWP 14108):
#1 __GI___lll_lock_wait (futex=0x7d55d001cc58)
#2 __pthread_mutex_cond_lock (mutex=0x7d55d001cc58)
#4 ___pthread_cond_wait ()
#5 virCondWait () from libvirt.so.0
#6 libvirt_driver_nodedev.so
(gdb) x/4dw 0x7d55d001cc58
0x7d55d001cc58: 2 0 14165 2
__lock __count __owner __nusers
__owner is the daemon-shutdown thread itself, parked in pthread_join()
waiting for the very thread that needs that lock in order to exit.
src/node_device/node_device_udev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 104433fb88..ac9be10382 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -2482,10 +2482,17 @@ nodeStateShutdownWait(void)
if (!priv)
return 0;
- VIR_WITH_OBJECT_LOCK_GUARD(priv) {
- if (priv->udevThread)
- virThreadJoin(priv->udevThread);
- }
+ /* Do not hold @priv's lock while joining the udev thread.
+ * udevEventHandleThread() must acquire that very lock in order to
+ * observe @priv->udevThreadQuit - already set by
+ * nodeStateShutdownPrepare() - and return. Joining while holding the
+ * lock therefore deadlocks the two threads against each other.
+ *
+ * @priv->udevThread is only ever assigned in nodeStateInitialize() and
+ * released by udevEventDataDispose(), and the udev thread holds a
+ * reference to @priv, so accessing it here without the lock is safe. */
+ if (priv->udevThread)
+ virThreadJoin(priv->udevThread);
if (priv->workerPool)
virThreadPoolDrain(priv->workerPool);
--
2.48.1
2
1
[PATCH v2 0/4] resctrl: support whole-process allocations and monitoring
by Jedrzej Wasiukiewicz 22 Sep '26
by Jedrzej Wasiukiewicz 22 Sep '26
22 Sep '26
Resctrl support in libvirt currently associates allocations and monitors
with a set of vCPUs. This does not account for resource consumption by
QEMU IOThreads, worker threads and emulator threads.
Allow cachetune, memorytune, energytune and their monitor elements to
omit the vcpus attribute and apply to the whole QEMU process. Assigning
the emulator process to the resctrl group before it creates threads lets
all subsequently created threads inherit the same configuration.
Whole-process and per-vCPU allocations cannot be mixed within a domain.
A monitor without vcpus inherits its enclosing allocation's scope. Thus,
it monitors the whole process under a whole-process allocation and the
allocation's vCPU set under a per-vCPU allocation.
This series was previously posted as:
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/QFXZ…
Changes since v1:
- Rebased onto current master.
- Split the independent resctrl domstats fixes into a separate series.
- Added Christopher's Reviewed-by.
- Dropped the NEWS patch.
Jedrzej Wasiukiewicz (4):
conf: allow omitting vcpus in cachetune/memorytune/energytune
conf: implement whole-process resctrl scope
qemu: assign whole-process resctrl groups at domain start
qemu: omit vcpus for whole-process resctrl monitor stats
docs/formatdomain.rst | 57 +++--
src/conf/domain_conf.c | 231 ++++++++++++------
src/conf/domain_conf.h | 2 +
src/conf/schemas/domaincommon.rng | 48 ++--
src/qemu/qemu_driver.c | 24 +-
src/qemu/qemu_process.c | 40 ++-
src/util/virresctrl.c | 10 +-
.../cachetune-monitor-empty-vcpus.xml | 30 +++
.../cachetune-monitor-inherit-alloc.xml | 30 +++
.../cachetune-wholeprocess-duplicate.xml | 32 +++
...chetune-wholeprocess-monitor-duplicate.xml | 31 +++
.../cachetune-wholeprocess-monitors.xml | 31 +++
.../energytune-colliding-monitor.xml | 30 +++
.../energytune-wholeprocess.xml | 29 +++
.../memorytune-wholeprocess.xml | 29 +++
.../resctrl-wholeprocess-alloc-monitor.xml | 32 +++
.../resctrl-wholeprocess-layering.xml | 32 +++
.../resctrl-wholeprocess-monitors.xml | 33 +++
.../cachetune-monitor-inherit-alloc.xml | 30 +++
tests/genericxml2xmltest.c | 11 +
20 files changed, 662 insertions(+), 130 deletions(-)
create mode 100644 tests/genericxml2xmlindata/cachetune-monitor-empty-vcpus.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-monitor-inherit-alloc.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-duplicate.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-monitor-duplicate.xml
create mode 100644 tests/genericxml2xmlindata/cachetune-wholeprocess-monitors.xml
create mode 100644 tests/genericxml2xmlindata/energytune-colliding-monitor.xml
create mode 100644 tests/genericxml2xmlindata/energytune-wholeprocess.xml
create mode 100644 tests/genericxml2xmlindata/memorytune-wholeprocess.xml
create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-alloc-monitor.xml
create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-layering.xml
create mode 100644 tests/genericxml2xmlindata/resctrl-wholeprocess-monitors.xml
create mode 100644 tests/genericxml2xmloutdata/cachetune-monitor-inherit-alloc.xml
--
2.43.0
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
2
9
From: Davide Marro <dmarro(a)redhat.com>
QEMU uses uint64 values for block latency histogram boundaries, while
libvirt currently stores and parses them as unsigned int values.
This limits histogram boundaries to UINT32_MAX nanoseconds and prevents
using larger values supported by QEMU.
Use unsigned long long for latency histogram boundaries throughout the
domain configuration and QEMU monitor code. Update the XML schema and
parser accordingly, and serialize the values using the 64-bit JSON
number helper.
Extend the XML and QEMU monitor tests with a 5000000000 nanosecond
boundary to verify values above UINT32_MAX are preserved.
Resolves: https://gitlab.com/libvirt/libvirt/-/work_items/919
Signed-off-by: Davide Marro <dmarro(a)redhat.com>
---
src/conf/domain_conf.c | 12 ++---
src/conf/domain_conf.h | 10 ++--
src/conf/schemas/domaincommon.rng | 2 +-
src/qemu/qemu_monitor.c | 10 ++--
src/qemu/qemu_monitor.h | 10 ++--
src/qemu/qemu_monitor_json.c | 14 +++---
src/qemu/qemu_monitor_json.h | 10 ++--
tests/qemumonitorjsontest.c | 46 ++++++++++++++++---
...isk-statistics-intervals.x86_64-latest.xml | 1 +
.../disk-statistics-intervals.xml | 1 +
10 files changed, 75 insertions(+), 41 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1327793b0a..94a1f8bd8e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8427,7 +8427,7 @@ virDomainDiskDefDriverParseXMLHistogramOne(virDomainDiskDef *def,
xmlNodePtr cur)
{
g_autofree char *histogram_type = NULL;
- unsigned int **histogram_config = NULL;
+ unsigned long long **histogram_config = NULL;
g_autoptr(GPtrArray) binNodes = virXMLNodeGetSubelementList(cur, "bin");
size_t nbins = 0;
size_t i;
@@ -8463,12 +8463,12 @@ virDomainDiskDefDriverParseXMLHistogramOne(virDomainDiskDef *def,
return -1;
}
- *histogram_config = g_new0(unsigned int, binNodes->len + 1);
+ *histogram_config = g_new0(unsigned long long, binNodes->len + 1);
for (i = 0; i < binNodes->len; i++) {
- unsigned int val;
+ unsigned long long val;
- if (virXMLPropUInt(g_ptr_array_index(binNodes, i),
+ if (virXMLPropULongLong(g_ptr_array_index(binNodes, i),
"start", 10,
VIR_XML_PROP_REQUIRED,
&val) < 0)
@@ -24571,7 +24571,7 @@ virDomainDiskDefFormatThrottleFilters(virBuffer *buf,
static void
virDomainDiskDefFormatDriverHistogram(virBuffer *buf,
const char *type,
- unsigned int *bins)
+ unsigned long long *bins)
{
g_auto(virBuffer) histogramAttrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) histogramChildBuf = VIR_BUFFER_INIT_CHILD(buf);
@@ -24586,7 +24586,7 @@ virDomainDiskDefFormatDriverHistogram(virBuffer *buf,
virBufferAddLit(&histogramChildBuf, "<bin start='0'/>\n");
for (; *bins > 0; bins++)
- virBufferAsprintf(&histogramChildBuf, "<bin start='%u'/>\n", *bins);
+ virBufferAsprintf(&histogramChildBuf, "<bin start='%llu'/>\n", *bins);
virXMLFormatElement(buf, "latency-histogram", &histogramAttrBuf, &histogramChildBuf);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f7cbe7bf1d..eadb5a49a4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -599,11 +599,11 @@ struct _virDomainDiskDef {
unsigned int *statistics; /* Optional, zero terminated list of intervals to
collect statistics for */
/* optional zero terminated lists of bin boundaries for latency histograms */
- unsigned int *histogram_boundaries;
- unsigned int *histogram_boundaries_read;
- unsigned int *histogram_boundaries_write;
- unsigned int *histogram_boundaries_zone;
- unsigned int *histogram_boundaries_flush;
+ unsigned long long *histogram_boundaries;
+ unsigned long long *histogram_boundaries_read;
+ unsigned long long *histogram_boundaries_write;
+ unsigned long long *histogram_boundaries_zone;
+ unsigned long long *histogram_boundaries_flush;
virDomainDiskDetectZeroes detect_zeroes;
virTristateSwitch discard_no_unref;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 0c0a3597a9..d1b10c1c5f 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -2845,7 +2845,7 @@
<oneOrMore>
<element name='bin'>
<attribute name='start'>
- <ref name="unsignedInt"/>
+ <ref name="unsignedLong"/>
</attribute>
</element>
</oneOrMore>
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 21df06ebd8..2c86cd1971 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4558,11 +4558,11 @@ qemuMonitorBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush)
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush)
{
QEMU_CHECK_MONITOR(mon);
VIR_DEBUG("id='%s'", id);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index e560618bf4..e9b6a25f0c 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1988,11 +1988,11 @@ qemuMonitorBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush);
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush);
int
qemuMonitorAnnounceSelf(qemuMonitor *mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 7e3249cd47..8e88dc9442 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -9176,7 +9176,7 @@ qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
static virJSONValue *
-qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
+qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned long long *bound)
{
g_autoptr(virJSONValue) ret = virJSONValueNewArray();
@@ -9184,7 +9184,7 @@ qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
return NULL;
for (; *bound > 0; bound++) {
- g_autoptr(virJSONValue) val = virJSONValueNewNumberUint(*bound);
+ g_autoptr(virJSONValue) val = virJSONValueNewNumberUlong(*bound);
/* the only error is if the first argument is not an array */
ignore_value(virJSONValueArrayAppend(ret, &val));
@@ -9197,11 +9197,11 @@ qemuMonitorJSONBlockLatencyHistogramBoundary(unsigned int *bound)
int
qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush)
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 3b7b04a11d..63eded7ecb 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -818,11 +818,11 @@ qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
int
qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitor *mon,
const char *id,
- unsigned int *boundaries,
- unsigned int *boundaries_read,
- unsigned int *boundaries_write,
- unsigned int *boundaries_zone,
- unsigned int *boundaries_flush);
+ unsigned long long *boundaries,
+ unsigned long long *boundaries_read,
+ unsigned long long *boundaries_write,
+ unsigned long long *boundaries_zone,
+ unsigned long long *boundaries_flush);
int
qemuMonitorJSONAnnounceSelf(qemuMonitor *mon,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 70f03afb81..a963029c69 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1130,13 +1130,45 @@ GEN_TEST_FUNC(qemuMonitorJSONSetAction,
GEN_TEST_FUNC(qemuMonitorJSONSetLaunchSecurityState, "sev_secret_header",
"sev_secret", 0, true)
-unsigned int testHistogramBoundaries[] = {10, 30, 50, 0};
-GEN_TEST_FUNC(qemuMonitorJSONBlockLatencyHistogramSet, "devid",
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries,
- testHistogramBoundaries)
+static int
+testQemuMonitorJSONqemuMonitorJSONBlockLatencyHistogramSet(const void *opaque)
+{
+ const testQemuMonitorJSONSimpleFuncData *data = opaque;
+ virDomainXMLOption *xmlopt = data->xmlopt;
+ unsigned long long boundaries[] = {10, 30, 5000000000ULL, 0};
+ g_autoptr(qemuMonitorTest) test = NULL;
+
+ if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
+ return -1;
+
+ if (qemuMonitorTestAddItemVerbatim(test,
+ "{"
+ "\"execute\":\"block-latency-histogram-set\","
+ "\"arguments\":{"
+ "\"id\":\"devid\","
+ "\"boundaries\":[10,30,5000000000],"
+ "\"boundaries-read\":[10,30,5000000000],"
+ "\"boundaries-write\":[10,30,5000000000],"
+ "\"boundaries-zap\":[10,30,5000000000],"
+ "\"boundaries-flush\":[10,30,5000000000]"
+ "},"
+ "\"id\":\"libvirt-1\""
+ "}",
+ NULL,
+ "{\"return\":{}}") < 0)
+ return -1;
+
+ if (qemuMonitorJSONBlockLatencyHistogramSet(qemuMonitorTestGetMonitor(test),
+ "devid",
+ boundaries,
+ boundaries,
+ boundaries,
+ boundaries,
+ boundaries) < 0)
+ return -1;
+
+ return 0;
+}
static int
testQemuMonitorJSONqemuMonitorJSONNBDServerStart(const void *opaque)
diff --git a/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml b/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
index d02f954073..d245eedb5b 100644
--- a/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
+++ b/tests/qemuxmlconfdata/disk-statistics-intervals.x86_64-latest.xml
@@ -26,6 +26,7 @@
<bin start='0'/>
<bin start='20'/>
<bin start='30'/>
+ <bin start='5000000000'/>
</latency-histogram>
</statistics>
</driver>
diff --git a/tests/qemuxmlconfdata/disk-statistics-intervals.xml b/tests/qemuxmlconfdata/disk-statistics-intervals.xml
index 5f9e9470d7..8b1e7481b2 100644
--- a/tests/qemuxmlconfdata/disk-statistics-intervals.xml
+++ b/tests/qemuxmlconfdata/disk-statistics-intervals.xml
@@ -23,6 +23,7 @@
<bin start='0'/>
<bin start='20'/>
<bin start='30'/>
+ <bin start='5000000000'/>
</latency-histogram>
</statistics>
</driver>
--
2.54.0 (Apple Git-157)
1
0
From: Michal Privoznik <mprivozn(a)redhat.com>
Ever since of v6.9.0-rc1~384 we allow zero sized bitmaps. If
that's the case then the map is kept unallocated (NULL).
Unfortunately, some virBitmap APIs call memcpy()/memset() which
doesn't allow NULL pointers. Introduce checks to these APIs
(virBitmapNewCopy(), virBitmapSetAll() and virBitmapClearAll()).
While at it, also introduce a test case to virbitmaptest to catch
UB in our CI.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virbitmap.c | 9 ++++++++-
tests/virbitmaptest.c | 27 +++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 78545501b7..b9b737a087 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -587,7 +587,8 @@ virBitmapNewCopy(virBitmap *src)
{
virBitmap *dst = virBitmapNew(src->nbits);
- memcpy(dst->map, src->map, dst->map_len * sizeof(src->map[0]));
+ if (G_LIKELY(dst->map_len > 0))
+ memcpy(dst->map, src->map, dst->map_len * sizeof(src->map[0]));
return dst;
}
@@ -770,6 +771,9 @@ virBitmapClearTail(virBitmap *bitmap)
*/
void virBitmapSetAll(virBitmap *bitmap)
{
+ if (G_UNLIKELY(bitmap->map_len == 0))
+ return;
+
memset(bitmap->map, 0xff,
bitmap->map_len * (VIR_BITMAP_BITS_PER_UNIT / CHAR_BIT));
@@ -786,6 +790,9 @@ void virBitmapSetAll(virBitmap *bitmap)
void
virBitmapClearAll(virBitmap *bitmap)
{
+ if (G_UNLIKELY(bitmap->map_len == 0))
+ return;
+
memset(bitmap->map, 0,
bitmap->map_len * (VIR_BITMAP_BITS_PER_UNIT / CHAR_BIT));
}
diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index 709c62ab54..549956ad04 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -768,6 +768,30 @@ test17(const void *opaque G_GNUC_UNUSED)
}
+static int
+test18(const void *opaque G_GNUC_UNUSED)
+{
+ g_autoptr(virBitmap) map = virBitmapNew(0);
+ g_autoptr(virBitmap) copy = virBitmapNewCopy(map);
+
+ /* Creating an empty bitmap means underlying array of bits is
+ * unallocated (NULL). For some virBitmap APIs this may lead
+ * to UB. The whole point of this test is to call those and
+ * rely on clang's UB sanitizer to catch such errors at
+ * runtime. */
+
+ virBitmapSetAll(map);
+ virBitmapClearAll(copy);
+
+ if (!virBitmapEqual(map, copy)) {
+ fprintf(stderr, "empty maps don't equal\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+
#define TESTBINARYOP(A, B, RES, FUNC) \
testBinaryOpData.a = A; \
testBinaryOpData.b = B; \
@@ -847,6 +871,9 @@ mymain(void)
if (virTestRun("test17", test17, NULL) < 0)
ret = -1;
+ if (virTestRun("test18", test18, NULL) < 0)
+ ret = -1;
+
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.55.0
2
1