From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
This will help with the following patch, which also requires config access.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 9 +++++----
src/qemu/qemu_capabilities.h | 9 +++++----
src/qemu/qemu_conf.c | 9 +++++----
tests/domaincapstest.c | 7 +++----
4 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index d13b4c8109..ca99e61896 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -6926,12 +6926,11 @@ virQEMUCapsFillDomainFeatureHypervCaps(virQEMUCaps *qemuCaps,
int
-virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
+virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg,
+ virQEMUCaps *qemuCaps,
virArch hostarch,
virDomainCaps *domCaps,
- bool privileged,
- virFirmware **firmwares,
- size_t nfirmwares)
+ bool privileged)
{
virDomainCapsOS *os = &domCaps->os;
virDomainCapsDeviceDisk *disk = &domCaps->disk;
@@ -6948,6 +6947,8 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
virDomainCapsLaunchSecurity *launchSecurity = &domCaps->launchSecurity;
virDomainCapsDeviceNet *net = &domCaps->net;
virDomainCapsDevicePanic *panic = &domCaps->panic;
+ virFirmware **firmwares = cfg->firmwares;
+ size_t nfirmwares = cfg->nfirmwares;
virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e836d107aa..733b84029d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -28,6 +28,8 @@
#include "virfilecache.h"
#include "virenum.h"
+typedef struct _virQEMUDriverConfig virQEMUDriverConfig;
+
/*
* Internal flags to keep track of qemu command line capabilities
*
@@ -865,12 +867,11 @@ void virQEMUCapsInitGuestFromBinary(virCaps *caps,
virQEMUCaps *qemuCaps,
virArch guestarch);
-int virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
+int virQEMUCapsFillDomainCaps(virQEMUDriverConfig *cfg,
+ virQEMUCaps *qemuCaps,
virArch hostarch,
virDomainCaps *domCaps,
- bool privileged,
- virFirmware **firmwares,
- size_t nfirmwares);
+ bool privileged);
void virQEMUCapsFillDomainMemoryBackingCaps(virQEMUCaps *qemuCaps,
virDomainCapsMemoryBacking *memoryBacking);
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 65016feb6a..79634511db 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1623,10 +1623,11 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriver *driver,
if (!(domCaps = virDomainCapsNew(path, machine, arch, virttype)))
return NULL;
- if (virQEMUCapsFillDomainCaps(qemuCaps, driver->hostarch,
- domCaps, driver->privileged,
- cfg->firmwares,
- cfg->nfirmwares) < 0)
+ if (virQEMUCapsFillDomainCaps(cfg,
+ qemuCaps,
+ driver->hostarch,
+ domCaps,
+ driver->privileged) < 0)
return NULL;
return g_steal_pointer(&domCaps);
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 96dc029af3..71e181d179 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -99,10 +99,9 @@ fillQemuCaps(virDomainCaps *domCaps,
if (!domCaps->machine)
domCaps->machine = g_strdup(virQEMUCapsGetPreferredMachine(qemuCaps,
virtType));
- if (virQEMUCapsFillDomainCaps(qemuCaps, domCaps->arch, domCaps,
- false,
- cfg->firmwares,
- cfg->nfirmwares) < 0)
+ if (virQEMUCapsFillDomainCaps(cfg,
+ qemuCaps, domCaps->arch, domCaps,
+ false) < 0)
return -1;
/* The function above tries to query host's VFIO capabilities by calling
--
2.47.0