From 63aac8c299ed19866495d3b83d3c5d851af152d2 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 14 Sep 2016 07:28:18 +0200 Subject: [PATCH] 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. --- src/qemu/qemu_domain.h | 3 +++ 1 file changed, 3 insertions(+) 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, -- GitLab