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 1/3] Add a true or false option to the DEFINE_PROP_UUID macro.
Date: Tue, 19 Jun 2018 11:32:25 -0500 [thread overview]
Message-ID: <20180619163228.13790-2-venu.busireddy@oracle.com> (raw)
In-Reply-To: <20180619163228.13790-1-venu.busireddy@oracle.com>
It may not always be desirable to have a random UUID stuffed into the
'_field' member. Add a new option '_default' to the macro, 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() \
next prev parent reply other threads:[~2018-06-19 16:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-19 16:32 [Qemu-devel] [PATCH 0/3] Use of unique identifier for pairing virtio and passthrough devices Venu Busireddy
2018-06-19 16:32 ` Venu Busireddy [this message]
2018-06-19 16:32 ` [Qemu-devel] [PATCH 2/3] Add "Group Identifier" support to PCIe bridges Venu Busireddy
2018-06-19 17:24 ` Michael S. Tsirkin
2018-06-19 18:14 ` [Qemu-devel] [virtio-dev] " Venu Busireddy
2018-06-19 18:21 ` Michael S. Tsirkin
2018-06-19 18:36 ` Venu Busireddy
2018-06-19 18:53 ` Michael S. Tsirkin
2018-06-19 19:02 ` Venu Busireddy
2018-06-19 19:10 ` Michael S. Tsirkin
2018-06-19 16:32 ` [Qemu-devel] [PATCH 3/3] Add "Group Identifier" support to virtio devices Venu Busireddy
2018-06-19 16:32 ` [Qemu-devel] [PATCH virtio 1/1] Add "Group Identifier" support to virtio PCI capabilities Venu Busireddy
2018-06-19 17:30 ` Michael S. Tsirkin
2018-06-19 17:54 ` [Qemu-devel] [virtio-dev] " Venu Busireddy
2018-06-19 18:12 ` Michael S. Tsirkin
2018-06-19 18:18 ` Venu Busireddy
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=20180619163228.13790-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).