Rename 'qemuCapsXXX' to 'virQEMUCapsXXX'

To avoid confusion between 'virCapsPtr' and 'qemuCapsPtr'
do some renaming of various fucntions/variables. All
instances of 'qemuCapsPtr' are renamed to 'qemuCaps'. To
avoid that clashing with the 'qemuCaps' typedef though,
rename the latter to virQEMUCaps.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-02-01 13:48:58 +00:00
parent fed92f08db
commit 32803ba409
14 changed files with 1215 additions and 1213 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
# include "qemu_monitor.h"
/* Internal flags to keep track of qemu command line capabilities */
enum qemuCapsFlags {
enum virQEMUCapsFlags {
QEMU_CAPS_KQEMU = 0, /* Whether KQEMU is compiled in */
QEMU_CAPS_VNC_COLON = 1, /* VNC takes or address + display */
QEMU_CAPS_NO_REBOOT = 2, /* Is the -no-reboot flag available */
@ -170,79 +170,81 @@ enum qemuCapsFlags {
QEMU_CAPS_LAST, /* this must always be the last item */
};
typedef struct _qemuCaps qemuCaps;
typedef qemuCaps *qemuCapsPtr;
typedef struct _virQEMUCaps virQEMUCaps;
typedef virQEMUCaps *virQEMUCapsPtr;
typedef struct _qemuCapsCache qemuCapsCache;
typedef qemuCapsCache *qemuCapsCachePtr;
typedef struct _virQEMUCapsCache virQEMUCapsCache;
typedef virQEMUCapsCache *virQEMUCapsCachePtr;
qemuCapsPtr qemuCapsNew(void);
qemuCapsPtr qemuCapsNewCopy(qemuCapsPtr caps);
qemuCapsPtr qemuCapsNewForBinary(const char *binary,
const char *libDir,
uid_t runUid,
gid_t runGid);
virQEMUCapsPtr virQEMUCapsNew(void);
virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps);
virQEMUCapsPtr virQEMUCapsNewForBinary(const char *binary,
const char *libDir,
uid_t runUid,
gid_t runGid);
int qemuCapsProbeQMP(qemuCapsPtr caps,
qemuMonitorPtr mon);
int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon);
void qemuCapsSet(qemuCapsPtr caps,
enum qemuCapsFlags flag) ATTRIBUTE_NONNULL(1);
void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
enum virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
void qemuCapsSetList(qemuCapsPtr caps, ...) ATTRIBUTE_NONNULL(1);
void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1);
void qemuCapsClear(qemuCapsPtr caps,
enum qemuCapsFlags flag) ATTRIBUTE_NONNULL(1);
void virQEMUCapsClear(virQEMUCapsPtr qemuCaps,
enum virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
bool qemuCapsGet(qemuCapsPtr caps,
enum qemuCapsFlags flag);
bool virQEMUCapsGet(virQEMUCapsPtr qemuCaps,
enum virQEMUCapsFlags flag);
char *qemuCapsFlagsString(qemuCapsPtr caps);
char *virQEMUCapsFlagsString(virQEMUCapsPtr qemuCaps);
const char *qemuCapsGetBinary(qemuCapsPtr caps);
virArch qemuCapsGetArch(qemuCapsPtr caps);
unsigned int qemuCapsGetVersion(qemuCapsPtr caps);
unsigned int qemuCapsGetKVMVersion(qemuCapsPtr caps);
int qemuCapsAddCPUDefinition(qemuCapsPtr caps,
const char *name);
size_t qemuCapsGetCPUDefinitions(qemuCapsPtr caps,
char ***names);
size_t qemuCapsGetMachineTypes(qemuCapsPtr caps,
char ***names);
const char *qemuCapsGetCanonicalMachine(qemuCapsPtr caps,
const char *name);
const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps);
virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps);
unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps);
unsigned int virQEMUCapsGetKVMVersion(virQEMUCapsPtr qemuCaps);
int virQEMUCapsAddCPUDefinition(virQEMUCapsPtr qemuCaps,
const char *name);
size_t virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
char ***names);
size_t virQEMUCapsGetMachineTypes(virQEMUCapsPtr qemuCaps,
char ***names);
const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps,
const char *name);
int qemuCapsGetMachineTypesCaps(qemuCapsPtr caps,
size_t *nmachines,
virCapsGuestMachinePtr **machines);
int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps,
size_t *nmachines,
virCapsGuestMachinePtr **machines);
bool qemuCapsIsValid(qemuCapsPtr caps);
bool virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps);
qemuCapsCachePtr qemuCapsCacheNew(const char *libDir,
uid_t uid, gid_t gid);
qemuCapsPtr qemuCapsCacheLookup(qemuCapsCachePtr cache, const char *binary);
qemuCapsPtr qemuCapsCacheLookupCopy(qemuCapsCachePtr cache, const char *binary);
void qemuCapsCacheFree(qemuCapsCachePtr cache);
virQEMUCapsCachePtr virQEMUCapsCacheNew(const char *libDir,
uid_t uid, gid_t gid);
virQEMUCapsPtr virQEMUCapsCacheLookup(virQEMUCapsCachePtr cache,
const char *binary);
virQEMUCapsPtr virQEMUCapsCacheLookupCopy(virQEMUCapsCachePtr cache,
const char *binary);
void virQEMUCapsCacheFree(virQEMUCapsCachePtr cache);
virCapsPtr qemuCapsInit(qemuCapsCachePtr cache);
virCapsPtr virQEMUCapsInit(virQEMUCapsCachePtr cache);
int qemuCapsGetDefaultVersion(virCapsPtr caps,
qemuCapsCachePtr capsCache,
unsigned int *version);
int virQEMUCapsGetDefaultVersion(virCapsPtr caps,
virQEMUCapsCachePtr capsCache,
unsigned int *version);
/* Only for use by test suite */
int qemuCapsParseHelpStr(const char *qemu,
const char *str,
qemuCapsPtr caps,
unsigned int *version,
unsigned int *is_kvm,
unsigned int *kvm_version,
bool check_yajl);
int virQEMUCapsParseHelpStr(const char *qemu,
const char *str,
virQEMUCapsPtr qemuCaps,
unsigned int *version,
unsigned int *is_kvm,
unsigned int *kvm_version,
bool check_yajl);
/* Only for use by test suite */
int qemuCapsParseDeviceStr(qemuCapsPtr caps, const char *str);
int virQEMUCapsParseDeviceStr(virQEMUCapsPtr qemuCaps, const char *str);
VIR_ENUM_DECL(qemuCaps);
VIR_ENUM_DECL(virQEMUCaps);
bool qemuCapsUsedQMP(qemuCapsPtr caps);
bool virQEMUCapsUsedQMP(virQEMUCapsPtr qemuCaps);
#endif /* __QEMU_CAPABILITIES_H__*/

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
virDomainDefPtr def,
virDomainChrSourceDefPtr monitor_chr,
bool monitor_json,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
const char *migrateFrom,
int migrateFd,
virDomainSnapshotObjPtr current_snapshot,
@ -64,14 +64,14 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
/* Generate string for arch-specific '-device' parameter */
char *
qemuBuildChrDeviceStr (virDomainChrDefPtr serial,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
virArch arch,
char *machine);
/* With vlan == -1, use netdev syntax, else old hostnet */
char * qemuBuildHostNetStr(virDomainNetDefPtr net,
virQEMUDriverPtr driver,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
char type_sep,
int vlan,
const char *tapfd,
@ -86,50 +86,50 @@ char * qemuBuildNicStr(virDomainNetDefPtr net,
char * qemuBuildNicDevStr(virDomainNetDefPtr net,
int vlan,
int bootindex,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
/* Both legacy & current support */
char *qemuBuildDriveStr(virConnectPtr conn,
virDomainDiskDefPtr disk,
bool bootable,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char *qemuBuildFSStr(virDomainFSDefPtr fs,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
/* Current, best practice */
char * qemuBuildDriveDevStr(virDomainDefPtr def,
virDomainDiskDefPtr disk,
int bootindex,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char * qemuBuildFSDevStr(virDomainFSDefPtr fs,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
/* Current, best practice */
char * qemuBuildControllerDevStr(virDomainDefPtr domainDef,
virDomainControllerDefPtr def,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
int *nusbcontroller);
char * qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char * qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char * qemuBuildUSBInputDevStr(virDomainInputDefPtr dev,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char * qemuBuildSoundDevStr(virDomainSoundDefPtr sound,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
/* Legacy, pre device support */
char * qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev);
/* Current, best practice */
char * qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev,
const char *configfd,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
int qemuOpenPCIConfig(virDomainHostdevDefPtr dev);
@ -137,61 +137,61 @@ int qemuOpenPCIConfig(virDomainHostdevDefPtr dev);
char * qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev);
/* Current, best practice */
char * qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
char * qemuBuildHubDevStr(virDomainHubDefPtr dev, qemuCapsPtr caps);
char * qemuBuildHubDevStr(virDomainHubDefPtr dev, virQEMUCapsPtr qemuCaps);
char * qemuBuildRedirdevDevStr(virDomainDefPtr def,
virDomainRedirdevDefPtr dev,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
int qemuNetworkIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps)
virQEMUCapsPtr qemuCaps)
ATTRIBUTE_NONNULL(2);
int qemuPhysIfaceConnect(virDomainDefPtr def,
virQEMUDriverPtr driver,
virDomainNetDefPtr net,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
enum virNetDevVPortProfileOp vmop);
int qemuOpenVhostNet(virDomainDefPtr def,
virDomainNetDefPtr net,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
int *vhostfd);
/*
* NB: def->name can be NULL upon return and the caller
* *must* decide how to fill in a name in this case
*/
virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
const char **progenv,
const char **progargv,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLineString(virCapsPtr caps,
virDomainDefPtr qemuParseCommandLineString(virCapsPtr qemuCaps,
const char *args,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr caps,
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
pid_t pid,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
int qemuDomainAssignAddresses(virDomainDefPtr def,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
int qemuDomainAssignPCIAddresses(virDomainDefPtr def,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
virDomainObjPtr obj);
qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def);
int qemuDomainPCIAddressReserveFunction(qemuDomainPCIAddressSetPtr addrs,
@ -212,15 +212,15 @@ int qemuDomainPCIAddressReleaseSlot(qemuDomainPCIAddressSetPtr addrs, int slot);
void qemuDomainPCIAddressSetFree(qemuDomainPCIAddressSetPtr addrs);
int qemuAssignDevicePCISlots(virDomainDefPtr def,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
qemuDomainPCIAddressSetPtr addrs);
int qemuAssignDeviceAliases(virDomainDefPtr def, qemuCapsPtr caps);
int qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps);
int qemuDomainNetVLAN(virDomainNetDefPtr def);
int qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx);
int qemuAssignDeviceDiskAlias(virDomainDefPtr vmdef,
virDomainDiskDefPtr def,
qemuCapsPtr caps);
virQEMUCapsPtr qemuCaps);
int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, virDomainHostdevDefPtr hostdev, int idx);
int qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller);
int qemuAssignDeviceRedirdevAlias(virDomainDefPtr def, virDomainRedirdevDefPtr redirdev, int idx);

View File

@ -187,7 +187,7 @@ struct _virQEMUDriver {
virCapsPtr caps;
/* Immutable pointer, self-locking APIs */
qemuCapsCachePtr capsCache;
virQEMUCapsCachePtr qemuCapsCache;
/* Immutable pointer, self-locking APIs */
virDomainEventStatePtr domainEventState;

View File

@ -231,7 +231,7 @@ static void qemuDomainObjPrivateFree(void *data)
{
qemuDomainObjPrivatePtr priv = data;
virObjectUnref(priv->caps);
virObjectUnref(priv->qemuCaps);
qemuDomainPCIAddressSetFree(priv->pciaddrs);
virDomainChrSourceDefFree(priv->monConfig);
@ -291,13 +291,13 @@ static int qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data)
virBufferAddLit(buf, " </vcpus>\n");
}
if (priv->caps) {
if (priv->qemuCaps) {
int i;
virBufferAddLit(buf, " <qemuCaps>\n");
for (i = 0 ; i < QEMU_CAPS_LAST ; i++) {
if (qemuCapsGet(priv->caps, i)) {
if (virQEMUCapsGet(priv->qemuCaps, i)) {
virBufferAsprintf(buf, " <flag name='%s'/>\n",
qemuCapsTypeToString(i));
virQEMUCapsTypeToString(i));
}
}
virBufferAddLit(buf, " </qemuCaps>\n");
@ -336,7 +336,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
char *tmp;
int n, i;
xmlNodePtr *nodes = NULL;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
if (VIR_ALLOC(priv->monConfig) < 0) {
virReportOOMError();
@ -408,13 +408,13 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
goto error;
}
if (n > 0) {
if (!(caps = qemuCapsNew()))
if (!(qemuCaps = virQEMUCapsNew()))
goto error;
for (i = 0 ; i < n ; i++) {
char *str = virXMLPropString(nodes[i], "name");
if (str) {
int flag = qemuCapsTypeFromString(str);
int flag = virQEMUCapsTypeFromString(str);
if (flag < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown qemu capabilities flag %s"), str);
@ -422,11 +422,11 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
goto error;
}
VIR_FREE(str);
qemuCapsSet(caps, flag);
virQEMUCapsSet(qemuCaps, flag);
}
}
priv->caps = caps;
priv->qemuCaps = qemuCaps;
}
VIR_FREE(nodes);
@ -477,7 +477,7 @@ error:
virDomainChrSourceDefFree(priv->monConfig);
priv->monConfig = NULL;
VIR_FREE(nodes);
virObjectUnref(caps);
virObjectUnref(qemuCaps);
return -1;
}

View File

@ -145,7 +145,7 @@ struct _qemuDomainObjPrivate {
qemuDomainPCIAddressSetPtr pciaddrs;
int persistentAddrs;
qemuCapsPtr caps;
virQEMUCapsPtr qemuCaps;
char *lockState;
bool fakeReboot;

View File

@ -427,7 +427,7 @@ qemuCreateCapabilities(virQEMUDriverPtr driver)
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
/* Basic host arch / guest machine capabilities */
if (!(caps = qemuCapsInit(driver->capsCache))) {
if (!(caps = virQEMUCapsInit(driver->qemuCapsCache))) {
virReportOOMError();
virObjectUnref(cfg);
return NULL;
@ -816,10 +816,10 @@ qemuStartup(bool privileged,
}
}
qemu_driver->capsCache = qemuCapsCacheNew(cfg->libDir,
cfg->user,
cfg->group);
if (!qemu_driver->capsCache)
qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir,
cfg->user,
cfg->group);
if (!qemu_driver->qemuCapsCache)
goto error;
if ((qemu_driver->caps = qemuCreateCapabilities(qemu_driver)) == NULL)
@ -1055,7 +1055,7 @@ qemuShutdown(void) {
virObjectUnref(qemu_driver->activeUsbHostdevs);
virHashFree(qemu_driver->sharedDisks);
virObjectUnref(qemu_driver->caps);
qemuCapsCacheFree(qemu_driver->capsCache);
virQEMUCapsCacheFree(qemu_driver->qemuCapsCache);
virObjectUnref(qemu_driver->domains);
virObjectUnref(qemu_driver->remotePorts);
@ -1505,9 +1505,9 @@ static int qemuGetVersion(virConnectPtr conn, unsigned long *version) {
unsigned int qemuVersion;
qemuDriverLock(driver);
if (qemuCapsGetDefaultVersion(driver->caps,
driver->capsCache,
&qemuVersion) < 0)
if (virQEMUCapsGetDefaultVersion(driver->caps,
driver->qemuCapsCache,
&qemuVersion) < 0)
goto cleanup;
*version = qemuVersion;
@ -1542,11 +1542,11 @@ static int qemuNumDomains(virConnectPtr conn) {
static int
qemuCanonicalizeMachine(virDomainDefPtr def, qemuCapsPtr caps)
qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
{
const char *canon;
if (!(canon = qemuCapsGetCanonicalMachine(caps, def->os.machine)))
if (!(canon = virQEMUCapsGetCanonicalMachine(qemuCaps, def->os.machine)))
return 0;
if (STRNEQ(canon, def->os.machine)) {
@ -1572,7 +1572,7 @@ static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
virDomainEventPtr event = NULL;
virDomainEventPtr event2 = NULL;
unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
virCheckFlags(VIR_DOMAIN_START_PAUSED |
VIR_DOMAIN_START_AUTODESTROY, NULL);
@ -1591,13 +1591,13 @@ static virDomainPtr qemuDomainCreate(virConnectPtr conn, const char *xml,
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
if (!(caps = qemuCapsCacheLookup(driver->capsCache, def->emulator)))
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
if (qemuCanonicalizeMachine(def, caps) < 0)
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
goto cleanup;
if (qemuDomainAssignAddresses(def, caps, NULL) < 0)
if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
@ -1653,7 +1653,7 @@ cleanup:
if (event2)
qemuDomainEventQueue(driver, event2);
}
virObjectUnref(caps);
virObjectUnref(qemuCaps);
qemuDriverUnlock(driver);
return dom;
}
@ -1934,8 +1934,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
}
} else {
#if WITH_YAJL
if (qemuCapsGet(priv->caps, QEMU_CAPS_MONITOR_JSON)) {
if (!qemuCapsGet(priv->caps, QEMU_CAPS_NO_SHUTDOWN)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Reboot is not supported with this QEMU binary"));
goto cleanup;
@ -2412,7 +2412,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
if ((vm->def->memballoon != NULL) &&
(vm->def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE)) {
info->memory = vm->def->mem.max_balloon;
} else if (qemuCapsGet(priv->caps, QEMU_CAPS_BALLOON_EVENT)) {
} else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT)) {
info->memory = vm->def->mem.cur_balloon;
} else if (qemuDomainJobAllowed(priv, QEMU_JOB_QUERY)) {
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
@ -3206,7 +3206,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DUMP_GUEST_MEMORY)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY)) {
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("dump-guest-memory is not supported"));
return -1;
@ -5216,7 +5216,7 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom,
/* Refresh current memory based on balloon info if supported */
if ((vm->def->memballoon != NULL) &&
(vm->def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_NONE) &&
!qemuCapsGet(priv->caps, QEMU_CAPS_BALLOON_EVENT) &&
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BALLOON_EVENT) &&
(virDomainObjIsActive(vm))) {
/* Don't delay if someone's using the monitor, just use
* existing most recent data instead */
@ -5305,7 +5305,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL;
virDomainChrSourceDef monConfig;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
bool monitor_json = false;
virCommandPtr cmd = NULL;
char *ret = NULL;
@ -5328,7 +5328,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
if (!def)
goto cleanup;
if (!(caps = qemuCapsCacheLookup(driver->capsCache, def->emulator)))
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
/* Since we're just exporting args, we can't do bridge/network/direct
@ -5403,16 +5403,16 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
net->model = model;
}
monitor_json = qemuCapsGet(caps, QEMU_CAPS_MONITOR_JSON);
monitor_json = virQEMUCapsGet(qemuCaps, QEMU_CAPS_MONITOR_JSON);
if (qemuProcessPrepareMonitorChr(cfg, &monConfig, def->name) < 0)
goto cleanup;
if (qemuAssignDeviceAliases(def, caps) < 0)
if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
goto cleanup;
if (!(cmd = qemuBuildCommandLine(conn, driver, def,
&monConfig, monitor_json, caps,
&monConfig, monitor_json, qemuCaps,
NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP)))
goto cleanup;
@ -5421,7 +5421,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
cleanup:
qemuDriverUnlock(driver);
virObjectUnref(caps);
virObjectUnref(qemuCaps);
virCommandFree(cmd);
virDomainDefFree(def);
virObjectUnref(cfg);
@ -5590,7 +5590,7 @@ static virDomainPtr qemuDomainDefine(virConnectPtr conn, const char *xml) {
virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL;
virDomainEventPtr event = NULL;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
virQEMUDriverConfigPtr cfg;
qemuDriverLock(driver);
@ -5603,13 +5603,13 @@ static virDomainPtr qemuDomainDefine(virConnectPtr conn, const char *xml) {
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
if (!(caps = qemuCapsCacheLookup(driver->capsCache, def->emulator)))
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
if (qemuCanonicalizeMachine(def, caps) < 0)
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
goto cleanup;
if (qemuDomainAssignAddresses(def, caps, NULL) < 0)
if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
@ -5665,7 +5665,7 @@ cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
virObjectUnref(caps);
virObjectUnref(qemuCaps);
qemuDriverUnlock(driver);
virObjectUnref(cfg);
return dom;
@ -6119,7 +6119,7 @@ qemuDomainUpdateDeviceLive(virDomainObjPtr vm,
}
static int
qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
{
@ -6146,7 +6146,7 @@ qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
if (virDomainDefAddImplicitControllers(vmdef) < 0)
return -1;
if (qemuDomainAssignAddresses(vmdef, caps, NULL) < 0)
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
@ -6157,7 +6157,7 @@ qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
return -1;
}
dev->data.net = NULL;
if (qemuDomainAssignAddresses(vmdef, caps, NULL) < 0)
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
@ -6173,7 +6173,7 @@ qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
return -1;
}
dev->data.hostdev = NULL;
if (qemuDomainAssignAddresses(vmdef, caps, NULL) < 0)
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
@ -6205,7 +6205,7 @@ qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
return -1;
dev->data.controller = NULL;
if (qemuDomainAssignAddresses(vmdef, caps, NULL) < 0)
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
@ -6303,7 +6303,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
}
static int
qemuDomainUpdateDeviceConfig(qemuCapsPtr caps,
qemuDomainUpdateDeviceConfig(virQEMUCapsPtr qemuCaps,
virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
{
@ -6369,7 +6369,7 @@ qemuDomainUpdateDeviceConfig(qemuCapsPtr caps,
vmdef->nets[pos] = net;
dev->data.net = NULL;
if (qemuDomainAssignAddresses(vmdef, caps, NULL) < 0)
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
@ -6400,7 +6400,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0;
int ret = -1;
unsigned int affect;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
qemuDomainObjPrivatePtr priv;
virQEMUDriverConfigPtr cfg = NULL;
@ -6464,9 +6464,9 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
goto endjob;
}
if (priv->caps)
caps = virObjectRef(priv->caps);
else if (!(caps = qemuCapsCacheLookup(driver->capsCache, vm->def->emulator)))
if (priv->qemuCaps)
qemuCaps = virObjectRef(priv->qemuCaps);
else if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, vm->def->emulator)))
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
@ -6479,13 +6479,13 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
goto endjob;
switch (action) {
case QEMU_DEVICE_ATTACH:
ret = qemuDomainAttachDeviceConfig(caps, vmdef, dev);
ret = qemuDomainAttachDeviceConfig(qemuCaps, vmdef, dev);
break;
case QEMU_DEVICE_DETACH:
ret = qemuDomainDetachDeviceConfig(vmdef, dev);
break;
case QEMU_DEVICE_UPDATE:
ret = qemuDomainUpdateDeviceConfig(caps, vmdef, dev);
ret = qemuDomainUpdateDeviceConfig(qemuCaps, vmdef, dev);
break;
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
@ -6545,7 +6545,7 @@ endjob:
vm = NULL;
cleanup:
virObjectUnref(caps);
virObjectUnref(qemuCaps);
virDomainDefFree(vmdef);
if (dev != dev_copy)
virDomainDeviceDefFree(dev_copy);
@ -10733,7 +10733,7 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
qemuDomainObjPrivatePtr priv = vm->privateData;
if (def->state == VIR_DOMAIN_DISK_SNAPSHOT &&
reuse && !qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION)) {
reuse && !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("reuse is not supported with this QEMU binary"));
goto cleanup;
@ -10849,7 +10849,7 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
if (def->state != VIR_DOMAIN_DISK_SNAPSHOT && active) {
if (external == 1 ||
qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION)) {
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
*flags |= VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC;
} else if (atomic && external > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@ -11035,12 +11035,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
}
/* 'cgroup' is still NULL if cgroups are disabled. */
if (qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
if (!(actions = virJSONValueNewArray())) {
virReportOOMError();
goto cleanup;
}
} else if (!qemuCapsGet(priv->caps, QEMU_CAPS_DISK_SNAPSHOT)) {
} else if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DISK_SNAPSHOT)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("live disk snapshot not supported with this "
"QEMU binary"));
@ -11112,7 +11112,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
cleanup:
virCgroupFree(&cgroup);
if (ret == 0 || !qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION)) {
if (ret == 0 || !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
if (virDomainSaveStatus(driver->caps, cfg->stateDir, vm) < 0 ||
(persist && virDomainSaveConfig(cfg->configDir, vm->newDef) < 0))
ret = -1;
@ -11138,7 +11138,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
bool memory = snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
bool memory_unlink = false;
bool atomic = !!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC);
bool transaction = qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION);
bool transaction = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION);
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool pmsuspended = false;
@ -12576,7 +12576,7 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
bool monJSON = false;
pid_t pid = pid_value;
char *pidfile = NULL;
qemuCapsPtr caps = NULL;
virQEMUCapsPtr qemuCaps = NULL;
virCheckFlags(0, NULL);
@ -12606,13 +12606,13 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
goto cleanup;
}
if (!(caps = qemuCapsCacheLookup(driver->capsCache, def->emulator)))
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
if (qemuCanonicalizeMachine(def, caps) < 0)
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
goto cleanup;
if (qemuDomainAssignAddresses(def, caps, NULL) < 0)
if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
@ -12647,7 +12647,7 @@ endjob:
cleanup:
virDomainDefFree(def);
virObjectUnref(caps);
virObjectUnref(qemuCaps);
virDomainChrSourceDefFree(monConfig);
if (vm)
virObjectUnlock(vm);
@ -13034,9 +13034,9 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base,
}
priv = vm->privateData;
if (qemuCapsGet(priv->caps, QEMU_CAPS_BLOCKJOB_ASYNC)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC)) {
async = true;
} else if (!qemuCapsGet(priv->caps, QEMU_CAPS_BLOCKJOB_SYNC)) {
} else if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_SYNC)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block jobs not supported with this QEMU binary"));
goto cleanup;
@ -13251,8 +13251,8 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *path,
goto cleanup;
}
if (!(qemuCapsGet(priv->caps, QEMU_CAPS_DRIVE_MIRROR) &&
qemuCapsGet(priv->caps, QEMU_CAPS_BLOCKJOB_ASYNC))) {
if (!(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_MIRROR) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block copy is not supported with this QEMU binary"));
goto cleanup;
@ -13449,7 +13449,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
"%s", _("domain is not running"));
goto endjob;
}
if (!qemuCapsGet(priv->caps, QEMU_CAPS_BLOCK_COMMIT)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_COMMIT)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("online commit not supported with this QEMU binary"));
goto endjob;
@ -13684,7 +13684,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
priv = vm->privateData;
cfg = virQEMUDriverGetConfig(driver);
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DRIVE_IOTUNE)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block I/O throttling not supported with this "
"QEMU binary"));
@ -14488,7 +14488,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
goto cleanup;
}
if (!qemuCapsGet(priv->caps, QEMU_CAPS_WAKEUP) &&
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_WAKEUP) &&
(target == VIR_NODE_SUSPEND_TARGET_MEM ||
target == VIR_NODE_SUSPEND_TARGET_HYBRID)) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
@ -14575,7 +14575,7 @@ qemuDomainPMWakeup(virDomainPtr dom,
priv = vm->privateData;
if (!qemuCapsGet(priv->caps, QEMU_CAPS_WAKEUP)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_WAKEUP)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Unable to wake up domain due to "
"missing system_wakeup monitor command"));

