From patchwork Wed Jun 27 03:49:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 10490459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CA3860375 for ; Wed, 27 Jun 2018 03:51:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D7AB1FFB2 for ; Wed, 27 Jun 2018 03:51:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F212520182; Wed, 27 Jun 2018 03:51:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8180E1FFB2 for ; Wed, 27 Jun 2018 03:51:13 +0000 (UTC) Received: from localhost ([::1]:56321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fY1U8-0007ZY-1B for patchwork-qemu-devel@patchwork.kernel.org; Tue, 26 Jun 2018 23:51:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fY1Su-0006eN-9p for qemu-devel@nongnu.org; Tue, 26 Jun 2018 23:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fY1Sr-00061a-6r for qemu-devel@nongnu.org; Tue, 26 Jun 2018 23:49:56 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:59414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fY1Sq-0005wt-Th for qemu-devel@nongnu.org; Tue, 26 Jun 2018 23:49:53 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5R3mwSf074521; Wed, 27 Jun 2018 03:49:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=tiIYSssSEiM69+O27q16WonleeIxnikCjunTkJg7fEQ=; b=Qtv9Qs45LDqKXhd5z6kg9g+lRn2Vrah/OmlAaAqej6h4jMxT4YI6PWkDdVCfBYej/cZ/ qQ3ZjQtlQLPminqTFN1WZk0F2FedRlpduN4eObBEGeIeoZkrHzgsAO4+Clw/RofIg1ou FKBw+3T447m1bV8S9KOgCZnrFvor+boouKKZ6HO2k3WPOeq4I7j6/cLtE4r+j5Z3BevH DS9tJq1WXaHVn4NPUPOj3FHzNulfv8P6MI+X9nVD5oU/XQHj3Ufn6IriyOyzEldrkoSo kK9322TeJGTR5JGJ5A6ieJLtkJFXtML1sfQfkEMHQLdlsjO7B4pFRPLGckeHuONzyeYn YA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2jukmtu4r7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Jun 2018 03:49:49 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5R3nn6h011862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Jun 2018 03:49:49 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5R3nmXX019323; Wed, 27 Jun 2018 03:49:48 GMT Received: from troi.attlocal.net (/10.154.103.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Jun 2018 20:49:48 -0700 From: Venu Busireddy To: venu.busireddy@oracle.com, "Michael S . Tsirkin" , Marcel Apfelbaum Date: Tue, 26 Jun 2018 22:49:31 -0500 Message-Id: <20180627034935.20276-2-venu.busireddy@oracle.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180627034935.20276-1-venu.busireddy@oracle.com> References: <20180627034935.20276-1-venu.busireddy@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8936 signatures=668703 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806270042 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [PATCH v2 1/4] Add a true or false option to the DEFINE_PROP_UUID macro. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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() \