[PATCH 08/11] qemu: domain: Add vcpu private data structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Members will be added in follow-up patches.
---
 src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++
 src/qemu/qemu_domain.h | 13 +++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 42b5511..4c3df04 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -811,6 +811,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
@@ -1636,6 +1676,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
     .alloc = qemuDomainObjPrivateAlloc,
     .free = qemuDomainObjPrivateFree,
     .diskNew = qemuDomainDiskPrivateNew,
+    .vcpuNew = qemuDomainVcpuPrivateNew,
     .hostdevNew = qemuDomainHostdevPrivateNew,
     .parse = qemuDomainObjPrivateXMLParse,
     .format = qemuDomainObjPrivateXMLFormat,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index c49f31c..16d0996 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -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;
-- 
2.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]