mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
domaincaps: Expose UEFI binary path, if it exists
Check to see if the UEFI binary mentioned in qemu.conf actually exists, and if so expose it in domcapabilities like <loader ...> <value>/path/to/ovmf</value> </loader> We introduce some generic domcaps infrastructure for handling a dynamic list of string values, it may be of use for future bits. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2b2e4a7acf
commit
f05b6a918e
@ -105,6 +105,7 @@
|
|||||||
...
|
...
|
||||||
<os supported='yes'>
|
<os supported='yes'>
|
||||||
<loader supported='yes'>
|
<loader supported='yes'>
|
||||||
|
<value>/usr/share/OVMF/OVMF_CODE.fd</value>
|
||||||
<enum name='type'>
|
<enum name='type'>
|
||||||
<value>rom</value>
|
<value>rom</value>
|
||||||
<value>pflash</value>
|
<value>pflash</value>
|
||||||
@ -122,6 +123,11 @@
|
|||||||
<p>For the <code>loader</code> element, the following can occur:</p>
|
<p>For the <code>loader</code> element, the following can occur:</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
|
<dt>value</dt>
|
||||||
|
<dd>List of known loader paths. Currently this is only used
|
||||||
|
to advertise known locations of OVMF binaries for qemu. Binaries
|
||||||
|
will only be listed if they actually exist on disk.</dd>
|
||||||
|
|
||||||
<dt>type</dt>
|
<dt>type</dt>
|
||||||
<dd>Whether loader is a typical BIOS (<code>rom</code>) or
|
<dd>Whether loader is a typical BIOS (<code>rom</code>) or
|
||||||
an UEFI binary (<code>pflash</code>). This refers to
|
an UEFI binary (<code>pflash</code>). This refers to
|
||||||
|
@ -47,6 +47,9 @@
|
|||||||
<define name='loader'>
|
<define name='loader'>
|
||||||
<element name='loader'>
|
<element name='loader'>
|
||||||
<ref name='supported'/>
|
<ref name='supported'/>
|
||||||
|
<optional>
|
||||||
|
<ref name='value'/>
|
||||||
|
</optional>
|
||||||
<ref name='enum'/>
|
<ref name='enum'/>
|
||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
@ -85,6 +88,14 @@
|
|||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
<define name='value'>
|
||||||
|
<zeroOrMore>
|
||||||
|
<element name='value'>
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
</zeroOrMore>
|
||||||
|
</define>
|
||||||
|
|
||||||
<define name='supported'>
|
<define name='supported'>
|
||||||
<attribute name='supported'>
|
<attribute name='supported'>
|
||||||
<ref name="virYesNo"/>
|
<ref name="virYesNo"/>
|
||||||
@ -97,11 +108,7 @@
|
|||||||
<attribute name='name'>
|
<attribute name='name'>
|
||||||
<text/>
|
<text/>
|
||||||
</attribute>
|
</attribute>
|
||||||
<zeroOrMore>
|
<ref name='value'/>
|
||||||
<element name='value'>
|
|
||||||
<text/>
|
|
||||||
</element>
|
|
||||||
</zeroOrMore>
|
|
||||||
</element>
|
</element>
|
||||||
</zeroOrMore>
|
</zeroOrMore>
|
||||||
</define>
|
</define>
|
||||||
|
@ -47,6 +47,20 @@ static int virDomainCapsOnceInit(void)
|
|||||||
VIR_ONCE_GLOBAL_INIT(virDomainCaps)
|
VIR_ONCE_GLOBAL_INIT(virDomainCaps)
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
virDomainCapsStringValuesFree(virDomainCapsStringValuesPtr values)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if (!values || !values->values)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < values->nvalues; i++)
|
||||||
|
VIR_FREE(values->values[i]);
|
||||||
|
VIR_FREE(values->values);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virDomainCapsDispose(void *obj)
|
virDomainCapsDispose(void *obj)
|
||||||
{
|
{
|
||||||
@ -54,6 +68,8 @@ virDomainCapsDispose(void *obj)
|
|||||||
|
|
||||||
VIR_FREE(caps->path);
|
VIR_FREE(caps->path);
|
||||||
VIR_FREE(caps->machine);
|
VIR_FREE(caps->machine);
|
||||||
|
|
||||||
|
virDomainCapsStringValuesFree(&caps->os.loader.values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,6 +172,18 @@ virDomainCapsEnumFormat(virBufferPtr buf,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
virDomainCapsStringValuesFormat(virBufferPtr buf,
|
||||||
|
virDomainCapsStringValuesPtr values)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < values->nvalues; i++)
|
||||||
|
virBufferEscapeString(buf, "<value>%s</value>\n", values->values[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define FORMAT_PROLOGUE(item) \
|
#define FORMAT_PROLOGUE(item) \
|
||||||
do { \
|
do { \
|
||||||
virBufferAsprintf(buf, "<" #item " supported='%s'%s\n", \
|
virBufferAsprintf(buf, "<" #item " supported='%s'%s\n", \
|
||||||
@ -185,6 +213,7 @@ virDomainCapsLoaderFormat(virBufferPtr buf,
|
|||||||
{
|
{
|
||||||
FORMAT_PROLOGUE(loader);
|
FORMAT_PROLOGUE(loader);
|
||||||
|
|
||||||
|
virDomainCapsStringValuesFormat(buf, &loader->values);
|
||||||
ENUM_PROCESS(loader, type, virDomainLoaderTypeToString);
|
ENUM_PROCESS(loader, type, virDomainLoaderTypeToString);
|
||||||
ENUM_PROCESS(loader, readonly, virTristateBoolTypeToString);
|
ENUM_PROCESS(loader, readonly, virTristateBoolTypeToString);
|
||||||
|
|
||||||
|
@ -37,6 +37,13 @@ struct _virDomainCapsEnum {
|
|||||||
unsigned int values; /* Bitmask of values supported in the corresponding enum */
|
unsigned int values; /* Bitmask of values supported in the corresponding enum */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct _virDomainCapsStringValues virDomainCapsStringValues;
|
||||||
|
typedef virDomainCapsStringValues *virDomainCapsStringValuesPtr;
|
||||||
|
struct _virDomainCapsStringValues {
|
||||||
|
char **values; /* raw string values */
|
||||||
|
size_t nvalues; /* number of strings */
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct _virDomainCapsDevice virDomainCapsDevice;
|
typedef struct _virDomainCapsDevice virDomainCapsDevice;
|
||||||
typedef virDomainCapsDevice *virDomainCapsDevicePtr;
|
typedef virDomainCapsDevice *virDomainCapsDevicePtr;
|
||||||
struct _virDomainCapsDevice {
|
struct _virDomainCapsDevice {
|
||||||
@ -47,6 +54,7 @@ typedef struct _virDomainCapsLoader virDomainCapsLoader;
|
|||||||
typedef virDomainCapsLoader *virDomainCapsLoaderPtr;
|
typedef virDomainCapsLoader *virDomainCapsLoaderPtr;
|
||||||
struct _virDomainCapsLoader {
|
struct _virDomainCapsLoader {
|
||||||
virDomainCapsDevice device;
|
virDomainCapsDevice device;
|
||||||
|
virDomainCapsStringValues values; /* Info about values for the element */
|
||||||
virDomainCapsEnum type; /* Info about virDomainLoader */
|
virDomainCapsEnum type; /* Info about virDomainLoader */
|
||||||
virDomainCapsEnum readonly; /* Info about readonly:virTristateBool */
|
virDomainCapsEnum readonly; /* Info about readonly:virTristateBool */
|
||||||
};
|
};
|
||||||
|
@ -3611,10 +3611,30 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
|
|||||||
static int
|
static int
|
||||||
virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
|
||||||
virDomainCapsLoaderPtr loader,
|
virDomainCapsLoaderPtr loader,
|
||||||
virArch arch)
|
virArch arch,
|
||||||
|
virQEMUDriverConfigPtr cfg)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
loader->device.supported = true;
|
loader->device.supported = true;
|
||||||
|
|
||||||
|
if (VIR_ALLOC_N(loader->values.values, cfg->nloader) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (i = 0; i < cfg->nloader; i++) {
|
||||||
|
const char *filename = cfg->loader[i];
|
||||||
|
|
||||||
|
if (!virFileExists(filename)) {
|
||||||
|
VIR_DEBUG("loader filename=%s does not exist", filename);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (VIR_STRDUP(loader->values.values[loader->values.nvalues],
|
||||||
|
filename) < 0)
|
||||||
|
return -1;
|
||||||
|
loader->values.nvalues++;
|
||||||
|
}
|
||||||
|
|
||||||
VIR_DOMAIN_CAPS_ENUM_SET(loader->type,
|
VIR_DOMAIN_CAPS_ENUM_SET(loader->type,
|
||||||
VIR_DOMAIN_LOADER_TYPE_ROM);
|
VIR_DOMAIN_LOADER_TYPE_ROM);
|
||||||
|
|
||||||
@ -3636,12 +3656,13 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
|
|||||||
static int
|
static int
|
||||||
virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps,
|
||||||
virDomainCapsOSPtr os,
|
virDomainCapsOSPtr os,
|
||||||
virArch arch)
|
virArch arch,
|
||||||
|
virQEMUDriverConfigPtr cfg)
|
||||||
{
|
{
|
||||||
virDomainCapsLoaderPtr loader = &os->loader;
|
virDomainCapsLoaderPtr loader = &os->loader;
|
||||||
|
|
||||||
os->device.supported = true;
|
os->device.supported = true;
|
||||||
if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch) < 0)
|
if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, loader, arch, cfg) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3725,7 +3746,8 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps,
|
|||||||
|
|
||||||
int
|
int
|
||||||
virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
|
virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps,
|
||||||
|
virQEMUDriverConfigPtr cfg)
|
||||||
{
|
{
|
||||||
virDomainCapsOSPtr os = &domCaps->os;
|
virDomainCapsOSPtr os = &domCaps->os;
|
||||||
virDomainCapsDeviceDiskPtr disk = &domCaps->disk;
|
virDomainCapsDeviceDiskPtr disk = &domCaps->disk;
|
||||||
@ -3734,7 +3756,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
|
|||||||
|
|
||||||
domCaps->maxvcpus = maxvcpus;
|
domCaps->maxvcpus = maxvcpus;
|
||||||
|
|
||||||
if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch) < 0 ||
|
if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch, cfg) < 0 ||
|
||||||
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 ||
|
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 ||
|
||||||
virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0)
|
virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -324,7 +324,12 @@ int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
|
|||||||
virQEMUCapsPtr kvmbinCaps,
|
virQEMUCapsPtr kvmbinCaps,
|
||||||
virArch guestarch);
|
virArch guestarch);
|
||||||
|
|
||||||
|
/* Forward declaration */
|
||||||
|
typedef struct _virQEMUDriverConfig virQEMUDriverConfig;
|
||||||
|
typedef virQEMUDriverConfig *virQEMUDriverConfigPtr;
|
||||||
|
|
||||||
int virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
|
int virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
|
||||||
virQEMUCapsPtr qemuCaps);
|
virQEMUCapsPtr qemuCaps,
|
||||||
|
virQEMUDriverConfigPtr cfg);
|
||||||
|
|
||||||
#endif /* __QEMU_CAPABILITIES_H__*/
|
#endif /* __QEMU_CAPABILITIES_H__*/
|
||||||
|
@ -17285,12 +17285,15 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
|
|||||||
int virttype; /* virDomainVirtType */
|
int virttype; /* virDomainVirtType */
|
||||||
virDomainCapsPtr domCaps = NULL;
|
virDomainCapsPtr domCaps = NULL;
|
||||||
int arch = virArchFromHost(); /* virArch */
|
int arch = virArchFromHost(); /* virArch */
|
||||||
|
virQEMUDriverConfigPtr cfg = NULL;
|
||||||
|
|
||||||
virCheckFlags(0, ret);
|
virCheckFlags(0, ret);
|
||||||
|
|
||||||
if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0)
|
if (virConnectGetDomainCapabilitiesEnsureACL(conn) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
|
||||||
if (qemuHostdevHostSupportsPassthroughLegacy())
|
if (qemuHostdevHostSupportsPassthroughLegacy())
|
||||||
virttype = VIR_DOMAIN_VIRT_KVM;
|
virttype = VIR_DOMAIN_VIRT_KVM;
|
||||||
else
|
else
|
||||||
@ -17357,11 +17360,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
|
|||||||
if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype)))
|
if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0)
|
if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virDomainCapsFormat(domCaps);
|
ret = virDomainCapsFormat(domCaps);
|
||||||
cleanup:
|
cleanup:
|
||||||
|
virObjectUnref(cfg);
|
||||||
virObjectUnref(domCaps);
|
virObjectUnref(domCaps);
|
||||||
virObjectUnref(qemuCaps);
|
virObjectUnref(qemuCaps);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
<vcpu max='255'/>
|
<vcpu max='255'/>
|
||||||
<os supported='yes'>
|
<os supported='yes'>
|
||||||
<loader supported='yes'>
|
<loader supported='yes'>
|
||||||
|
<value>/foo/bar</value>
|
||||||
|
<value>/tmp/my_path</value>
|
||||||
<enum name='type'>
|
<enum name='type'>
|
||||||
<value>rom</value>
|
<value>rom</value>
|
||||||
<value>pflash</value>
|
<value>pflash</value>
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
<os supported='yes'>
|
<os supported='yes'>
|
||||||
<loader supported='yes'>
|
<loader supported='yes'>
|
||||||
|
<value>/usr/share/OVMF/OVMF_CODE.fd</value>
|
||||||
<enum name='type'>
|
<enum name='type'>
|
||||||
<value>rom</value>
|
<value>rom</value>
|
||||||
<value>pflash</value>
|
<value>pflash</value>
|
||||||
|
@ -34,6 +34,27 @@ typedef int (*virDomainCapsFill)(virDomainCapsPtr domCaps,
|
|||||||
#define SET_ALL_BITS(x) \
|
#define SET_ALL_BITS(x) \
|
||||||
memset(&(x.values), 0xff, sizeof(x.values))
|
memset(&(x.values), 0xff, sizeof(x.values))
|
||||||
|
|
||||||
|
static int ATTRIBUTE_SENTINEL
|
||||||
|
fillStringValues(virDomainCapsStringValuesPtr values, ...)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
va_list list;
|
||||||
|
const char *str;
|
||||||
|
|
||||||
|
va_start(list, values);
|
||||||
|
while ((str = va_arg(list, const char *))) {
|
||||||
|
if (VIR_REALLOC_N(values->values, values->nvalues + 1) < 0 ||
|
||||||
|
VIR_STRDUP(values->values[values->nvalues], str) < 0) {
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
values->nvalues++;
|
||||||
|
}
|
||||||
|
va_end(list);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
fillAll(virDomainCapsPtr domCaps,
|
fillAll(virDomainCapsPtr domCaps,
|
||||||
void *opaque ATTRIBUTE_UNUSED)
|
void *opaque ATTRIBUTE_UNUSED)
|
||||||
@ -49,6 +70,11 @@ fillAll(virDomainCapsPtr domCaps,
|
|||||||
loader->device.supported = true;
|
loader->device.supported = true;
|
||||||
SET_ALL_BITS(loader->type);
|
SET_ALL_BITS(loader->type);
|
||||||
SET_ALL_BITS(loader->readonly);
|
SET_ALL_BITS(loader->readonly);
|
||||||
|
if (fillStringValues(&loader->values,
|
||||||
|
"/foo/bar",
|
||||||
|
"/tmp/my_path",
|
||||||
|
NULL) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
disk->device.supported = true;
|
disk->device.supported = true;
|
||||||
SET_ALL_BITS(disk->diskDevice);
|
SET_ALL_BITS(disk->diskDevice);
|
||||||
@ -66,13 +92,21 @@ fillAll(virDomainCapsPtr domCaps,
|
|||||||
|
|
||||||
#ifdef WITH_QEMU
|
#ifdef WITH_QEMU
|
||||||
# include "testutilsqemu.h"
|
# include "testutilsqemu.h"
|
||||||
|
|
||||||
|
struct fillQemuCapsData {
|
||||||
|
virQEMUCapsPtr qemuCaps;
|
||||||
|
virQEMUDriverConfigPtr cfg;
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
fillQemuCaps(virDomainCapsPtr domCaps,
|
fillQemuCaps(virDomainCapsPtr domCaps,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
virQEMUCapsPtr qemuCaps = (virQEMUCapsPtr) opaque;
|
struct fillQemuCapsData *data = (struct fillQemuCapsData *) opaque;
|
||||||
|
virQEMUCapsPtr qemuCaps = data->qemuCaps;
|
||||||
|
virQEMUDriverConfigPtr cfg = data->cfg;
|
||||||
|
|
||||||
if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps) < 0)
|
if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps, cfg) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* The function above tries to query host's KVM & VFIO capabilities by
|
/* The function above tries to query host's KVM & VFIO capabilities by
|
||||||
@ -97,7 +131,7 @@ buildVirDomainCaps(const char *emulatorbin,
|
|||||||
virDomainCapsFill fillFunc,
|
virDomainCapsFill fillFunc,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
virDomainCapsPtr domCaps;
|
virDomainCapsPtr domCaps, ret = NULL;
|
||||||
|
|
||||||
if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, type)))
|
if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, type)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -107,8 +141,9 @@ buildVirDomainCaps(const char *emulatorbin,
|
|||||||
domCaps = NULL;
|
domCaps = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = domCaps;
|
||||||
cleanup:
|
cleanup:
|
||||||
return domCaps;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct test_virDomainCapsFormatData {
|
struct test_virDomainCapsFormatData {
|
||||||
@ -182,13 +217,16 @@ mymain(void)
|
|||||||
|
|
||||||
#ifdef WITH_QEMU
|
#ifdef WITH_QEMU
|
||||||
|
|
||||||
|
virQEMUDriverConfigPtr cfg = virQEMUDriverConfigNew(false);
|
||||||
|
|
||||||
# define DO_TEST_QEMU(Filename, QemuCapsFile, Emulatorbin, Machine, Arch, Type, ...) \
|
# define DO_TEST_QEMU(Filename, QemuCapsFile, Emulatorbin, Machine, Arch, Type, ...) \
|
||||||
do { \
|
do { \
|
||||||
const char *capsPath = abs_srcdir "/qemucapabilitiesdata/" QemuCapsFile ".caps"; \
|
const char *capsPath = abs_srcdir "/qemucapabilitiesdata/" QemuCapsFile ".caps"; \
|
||||||
virQEMUCapsPtr qemuCaps = qemuTestParseCapabilities(capsPath); \
|
virQEMUCapsPtr qemuCaps = qemuTestParseCapabilities(capsPath); \
|
||||||
|
struct fillQemuCapsData fillData = {.qemuCaps = qemuCaps, .cfg = cfg}; \
|
||||||
struct test_virDomainCapsFormatData data = {.filename = Filename, \
|
struct test_virDomainCapsFormatData data = {.filename = Filename, \
|
||||||
.emulatorbin = Emulatorbin, .machine = Machine, .arch = Arch, \
|
.emulatorbin = Emulatorbin, .machine = Machine, .arch = Arch, \
|
||||||
.type = Type, .fillFunc = fillQemuCaps, .opaque = qemuCaps}; \
|
.type = Type, .fillFunc = fillQemuCaps, .opaque = &fillData}; \
|
||||||
if (!qemuCaps) { \
|
if (!qemuCaps) { \
|
||||||
fprintf(stderr, "Unable to build qemu caps from %s\n", capsPath); \
|
fprintf(stderr, "Unable to build qemu caps from %s\n", capsPath); \
|
||||||
ret = -1; \
|
ret = -1; \
|
||||||
@ -199,6 +237,7 @@ mymain(void)
|
|||||||
DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1", "/usr/bin/qemu-system-x86_64",
|
DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1", "/usr/bin/qemu-system-x86_64",
|
||||||
"pc-1.2", VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_KVM);
|
"pc-1.2", VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_KVM);
|
||||||
|
|
||||||
|
virObjectUnref(cfg);
|
||||||
#endif /* WITH_QEMU */
|
#endif /* WITH_QEMU */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user