]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: domain: Add macro to simplify access to vm private data
authorPeter Krempa <pkrempa@redhat.com>
Wed, 14 Sep 2016 05:28:18 +0000 (07:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 Sep 2016 14:32:36 +0000 (16:32 +0200)
Sometimes adding a separate variable to access vm->privateData is not
necessary. Add a macro that will do the typecasting rather than having
to add a temp variable to force the compiler to typecast it.

src/qemu/qemu_domain.h

index c2fab3ba35212de328774c6a6a585186f45e4ff2..521531be03460d21dc47296c3e61e172e630b579 100644 (file)
@@ -234,6 +234,9 @@ struct _qemuDomainObjPrivate {
     size_t masterKeyLen;
 };
 
+# define QEMU_DOMAIN_PRIVATE(vm)       \
+    ((qemuDomainObjPrivatePtr) (vm)->privateData)
+
 /* Type of domain secret */
 typedef enum {
     VIR_DOMAIN_SECRET_INFO_TYPE_PLAIN = 0,