All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venu Busireddy <venu.busireddy@oracle.com>
To: venu.busireddy@oracle.com, "Michael S . Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>
Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 1/4] Add a true or false option to the DEFINE_PROP_UUID macro.
Date: Tue, 26 Jun 2018 22:49:31 -0500	[thread overview]
Message-ID: <20180627034935.20276-2-venu.busireddy@oracle.com> (raw)
In-Reply-To: <20180627034935.20276-1-venu.busireddy@oracle.com>

It may not always be desirable to have a random UUID stuffed into the
'_field' member. Add a new boolean option '_default' that will allow
the caller to specify if a random UUID needs be generated or not.

Also modified the instance where this macro is used.

Signed-off-by: Venu Busireddy <venu.busireddy@oracle.com>
---
 hw/acpi/vmgenid.c            | 2 +-
 include/hw/qdev-properties.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index d78b579a20..6d53757ee5 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -215,7 +215,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
 }
 
 static Property vmgenid_device_properties[] = {
-    DEFINE_PROP_UUID(VMGENID_GUID, VmGenIdState, guid),
+    DEFINE_PROP_UUID(VMGENID_GUID, VmGenIdState, guid, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 4f60cc88f3..7d39a4bdcd 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -218,12 +218,12 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar;
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_off_auto_pcibar, \
                         OffAutoPCIBAR)
 
-#define DEFINE_PROP_UUID(_name, _state, _field) {                  \
+#define DEFINE_PROP_UUID(_name, _state, _field, _default) {        \
         .name      = (_name),                                      \
         .info      = &qdev_prop_uuid,                              \
         .offset    = offsetof(_state, _field)                      \
             + type_check(QemuUUID, typeof_field(_state, _field)),  \
-        .set_default = true,                                       \
+        .set_default = _default,                                   \
         }
 
 #define DEFINE_PROP_END_OF_LIST()               \

WARNING: multiple messages have this Message-ID (diff)
From: Venu Busireddy <venu.busireddy@oracle.com>
To: venu.busireddy@oracle.com, "Michael S . Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>
Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org
Subject: [virtio-dev] [PATCH v2 1/4] Add a true or false option to the DEFINE_PROP_UUID macro.
Date: Tue, 26 Jun 2018 22:49:31 -0500	[thread overview]
Message-ID: <20180627034935.20276-2-venu.busireddy@oracle.com> (raw)
In-Reply-To: <20180627034935.20276-1-venu.busireddy@oracle.com>

It may not always be desirable to have a random UUID stuffed into the
'_field' member. Add a new boolean option '_default' that will allow
the caller to specify if a random UUID needs be generated or not.

Also modified the instance where this macro is used.

