qemu: domain: Add vcpu private data structure

Members will be added in follow-up patches.
This commit is contained in:
Peter Krempa 2016-06-29 15:40:09 +02:00
parent 5fe0b6b0a7
commit 2540c93203
2 changed files with 54 additions and 0 deletions

View File

@ -812,6 +812,46 @@ qemuDomainHostdevPrivateDispose(void *obj)
}
static virClassPtr qemuDomainVcpuPrivateClass;
static void qemuDomainVcpuPrivateDispose(void *obj);
static int
qemuDomainVcpuPrivateOnceInit(void)
{
qemuDomainVcpuPrivateClass = virClassNew(virClassForObject(),
"qemuDomainVcpuPrivate",
sizeof(qemuDomainVcpuPrivate),
qemuDomainVcpuPrivateDispose);
if (!qemuDomainVcpuPrivateClass)
return -1;
else
return 0;
}
VIR_ONCE_GLOBAL_INIT(qemuDomainVcpuPrivate)
static virObjectPtr
qemuDomainVcpuPrivateNew(void)
{
qemuDomainVcpuPrivatePtr priv;
if (qemuDomainVcpuPrivateInitialize() < 0)
return NULL;
if (!(priv = virObjectNew(qemuDomainVcpuPrivateClass)))
return NULL;
return (virObjectPtr) priv;
}
static void
qemuDomainVcpuPrivateDispose(void *obj ATTRIBUTE_UNUSED)
{
return;
}
/* qemuDomainSecretPlainSetup:
* @conn: Pointer to connection
* @secinfo: Pointer to secret info
@ -1637,6 +1677,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
.alloc = qemuDomainObjPrivateAlloc,
.free = qemuDomainObjPrivateFree,
.diskNew = qemuDomainDiskPrivateNew,
.vcpuNew = qemuDomainVcpuPrivateNew,
.hostdevNew = qemuDomainHostdevPrivateNew,
.parse = qemuDomainObjPrivateXMLParse,
.format = qemuDomainObjPrivateXMLFormat,

View File

@ -312,6 +312,19 @@ struct _qemuDomainDiskPrivate {
# define QEMU_DOMAIN_HOSTDEV_PRIVATE(hostdev) \
((qemuDomainHostdevPrivatePtr) (hostdev)->privateData)
typedef struct _qemuDomainVcpuPrivate qemuDomainVcpuPrivate;
typedef qemuDomainVcpuPrivate *qemuDomainVcpuPrivatePtr;
struct _qemuDomainVcpuPrivate {
virObject parent;
int dummy;
};
# define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \
((qemuDomainVcpuPrivatePtr) (vcpu)->privateData)
struct qemuDomainDiskInfo {
bool removable;
bool locked;