View File

@ -104,7 +104,7 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
goto cleanup;
}
if (!(driveAlias = qemuDeviceDriveHostAlias(origdisk, priv->caps)))
if (!(driveAlias = qemuDeviceDriveHostAlias(origdisk, priv->qemuCaps)))
goto error;
qemuDomainObjEnterMonitorWithDriver(driver, vm);
@ -257,17 +257,17 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
goto cleanup;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, &disk->info) < 0)
goto error;
releaseaddr = true;
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->caps) < 0)
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->qemuCaps) < 0)
goto error;
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->caps)))
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps)))
goto error;
if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->caps)))
if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->qemuCaps)))
goto error;
}
@ -277,7 +277,7 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
ret = qemuMonitorAddDevice(priv->mon, devstr);
@ -321,7 +321,7 @@ cleanup:
return ret;
error:
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
(disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
@ -356,7 +356,7 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
return -1;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, &controller->info) < 0)
goto cleanup;
releaseaddr = true;
@ -365,13 +365,13 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
controller->model == -1 &&
!qemuCapsGet(priv->caps, QEMU_CAPS_PIIX3_USB_UHCI)) {
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB controller hotplug unsupported in this QEMU binary"));
goto cleanup;
}
if (!(devstr = qemuBuildControllerDevStr(vm->def, controller, priv->caps, NULL))) {
if (!(devstr = qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, NULL))) {
goto cleanup;
}
}
@ -382,7 +382,7 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDevice(priv->mon, devstr);
} else {
ret = qemuMonitorAttachPCIDiskController(priv->mon,
@ -398,7 +398,7 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
cleanup:
if ((ret != 0) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
(controller->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
@ -497,14 +497,14 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
goto error;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->caps) < 0)
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->qemuCaps) < 0)
goto error;
if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->caps)))
if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->qemuCaps)))
goto error;
}
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->caps)))
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps)))
goto error;
for (i = 0 ; i <= disk->info.addr.drive.controller ; i++) {
@ -530,7 +530,7 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
ret = qemuMonitorAddDevice(priv->mon, devstr);
@ -619,12 +619,12 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
goto error;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->caps) < 0)
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->qemuCaps) < 0)
goto error;
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->caps)))
if (!(drivestr = qemuBuildDriveStr(conn, disk, false, priv->qemuCaps)))
goto error;
if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->caps)))
if (!(devstr = qemuBuildDriveDevStr(NULL, disk, 0, priv->qemuCaps)))
goto error;
}
@ -634,7 +634,7 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
ret = qemuMonitorAddDrive(priv->mon, drivestr);
if (ret == 0) {
ret = qemuMonitorAddDevice(priv->mon, devstr);
@ -723,7 +723,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto cleanup;
}
if (!qemuCapsGet(priv->caps, QEMU_CAPS_HOST_NET_ADD)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_HOST_NET_ADD)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("installed qemu version does not support host_net_add"));
goto cleanup;
@ -738,38 +738,38 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
*/
if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
cfg->privileged ||
(!qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV_BRIDGE))) {
(!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV_BRIDGE))) {
if ((tapfd = qemuNetworkIfaceConnect(vm->def, conn, driver, net,
priv->caps)) < 0)
priv->qemuCaps)) < 0)
goto cleanup;
iface_connected = true;
if (qemuOpenVhostNet(vm->def, net, priv->caps, &vhostfd) < 0)
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
goto cleanup;
}
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
if ((tapfd = qemuPhysIfaceConnect(vm->def, driver, net,
priv->caps,
priv->qemuCaps,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE)) < 0)
goto cleanup;
iface_connected = true;
if (qemuOpenVhostNet(vm->def, net, priv->caps, &vhostfd) < 0)
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
goto cleanup;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_NET_NAME) ||
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NET_NAME) ||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceNetAlias(vm->def, net, -1) < 0)
goto cleanup;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, &net->info) < 0)
goto cleanup;
releaseaddr = true;
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
vlan = -1;
} else {
vlan = qemuDomainNetVLAN(net);
@ -791,22 +791,22 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto no_memory;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!(netstr = qemuBuildHostNetStr(net, driver, priv->caps,
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (!(netstr = qemuBuildHostNetStr(net, driver, priv->qemuCaps,
',', -1, tapfd_name,
vhostfd_name)))
goto cleanup;
} else {
if (!(netstr = qemuBuildHostNetStr(net, driver, priv->caps,
if (!(netstr = qemuBuildHostNetStr(net, driver, priv->qemuCaps,
' ', vlan, tapfd_name,
vhostfd_name)))
goto cleanup;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorAddNetdev(priv->mon, netstr, tapfd, tapfd_name,
vhostfd, vhostfd_name) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
@ -832,8 +832,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto cleanup;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!(nicstr = qemuBuildNicDevStr(net, vlan, 0, priv->caps)))
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (!(nicstr = qemuBuildNicDevStr(net, vlan, 0, priv->qemuCaps)))
goto try_remove;
} else {
if (!(nicstr = qemuBuildNicStr(net, NULL, vlan)))
@ -841,7 +841,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorAddDevice(priv->mon, nicstr) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
@ -868,7 +868,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
} else {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
if (qemuMonitorSetLink(priv->mon, net->info.alias, VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
@ -892,7 +892,7 @@ cleanup:
if (!ret) {
vm->def->nets[vm->def->nnets++] = net;
} else {
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
(net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
@ -926,8 +926,8 @@ try_remove:
goto cleanup;
if (vlan < 0) {
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
char *netdev_name;
if (virAsprintf(&netdev_name, "host%s", net->info.alias) < 0)
goto no_memory;
@ -979,13 +979,13 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
&hostdev, 1) < 0)
return -1;
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto error;
if (qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, hostdev->info) < 0)
goto error;
releaseaddr = true;
if (qemuCapsGet(priv->caps, QEMU_CAPS_PCI_CONFIGFD)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) {
configfd = qemuOpenPCIConfig(hostdev);
if (configfd >= 0) {
if (virAsprintf(&configfd_name, "fd-%s",
@ -1003,7 +1003,7 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
}
if (!(devstr = qemuBuildPCIHostdevDevStr(hostdev, configfd_name,
priv->caps)))
priv->qemuCaps)))
goto error;
qemuDomainObjEnterMonitorWithDriver(driver, vm);
@ -1035,7 +1035,7 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
return 0;
error:
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
(hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
releaseaddr &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
@ -1061,10 +1061,10 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
virDomainDefPtr def = vm->def;
char *devstr = NULL;
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
goto error;
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->caps)))
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
goto error;
}
@ -1074,7 +1074,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE))
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
ret = qemuMonitorAddDevice(priv->mon, devstr);
else
goto error;
@ -1104,10 +1104,10 @@ int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
qemuDomainObjPrivatePtr priv = vm->privateData;
char *devstr = NULL;
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto error;
if (!(devstr = qemuBuildUSBHostdevDevStr(hostdev, priv->caps)))
if (!(devstr = qemuBuildUSBHostdevDevStr(hostdev, priv->qemuCaps)))
goto error;
}
@ -1144,7 +1144,7 @@ int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE))
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
ret = qemuMonitorAddDevice(priv->mon, devstr);
else
ret = qemuMonitorAddUSBDeviceExact(priv->mon,
@ -2057,7 +2057,7 @@ int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
@ -2079,7 +2079,7 @@ int qemuDomainDetachPciDiskDevice(virQEMUDriverPtr driver,
virDomainAuditDisk(vm, detach->src, NULL, "detach", true);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
detach->info.addr.pci.slot) < 0)
VIR_WARN("Unable to release PCI address on %s", dev->data.disk->src);
@ -2129,7 +2129,7 @@ int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
goto cleanup;
}
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Underlying qemu does not support %s disk removal"),
virDomainDiskBusTypeToString(dev->data.disk->bus));
@ -2293,13 +2293,13 @@ int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
goto cleanup;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceControllerAlias(detach) < 0)
goto cleanup;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
goto cleanup;
@ -2316,7 +2316,7 @@ int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
virDomainControllerRemove(vm->def, idx);
virDomainControllerDefFree(detach);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
detach->info.addr.pci.slot) < 0)
VIR_WARN("Unable to release PCI address on controller");
@ -2355,7 +2355,7 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
rv = qemuMonitorDelDevice(priv->mon, detach->info->alias);
} else {
rv = qemuMonitorRemovePCIDevice(priv->mon, &detach->info->addr.pci);
@ -2392,7 +2392,7 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
virObjectUnlock(driver->activePciHostdevs);
virObjectUnlock(driver->inactivePciHostdevs);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
detach->info->addr.pci.slot) < 0)
VIR_WARN("Unable to release PCI address on host device");
@ -2418,7 +2418,7 @@ qemuDomainDetachHostUsbDevice(virQEMUDriverPtr driver,
return -1;
}
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached with this QEMU version"));
return -1;
@ -2611,7 +2611,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
@ -2626,8 +2626,8 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
}
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV) &&
qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
@ -2644,7 +2644,7 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virDomainAuditNet(vm, detach, NULL, "detach", true);
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
qemuDomainPCIAddressReleaseSlot(priv->pciaddrs,
detach->info.addr.pci.slot) < 0)
VIR_WARN("Unable to release PCI address on NIC");

