From: Peter Krempa Date: Wed, 14 Sep 2016 05:28:18 +0000 (+0200) Subject: qemu: domain: Add macro to simplify access to vm private data X-Git-Tag: v2.3.0-rc1~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63aac8c299ed19866495d3b83d3c5d851af152d2;p=thirdparty%2Flibvirt.git qemu: domain: Add macro to simplify access to vm private data 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. --- diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index c2fab3ba35..521531be03 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -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,