Devel
Threads by month
- ----- 2026 -----
- 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
February 2025
- 45 participants
- 127 discussions
13 Feb '25
Sponsored by: Future Crew, LLC
Signed-off-by: Alexander Shursha <kekek2(a)ya.ru>
---
src/meson.build | 1 +
src/util/virpci.c | 464 ++++++++++------------------------------
tests/qemuhotplugtest.c | 11 +-
tests/qemumemlocktest.c | 9 +
tests/qemuxmlconftest.c | 9 +
tests/virpcimock.c | 21 +-
6 files changed, 160 insertions(+), 355 deletions(-)
diff --git a/src/meson.build b/src/meson.build
index 9413192a55..39788ac4d7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -411,6 +411,7 @@ libvirt_lib = shared_library(
dtrace_gen_objects,
dependencies: [
src_dep,
+ pciaccess_dep
],
link_args: libvirt_link_args,
link_whole: [
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 90617e69c6..3f95fa2b3f 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <pciaccess.h>
#ifdef __linux__
# include <sys/utsname.h>
@@ -72,7 +73,7 @@ struct _virPCIDevice {
char *name; /* domain:bus:slot.function */
char id[PCI_ID_LEN]; /* product vendor */
- char *path;
+ struct pci_device *device;
/* The driver:domain which uses the device */
char *used_by_drvname;
@@ -359,121 +360,6 @@ virPCIDeviceGetCurrentDriverNameAndType(virPCIDevice *dev,
}
-static int
-virPCIDeviceConfigOpenInternal(virPCIDevice *dev, bool readonly, bool fatal)
-{
- int fd;
-
- fd = open(dev->path, readonly ? O_RDONLY : O_RDWR);
-
- if (fd < 0) {
- if (fatal) {
- virReportSystemError(errno,
- _("Failed to open config space file '%1$s'"),
- dev->path);
- } else {
- VIR_WARN("Failed to open config space file '%s': %s",
- dev->path, g_strerror(errno));
- }
- return -1;
- }
-
- VIR_DEBUG("%s %s: opened %s", dev->id, dev->name, dev->path);
- return fd;
-}
-
-static int
-virPCIDeviceConfigOpen(virPCIDevice *dev)
-{
- return virPCIDeviceConfigOpenInternal(dev, true, true);
-}
-
-static int
-virPCIDeviceConfigOpenTry(virPCIDevice *dev)
-{
- return virPCIDeviceConfigOpenInternal(dev, true, false);
-}
-
-static int
-virPCIDeviceConfigOpenWrite(virPCIDevice *dev)
-{
- return virPCIDeviceConfigOpenInternal(dev, false, true);
-}
-
-static void
-virPCIDeviceConfigClose(virPCIDevice *dev, int cfgfd)
-{
- if (VIR_CLOSE(cfgfd) < 0) {
- VIR_WARN("Failed to close config space file '%s': %s",
- dev->path, g_strerror(errno));
- }
-}
-
-
-static int
-virPCIDeviceRead(virPCIDevice *dev,
- int cfgfd,
- unsigned int pos,
- uint8_t *buf,
- unsigned int buflen)
-{
- memset(buf, 0, buflen);
- errno = 0;
-
- if (lseek(cfgfd, pos, SEEK_SET) != pos ||
- saferead(cfgfd, buf, buflen) != buflen) {
- VIR_DEBUG("Failed to read %u bytes at %u from '%s' : %s",
- buflen, pos, dev->path, g_strerror(errno));
- return -1;
- }
- return 0;
-}
-
-
-/**
- * virPCIDeviceReadN:
- * @dev: virPCIDevice object (used only to log name of config file)
- * @cfgfd: open file descriptor for device config file in sysfs
- * @pos: byte offset in the file to read from
- *
- * read "N" (where "N" is "8", "16", or "32", and appears at the end
- * of the function name) bytes from a PCI device's already-opened
- * sysfs config file and return them as the return value from the
- * function.
- *
- * Returns the value at @pos in the file, or 0 if there was an
- * error. NB: since 0 could be a valid value, occurrence of an error
- * must be determined by examining errno. errno is always reset to 0
- * before the seek/read is attempted (see virPCIDeviceRead()), so if
- * errno != 0 on return from one of these functions, then either the
- * seek or the read operation failed for some reason. If errno == 0
- * and the return value is 0, then the config file really does contain
- * the value 0 at @pos.
- */
-static uint8_t
-virPCIDeviceRead8(virPCIDevice *dev, int cfgfd, unsigned int pos)
-{
- uint8_t buf;
- virPCIDeviceRead(dev, cfgfd, pos, &buf, sizeof(buf));
- return buf;
-}
-
-static uint16_t
-virPCIDeviceRead16(virPCIDevice *dev, int cfgfd, unsigned int pos)
-{
- uint8_t buf[2];
- virPCIDeviceRead(dev, cfgfd, pos, &buf[0], sizeof(buf));
- return (buf[0] << 0) | (buf[1] << 8);
-}
-
-static uint32_t
-virPCIDeviceRead32(virPCIDevice *dev, int cfgfd, unsigned int pos)
-{
- uint8_t buf[4];
- virPCIDeviceRead(dev, cfgfd, pos, &buf[0], sizeof(buf));
- return (buf[0] << 0) | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
-}
-
static int
virPCIDeviceReadClass(virPCIDevice *dev, uint16_t *device_class)
{
@@ -499,36 +385,6 @@ virPCIDeviceReadClass(virPCIDevice *dev, uint16_t *device_class)
return 0;
}
-static int
-virPCIDeviceWrite(virPCIDevice *dev,
- int cfgfd,
- unsigned int pos,
- uint8_t *buf,
- unsigned int buflen)
-{
- if (lseek(cfgfd, pos, SEEK_SET) != pos ||
- safewrite(cfgfd, buf, buflen) != buflen) {
- VIR_WARN("Failed to write to '%s' : %s", dev->path,
- g_strerror(errno));
- return -1;
- }
- return 0;
-}
-
-static void
-virPCIDeviceWrite16(virPCIDevice *dev, int cfgfd, unsigned int pos, uint16_t val)
-{
- uint8_t buf[2] = { (val >> 0), (val >> 8) };
- virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
-}
-
-static void
-virPCIDeviceWrite32(virPCIDevice *dev, int cfgfd, unsigned int pos, uint32_t val)
-{
- uint8_t buf[4] = { (val >> 0), (val >> 8), (val >> 16), (val >> 24) };
- virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
-}
-
typedef int (*virPCIDeviceIterPredicate)(virPCIDevice *, virPCIDevice *,
void *);
@@ -610,7 +466,6 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predicate,
*/
static int
virPCIDeviceFindCapabilityOffset(virPCIDevice *dev,
- int cfgfd,
unsigned int capability,
unsigned int *offset)
{
@@ -619,11 +474,13 @@ virPCIDeviceFindCapabilityOffset(virPCIDevice *dev,
*offset = 0; /* assume failure (*nothing* can be at offset 0) */
- status = virPCIDeviceRead16(dev, cfgfd, PCI_STATUS);
+ pci_device_cfg_read_u16(dev->device, &status, PCI_STATUS);
+
if (errno != 0 || !(status & PCI_STATUS_CAP_LIST))
goto error;
- pos = virPCIDeviceRead8(dev, cfgfd, PCI_CAPABILITY_LIST);
+ pci_device_cfg_read_u8(dev->device, &pos, PCI_CAPABILITY_LIST);
+
if (errno != 0)
goto error;
@@ -635,7 +492,9 @@ virPCIDeviceFindCapabilityOffset(virPCIDevice *dev,
* capabilities here.
*/
while (pos >= PCI_CONF_HEADER_LEN && pos != 0xff) {
- uint8_t capid = virPCIDeviceRead8(dev, cfgfd, pos);
+ uint8_t capid;
+ pci_device_cfg_read_u8(dev->device, &capid, pos);
+
if (errno != 0)
goto error;
@@ -646,7 +505,8 @@ virPCIDeviceFindCapabilityOffset(virPCIDevice *dev,
return 0;
}
- pos = virPCIDeviceRead8(dev, cfgfd, pos + 1);
+ pci_device_cfg_read_u8(dev->device, &pos, pos + 1);
+
if (errno != 0)
goto error;
}
@@ -665,7 +525,6 @@ virPCIDeviceFindCapabilityOffset(virPCIDevice *dev,
static unsigned int
virPCIDeviceFindExtendedCapabilityOffset(virPCIDevice *dev,
- int cfgfd,
unsigned int capability)
{
int ttl;
@@ -677,7 +536,7 @@ virPCIDeviceFindExtendedCapabilityOffset(virPCIDevice *dev,
pos = PCI_EXT_CAP_BASE;
while (ttl > 0 && pos >= PCI_EXT_CAP_BASE) {
- header = virPCIDeviceRead32(dev, cfgfd, pos);
+ header = pci_device_cfg_read_u32(dev->device, &header, pos);
if ((header & PCI_EXT_CAP_ID_MASK) == capability)
return pos;
@@ -693,7 +552,7 @@ virPCIDeviceFindExtendedCapabilityOffset(virPCIDevice *dev,
* not have FLR, 1 if it does, and -1 on error
*/
static bool
-virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev, int cfgfd)
+virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev)
{
uint32_t caps;
unsigned int pos;
@@ -707,7 +566,7 @@ virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev, int cfgfd)
* on SR-IOV NICs at the moment.
*/
if (dev->pcie_cap_pos) {
- caps = virPCIDeviceRead32(dev, cfgfd, dev->pcie_cap_pos + PCI_EXP_DEVCAP);
+ pci_device_cfg_read_u32(dev->device, &caps, dev->pcie_cap_pos + PCI_EXP_DEVCAP);
if (caps & PCI_EXP_DEVCAP_FLR) {
VIR_DEBUG("%s %s: detected PCIe FLR capability", dev->id, dev->name);
return true;
@@ -718,11 +577,13 @@ virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev, int cfgfd)
* the same thing, except for conventional PCI
* devices. This is not common yet.
*/
- if (virPCIDeviceFindCapabilityOffset(dev, cfgfd, PCI_CAP_ID_AF, &pos) < 0)
+ if (virPCIDeviceFindCapabilityOffset(dev, PCI_CAP_ID_AF, &pos) < 0)
goto error;
if (pos) {
- caps = virPCIDeviceRead16(dev, cfgfd, pos + PCI_AF_CAP);
+ uint16_t caps16;
+ pci_device_cfg_read_u16(dev->device, &caps16, pos + PCI_AF_CAP);
+ caps = caps16;
if (caps & PCI_AF_CAP_FLR) {
VIR_DEBUG("%s %s: detected PCI FLR capability", dev->id, dev->name);
return true;
@@ -754,13 +615,13 @@ virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev, int cfgfd)
* internal reset, not just a soft reset.
*/
static bool
-virPCIDeviceDetectPowerManagementReset(virPCIDevice *dev, int cfgfd)
+virPCIDeviceDetectPowerManagementReset(virPCIDevice *dev)
{
if (dev->pci_pm_cap_pos) {
uint32_t ctl;
/* require the NO_SOFT_RESET bit is clear */
- ctl = virPCIDeviceRead32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL);
+ pci_device_cfg_read_u32(dev->device, &ctl, dev->pci_pm_cap_pos + PCI_PM_CTRL);
if (!(ctl & PCI_PM_CTRL_NO_SOFT_RESET)) {
VIR_DEBUG("%s %s: detected PM reset capability", dev->id, dev->name);
return true;
@@ -811,26 +672,22 @@ virPCIDeviceIsParent(virPCIDevice *dev, virPCIDevice *check, void *data)
uint8_t header_type, secondary, subordinate;
virPCIDevice **best = data;
int ret = 0;
- int fd;
if (dev->address.domain != check->address.domain)
return 0;
- if ((fd = virPCIDeviceConfigOpenTry(check)) < 0)
- return 0;
-
/* Is it a bridge? */
ret = virPCIDeviceReadClass(check, &device_class);
if (ret < 0 || device_class != PCI_CLASS_BRIDGE_PCI)
- goto cleanup;
+ return ret;
/* Is it a plane? */
- header_type = virPCIDeviceRead8(check, fd, PCI_HEADER_TYPE);
+ pci_device_cfg_read_u8(check->device, &header_type, PCI_HEADER_TYPE);
if ((header_type & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_BRIDGE)
- goto cleanup;
+ return ret;
- secondary = virPCIDeviceRead8(check, fd, PCI_SECONDARY_BUS);
- subordinate = virPCIDeviceRead8(check, fd, PCI_SUBORDINATE_BUS);
+ pci_device_cfg_read_u8(check->device, &secondary, PCI_SECONDARY_BUS);
+ pci_device_cfg_read_u8(check->device, &subordinate, PCI_SUBORDINATE_BUS);
VIR_DEBUG("%s %s: found parent device %s", dev->id, dev->name, check->name);
@@ -838,8 +695,7 @@ virPCIDeviceIsParent(virPCIDevice *dev, virPCIDevice *check, void *data)
* the direct parent. No further work is necessary
*/
if (dev->address.bus == secondary) {
- ret = 1;
- goto cleanup;
+ return 1;
}
/* otherwise, SRIOV allows VFs to be on different buses than their PFs.
@@ -850,35 +706,26 @@ virPCIDeviceIsParent(virPCIDevice *dev, virPCIDevice *check, void *data)
if (*best == NULL) {
*best = virPCIDeviceNew(&check->address);
if (*best == NULL) {
- ret = -1;
- goto cleanup;
+ return -1;
}
} else {
/* OK, we had already recorded a previous "best" match for the
* parent. See if the current device is more restrictive than the
* best, and if so, make it the new best
*/
- int bestfd;
uint8_t best_secondary;
- if ((bestfd = virPCIDeviceConfigOpenTry(*best)) < 0)
- goto cleanup;
- best_secondary = virPCIDeviceRead8(*best, bestfd, PCI_SECONDARY_BUS);
- virPCIDeviceConfigClose(*best, bestfd);
+ pci_device_cfg_read_u8((*best)->device, &best_secondary, PCI_SECONDARY_BUS);
if (secondary > best_secondary) {
virPCIDeviceFree(*best);
*best = virPCIDeviceNew(&check->address);
if (*best == NULL) {
- ret = -1;
- goto cleanup;
+ return -1;
}
}
}
}
-
- cleanup:
- virPCIDeviceConfigClose(check, fd);
return ret;
}
@@ -902,15 +749,14 @@ virPCIDeviceGetParent(virPCIDevice *dev, virPCIDevice **parent)
*/
static int
virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev,
- int cfgfd,
virPCIDeviceList *inactiveDevs)
{
g_autoptr(virPCIDevice) parent = NULL;
g_autoptr(virPCIDevice) conflict = NULL;
uint8_t config_space[PCI_CONF_LEN];
uint16_t ctl;
- int ret = -1;
- int parentfd;
+ pciaddr_t bytes_read;
+ pciaddr_t bytes_written;
/* Refuse to do a secondary bus reset if there are other
* devices/functions behind the bus are used by the host
@@ -932,8 +778,6 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev,
dev->name);
return -1;
}
- if ((parentfd = virPCIDeviceConfigOpenWrite(parent)) < 0)
- goto out;
VIR_DEBUG("%s %s: doing a secondary bus reset", dev->id, dev->name);
@@ -941,38 +785,37 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev,
* for the supplied device since we refuse to do a reset if there
* are multiple devices/functions
*/
- if (virPCIDeviceRead(dev, cfgfd, 0, config_space, PCI_CONF_LEN) < 0) {
+ pci_device_cfg_read(dev->device, config_space, 0, PCI_CONF_LEN, &bytes_read);
+ if (bytes_read < PCI_CONF_LEN) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to read PCI config space for %1$s"),
dev->name);
- goto out;
+ return -1;
}
/* Read the control register, set the reset flag, wait 200ms,
* unset the reset flag and wait 200ms.
*/
- ctl = virPCIDeviceRead16(dev, parentfd, PCI_BRIDGE_CONTROL);
- virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL,
- ctl | PCI_BRIDGE_CTL_RESET);
+ pci_device_cfg_read_u16(parent->device, &ctl, PCI_BRIDGE_CONTROL);
+
+ pci_device_cfg_write_u16(parent->device, ctl | PCI_BRIDGE_CTL_RESET, PCI_BRIDGE_CONTROL);
g_usleep(200 * 1000); /* sleep 200ms */
- virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL, ctl);
+ pci_device_cfg_write_u16(parent->device, ctl, PCI_BRIDGE_CONTROL);
g_usleep(200 * 1000); /* sleep 200ms */
- if (virPCIDeviceWrite(dev, cfgfd, 0, config_space, PCI_CONF_LEN) < 0) {
+ pci_device_cfg_write(dev->device, config_space, 0, PCI_CONF_LEN, &bytes_written);
+ if (bytes_written < PCI_CONF_LEN) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to restore PCI config space for %1$s"),
dev->name);
- goto out;
+ return -1;
}
- ret = 0;
- out:
- virPCIDeviceConfigClose(parent, parentfd);
- return ret;
+ return 0;
}
/* Power management reset attempts to reset a device using a
@@ -980,16 +823,19 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev,
* above we require the device supports a full internal reset.
*/
static int
-virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, int cfgfd)
+virPCIDeviceTryPowerManagementReset(virPCIDevice *dev)
{
uint8_t config_space[PCI_CONF_LEN];
uint32_t ctl;
+ pciaddr_t bytes_read;
+ pciaddr_t bytes_written;
if (!dev->pci_pm_cap_pos)
return -1;
/* Save and restore the device's config space. */
- if (virPCIDeviceRead(dev, cfgfd, 0, &config_space[0], PCI_CONF_LEN) < 0) {
+ pci_device_cfg_read(dev->device, config_space, 0, PCI_CONF_LEN, &bytes_read);
+ if (bytes_read < PCI_CONF_LEN) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to read PCI config space for %1$s"),
dev->name);
@@ -998,20 +844,19 @@ virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, int cfgfd)
VIR_DEBUG("%s %s: doing a power management reset", dev->id, dev->name);
- ctl = virPCIDeviceRead32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL);
+ pci_device_cfg_read_u32(dev->device, &ctl, dev->pci_pm_cap_pos + PCI_PM_CTRL);
ctl &= ~PCI_PM_CTRL_STATE_MASK;
- virPCIDeviceWrite32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL,
- ctl | PCI_PM_CTRL_STATE_D3hot);
+ pci_device_cfg_write_u32(dev->device, ctl | PCI_PM_CTRL_STATE_D3hot, dev->pci_pm_cap_pos + PCI_PM_CTRL);
g_usleep(10 * 1000); /* sleep 10ms */
- virPCIDeviceWrite32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL,
- ctl | PCI_PM_CTRL_STATE_D0);
+ pci_device_cfg_write_u32(dev->device, ctl | PCI_PM_CTRL_STATE_D0, dev->pci_pm_cap_pos + PCI_PM_CTRL);
g_usleep(10 * 1000); /* sleep 10ms */
- if (virPCIDeviceWrite(dev, cfgfd, 0, &config_space[0], PCI_CONF_LEN) < 0) {
+ pci_device_cfg_write(dev->device, config_space, 0, PCI_CONF_LEN, &bytes_written);
+ if (bytes_written < PCI_CONF_LEN) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to restore PCI config space for %1$s"),
dev->name);
@@ -1046,10 +891,10 @@ virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, int cfgfd)
* Always returns success (0) (for now)
*/
static int
-virPCIDeviceInit(virPCIDevice *dev, int cfgfd)
+virPCIDeviceInit(virPCIDevice *dev)
{
dev->is_pcie = false;
- if (virPCIDeviceFindCapabilityOffset(dev, cfgfd, PCI_CAP_ID_EXP, &dev->pcie_cap_pos) < 0) {
+ if (virPCIDeviceFindCapabilityOffset(dev, PCI_CAP_ID_EXP, &dev->pcie_cap_pos) < 0) {
/* an unprivileged process is unable to read *all* of a
* device's PCI config (it can only read the first 64
* bytes, which isn't enough for see the Express
@@ -1065,18 +910,13 @@ virPCIDeviceInit(virPCIDevice *dev, int cfgfd)
* -1), then we blindly assume the most likely outcome -
* PCIe.
*/
- off_t configLen = virFileLength(virPCIDeviceGetConfigPath(dev), -1);
-
- if (configLen != 256)
- dev->is_pcie = true;
-
} else {
dev->is_pcie = (dev->pcie_cap_pos != 0);
}
- virPCIDeviceFindCapabilityOffset(dev, cfgfd, PCI_CAP_ID_PM, &dev->pci_pm_cap_pos);
- dev->has_flr = virPCIDeviceDetectFunctionLevelReset(dev, cfgfd);
- dev->has_pm_reset = virPCIDeviceDetectPowerManagementReset(dev, cfgfd);
+ virPCIDeviceFindCapabilityOffset(dev, PCI_CAP_ID_PM, &dev->pci_pm_cap_pos);
+ dev->has_flr = virPCIDeviceDetectFunctionLevelReset(dev);
+ dev->has_pm_reset = virPCIDeviceDetectPowerManagementReset(dev);
return 0;
}
@@ -1089,7 +929,6 @@ virPCIDeviceReset(virPCIDevice *dev,
g_autofree char *drvName = NULL;
virPCIStubDriver drvType;
int ret = -1;
- int fd = -1;
int hdrType = -1;
if (virPCIGetHeaderType(dev, &hdrType) < 0)
@@ -1114,29 +953,26 @@ virPCIDeviceReset(virPCIDevice *dev,
* be redundant.
*/
if (virPCIDeviceGetCurrentDriverNameAndType(dev, &drvName, &drvType) < 0)
- goto cleanup;
+ return -1;
if (drvType == VIR_PCI_STUB_DRIVER_VFIO) {
VIR_DEBUG("Device %s is bound to %s - skip reset", dev->name, drvName);
ret = 0;
- goto cleanup;
+ return 0;
}
VIR_DEBUG("Resetting device %s", dev->name);
- if ((fd = virPCIDeviceConfigOpenWrite(dev)) < 0)
- goto cleanup;
-
- if (virPCIDeviceInit(dev, fd) < 0)
- goto cleanup;
+ if (virPCIDeviceInit(dev) < 0)
+ return -1;
/* KVM will perform FLR when starting and stopping
* a guest, so there is no need for us to do it here.
*/
if (dev->has_flr) {
ret = 0;
- goto cleanup;
+ return 0;
}
/* If the device supports PCI power management reset,
@@ -1144,11 +980,11 @@ virPCIDeviceReset(virPCIDevice *dev,
* the function, not the whole device.
*/
if (dev->has_pm_reset)
- ret = virPCIDeviceTryPowerManagementReset(dev, fd);
+ ret = virPCIDeviceTryPowerManagementReset(dev);
/* Bus reset is not an option with the root bus */
if (ret < 0 && dev->address.bus != 0)
- ret = virPCIDeviceTrySecondaryBusReset(dev, fd, inactiveDevs);
+ ret = virPCIDeviceTrySecondaryBusReset(dev, inactiveDevs);
if (ret < 0) {
virErrorPtr err = virGetLastError();
@@ -1159,8 +995,6 @@ virPCIDeviceReset(virPCIDevice *dev,
_("no FLR, PM reset or bus reset available"));
}
- cleanup:
- virPCIDeviceConfigClose(dev, fd);
return ret;
}
@@ -1756,28 +1590,6 @@ virPCIDeviceReattach(virPCIDevice *dev,
return 0;
}
-static char *
-virPCIDeviceReadID(virPCIDevice *dev, const char *id_name)
-{
- g_autofree char *path = NULL;
- g_autofree char *id_str = NULL;
-
- path = virPCIFile(dev->name, id_name);
-
- /* ID string is '0xNNNN\n' ... i.e. 7 bytes */
- if (virFileReadAll(path, 7, &id_str) < 0)
- return NULL;
-
- /* Check for 0x suffix */
- if (id_str[0] != '0' || id_str[1] != 'x')
- return NULL;
-
- /* Chop off the newline; we know the string is 7 bytes */
- id_str[6] = '\0';
-
- return g_steal_pointer(&id_str);
-}
-
bool
virPCIDeviceAddressIsValid(virPCIDeviceAddress *addr,
bool report)
@@ -1865,9 +1677,9 @@ virPCIDeviceExists(const virPCIDeviceAddress *addr)
virPCIDevice *
virPCIDeviceNew(const virPCIDeviceAddress *address)
{
+ struct pci_device * device;
+
g_autoptr(virPCIDevice) dev = NULL;
- g_autofree char *vendor = NULL;
- g_autofree char *product = NULL;
dev = g_new0(virPCIDevice, 1);
@@ -1875,31 +1687,21 @@ virPCIDeviceNew(const virPCIDeviceAddress *address)
dev->name = virPCIDeviceAddressAsString(&dev->address);
- dev->path = g_strdup_printf(PCI_SYSFS "devices/%s/config", dev->name);
-
- if (!virFileExists(dev->path)) {
- virReportSystemError(errno,
- _("Device %1$s not found: could not access %2$s"),
- dev->name, dev->path);
+ pci_system_init();
+ device = pci_device_find_by_slot(address->domain, address->bus, address->slot, address->function);
+ if (!device)
return NULL;
- }
-
- vendor = virPCIDeviceReadID(dev, "vendor");
- product = virPCIDeviceReadID(dev, "device");
-
- if (!vendor || !product) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to read product/vendor ID for %1$s"),
- dev->name);
+ dev->device = g_memdup(device, sizeof(*dev->device));
+ if (!dev->device) {
+ virReportSystemError(errno,
+ _("Not found device domain: %1$d, bus: %2$d, slot: %3$d, function: %4$d"),
+ address->domain, address->bus, address->slot, address->function);
return NULL;
}
-
- /* strings contain '0x' prefix */
- if (g_snprintf(dev->id, sizeof(dev->id), "%s %s", &vendor[2],
- &product[2]) >= sizeof(dev->id)) {
+ if (g_snprintf(dev->id, sizeof(dev->id), "%x %x", dev->device->vendor_id, dev->device->device_id) >= sizeof(dev->id)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("dev->id buffer overflow: %1$s %2$s"),
- &vendor[2], &product[2]);
+ _("dev->id buffer overflow: %1$d %2$d"),
+ dev->device->vendor_id, dev->device->device_id);
return NULL;
}
@@ -1918,10 +1720,10 @@ virPCIDeviceCopy(virPCIDevice *dev)
/* shallow copy to take care of most attributes */
*copy = *dev;
- copy->path = NULL;
- copy->used_by_drvname = copy->used_by_domname = NULL;
+ copy->device = NULL;
+ copy->device = g_memdup(dev->device, sizeof(*dev->device));
+ copy->name = copy->used_by_drvname = copy->used_by_domname = copy->stubDriverName = NULL;
copy->name = g_strdup(dev->name);
- copy->path = g_strdup(dev->path);
copy->used_by_drvname = g_strdup(dev->used_by_drvname);
copy->used_by_domname = g_strdup(dev->used_by_domname);
copy->stubDriverName = g_strdup(dev->stubDriverName);
@@ -1936,10 +1738,11 @@ virPCIDeviceFree(virPCIDevice *dev)
return;
VIR_DEBUG("%s %s: freeing", dev->id, dev->name);
g_free(dev->name);
- g_free(dev->path);
g_free(dev->used_by_drvname);
g_free(dev->used_by_domname);
g_free(dev->stubDriverName);
+ if (dev->device)
+ g_free(dev->device);
g_free(dev);
}
@@ -1971,9 +1774,9 @@ virPCIDeviceGetName(virPCIDevice *dev)
* config file.
*/
const char *
-virPCIDeviceGetConfigPath(virPCIDevice *dev)
+virPCIDeviceGetConfigPath(virPCIDevice *dev G_GNUC_UNUSED)
{
- return dev->path;
+ return NULL;
}
void virPCIDeviceSetManaged(virPCIDevice *dev, bool managed)
@@ -2484,47 +2287,37 @@ virPCIDeviceDownstreamLacksACS(virPCIDevice *dev)
uint16_t flags;
uint16_t ctrl;
unsigned int pos;
- int fd;
- int ret = 0;
uint16_t device_class;
- if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
+ if (virPCIDeviceInit(dev) < 0) {
return -1;
-
- if (virPCIDeviceInit(dev, fd) < 0) {
- ret = -1;
- goto cleanup;
}
if (virPCIDeviceReadClass(dev, &device_class) < 0)
- goto cleanup;
+ return 0;
pos = dev->pcie_cap_pos;
if (!pos || device_class != PCI_CLASS_BRIDGE_PCI)
- goto cleanup;
+ return 0;
- flags = virPCIDeviceRead16(dev, fd, pos + PCI_EXP_FLAGS);
+ pci_device_cfg_read_u16(dev->device, &flags, pos + PCI_EXP_FLAGS);
if (((flags & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_DOWNSTREAM)
- goto cleanup;
+ return 0;
- pos = virPCIDeviceFindExtendedCapabilityOffset(dev, fd, PCI_EXT_CAP_ID_ACS);
+ pos = virPCIDeviceFindExtendedCapabilityOffset(dev, PCI_EXT_CAP_ID_ACS);
if (!pos) {
VIR_DEBUG("%s %s: downstream port lacks ACS", dev->id, dev->name);
- ret = 1;
- goto cleanup;
+ return 1;
}
- ctrl = virPCIDeviceRead16(dev, fd, pos + PCI_EXT_ACS_CTRL);
+ pci_device_cfg_read_u16(dev->device, &ctrl, pos + PCI_EXT_ACS_CTRL);
if ((ctrl & PCI_EXT_CAP_ACS_ENABLED) != PCI_EXT_CAP_ACS_ENABLED) {
VIR_DEBUG("%s %s: downstream port has ACS disabled",
dev->id, dev->name);
- ret = 1;
- goto cleanup;
+ return 1;
}
- cleanup:
- virPCIDeviceConfigClose(dev, fd);
- return ret;
+ return 0;
}
static int
@@ -3189,48 +2982,27 @@ virPCIDeviceGetVPD(virPCIDevice *dev G_GNUC_UNUSED)
int
virPCIDeviceIsPCIExpress(virPCIDevice *dev)
{
- int fd;
- int ret = -1;
-
- if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
- return ret;
-
- if (virPCIDeviceInit(dev, fd) < 0)
- goto cleanup;
-
- ret = dev->is_pcie;
+ if (virPCIDeviceInit(dev) < 0)
+ return -1;
- cleanup:
- virPCIDeviceConfigClose(dev, fd);
- return ret;
+ return dev->is_pcie;
}
int
virPCIDeviceHasPCIExpressLink(virPCIDevice *dev)
{
- int fd;
- int ret = -1;
uint16_t cap, type;
-
- if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
- return ret;
-
- if (virPCIDeviceInit(dev, fd) < 0)
- goto cleanup;
+ if (virPCIDeviceInit(dev) < 0)
+ return -1;
if (dev->pcie_cap_pos == 0) {
- ret = 0;
- goto cleanup;
+ return 0;
}
- cap = virPCIDeviceRead16(dev, fd, dev->pcie_cap_pos + PCI_CAP_FLAGS);
+ pci_device_cfg_read_u16(dev->device, &cap, dev->pcie_cap_pos + PCI_CAP_FLAGS);
type = (cap & PCI_EXP_FLAGS_TYPE) >> 4;
- ret = type != PCI_EXP_TYPE_ROOT_INT_EP && type != PCI_EXP_TYPE_ROOT_EC;
-
- cleanup:
- virPCIDeviceConfigClose(dev, fd);
- return ret;
+ return type != PCI_EXP_TYPE_ROOT_INT_EP && type != PCI_EXP_TYPE_ROOT_EC;
}
int
@@ -3242,53 +3014,39 @@ virPCIDeviceGetLinkCapSta(virPCIDevice *dev,
unsigned int *sta_width)
{
uint32_t t;
- int fd;
- int ret = -1;
-
- if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
- return ret;
-
- if (virPCIDeviceInit(dev, fd) < 0)
- goto cleanup;
+ uint16_t t16;
+ if (virPCIDeviceInit(dev) < 0)
+ return -1;
if (!dev->pcie_cap_pos) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("pci device %1$s is not a PCI-Express device"),
dev->name);
- goto cleanup;
+ return -1;
}
- t = virPCIDeviceRead32(dev, fd, dev->pcie_cap_pos + PCI_EXP_LNKCAP);
+ pci_device_cfg_read_u32(dev->device, &t, dev->pcie_cap_pos + PCI_EXP_LNKCAP);
*cap_port = t >> 24;
*cap_speed = t & PCI_EXP_LNKCAP_SPEED;
*cap_width = (t & PCI_EXP_LNKCAP_WIDTH) >> 4;
- t = virPCIDeviceRead16(dev, fd, dev->pcie_cap_pos + PCI_EXP_LNKSTA);
+ pci_device_cfg_read_u16(dev->device, &t16, dev->pcie_cap_pos + PCI_EXP_LNKSTA);
+ t = t16;
*sta_speed = t & PCI_EXP_LNKSTA_SPEED;
*sta_width = (t & PCI_EXP_LNKSTA_WIDTH) >> 4;
- ret = 0;
-
- cleanup:
- virPCIDeviceConfigClose(dev, fd);
- return ret;
+ return 0;
}
int virPCIGetHeaderType(virPCIDevice *dev, int *hdrType)
{
- int fd;
uint8_t type;
*hdrType = -1;
- if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
- return -1;
-
- type = virPCIDeviceRead8(dev, fd, PCI_HEADER_TYPE);
-
- virPCIDeviceConfigClose(dev, fd);
+ pci_device_cfg_read_u8(dev->device, &type, PCI_HEADER_TYPE);
type &= PCI_HEADER_TYPE_MASK;
if (type >= VIR_PCI_HEADER_LAST) {
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index d2a1f5acf1..fd8339bd30 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -18,12 +18,14 @@
*/
#include <config.h>
+#include "testutils.h"
+
+#ifdef __linux__
#include "qemu/qemu_alias.h"
#include "qemu/qemu_conf.h"
#include "qemu/qemu_hotplug.h"
#include "qemumonitortestutils.h"
-#include "testutils.h"
#include "testutilsqemu.h"
#include "testutilsqemuschema.h"
#include "virhostdev.h"
@@ -816,3 +818,10 @@ VIR_TEST_MAIN_PRELOAD(mymain,
VIR_TEST_MOCK("domaincaps"),
VIR_TEST_MOCK("virprocess"),
VIR_TEST_MOCK("qemuhotplug"));
+#else
+int
+main(void)
+{
+ return EXIT_AM_SKIP;
+}
+#endif
diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index a2888732f7..5f62c80665 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -7,6 +7,8 @@
#include "testutils.h"
+#ifdef __linux__
+
#ifdef WITH_QEMU
# include "internal.h"
@@ -137,3 +139,10 @@ main(void)
}
#endif /* WITH_QEMU */
+#else
+int
+main(void)
+{
+ return EXIT_AM_SKIP;
+}
+#endif
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 1f0068864a..6f84812109 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -7,6 +7,8 @@
#include "testutils.h"
+#ifdef __linux__
+
#ifdef WITH_QEMU
# include "internal.h"
@@ -3051,3 +3053,10 @@ int main(void)
}
#endif /* WITH_QEMU */
+#else
+int
+main(void)
+{
+ return EXIT_AM_SKIP;
+}
+#endif
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 5b923c63ce..2fa12903d2 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -22,7 +22,7 @@
#include "virpcivpdpriv.h"
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__)
# define VIR_MOCK_LOOKUP_MAIN
# include "virmock.h"
# include "virpci.h"
@@ -42,6 +42,10 @@ static int (*real___open_2)(const char *path, int flags);
static int (*real_close)(int fd);
static DIR * (*real_opendir)(const char *name);
static char *(*real_virFileCanonicalizePath)(const char *path);
+static int (*real_scandir)(const char *restrict dirp,
+ struct dirent ***restrict namelist,
+ typeof(int(const struct dirent *)) *filter,
+ typeof(int(const struct dirent **, const struct dirent **)) *compar);
static char *fakerootdir;
@@ -955,6 +959,7 @@ init_syms(void)
VIR_MOCK_REAL_INIT(opendir);
# endif
VIR_MOCK_REAL_INIT(virFileCanonicalizePath);
+ VIR_MOCK_REAL_INIT(scandir);
}
static void
@@ -1172,6 +1177,20 @@ virFileCanonicalizePath(const char *path)
return real_virFileCanonicalizePath(newpath);
}
+int scandir(const char *restrict dirp, struct dirent ***restrict namelist,
+ typeof(int(const struct dirent *)) *filter,
+ typeof(int(const struct dirent **, const struct dirent **)) *compar)
+{
+ g_autofree char *newpath = NULL;
+
+ init_syms();
+
+ if (getrealpath(&newpath, dirp) < 0)
+ return -1;
+
+ return real_scandir(newpath, namelist, filter, compar);
+}
+
# include "virmockstathelpers.c"
#else
--
2.47.1
3
12
*** BLURB HERE ***
Michal PrÃvoznÃk (2):
virgdbus: Introduce virGDBusHasSessionBus()
remote_daemon: Silence DBus errors
src/libvirt_private.syms | 1 +
src/remote/remote_daemon.c | 36 +++++++++++++++------------
src/util/virgdbus.c | 50 +++++++++++++++++++++++++++++++++++---
src/util/virgdbus.h | 3 +++
4 files changed, 70 insertions(+), 20 deletions(-)
--
2.45.3
2
3
These patches are a spin off from my bigger auto-shutdown series:
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/EIBL…
Since they're self contained, they can be merged sooner while
I'm still working on Peter's feedback from latter parts of the
above patch series.
Daniel P. Berrangé (8):
bhyve: add 'driver' to bhyveProcessStart method
bhyve: stop opening & passing connection to bhyveProcessStart
util: add APIs for more systemd notifications
remote: notify systemd when reloading config
hypervisor: introduce helper for autostart
src: convert drivers over to use new autostart helper
hypervisor: add support for delay interval during autostart
qemu: add 'auto_start_delay' configuration parameter
src/bhyve/bhyve_driver.c | 60 ++++++++++--------------------
src/bhyve/bhyve_process.c | 5 +--
src/bhyve/bhyve_process.h | 3 +-
src/hypervisor/domain_driver.c | 55 +++++++++++++++++++++++++++
src/hypervisor/domain_driver.h | 19 ++++++++++
src/libvirt_private.syms | 7 +++-
src/libxl/libxl_driver.c | 36 +++++-------------
src/lxc/lxc_driver.c | 13 ++++---
src/lxc/lxc_process.c | 18 +--------
src/lxc/lxc_process.h | 2 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf.in | 5 +++
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_driver.c | 55 +++++++++------------------
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/remote/libvirtd.service.in | 2 +-
src/remote/remote_daemon.c | 2 +
src/rpc/virnetdaemon.c | 2 +-
src/util/virsystemd.c | 44 ++++++++++++++++++++--
src/util/virsystemd.h | 6 ++-
src/virtd.service.in | 2 +-
22 files changed, 202 insertions(+), 139 deletions(-)
--
2.47.1
2
17
12 Feb '25
On Thu, Feb 06, 2025 at 10:20:09AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > ---
> > qapi/block-export.json | 10 ++++++++++
> > include/block/nbd.h | 6 +++---
>
> [..]
>
> > @@ -52,6 +57,10 @@
> > #
> > # @addr: Address on which to listen.
> > #
> > +# @handshake-max-secs: Time limit, in seconds, at which a client that
> > +# has not completed the negotiation handshake will be disconnected,
> > +# or 0 for no limit (since 10.0; default: 10).
> > +#
>
> Hmm. [not about the series], shouldn't we finally deprecate older interface?
By older interface, you are asking about the QMP command
'nbd-server-start' as compared to struct NbdServerOptions. But the
struct is not directly present in any QMP commands; rather, it only
appears to be used by qemu-storage-daemon as one of its command line
options that needs to set up an NBD server with a JSON-like syntax
that has less nesting than QMP nbd-server-start. blockdev-nbd.c has
two functions [nbd_server_start_options(NbdServerOPtions *arg...) and
qmp_nbd_server_start(args...)] that both unpack their slightly
different forms and pass them as parameters to nbd_server_start() that
is then agnostic to whether the older QMP command or newer q-s-d CLI
option was specified.
It looks like libvirt is still using QMP nbd-server-start. If we were
to start the deprecation process for qemu 10.0, what would the new
command look like? What would everyone be required to use by qemu
10.2?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
2
1
[PATCH 0/5] qemu: migration: Reactivate block nodes after migration if VM is left paused
by Peter Krempa 12 Feb '25
by Peter Krempa 12 Feb '25
12 Feb '25
Patch 1/5 is a bugfix for the qemu-replies-tool.
For justification of 2-5/5 see 5/5.
Peter Krempa (5):
qemu-replies-tool: Dump also query string for optional members
qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to
'v9.2.0-1636-gffaf7f0376'
qemu: capabilies: Introduce QEMU_CAPS_BLOCKDEV_SET_ACTIVE
qemu: monitor: Add monitor backend for 'blockdev-set-active'
qemu: migration: Reactivate block nodes after migration if VM is left
paused
scripts/qemu-replies-tool.py | 4 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_migration.c | 46 +-
src/qemu/qemu_monitor.c | 21 +
src/qemu/qemu_monitor.h | 5 +
src/qemu/qemu_monitor_json.c | 21 +
src/qemu/qemu_monitor_json.h | 5 +
.../caps_10.0.0_x86_64.replies | 3918 +++++++++--------
.../caps_10.0.0_x86_64.xml | 3 +-
tests/qemumonitorjsontest.c | 31 +
11 files changed, 2113 insertions(+), 1944 deletions(-)
--
2.48.1
2
12
[PATCH v5 00/18] *** qemu: block: Support block disk along with throttle filters ***
by Harikumar R 12 Feb '25
by Harikumar R 12 Feb '25
12 Feb '25
*** BLURB HERE ***
Chun Feng Wu (17):
schema: Add new domain elements to support multiple throttle groups
schema: Add new domain elements to support multiple throttle filters
config: Introduce ThrottleGroup and corresponding XML parsing
config: Introduce ThrottleFilter and corresponding XML parsing
qemu: monitor: Add support for ThrottleGroup operations
tests: Test qemuMonitorJSONGetThrottleGroup and
qemuMonitorJSONUpdateThrottleGroup
remote: New APIs for ThrottleGroup lifecycle management
qemu: Refactor qemuDomainSetBlockIoTune to extract common methods
qemu: Implement qemu driver for throttle API
qemu: helper: throttle filter nodename and preparation processing
qemu: block: Support block disk along with throttle filters
config: validate: Verify iotune, throttle group and filter
qemuxmlconftest: Add 'throttlefilter' tests
test_driver: Test throttle group lifecycle APIs
virsh: Refactor iotune options for re-use
virsh: Add support for throttle group operations
virsh: Add option "throttle-groups" to "attach_disk"
Harikumar Rajkumar (1):
tests: Test qemuxmlactivetestThrottleGroup
docs/formatdomain.rst | 47 ++
docs/manpages/virsh.rst | 135 +++-
include/libvirt/libvirt-domain.h | 21 +
src/conf/domain_conf.c | 398 ++++++++++
src/conf/domain_conf.h | 45 ++
src/conf/domain_validate.c | 119 ++-
src/conf/schemas/domaincommon.rng | 293 ++++----
src/conf/virconftypes.h | 4 +
src/driver-hypervisor.h | 22 +
src/libvirt-domain.c | 174 +++++
src/libvirt_private.syms | 8 +
src/libvirt_public.syms | 7 +
src/qemu/qemu_block.c | 136 ++++
src/qemu/qemu_block.h | 49 ++
src/qemu/qemu_command.c | 180 +++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain.c | 73 +-
src/qemu/qemu_driver.c | 619 +++++++++++++---
src/qemu/qemu_hotplug.c | 33 +
src/qemu/qemu_monitor.c | 34 +
src/qemu/qemu_monitor.h | 14 +
src/qemu/qemu_monitor_json.c | 134 ++++
src/qemu/qemu_monitor_json.h | 14 +
src/remote/remote_daemon_dispatch.c | 44 ++
src/remote/remote_driver.c | 40 ++
src/remote/remote_protocol.x | 48 +-
src/remote_protocol-structs | 28 +
src/test/test_driver.c | 452 ++++++++----
tests/qemumonitorjsontest.c | 86 +++
.../throttlefilter-in.xml | 392 ++++++++++
.../throttlefilter-out.xml | 393 ++++++++++
tests/qemuxmlactivetest.c | 1 +
.../throttlefilter-invalid.x86_64-latest.err | 1 +
.../throttlefilter-invalid.xml | 89 +++
.../throttlefilter.x86_64-latest.args | 55 ++
.../throttlefilter.x86_64-latest.xml | 105 +++
tests/qemuxmlconfdata/throttlefilter.xml | 95 +++
tests/qemuxmlconftest.c | 2 +
tools/virsh-completer-domain.c | 82 +++
tools/virsh-completer-domain.h | 16 +
tools/virsh-domain.c | 680 ++++++++++++++----
41 files changed, 4649 insertions(+), 525 deletions(-)
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-in.xml
create mode 100644 tests/qemustatusxml2xmldata/throttlefilter-out.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err
create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml
--
2.39.5 (Apple Git-154)
4
51
12 Feb '25
When processing the PCI devices we can only read the configs for each of
them if running as privileged. That information is saved in the driver
state as a boolean introduced in commit 643c74abff01. However since
that version it is only written to once during nodeStateInitialize() and
only read from that point (apart from some commits around v3.9.0 release
when it was not even set, but that was fixed before v3.10.0). And it is
only read once, just to store that boolean in a temporary variable which
is also used in only one condition.
Rewrite this without locking and save few lines of code.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/node_device/node_device_udev.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7b4ff80f8fb4..be5ee0108c85 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -430,7 +430,6 @@ udevProcessPCI(virNodeDeviceDriverState *driver_state,
g_autofree char *linkpath = NULL;
int ret = -1;
char *p;
- bool privileged = false;
linkpath = g_strdup_printf("%s/config", udev_device_get_syspath(device));
if (virFileWaitForExists(linkpath, 10, 100) < 0) {
@@ -440,10 +439,6 @@ udevProcessPCI(virNodeDeviceDriverState *driver_state,
goto cleanup;
}
- VIR_WITH_MUTEX_LOCK_GUARD(&driver_state->lock) {
- privileged = driver_state->privileged;
- }
-
pci_dev->klass = -1;
if (udevGetIntProperty(device, "PCI_CLASS", &pci_dev->klass, 16) < 0)
goto cleanup;
@@ -491,7 +486,7 @@ udevProcessPCI(virNodeDeviceDriverState *driver_state,
goto cleanup;
/* We need to be root to read PCI device configs */
- if (privileged) {
+ if (driver_state->privileged) {
if (virPCIGetHeaderType(pciDev, &pci_dev->hdrType) < 0)
goto cleanup;
--
2.48.1
2
3
The commit in question made an incorrect change that resulted in getting
O_RDONLY FD instead of O_RDWR preventing any writes to happen with the
following error:
virQEMUSaveDataWrite:176 : failed to write header to domain save file '/path/to/save.img': Bad file descriptor
Fixes: 517248e2394476a3105ff5866b0b718fc6583073
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 78bfaa5b3a..a35abf2747 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5949,7 +5949,7 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path,
if (qemuSaveImageGetMetadata(driver, NULL, path, &def, &data) < 0)
goto cleanup;
- fd = qemuSaveImageOpen(driver, path, 0, NULL, false);
+ fd = qemuSaveImageOpen(driver, path, false, NULL, true);
if (fd < 0)
goto cleanup;
--
2.48.1
3
2
This replaces Fedora 39 with Fedora 41, updates the FreeBSD
Cirrus CI image names, and tweaks some package names
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
NB: this updates the integration test config files but the
integration test machine lacks updates. I have disabled
running of integration tests in the scheduled nightly
build pipelines.
ci/buildenv/debian-11-cross-aarch64.sh | 2 +-
ci/buildenv/debian-11-cross-armv6l.sh | 2 +-
ci/buildenv/debian-11-cross-armv7l.sh | 2 +-
ci/buildenv/debian-11-cross-i686.sh | 2 +-
ci/buildenv/debian-11-cross-mips64el.sh | 2 +-
ci/buildenv/debian-11-cross-mipsel.sh | 2 +-
ci/buildenv/debian-11-cross-ppc64le.sh | 2 +-
ci/buildenv/debian-11-cross-s390x.sh | 2 +-
ci/buildenv/debian-11.sh | 2 +-
ci/buildenv/debian-12-cross-aarch64.sh | 2 +-
ci/buildenv/debian-12-cross-armv6l.sh | 2 +-
ci/buildenv/debian-12-cross-armv7l.sh | 2 +-
ci/buildenv/debian-12-cross-i686.sh | 2 +-
ci/buildenv/debian-12-cross-mips64el.sh | 2 +-
ci/buildenv/debian-12-cross-mipsel.sh | 2 +-
ci/buildenv/debian-12-cross-ppc64le.sh | 2 +-
ci/buildenv/debian-12-cross-s390x.sh | 2 +-
ci/buildenv/debian-12.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-mips64el.sh | 2 +-
ci/buildenv/debian-sid-cross-ppc64le.sh | 2 +-
ci/buildenv/debian-sid-cross-s390x.sh | 2 +-
ci/buildenv/debian-sid.sh | 2 +-
...-mingw32.sh => fedora-41-cross-mingw32.sh} | 2 +-
...-mingw64.sh => fedora-41-cross-mingw64.sh} | 2 +-
ci/buildenv/{fedora-39.sh => fedora-41.sh} | 3 +-
ci/cirrus/freebsd-13.vars | 2 +-
ci/cirrus/freebsd-14.vars | 2 +-
.../debian-11-cross-aarch64.Dockerfile | 2 +-
.../debian-11-cross-armv6l.Dockerfile | 2 +-
.../debian-11-cross-armv7l.Dockerfile | 2 +-
ci/containers/debian-11-cross-i686.Dockerfile | 2 +-
.../debian-11-cross-mips64el.Dockerfile | 2 +-
.../debian-11-cross-mipsel.Dockerfile | 2 +-
.../debian-11-cross-ppc64le.Dockerfile | 2 +-
.../debian-11-cross-s390x.Dockerfile | 2 +-
ci/containers/debian-11.Dockerfile | 2 +-
.../debian-12-cross-aarch64.Dockerfile | 2 +-
.../debian-12-cross-armv6l.Dockerfile | 2 +-
.../debian-12-cross-armv7l.Dockerfile | 2 +-
ci/containers/debian-12-cross-i686.Dockerfile | 2 +-
.../debian-12-cross-mips64el.Dockerfile | 2 +-
.../debian-12-cross-mipsel.Dockerfile | 2 +-
.../debian-12-cross-ppc64le.Dockerfile | 2 +-
.../debian-12-cross-s390x.Dockerfile | 2 +-
ci/containers/debian-12.Dockerfile | 2 +-
.../debian-sid-cross-aarch64.Dockerfile | 2 +-
.../debian-sid-cross-armv6l.Dockerfile | 2 +-
.../debian-sid-cross-armv7l.Dockerfile | 2 +-
.../debian-sid-cross-i686.Dockerfile | 2 +-
.../debian-sid-cross-mips64el.Dockerfile | 2 +-
.../debian-sid-cross-ppc64le.Dockerfile | 2 +-
.../debian-sid-cross-s390x.Dockerfile | 2 +-
ci/containers/debian-sid.Dockerfile | 2 +-
...ile => fedora-41-cross-mingw32.Dockerfile} | 4 +--
...ile => fedora-41-cross-mingw64.Dockerfile} | 4 +--
...ora-39.Dockerfile => fedora-41.Dockerfile} | 5 +--
ci/gitlab.yml | 1 +
ci/gitlab/build-templates.yml | 4 +--
ci/gitlab/builds.yml | 36 +++++++++----------
ci/gitlab/containers.yml | 16 ++++-----
ci/integration.yml | 20 +++++------
ci/manifest.yml | 4 +--
66 files changed, 106 insertions(+), 103 deletions(-)
rename ci/buildenv/{fedora-40-cross-mingw32.sh => fedora-41-cross-mingw32.sh} (98%)
rename ci/buildenv/{fedora-40-cross-mingw64.sh => fedora-41-cross-mingw64.sh} (98%)
rename ci/buildenv/{fedora-39.sh => fedora-41.sh} (97%)
rename ci/containers/{fedora-40-cross-mingw32.Dockerfile => fedora-41-cross-mingw32.Dockerfile} (96%)
rename ci/containers/{fedora-40-cross-mingw64.Dockerfile => fedora-41-cross-mingw64.Dockerfile} (96%)
rename ci/containers/{fedora-39.Dockerfile => fedora-41.Dockerfile} (96%)
diff --git a/ci/buildenv/debian-11-cross-aarch64.sh b/ci/buildenv/debian-11-cross-aarch64.sh
index 6600b73e74..a52164a851 100644
--- a/ci/buildenv/debian-11-cross-aarch64.sh
+++ b/ci/buildenv/debian-11-cross-aarch64.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/buildenv/debian-11-cross-armv6l.sh b/ci/buildenv/debian-11-cross-armv6l.sh
index 761d813df0..caef8e80a4 100644
--- a/ci/buildenv/debian-11-cross-armv6l.sh
+++ b/ci/buildenv/debian-11-cross-armv6l.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/buildenv/debian-11-cross-armv7l.sh b/ci/buildenv/debian-11-cross-armv7l.sh
index 6c016bd90b..81d92e6386 100644
--- a/ci/buildenv/debian-11-cross-armv7l.sh
+++ b/ci/buildenv/debian-11-cross-armv7l.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/buildenv/debian-11-cross-i686.sh b/ci/buildenv/debian-11-cross-i686.sh
index b9705f1c3c..7ab7242654 100644
--- a/ci/buildenv/debian-11-cross-i686.sh
+++ b/ci/buildenv/debian-11-cross-i686.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/buildenv/debian-11-cross-mips64el.sh b/ci/buildenv/debian-11-cross-mips64el.sh
index 065c61ba57..f983ab2981 100644
--- a/ci/buildenv/debian-11-cross-mips64el.sh
+++ b/ci/buildenv/debian-11-cross-mips64el.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/buildenv/debian-11-cross-mipsel.sh b/ci/buildenv/debian-11-cross-mipsel.sh
index 89a0a8904b..55a99b861f 100644
--- a/ci/buildenv/debian-11-cross-mipsel.sh
+++ b/ci/buildenv/debian-11-cross-mipsel.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
- libssh-gcrypt-dev:mipsel \
+ libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
diff --git a/ci/buildenv/debian-11-cross-ppc64le.sh b/ci/buildenv/debian-11-cross-ppc64le.sh
index c898939f09..b7d26e67fd 100644
--- a/ci/buildenv/debian-11-cross-ppc64le.sh
+++ b/ci/buildenv/debian-11-cross-ppc64le.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/buildenv/debian-11-cross-s390x.sh b/ci/buildenv/debian-11-cross-s390x.sh
index f1b94ac872..ac259c5625 100644
--- a/ci/buildenv/debian-11-cross-s390x.sh
+++ b/ci/buildenv/debian-11-cross-s390x.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/buildenv/debian-11.sh b/ci/buildenv/debian-11.sh
index 9ba9e80183..affdf6e445 100644
--- a/ci/buildenv/debian-11.sh
+++ b/ci/buildenv/debian-11.sh
@@ -57,7 +57,7 @@ function install_buildenv() {
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/buildenv/debian-12-cross-aarch64.sh b/ci/buildenv/debian-12-cross-aarch64.sh
index b4a056d940..1d69c099a4 100644
--- a/ci/buildenv/debian-12-cross-aarch64.sh
+++ b/ci/buildenv/debian-12-cross-aarch64.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/buildenv/debian-12-cross-armv6l.sh b/ci/buildenv/debian-12-cross-armv6l.sh
index 07ffb3da37..db2ee46af5 100644
--- a/ci/buildenv/debian-12-cross-armv6l.sh
+++ b/ci/buildenv/debian-12-cross-armv6l.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/buildenv/debian-12-cross-armv7l.sh b/ci/buildenv/debian-12-cross-armv7l.sh
index 6f88f6cc06..9ab435d0d7 100644
--- a/ci/buildenv/debian-12-cross-armv7l.sh
+++ b/ci/buildenv/debian-12-cross-armv7l.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/buildenv/debian-12-cross-i686.sh b/ci/buildenv/debian-12-cross-i686.sh
index 5da816d086..fbc6da5dd4 100644
--- a/ci/buildenv/debian-12-cross-i686.sh
+++ b/ci/buildenv/debian-12-cross-i686.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/buildenv/debian-12-cross-mips64el.sh b/ci/buildenv/debian-12-cross-mips64el.sh
index 09c445758c..f7067dfeb3 100644
--- a/ci/buildenv/debian-12-cross-mips64el.sh
+++ b/ci/buildenv/debian-12-cross-mips64el.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/buildenv/debian-12-cross-mipsel.sh b/ci/buildenv/debian-12-cross-mipsel.sh
index a762d1e3b8..6dd5333ae4 100644
--- a/ci/buildenv/debian-12-cross-mipsel.sh
+++ b/ci/buildenv/debian-12-cross-mipsel.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
- libssh-gcrypt-dev:mipsel \
+ libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
diff --git a/ci/buildenv/debian-12-cross-ppc64le.sh b/ci/buildenv/debian-12-cross-ppc64le.sh
index fe7b672799..97de655904 100644
--- a/ci/buildenv/debian-12-cross-ppc64le.sh
+++ b/ci/buildenv/debian-12-cross-ppc64le.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/buildenv/debian-12-cross-s390x.sh b/ci/buildenv/debian-12-cross-s390x.sh
index 1ca0768d14..725d1ee113 100644
--- a/ci/buildenv/debian-12-cross-s390x.sh
+++ b/ci/buildenv/debian-12-cross-s390x.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/buildenv/debian-12.sh b/ci/buildenv/debian-12.sh
index fcd5291f22..5e5b759f08 100644
--- a/ci/buildenv/debian-12.sh
+++ b/ci/buildenv/debian-12.sh
@@ -57,7 +57,7 @@ function install_buildenv() {
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/buildenv/debian-sid-cross-aarch64.sh b/ci/buildenv/debian-sid-cross-aarch64.sh
index b4a056d940..1d69c099a4 100644
--- a/ci/buildenv/debian-sid-cross-aarch64.sh
+++ b/ci/buildenv/debian-sid-cross-aarch64.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/buildenv/debian-sid-cross-armv6l.sh b/ci/buildenv/debian-sid-cross-armv6l.sh
index 53d2d79b38..ac03caeb5c 100644
--- a/ci/buildenv/debian-sid-cross-armv6l.sh
+++ b/ci/buildenv/debian-sid-cross-armv6l.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/buildenv/debian-sid-cross-armv7l.sh b/ci/buildenv/debian-sid-cross-armv7l.sh
index 4e60877e77..c540104cb0 100644
--- a/ci/buildenv/debian-sid-cross-armv7l.sh
+++ b/ci/buildenv/debian-sid-cross-armv7l.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/buildenv/debian-sid-cross-i686.sh b/ci/buildenv/debian-sid-cross-i686.sh
index 98e08b2397..b558576fca 100644
--- a/ci/buildenv/debian-sid-cross-i686.sh
+++ b/ci/buildenv/debian-sid-cross-i686.sh
@@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/buildenv/debian-sid-cross-mips64el.sh b/ci/buildenv/debian-sid-cross-mips64el.sh
index 09c445758c..f7067dfeb3 100644
--- a/ci/buildenv/debian-sid-cross-mips64el.sh
+++ b/ci/buildenv/debian-sid-cross-mips64el.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/buildenv/debian-sid-cross-ppc64le.sh b/ci/buildenv/debian-sid-cross-ppc64le.sh
index fe7b672799..97de655904 100644
--- a/ci/buildenv/debian-sid-cross-ppc64le.sh
+++ b/ci/buildenv/debian-sid-cross-ppc64le.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/buildenv/debian-sid-cross-s390x.sh b/ci/buildenv/debian-sid-cross-s390x.sh
index 1ca0768d14..725d1ee113 100644
--- a/ci/buildenv/debian-sid-cross-s390x.sh
+++ b/ci/buildenv/debian-sid-cross-s390x.sh
@@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/buildenv/debian-sid.sh b/ci/buildenv/debian-sid.sh
index fcd5291f22..5e5b759f08 100644
--- a/ci/buildenv/debian-sid.sh
+++ b/ci/buildenv/debian-sid.sh
@@ -57,7 +57,7 @@ function install_buildenv() {
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/buildenv/fedora-40-cross-mingw32.sh b/ci/buildenv/fedora-41-cross-mingw32.sh
similarity index 98%
rename from ci/buildenv/fedora-40-cross-mingw32.sh
rename to ci/buildenv/fedora-41-cross-mingw32.sh
index 9104b2e20e..b19f0dccb2 100644
--- a/ci/buildenv/fedora-40-cross-mingw32.sh
+++ b/ci/buildenv/fedora-41-cross-mingw32.sh
@@ -8,7 +8,7 @@ function install_buildenv() {
dnf update -y
dnf install -y \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
codespell \
diff --git a/ci/buildenv/fedora-40-cross-mingw64.sh b/ci/buildenv/fedora-41-cross-mingw64.sh
similarity index 98%
rename from ci/buildenv/fedora-40-cross-mingw64.sh
rename to ci/buildenv/fedora-41-cross-mingw64.sh
index 35120064ec..20dca703b5 100644
--- a/ci/buildenv/fedora-40-cross-mingw64.sh
+++ b/ci/buildenv/fedora-41-cross-mingw64.sh
@@ -8,7 +8,7 @@ function install_buildenv() {
dnf update -y
dnf install -y \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
codespell \
diff --git a/ci/buildenv/fedora-39.sh b/ci/buildenv/fedora-41.sh
similarity index 97%
rename from ci/buildenv/fedora-39.sh
rename to ci/buildenv/fedora-41.sh
index e45ac2230f..c32a689fbd 100644
--- a/ci/buildenv/fedora-39.sh
+++ b/ci/buildenv/fedora-41.sh
@@ -9,7 +9,7 @@ function install_buildenv() {
dnf install -y \
audit-libs-devel \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
clang \
@@ -82,6 +82,7 @@ function install_buildenv() {
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
+ systemtap-sdt-dtrace \
wireshark-devel \
xen-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars
index fbcd613095..56b66e3b2a 100644
--- a/ci/cirrus/freebsd-13.vars
+++ b/ci/cirrus/freebsd-13.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
-PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
+PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/ci/cirrus/freebsd-14.vars b/ci/cirrus/freebsd-14.vars
index 3002987cbd..fb665d16ee 100644
--- a/ci/cirrus/freebsd-14.vars
+++ b/ci/cirrus/freebsd-14.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip'
-PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
+PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/ci/containers/debian-11-cross-aarch64.Dockerfile b/ci/containers/debian-11-cross-aarch64.Dockerfile
index f8d4ea8ed2..79c359f9fa 100644
--- a/ci/containers/debian-11-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-11-cross-aarch64.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/containers/debian-11-cross-armv6l.Dockerfile b/ci/containers/debian-11-cross-armv6l.Dockerfile
index f974163000..27bd6c578b 100644
--- a/ci/containers/debian-11-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-11-cross-armv6l.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/containers/debian-11-cross-armv7l.Dockerfile b/ci/containers/debian-11-cross-armv7l.Dockerfile
index ced175c7c0..3b413673a6 100644
--- a/ci/containers/debian-11-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-11-cross-armv7l.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/containers/debian-11-cross-i686.Dockerfile b/ci/containers/debian-11-cross-i686.Dockerfile
index c1ee60f3b6..ab5173f2f1 100644
--- a/ci/containers/debian-11-cross-i686.Dockerfile
+++ b/ci/containers/debian-11-cross-i686.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/containers/debian-11-cross-mips64el.Dockerfile b/ci/containers/debian-11-cross-mips64el.Dockerfile
index 98c40beef4..04fa68f688 100644
--- a/ci/containers/debian-11-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-11-cross-mips64el.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/containers/debian-11-cross-mipsel.Dockerfile b/ci/containers/debian-11-cross-mipsel.Dockerfile
index e3531a9fac..558382ad25 100644
--- a/ci/containers/debian-11-cross-mipsel.Dockerfile
+++ b/ci/containers/debian-11-cross-mipsel.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
- libssh-gcrypt-dev:mipsel \
+ libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
diff --git a/ci/containers/debian-11-cross-ppc64le.Dockerfile b/ci/containers/debian-11-cross-ppc64le.Dockerfile
index 8f9f729909..ed68e8f0af 100644
--- a/ci/containers/debian-11-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-11-cross-ppc64le.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/containers/debian-11-cross-s390x.Dockerfile b/ci/containers/debian-11-cross-s390x.Dockerfile
index b09076b148..62791ac154 100644
--- a/ci/containers/debian-11-cross-s390x.Dockerfile
+++ b/ci/containers/debian-11-cross-s390x.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/containers/debian-11.Dockerfile b/ci/containers/debian-11.Dockerfile
index 1660bd9c52..48c59e3aab 100644
--- a/ci/containers/debian-11.Dockerfile
+++ b/ci/containers/debian-11.Dockerfile
@@ -59,7 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/containers/debian-12-cross-aarch64.Dockerfile b/ci/containers/debian-12-cross-aarch64.Dockerfile
index f4d587177b..ebccfbc203 100644
--- a/ci/containers/debian-12-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-12-cross-aarch64.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/containers/debian-12-cross-armv6l.Dockerfile b/ci/containers/debian-12-cross-armv6l.Dockerfile
index d8f2a3bc42..a6f51c80fd 100644
--- a/ci/containers/debian-12-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-12-cross-armv6l.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/containers/debian-12-cross-armv7l.Dockerfile b/ci/containers/debian-12-cross-armv7l.Dockerfile
index 1abfb79931..132938ce10 100644
--- a/ci/containers/debian-12-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-12-cross-armv7l.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/containers/debian-12-cross-i686.Dockerfile b/ci/containers/debian-12-cross-i686.Dockerfile
index 5681121d80..3a76ee4e76 100644
--- a/ci/containers/debian-12-cross-i686.Dockerfile
+++ b/ci/containers/debian-12-cross-i686.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/containers/debian-12-cross-mips64el.Dockerfile b/ci/containers/debian-12-cross-mips64el.Dockerfile
index a4f2aabe10..c8009062ef 100644
--- a/ci/containers/debian-12-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-12-cross-mips64el.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/containers/debian-12-cross-mipsel.Dockerfile b/ci/containers/debian-12-cross-mipsel.Dockerfile
index a3f0652818..efb4639a26 100644
--- a/ci/containers/debian-12-cross-mipsel.Dockerfile
+++ b/ci/containers/debian-12-cross-mipsel.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
- libssh-gcrypt-dev:mipsel \
+ libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
diff --git a/ci/containers/debian-12-cross-ppc64le.Dockerfile b/ci/containers/debian-12-cross-ppc64le.Dockerfile
index caf8229a8e..3b0cfab7ef 100644
--- a/ci/containers/debian-12-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-12-cross-ppc64le.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/containers/debian-12-cross-s390x.Dockerfile b/ci/containers/debian-12-cross-s390x.Dockerfile
index c4f8479c13..c730b44e03 100644
--- a/ci/containers/debian-12-cross-s390x.Dockerfile
+++ b/ci/containers/debian-12-cross-s390x.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/containers/debian-12.Dockerfile b/ci/containers/debian-12.Dockerfile
index 3e6d0597e2..778f6962d9 100644
--- a/ci/containers/debian-12.Dockerfile
+++ b/ci/containers/debian-12.Dockerfile
@@ -59,7 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/containers/debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile
index 3a06f01c5c..2d0e4d8a98 100644
--- a/ci/containers/debian-sid-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-sid-cross-aarch64.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
- libssh-gcrypt-dev:arm64 \
+ libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
diff --git a/ci/containers/debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile
index fdf129aa04..d3034c0131 100644
--- a/ci/containers/debian-sid-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv6l.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
- libssh-gcrypt-dev:armel \
+ libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
diff --git a/ci/containers/debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile
index 8dbb705d69..30234b6755 100644
--- a/ci/containers/debian-sid-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-sid-cross-armv7l.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
- libssh-gcrypt-dev:armhf \
+ libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
diff --git a/ci/containers/debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile
index f856306a62..2c2c4772c8 100644
--- a/ci/containers/debian-sid-cross-i686.Dockerfile
+++ b/ci/containers/debian-sid-cross-i686.Dockerfile
@@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
- libssh-gcrypt-dev:i386 \
+ libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
diff --git a/ci/containers/debian-sid-cross-mips64el.Dockerfile b/ci/containers/debian-sid-cross-mips64el.Dockerfile
index 468c5fbc3e..0af87394cc 100644
--- a/ci/containers/debian-sid-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-sid-cross-mips64el.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
- libssh-gcrypt-dev:mips64el \
+ libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
diff --git a/ci/containers/debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
index 37c256fe1e..d91a84c65b 100644
--- a/ci/containers/debian-sid-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-sid-cross-ppc64le.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
- libssh-gcrypt-dev:ppc64el \
+ libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
diff --git a/ci/containers/debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile
index 232a8d7844..147c5e992f 100644
--- a/ci/containers/debian-sid-cross-s390x.Dockerfile
+++ b/ci/containers/debian-sid-cross-s390x.Dockerfile
@@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
- libssh-gcrypt-dev:s390x \
+ libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile
index febd286d86..daa750324b 100644
--- a/ci/containers/debian-sid.Dockerfile
+++ b/ci/containers/debian-sid.Dockerfile
@@ -59,7 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
- libssh-gcrypt-dev \
+ libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
diff --git a/ci/containers/fedora-40-cross-mingw32.Dockerfile b/ci/containers/fedora-41-cross-mingw32.Dockerfile
similarity index 96%
rename from ci/containers/fedora-40-cross-mingw32.Dockerfile
rename to ci/containers/fedora-41-cross-mingw32.Dockerfile
index ed8566f273..6ab14be6fc 100644
--- a/ci/containers/fedora-40-cross-mingw32.Dockerfile
+++ b/ci/containers/fedora-41-cross-mingw32.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:40
+FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@@ -19,7 +19,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
codespell \
diff --git a/ci/containers/fedora-40-cross-mingw64.Dockerfile b/ci/containers/fedora-41-cross-mingw64.Dockerfile
similarity index 96%
rename from ci/containers/fedora-40-cross-mingw64.Dockerfile
rename to ci/containers/fedora-41-cross-mingw64.Dockerfile
index b030427e0c..a0ec65d74a 100644
--- a/ci/containers/fedora-40-cross-mingw64.Dockerfile
+++ b/ci/containers/fedora-41-cross-mingw64.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:40
+FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@@ -19,7 +19,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
codespell \
diff --git a/ci/containers/fedora-39.Dockerfile b/ci/containers/fedora-41.Dockerfile
similarity index 96%
rename from ci/containers/fedora-39.Dockerfile
rename to ci/containers/fedora-41.Dockerfile
index 2e35ca426d..a46f220de0 100644
--- a/ci/containers/fedora-39.Dockerfile
+++ b/ci/containers/fedora-41.Dockerfile
@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
-FROM registry.fedoraproject.org/fedora:39
+FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@@ -20,7 +20,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf install -y \
audit-libs-devel \
augeas \
- bash-completion \
+ bash-completion-devel \
ca-certificates \
ccache \
clang \
@@ -93,6 +93,7 @@ exec "$@"\n' > /usr/bin/nosync && \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
+ systemtap-sdt-dtrace \
wireshark-devel \
xen-devel && \
nosync dnf autoremove -y && \
diff --git a/ci/gitlab.yml b/ci/gitlab.yml
index 0daab12676..0e6de9f36d 100644
--- a/ci/gitlab.yml
+++ b/ci/gitlab.yml
@@ -55,6 +55,7 @@
variables:
RUN_UPSTREAM_NAMESPACE: libvirt
+ CONTAINER_UPSTREAM_NAMESPACE: libvirt
FF_SCRIPT_SECTIONS: 1
diff --git a/ci/gitlab/build-templates.yml b/ci/gitlab/build-templates.yml
index 5ba91ffc67..a4b76e06d0 100644
--- a/ci/gitlab/build-templates.yml
+++ b/ci/gitlab/build-templates.yml
@@ -35,7 +35,7 @@
fi
- cat /packages.txt
variables:
- IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
+ IMAGE: $CI_REGISTRY/$CONTAINER_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
rules:
### PUSH events
@@ -179,7 +179,7 @@
fi
- cat /packages.txt
variables:
- IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME-cross-$CROSS:latest
+ IMAGE: $CI_REGISTRY/$CONTAINER_UPSTREAM_NAMESPACE/libvirt/ci-$NAME-cross-$CROSS:latest
rules:
### PUSH events
diff --git a/ci/gitlab/builds.yml b/ci/gitlab/builds.yml
index 3e7f36802e..9c2f0ecad8 100644
--- a/ci/gitlab/builds.yml
+++ b/ci/gitlab/builds.yml
@@ -127,30 +127,30 @@ x86_64-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
-x86_64-fedora-39:
+x86_64-fedora-40:
extends: .native_build_job
needs:
- - job: x86_64-fedora-39-container
+ - job: x86_64-fedora-40-container
optional: true
allow_failure: false
variables:
- NAME: fedora-39
- TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:39
+ NAME: fedora-40
+ TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
-x86_64-fedora-40:
+x86_64-fedora-41:
extends: .native_build_job
needs:
- - job: x86_64-fedora-40-container
+ - job: x86_64-fedora-41-container
optional: true
allow_failure: false
variables:
- NAME: fedora-40
- TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
+ NAME: fedora-41
+ TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
artifacts:
expire_in: 1 day
paths:
@@ -544,29 +544,29 @@ s390x-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
-mingw32-fedora-40:
+mingw32-fedora-41:
extends: .cross_build_job
needs:
- - job: mingw32-fedora-40-container
+ - job: mingw32-fedora-41-container
optional: true
allow_failure: false
variables:
CROSS: mingw32
JOB_OPTIONAL: 1
- NAME: fedora-40
- TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
+ NAME: fedora-41
+ TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
-mingw64-fedora-40:
+mingw64-fedora-41:
extends: .cross_build_job
needs:
- - job: mingw64-fedora-40-container
+ - job: mingw64-fedora-41-container
optional: true
allow_failure: false
variables:
CROSS: mingw64
- NAME: fedora-40
- TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
+ NAME: fedora-41
+ TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
mingw32-fedora-rawhide:
@@ -602,7 +602,7 @@ x86_64-freebsd-13:
allow_failure:
exit_codes: 3
variables:
- CIRRUS_VM_IMAGE_NAME: freebsd-13-3
+ CIRRUS_VM_IMAGE_NAME: freebsd-13-4
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
@@ -617,7 +617,7 @@ x86_64-freebsd-14:
allow_failure:
exit_codes: 3
variables:
- CIRRUS_VM_IMAGE_NAME: freebsd-14-1
+ CIRRUS_VM_IMAGE_NAME: freebsd-14-2
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
diff --git a/ci/gitlab/containers.yml b/ci/gitlab/containers.yml
index 55137dc1c3..0cfc8ca952 100644
--- a/ci/gitlab/containers.yml
+++ b/ci/gitlab/containers.yml
@@ -57,18 +57,18 @@ x86_64-debian-sid-container:
NAME: debian-sid
-x86_64-fedora-39-container:
+x86_64-fedora-40-container:
extends: .container_job
allow_failure: false
variables:
- NAME: fedora-39
+ NAME: fedora-40
-x86_64-fedora-40-container:
+x86_64-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
- NAME: fedora-40
+ NAME: fedora-41
x86_64-fedora-rawhide-container:
@@ -292,19 +292,19 @@ s390x-debian-sid-container:
NAME: debian-sid-cross-s390x
-mingw32-fedora-40-container:
+mingw32-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
- NAME: fedora-40-cross-mingw32
+ NAME: fedora-41-cross-mingw32
-mingw64-fedora-40-container:
+mingw64-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
- NAME: fedora-40-cross-mingw64
+ NAME: fedora-41-cross-mingw64
mingw32-fedora-rawhide-container:
diff --git a/ci/integration.yml b/ci/integration.yml
index 2fc8d02956..ced3fbc3c2 100644
--- a/ci/integration.yml
+++ b/ci/integration.yml
@@ -29,23 +29,23 @@ centos-stream-9-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
-fedora-39-tests:
+fedora-40-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
- DISTRO: fedora-39
+ DISTRO: fedora-40
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- - x86_64-fedora-39
+ - x86_64-fedora-40
- project: libvirt/libvirt-perl
- job: x86_64-fedora-39
+ job: x86_64-fedora-40
ref: master
artifacts: true
- project: libvirt/libvirt-python
- job: x86_64-fedora-39
+ job: x86_64-fedora-40
ref: master
artifacts: true
@@ -53,22 +53,22 @@ fedora-39-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
-.fedora-39-upstream-qemu-tests:
+.fedora-40-upstream-qemu-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
- DISTRO: fedora-39
+ DISTRO: fedora-40
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- - x86_64-fedora-39
+ - x86_64-fedora-40
- project: libvirt/libvirt-perl
- job: x86_64-fedora-39
+ job: x86_64-fedora-40
ref: master
artifacts: true
- project: libvirt/libvirt-python
- job: x86_64-fedora-39
+ job: x86_64-fedora-40
ref: master
artifacts: true
diff --git a/ci/manifest.yml b/ci/manifest.yml
index 43b9995717..2c036aaa39 100644
--- a/ci/manifest.yml
+++ b/ci/manifest.yml
@@ -144,7 +144,7 @@ targets:
containers: false
builds: false
- fedora-39:
+ fedora-40:
jobs:
- arch: x86_64
artifacts:
@@ -152,7 +152,7 @@ targets:
paths:
- libvirt-rpms
- fedora-40:
+ fedora-41:
jobs:
- arch: x86_64
artifacts:
--
2.47.1
2
1
= Overview =
This patch set introduces support for acpi-generic-initiator devices,
supported by QEMU [1].
The acpi-generic-initiator object is required to support Multi-Instance GPU
(MIG) configurations on NVIDIA GPUs [2]. MIG enables partitioning of GPU
resources into multiple isolated instances, each requiring a dedicated NUMA
node definition.
= Implementation =
This patch set implements the libvirt counterpart to the QEMU feature,
enabling users to configure acpi-generic-initiator objects within libvirt
domain XML.
This includes:
- adding XML syntax to define acpi-generic-initiator objects,
- resolving the acpi-generic-initiator definitions into the proper QEMU
command-line arguments,
- ensuring compatibility with existing NUMA configuration.
= Example =
- Domain XML:
```
...
<cpu mode='host-passthrough' check='none'>
<numa>
<cell id='0' cpus='0-15' memory='8388608' unit='KiB'/>
<cell id='1' memory='0' unit='KiB'/>
<cell id='2' memory='0' unit='KiB'/>
<cell id='3' memory='0' unit='KiB'/>
<cell id='4' memory='0' unit='KiB'/>
<cell id='5' memory='0' unit='KiB'/>
<cell id='6' memory='0' unit='KiB'/>
<cell id='7' memory='0' unit='KiB'/>
<cell id='8' memory='0' unit='KiB'/>
</numa>
</cpu>
...
<devices>
...
<hostdev mode='subsystem' type='pci' managed='no'>
<source>
<address domain='0x0009' bus='0x01' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</hostdev>
<acpi-generic-initiator>
<alias name="gi1" />
<pci-dev>hostdev0</pci-dev>
<numa-node>1</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi2" />
<pci-dev>hostdev0</pci-dev>
<numa-node>2</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi3" />
<pci-dev>hostdev0</pci-dev>
<numa-node>3</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi4" />
<pci-dev>hostdev0</pci-dev>
<numa-node>4</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi5" />
<pci-dev>hostdev0</pci-dev>
<numa-node>5</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi6" />
<pci-dev>hostdev0</pci-dev>
<numa-node>6</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi7" />
<pci-dev>hostdev0</pci-dev>
<numa-node>7</numa-node>
</acpi-generic-initiator>
<acpi-generic-initiator>
<alias name="gi8" />
<pci-dev>hostdev0</pci-dev>
<numa-node>8</numa-node>
</acpi-generic-initiator>
</devices>
```
- Generated QEMU command line options:
```
... /usr/bin/qemu-system-aarch64 \
...
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":8589934592}' \
-numa node,nodeid=0,cpus=0-15,memdev=ram-node0 \
-numa node,nodeid=1 \
-numa node,nodeid=2 \
-numa node,nodeid=3 \
-numa node,nodeid=4 \
-numa node,nodeid=5 \
-numa node,nodeid=6 \
-numa node,nodeid=7 \
-numa node,nodeid=8 \
...
-device '{"driver":"vfio-pci","host":"0009:01:00.0","id":"hostdev0","bus":"pci.3","addr":"0x0"}'
...
-object acpi-generic-initiator,id=gi1,pci-dev=hostdev0,node=1 \
-object acpi-generic-initiator,id=gi2,pci-dev=hostdev0,node=2 \
-object acpi-generic-initiator,id=gi3,pci-dev=hostdev0,node=3 \
-object acpi-generic-initiator,id=gi4,pci-dev=hostdev0,node=4 \
-object acpi-generic-initiator,id=gi5,pci-dev=hostdev0,node=5 \
-object acpi-generic-initiator,id=gi6,pci-dev=hostdev0,node=6 \
-object acpi-generic-initiator,id=gi7,pci-dev=hostdev0,node=7 \
-object acpi-generic-initiator,id=gi8,pci-dev=hostdev0,node=8
```
= References =
[1] https://lore.kernel.org/all/20231225045603.7654-2-ankita@nvidia.com/
[2] https://www.nvidia.com/en-in/technologies/multi-instance-gpu/
Andrea Righi (2):
qemu: Allow to define NUMA nodes without memory or CPUs assigned
qemu: Introduce acpi-generic-initiator device
src/ch/ch_domain.c | 1 +
src/conf/domain_conf.c | 153 ++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 14 ++++
src/conf/domain_postparse.c | 1 +
src/conf/domain_validate.c | 40 ++++++++++
src/conf/numa_conf.c | 3 +
src/conf/schemas/domaincommon.rng | 19 +++++
src/conf/virconftypes.h | 2 +
src/libxl/libxl_driver.c | 6 ++
src/lxc/lxc_driver.c | 6 ++
src/qemu/qemu_command.c | 40 ++++++++--
src/qemu/qemu_domain.c | 2 +
src/qemu/qemu_domain_address.c | 4 +
src/qemu/qemu_driver.c | 3 +
src/qemu/qemu_hotplug.c | 5 ++
src/qemu/qemu_postparse.c | 1 +
src/qemu/qemu_validate.c | 1 +
src/test/test_driver.c | 4 +
18 files changed, 297 insertions(+), 8 deletions(-)
2
4