diff mbox series

[05/15] qdev: Add a no default uuid property

Message ID 20190919213924.31852-6-minyard@acm.org (mailing list archive)
State New, archived
Headers show
Series [01/15] ipmi: Fix watchdog NMI handling | expand

Commit Message

Corey Minyard Sept. 19, 2019, 9:39 p.m. UTC
From: Corey Minyard <cminyard@mvista.com>

This is for IPMI, which will behave differently if the UUID is
not set.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Fam Zheng <famz@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/hw/qdev-properties.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Cédric Le Goater Sept. 23, 2019, 5:47 a.m. UTC | #1
On 19/09/2019 23:39, minyard@acm.org wrote:
> From: Corey Minyard <cminyard@mvista.com>
> 
> This is for IPMI, which will behave differently if the UUID is
> not set.
> 
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> Cc: Fam Zheng <famz@redhat.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

C.


> ---
>  include/hw/qdev-properties.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 2e98dd60db..c6a8cb5516 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -238,6 +238,13 @@ extern const PropertyInfo qdev_prop_pcie_link_width;
>  #define DEFINE_PROP_AUDIODEV(_n, _s, _f) \
>      DEFINE_PROP(_n, _s, _f, qdev_prop_audiodev, QEMUSoundCard)
>  
> +#define DEFINE_PROP_UUID_NODEFAULT(_name, _state, _field) {        \
> +        .name      = (_name),                                      \
> +        .info      = &qdev_prop_uuid,                              \
> +        .offset    = offsetof(_state, _field)                      \
> +            + type_check(QemuUUID, typeof_field(_state, _field)),  \
> +        }
> +
>  #define DEFINE_PROP_END_OF_LIST()               \
>      {}
>  
>
diff mbox series

Patch

diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 2e98dd60db..c6a8cb5516 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -238,6 +238,13 @@  extern const PropertyInfo qdev_prop_pcie_link_width;
 #define DEFINE_PROP_AUDIODEV(_n, _s, _f) \
     DEFINE_PROP(_n, _s, _f, qdev_prop_audiodev, QEMUSoundCard)
 
+#define DEFINE_PROP_UUID_NODEFAULT(_name, _state, _field) {        \
+        .name      = (_name),                                      \
+        .info      = &qdev_prop_uuid,                              \
+        .offset    = offsetof(_state, _field)                      \
+            + type_check(QemuUUID, typeof_field(_state, _field)),  \
+        }
+
 #define DEFINE_PROP_END_OF_LIST()               \
     {}