View File

@ -1162,7 +1162,7 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
* migration finish until SPICE server transfers its data */
if (vm->def->ngraphics == 1 &&
vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
qemuCapsGet(priv->caps, QEMU_CAPS_SEAMLESS_MIGRATION))
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION))
wait_for_spice = true;
ret = qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob);
@ -2286,7 +2286,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
break;
case MIGRATION_DEST_UNIX:
if (qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_UNIX)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX)) {
ret = qemuMonitorMigrateToUnix(priv->mon, migrate_flags,
spec->dest.unix_socket.file);
} else {
@ -2441,7 +2441,7 @@ static int doNativeMigrate(virQEMUDriverPtr driver,
if (!uribits)
return -1;
if (qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_FD))
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD))
spec.destType = MIGRATION_DEST_CONNECT_HOST;
else
spec.destType = MIGRATION_DEST_HOST;
@ -2483,9 +2483,9 @@ static int doTunnelMigrate(virQEMUDriverPtr driver,
driver, vm, st, NULLSTR(cookiein), cookieinlen,
cookieout, cookieoutlen, flags, resource);
if (!qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
!qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_UNIX) &&
!qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX) &&
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Source qemu is too old to support tunnelled migration"));
virObjectUnref(cfg);
@ -2495,7 +2495,7 @@ static int doTunnelMigrate(virQEMUDriverPtr driver,
spec.fwdType = MIGRATION_FWD_STREAM;
spec.fwd.stream = st;
if (qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_FD)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD)) {
int fds[2];
spec.destType = MIGRATION_DEST_FD;
@ -3623,7 +3623,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
qemuDomainObjExitMonitorWithDriver(driver, vm);
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
(!compressor || pipe(pipeFD) == 0)) {
/* All right! We can use fd migration, which means that qemu
* doesn't have to open() the file, so while we still have to
@ -3674,7 +3674,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
if (!compressor) {
const char *args[] = { "cat", NULL };
if (qemuCapsGet(priv->caps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
priv->monConfig->type == VIR_DOMAIN_CHR_TYPE_UNIX) {
rc = qemuMonitorMigrateToFd(priv->mon,
QEMU_MONITOR_MIGRATE_BACKGROUND,

View File

@ -1414,8 +1414,8 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm)
qemuDomainObjEnterMonitorWithDriver(driver, vm);
ret = qemuMonitorSetCapabilities(priv->mon);
if (ret == 0 &&
qemuCapsGet(priv->caps, QEMU_CAPS_MONITOR_JSON))
ret = qemuCapsProbeQMP(priv->caps, priv->mon);
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON))
ret = virQEMUCapsProbeQMP(priv->qemuCaps, priv->mon);
qemuDomainObjExitMonitorWithDriver(driver, vm);
error:
@ -1625,10 +1625,10 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices,
static int
qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
virHashTablePtr paths)
{
bool chardevfmt = qemuCapsGet(caps, QEMU_CAPS_CHARDEV);
bool chardevfmt = virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV);
int i = 0;
if (qemuProcessLookupPTYs(vm->def->serials, vm->def->nserials,
@ -1753,7 +1753,7 @@ qemuProcessReadLogFD(int logfd, char *buf, int maxlen, int off)
static int
qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuCapsPtr caps,
virQEMUCapsPtr qemuCaps,
off_t pos)
{
char *buf = NULL;
@ -1763,7 +1763,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
virHashTablePtr paths = NULL;
qemuDomainObjPrivatePtr priv;
if (!qemuCapsUsedQMP(caps) && pos != -1) {
if (!virQEMUCapsUsedQMP(qemuCaps) && pos != -1) {
if ((logfd = qemuDomainOpenLog(driver, vm, pos)) < 0)
return -1;
@ -1798,7 +1798,7 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver,
VIR_DEBUG("qemuMonitorGetPtyPaths returned %i", ret);
if (ret == 0)
ret = qemuProcessFindCharDevicePTYsMonitor(vm, caps, paths);
ret = qemuProcessFindCharDevicePTYsMonitor(vm, qemuCaps, paths);
cleanup:
virHashFree(paths);
@ -1806,7 +1806,7 @@ cleanup:
if (pos != -1 && kill(vm->pid, 0) == -1 && errno == ESRCH) {
/* VM is dead, any other error raised in the interim is probably
* not as important as the qemu cmdline output */
if (qemuCapsUsedQMP(caps)) {
if (virQEMUCapsUsedQMP(qemuCaps)) {
if ((logfd = qemuDomainOpenLog(driver, vm, pos)) < 0)
return -1;
@ -2124,7 +2124,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
if (def->nets[i]->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
if (!qemuCapsGet(priv->caps, QEMU_CAPS_NETDEV)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("Setting of link state is not supported by this qemu"));
return -1;
@ -2225,7 +2225,7 @@ qemuProcessInitPasswords(virConnectPtr conn,
if (ret < 0)
goto cleanup;
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
for (i = 0 ; i < vm->def->ndisks ; i++) {
char *secret;
size_t secretLen;
@ -3237,14 +3237,14 @@ qemuProcessReconnect(void *opaque)
/* If upgrading from old libvirtd we won't have found any
* caps in the domain status, so re-query them
*/
if (!priv->caps &&
!(priv->caps = qemuCapsCacheLookupCopy(driver->capsCache,
obj->def->emulator)))
if (!priv->qemuCaps &&
!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
obj->def->emulator)))
goto error;
/* In case the domain shutdown while we were not running,
* we need to finish the shutdown process. And we need to do it after
* we have qemuCaps filled in.
* we have virQEMUCaps filled in.
*/
if (state == VIR_DOMAIN_SHUTDOWN ||
(state == VIR_DOMAIN_PAUSED &&
@ -3255,8 +3255,8 @@ qemuProcessReconnect(void *opaque)
goto endjob;
}
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE))
if ((qemuDomainAssignAddresses(obj->def, priv->caps, obj)) < 0)
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
goto error;
if (virSecurityManagerReserveLabel(driver->securityManager, obj->def, obj->pid) < 0)
@ -3330,7 +3330,7 @@ error:
* to remove danger of it ending up running twice if
* user tries to start it again later
*/
if (qemuCapsGet(priv->caps, QEMU_CAPS_NO_SHUTDOWN)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) {
/* If we couldn't get the monitor and qemu supports
* no-shutdown, we can safely say that the domain
* crashed ... */
@ -3732,12 +3732,12 @@ int qemuProcessStart(virConnectPtr conn,
}
VIR_DEBUG("Determining emulator version");
virObjectUnref(priv->caps);
if (!(priv->caps = qemuCapsCacheLookupCopy(driver->capsCache,
vm->def->emulator)))
virObjectUnref(priv->qemuCaps);
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
vm->def->emulator)))
goto cleanup;
if (qemuAssignDeviceAliases(vm->def, priv->caps) < 0)
if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
goto cleanup;
VIR_DEBUG("Checking for CDROM and floppy presence");
@ -3777,7 +3777,7 @@ int qemuProcessStart(virConnectPtr conn,
if (qemuProcessPrepareMonitorChr(cfg, priv->monConfig, vm->def->name) < 0)
goto cleanup;
if (qemuCapsGet(priv->caps, QEMU_CAPS_MONITOR_JSON))
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON))
priv->monJSON = 1;
else
priv->monJSON = 0;
@ -3808,15 +3808,15 @@ int qemuProcessStart(virConnectPtr conn,
* we also need to populate the PCi address set cache for later
* use in hotplug
*/
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Assigning domain PCI addresses");
if ((qemuDomainAssignAddresses(vm->def, priv->caps, vm)) < 0)
if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
goto cleanup;
}
VIR_DEBUG("Building emulator command line");
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON != 0, priv->caps,
priv->monJSON != 0, priv->qemuCaps,
migrateFrom, stdin_fd, snapshot, vmop)))
goto cleanup;
@ -3979,7 +3979,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Waiting for monitor to show up");
if (qemuProcessWaitForMonitor(driver, vm, priv->caps, pos) < 0)
if (qemuProcessWaitForMonitor(driver, vm, priv->qemuCaps, pos) < 0)
goto cleanup;
/* Failure to connect to agent shouldn't be fatal */
@ -4016,7 +4016,7 @@ int qemuProcessStart(virConnectPtr conn,
/* If we have -device, then addresses are assigned explicitly.
* If not, then we have to detect dynamic ones here */
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Determining domain device PCI addresses");
if (qemuProcessInitPCIAddresses(driver, vm) < 0)
goto cleanup;
@ -4370,8 +4370,8 @@ retry:
virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, reason);
VIR_FREE(priv->vcpupids);
priv->nvcpupids = 0;
virObjectUnref(priv->caps);
priv->caps = NULL;
virObjectUnref(priv->qemuCaps);
priv->qemuCaps = NULL;
VIR_FREE(priv->pidfile);
/* The "release" hook cleans up additional resources */
@ -4488,9 +4488,9 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
goto cleanup;
VIR_DEBUG("Determining emulator version");
virObjectUnref(priv->caps);
if (!(priv->caps = qemuCapsCacheLookupCopy(driver->capsCache,
vm->def->emulator)))
virObjectUnref(priv->qemuCaps);
if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
vm->def->emulator)))
goto cleanup;
VIR_DEBUG("Preparing monitor state");
@ -4507,9 +4507,9 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
* we also need to populate the PCi address set cache for later
* use in hotplug
*/
if (qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Assigning domain PCI addresses");
if ((qemuDomainAssignAddresses(vm->def, priv->caps, vm)) < 0)
if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
goto cleanup;
}
@ -4531,7 +4531,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
vm->pid = pid;
VIR_DEBUG("Waiting for monitor to show up");
if (qemuProcessWaitForMonitor(driver, vm, priv->caps, -1) < 0)
if (qemuProcessWaitForMonitor(driver, vm, priv->qemuCaps, -1) < 0)
goto cleanup;
/* Failure to connect to agent shouldn't be fatal */
@ -4548,7 +4548,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
/* If we have -device, then addresses are assigned explicitly.
* If not, then we have to detect dynamic ones here */
if (!qemuCapsGet(priv->caps, QEMU_CAPS_DEVICE)) {
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
VIR_DEBUG("Determining domain device PCI addresses");
if (qemuProcessInitPCIAddresses(driver, vm) < 0)
goto cleanup;

View File

@ -11,20 +11,20 @@
struct testInfo {
const char *name;
qemuCapsPtr flags;
virQEMUCapsPtr flags;
unsigned int version;
unsigned int is_kvm;
unsigned int kvm_version;
};
static void printMismatchedFlags(qemuCapsPtr got,
qemuCapsPtr expect)
static void printMismatchedFlags(virQEMUCapsPtr got,
virQEMUCapsPtr expect)
{
int i;
for (i = 0 ; i < QEMU_CAPS_LAST ; i++) {
bool gotFlag = qemuCapsGet(got, i);
bool expectFlag = qemuCapsGet(expect, i);
bool gotFlag = virQEMUCapsGet(got, i);
bool expectFlag = virQEMUCapsGet(expect, i);
if (gotFlag && !expectFlag)
fprintf(stderr, "Extra flag %i\n", i);
if (!gotFlag && expectFlag)
@ -38,7 +38,7 @@ static int testHelpStrParsing(const void *data)
char *path = NULL;
char *help = NULL;
unsigned int version, is_kvm, kvm_version;
qemuCapsPtr flags = NULL;
virQEMUCapsPtr flags = NULL;
int ret = -1;
char *got = NULL;
char *expected = NULL;
@ -49,19 +49,19 @@ static int testHelpStrParsing(const void *data)
if (virtTestLoadFile(path, &help) < 0)
goto cleanup;
if (!(flags = qemuCapsNew()))
if (!(flags = virQEMUCapsNew()))
goto cleanup;
if (qemuCapsParseHelpStr("QEMU", help, flags,
&version, &is_kvm, &kvm_version, false) == -1)
if (virQEMUCapsParseHelpStr("QEMU", help, flags,
&version, &is_kvm, &kvm_version, false) == -1)
goto cleanup;
# ifndef WITH_YAJL
if (qemuCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
if (virQEMUCapsGet(info->flags, QEMU_CAPS_MONITOR_JSON))
virQEMUCapsSet(flags, QEMU_CAPS_MONITOR_JSON);
# endif
if (qemuCapsGet(info->flags, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(info->flags, QEMU_CAPS_DEVICE)) {
VIR_FREE(path);
VIR_FREE(help);
if (virAsprintf(&path, "%s/qemuhelpdata/%s-device", abs_srcdir,
@ -71,12 +71,12 @@ static int testHelpStrParsing(const void *data)
if (virtTestLoadFile(path, &help) < 0)
goto cleanup;
if (qemuCapsParseDeviceStr(flags, help) < 0)
if (virQEMUCapsParseDeviceStr(flags, help) < 0)
goto cleanup;
}
got = qemuCapsFlagsString(flags);
expected = qemuCapsFlagsString(info->flags);
got = virQEMUCapsFlagsString(flags);
expected = virQEMUCapsFlagsString(info->flags);
if (!got || !expected)
goto cleanup;
@ -132,9 +132,9 @@ mymain(void)
struct testInfo info = { \
name, NULL, version, is_kvm, kvm_version \
}; \
if (!(info.flags = qemuCapsNew())) \
if (!(info.flags = virQEMUCapsNew())) \
return EXIT_FAILURE; \
qemuCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \
virQEMUCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \
if (virtTestRun("QEMU Help String Parsing " name, \
1, testHelpStrParsing, &info) < 0) \
ret = -1; \

View File

@ -81,7 +81,7 @@ typedef enum {
static int testCompareXMLToArgvFiles(const char *xml,
const char *cmdline,
qemuCapsPtr extraFlags,
virQEMUCapsPtr extraFlags,
const char *migrateFrom,
int migrateFd,
virQemuXML2ArgvTestFlags flags)
@ -108,7 +108,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
goto out;
}
if (qemuCapsGet(extraFlags, QEMU_CAPS_DOMID))
if (virQEMUCapsGet(extraFlags, QEMU_CAPS_DOMID))
vmdef->id = 6;
else
vmdef->id = -1;
@ -118,11 +118,11 @@ static int testCompareXMLToArgvFiles(const char *xml,
monitor_chr.data.nix.path = (char *)"/tmp/test-monitor";
monitor_chr.data.nix.listen = true;
qemuCapsSetList(extraFlags,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
virQEMUCapsSetList(extraFlags,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
if (STREQ(vmdef->os.machine, "pc") &&
STREQ(vmdef->emulator, "/usr/bin/qemu-system-x86_64")) {
@ -131,7 +131,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
goto out;
}
if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
if (virQEMUCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
if (qemuDomainAssignAddresses(vmdef, extraFlags, NULL)) {
if (flags & FLAG_EXPECT_ERROR)
goto ok;
@ -145,7 +145,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (vmdef->os.arch == VIR_ARCH_X86_64 ||
vmdef->os.arch == VIR_ARCH_I686) {
qemuCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
virQEMUCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
}
if (qemuAssignDeviceAliases(vmdef, extraFlags) < 0)
@ -207,7 +207,7 @@ out:
struct testInfo {
const char *name;
qemuCapsPtr extraFlags;
virQEMUCapsPtr extraFlags;
const char *migrateFrom;
int migrateFd;
unsigned int flags;
@ -228,7 +228,7 @@ testCompareXMLToArgvHelper(const void *data)
abs_srcdir, info->name) < 0)
goto cleanup;
if (qemuCapsGet(info->extraFlags, QEMU_CAPS_MONITOR_JSON))
if (virQEMUCapsGet(info->extraFlags, QEMU_CAPS_MONITOR_JSON))
flags |= FLAG_JSON;
result = testCompareXMLToArgvFiles(xml, args, info->extraFlags,
@ -243,7 +243,7 @@ cleanup:
static int
testAddCPUModels(qemuCapsPtr caps, bool skipLegacy)
testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
{
const char *newModels[] = {
"Opteron_G3", "Opteron_G2", "Opteron_G1",
@ -257,13 +257,13 @@ testAddCPUModels(qemuCapsPtr caps, bool skipLegacy)
size_t i;
for (i = 0 ; i < ARRAY_CARDINALITY(newModels) ; i++) {
if (qemuCapsAddCPUDefinition(caps, newModels[i]) < 0)
if (virQEMUCapsAddCPUDefinition(caps, newModels[i]) < 0)
return -1;
}
if (skipLegacy)
return 0;
for (i = 0 ; i < ARRAY_CARDINALITY(legacyModels) ; i++) {
if (qemuCapsAddCPUDefinition(caps, legacyModels[i]) < 0)
if (virQEMUCapsAddCPUDefinition(caps, legacyModels[i]) < 0)
return -1;
}
return 0;
@ -317,11 +317,11 @@ mymain(void)
static struct testInfo info = { \
name, NULL, migrateFrom, migrateFd, (flags) \
}; \
if (!(info.extraFlags = qemuCapsNew())) \
if (!(info.extraFlags = virQEMUCapsNew())) \
return EXIT_FAILURE; \
if (testAddCPUModels(info.extraFlags, skipLegacyCPUs) < 0) \
return EXIT_FAILURE; \
qemuCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST); \
virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\
if (virtTestRun("QEMU XML-2-ARGV " name, \
1, testCompareXMLToArgvHelper, &info) < 0) \
ret = -1; \

View File

@ -25,7 +25,7 @@ static virQEMUDriver driver;
static int testCompareXMLToArgvFiles(const char *xml,
const char *cmdline,
qemuCapsPtr extraFlags,
virQEMUCapsPtr extraFlags,
const char *migrateFrom,
int migrateFd,
bool json,
@ -76,7 +76,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
goto fail;
}
if (qemuCapsGet(extraFlags, QEMU_CAPS_DOMID))
if (virQEMUCapsGet(extraFlags, QEMU_CAPS_DOMID))
vmdef->id = 6;
else
vmdef->id = -1;
@ -86,13 +86,13 @@ static int testCompareXMLToArgvFiles(const char *xml,
monitor_chr.data.nix.path = (char *)"/tmp/test-monitor";
monitor_chr.data.nix.listen = true;
qemuCapsSetList(extraFlags,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
virQEMUCapsSetList(extraFlags,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_LAST);
if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE))
if (virQEMUCapsGet(extraFlags, QEMU_CAPS_DEVICE))
qemuDomainAssignAddresses(vmdef, extraFlags, NULL);
log = virtTestLogContentAndReset();
@ -101,7 +101,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (vmdef->os.arch == VIR_ARCH_X86_64 ||
vmdef->os.arch == VIR_ARCH_I686) {
qemuCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
virQEMUCapsSet(extraFlags, QEMU_CAPS_PCI_MULTIBUS);
}
if (qemuAssignDeviceAliases(vmdef, extraFlags) < 0)
@ -157,7 +157,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
struct testInfo {
const char *name;
qemuCapsPtr extraFlags;
virQEMUCapsPtr extraFlags;
const char *migrateFrom;
int migrateFd;
bool json;
@ -215,9 +215,9 @@ mymain(void)
struct testInfo info = { \
name, NULL, migrateFrom, migrateFd, json, expectError \
}; \
if (!(info.extraFlags = qemuCapsNew())) \
if (!(info.extraFlags = virQEMUCapsNew())) \
return EXIT_FAILURE; \
qemuCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST); \
virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\
if (virtTestRun("QEMU XML-2-ARGV " name, \
1, testCompareXMLToArgvHelper, &info) < 0) \
ret = -1; \