#define FORMAT_PROLOGUE(item) \
do { \
virBufferAsprintf(buf, "<" #item " supported='%s'%s\n", \
- item->device.supported ? "yes" : "no", \
- item->device.supported ? ">" : "/>"); \
- if (!item->device.supported) \
+ item->supported ? "yes" : "no", \
+ item->supported ? ">" : "/>"); \
+ if (!item->supported) \
return; \
virBufferAdjustIndent(buf, 2); \
} while (0)
size_t nvalues; /* number of strings */
};
-typedef struct _virDomainCapsDevice virDomainCapsDevice;
-typedef virDomainCapsDevice *virDomainCapsDevicePtr;
-struct _virDomainCapsDevice {
- bool supported; /* true if <devtype> is supported by hypervisor */
-};
-
typedef struct _virDomainCapsLoader virDomainCapsLoader;
typedef virDomainCapsLoader *virDomainCapsLoaderPtr;
struct _virDomainCapsLoader {
- virDomainCapsDevice device;
+ bool supported;
virDomainCapsStringValues values; /* Info about values for the element */
virDomainCapsEnum type; /* Info about virDomainLoader */
virDomainCapsEnum readonly; /* Info about readonly:virTristateBool */
typedef struct _virDomainCapsOS virDomainCapsOS;
typedef virDomainCapsOS *virDomainCapsOSPtr;
struct _virDomainCapsOS {
- virDomainCapsDevice device;
+ bool supported;
virDomainCapsLoader loader; /* Info about virDomainLoaderDef */
};
typedef struct _virDomainCapsDeviceDisk virDomainCapsDeviceDisk;
typedef virDomainCapsDeviceDisk *virDomainCapsDeviceDiskPtr;
struct _virDomainCapsDeviceDisk {
- virDomainCapsDevice device;
+ bool supported;
virDomainCapsEnum diskDevice; /* Info about virDomainDiskDevice enum values */
virDomainCapsEnum bus; /* Info about virDomainDiskBus enum values */
/* add new fields here */
typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
typedef virDomainCapsDeviceHostdev *virDomainCapsDeviceHostdevPtr;
struct _virDomainCapsDeviceHostdev {
- virDomainCapsDevice device;
+ bool supported;
virDomainCapsEnum mode; /* Info about virDomainHostdevMode */
virDomainCapsEnum startupPolicy; /* Info about virDomainStartupPolicy */
virDomainCapsEnum subsysType; /* Info about virDomainHostdevSubsysType */
{
size_t i;
- capsLoader->device.supported = true;
+ capsLoader->supported = true;
if (VIR_ALLOC_N(capsLoader->values.values, nloader) < 0)
return -1;
{
virDomainCapsLoaderPtr capsLoader = &os->loader;
- os->device.supported = true;
+ os->supported = true;
if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader,
loader, nloader) < 0)
return -1;
const char *machine,
virDomainCapsDeviceDiskPtr disk)
{
- disk->device.supported = true;
+ disk->supported = true;
/* QEMU supports all of these */
VIR_DOMAIN_CAPS_ENUM_SET(disk->diskDevice,
VIR_DOMAIN_DISK_DEVICE_DISK,
bool supportsPassthroughKVM = qemuHostdevHostSupportsPassthroughLegacy();
bool supportsPassthroughVFIO = qemuHostdevHostSupportsPassthroughVFIO();
- hostdev->device.supported = true;
+ hostdev->supported = true;
/* VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES is for containers only */
VIR_DOMAIN_CAPS_ENUM_SET(hostdev->mode,
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS);
virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev;
domCaps->maxvcpus = 255;
- os->device.supported = true;
+ os->supported = true;
- loader->device.supported = true;
+ loader->supported = true;
SET_ALL_BITS(loader->type);
SET_ALL_BITS(loader->readonly);
if (fillStringValues(&loader->values,
NULL) < 0)
return -1;
- disk->device.supported = true;
+ disk->supported = true;
SET_ALL_BITS(disk->diskDevice);
SET_ALL_BITS(disk->bus);
- hostdev->device.supported = true;
+ hostdev->supported = true;
SET_ALL_BITS(hostdev->mode);
SET_ALL_BITS(hostdev->startupPolicy);
SET_ALL_BITS(hostdev->subsysType);