From patchwork Tue Jun 19 16:32:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 10475173 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 E6B18601D7 for ; Tue, 19 Jun 2018 17:39:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D642028B54 for ; Tue, 19 Jun 2018 17:39:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9BE428D30; Tue, 19 Jun 2018 17:39:59 +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 6E7EE28B54 for ; Tue, 19 Jun 2018 17:39:59 +0000 (UTC) Received: from localhost ([::1]:44101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVKbm-00005r-No for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jun 2018 13:39:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVJYw-0004NA-2L for qemu-devel@nongnu.org; Tue, 19 Jun 2018 12:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVJYr-0002WZ-5s for qemu-devel@nongnu.org; Tue, 19 Jun 2018 12:32:58 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:40262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fVJYq-0002V7-U3 for qemu-devel@nongnu.org; Tue, 19 Jun 2018 12:32:53 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5JGTH5l037326; Tue, 19 Jun 2018 16:32:51 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=HbvTfZA7anu8+VdsXzTl/GpfQOo++KIboOUh2squQCo=; b=Mg0pLF+Yj03ComaYUDZnZ3HQ0rmEuUcYxfYtQhMwJ+iNNofUO4KTbVqKFgMkmz5wcnTY lS8VH05xSE/m1OzILtbjjy3HcK9KF6C7CkZUkvSzxp6Y6hDYJxyuvU6eZ+YGSNmev991 Ks7n6H5qi71RA7/asr5JDyEUGNcJuKLoRL1dNQK3s4RahiEk/C7iPhGLZ7s61YYY8ZwW qYQLwQMAizHWllr5543DWOehstn4mn36aoom4vowH2gfj1Ewi/H4PiQ5EIDX+zAgNhzW 3OOthOCLeWWn2Pch6z7+Mrtt4P5W117CB/owC66p38nY5KKHCVbVMzm1bIiGwx/ShF8Y Fg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2jmu6xrxnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jun 2018 16:32:51 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w5JGWouY019809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jun 2018 16:32:50 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5JGWnd6011482; Tue, 19 Jun 2018 16:32:49 GMT Received: from localhost.localdomain (/10.159.242.141) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Jun 2018 09:32:49 -0700 From: Venu Busireddy To: venu.busireddy@oracle.com, "Michael S . Tsirkin" , Marcel Apfelbaum Date: Tue, 19 Jun 2018 11:32:25 -0500 Message-Id: <20180619163228.13790-2-venu.busireddy@oracle.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180619163228.13790-1-venu.busireddy@oracle.com> References: <20180619163228.13790-1-venu.busireddy@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8929 signatures=668702 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-1805220000 definitions=main-1806190182 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 X-Mailman-Approved-At: Tue, 19 Jun 2018 13:31:57 -0400 Subject: [Qemu-devel] [PATCH 1/3] 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 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 --- 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() \