Signed-off-by: Venu Busireddy <venu.busireddy@oracle.com>
---
 hw/acpi/vmgenid.c            | 2 +-
 include/hw/qdev-properties.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index d78b579a20..6d53757ee5 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -215,7 +215,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
 }
 
 static Property vmgenid_device_properties[] = {
-    DEFINE_PROP_UUID(VMGENID_GUID, VmGenIdState, guid),
+    DEFINE_PROP_UUID(VMGENID_GUID, VmGenIdState, guid, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 4f60cc88f3..7d39a4bdcd 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -218,12 +218,12 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar;
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_off_auto_pcibar, \
                         OffAutoPCIBAR)
 
-#define DEFINE_PROP_UUID(_name, _state, _field) {                  \
+#define DEFINE_PROP_UUID(_name, _state, _field, _default) {        \
         .name      = (_name),                                      \
         .info      = &qdev_prop_uuid,                              \
         .offset    = offsetof(_state, _field)                      \
             + type_check(QemuUUID, typeof_field(_state, _field)),  \
-        .set_default = true,                                       \
+        .set_default = _default,                                   \
         }
 
 #define DEFINE_PROP_END_OF_LIST()               \

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  reply	other threads:[~2018-06-27  3:49 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27  3:49 [Qemu-devel] [PATCH v2 0/4] Use of unique identifier for pairing virtio and passthrough devices Venu Busireddy
2018-06-27  3:49 ` [virtio-dev] " Venu Busireddy
2018-06-27  3:49 ` Venu Busireddy [this message]
2018-06-27  3:49   ` [virtio-dev] [PATCH v2 1/4] Add a true or false option to the DEFINE_PROP_UUID macro Venu Busireddy
2018-06-27  3:49 ` [Qemu-devel] [PATCH v2 2/4] Add "Group Identifier" support to virtio devices Venu Busireddy
2018-06-27  3:49   ` [virtio-dev] " Venu Busireddy
2018-06-27  3:49 ` [Qemu-devel] [PATCH v2 3/4] Add "Group Identifier" support to Red Hat PCI bridge Venu Busireddy
2018-06-27  3:49   ` [virtio-dev] " Venu Busireddy
2018-06-27  4:02   ` [Qemu-devel] " Michael S. Tsirkin
2018-06-27  4:02     ` [virtio-dev] " Michael S. Tsirkin
2018-06-27  4:08     ` [Qemu-devel] " Venu Busireddy
2018-06-27  4:08       ` Venu Busireddy
2018-06-27 23:07       ` [Qemu-devel] " Venu Busireddy
2018-06-27 23:07         ` Venu Busireddy
2018-06-28  2:14         ` [Qemu-devel] " Michael S. Tsirkin
2018-06-28  2:14           ` Michael S. Tsirkin
2018-06-28  3:46           ` [Qemu-devel] " Venu Busireddy
2018-06-28  3:46             ` Venu Busireddy
2018-06-28  8:10           ` [Qemu-devel] " Siwei Liu
2018-06-28  8:10             ` Siwei Liu
2018-06-28  8:25     ` [Qemu-devel] " Daniel P. Berrangé
2018-06-28 10:07       ` [Qemu-devel] Retrieving configuration metadata from hypervisor (was: Re: [PATCH v2 3/4] Add "Group Identifier" support to Red Hat PCI bridge.) Cornelia Huck
2018-06-28 10:07         ` [virtio-dev] Retrieving configuration metadata from hypervisor (was: Re: [Qemu-devel] " Cornelia Huck
2018-06-27  3:49 ` [Qemu-devel] [PATCH v2 4/4] Add "Group Identifier" support to Red Hat PCI Express bridge Venu Busireddy
2018-06-27  3:49   ` [virtio-dev] " Venu Busireddy
2018-06-27  3:49 ` [Qemu-devel] [PATCH v2 virtio 1/1] Add "Group Identifier" to virtio PCI capabilities Venu Busireddy
2018-06-27  3:49   ` [virtio-dev] " Venu Busireddy
2018-06-27  4:06 ` [Qemu-devel] [PATCH v2 0/4] Use of unique identifier for pairing virtio and passthrough devices Michael S. Tsirkin
2018-06-27  4:06   ` [virtio-dev] " Michael S. Tsirkin
2018-06-27  4:12   ` [Qemu-devel] " Venu Busireddy
2018-06-27  4:12     ` Venu Busireddy
2018-06-27  7:21   ` [Qemu-devel] " Siwei Liu
2018-06-27  7:21     ` Siwei Liu
2018-06-27  8:17   ` [Qemu-devel] " Cornelia Huck
2018-06-27  8:17     ` Cornelia Huck
2018-06-27 12:24 ` [Qemu-devel] " Roman Kagan
2018-06-27 19:29   ` Venu Busireddy
2018-06-27 19:29     ` [virtio-dev] " Venu Busireddy
2018-06-27 19:47     ` Michael S. Tsirkin
2018-06-27 19:47       ` [virtio-dev] " Michael S. Tsirkin
2018-06-27 19:59       ` Venu Busireddy
2018-06-27 19:59         ` [virtio-dev] " Venu Busireddy
2018-06-27 20:12         ` Michael S. Tsirkin
2018-06-27 20:12           ` [virtio-dev] " Michael S. Tsirkin
2018-06-27 22:34           ` Venu Busireddy
2018-06-27 22:34             ` [virtio-dev] " Venu Busireddy
2018-06-28  1:54             ` Michael S. Tsirkin
2018-06-28  1:54               ` [virtio-dev] " Michael S. Tsirkin
2018-06-28  3:27               ` Venu Busireddy
2018-06-28  3:27                 ` [virtio-dev] " Venu Busireddy
2018-06-29 18:55                 ` [Qemu-devel] [virtio-dev] " Venu Busireddy
2018-06-29 18:55                   ` [virtio-dev] Re: [Qemu-devel] " Venu Busireddy
2018-06-29 21:59                   ` [Qemu-devel] [virtio-dev] " Michael S. Tsirkin
2018-06-29 21:59                     ` [virtio-dev] Re: [Qemu-devel] " Michael S. Tsirkin
2018-06-28 10:17     ` Roman Kagan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180627034935.20276-2-venu.busireddy@oracle.com \
    --to=venu.busireddy@oracle.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virtio-dev@lists.oasis-open.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.