Patchwork [19/37] qdev: add DEFINE_ABSTRACT_PROP() helper

login
register
mail settings
Submitter Igor Mammedov
Date Oct. 22, 2012, 3:03 p.m.
Message ID <1350918203-25198-20-git-send-email-imammedo@redhat.com>
Download mbox | patch
Permalink /patch/193217/
State New
Headers show

Comments

Igor Mammedov - Oct. 22, 2012, 3:03 p.m.
It will be used for declaring a static property with a custom setter/getter.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/qdev-properties.h | 5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/hw/qdev-properties.h b/hw/qdev-properties.h
index b2f7142..41358fa 100644
--- a/hw/qdev-properties.h
+++ b/hw/qdev-properties.h
@@ -27,6 +27,11 @@  extern PropertyInfo qdev_prop_pci_devfn;
 extern PropertyInfo qdev_prop_blocksize;
 extern PropertyInfo qdev_prop_pci_host_devaddr;
 
+#define DEFINE_ABSTRACT_PROP(_name, _prop) { \
+        .name      = (_name),                                    \
+        .info      = &(_prop),                                   \
+        }
+
 #define DEFINE_PROP(_name, _state, _field, _prop, _type) { \
         .name      = (_name),                                    \
         .info      = &(_prop),                                   \