From patchwork Mon Nov 27 13:05:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10076855 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 DBD8660353 for ; Mon, 27 Nov 2017 13:06:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA63628AFD for ; Mon, 27 Nov 2017 13:06:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF12128DAC; Mon, 27 Nov 2017 13:06:46 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 55F0A28AFD for ; Mon, 27 Nov 2017 13:06:46 +0000 (UTC) Received: from localhost ([::1]:60845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJJ7V-0004aZ-Jd for patchwork-qemu-devel@patchwork.kernel.org; Mon, 27 Nov 2017 08:06:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJJ6N-0004XY-Br for qemu-devel@nongnu.org; Mon, 27 Nov 2017 08:05:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJJ6L-00019c-42 for qemu-devel@nongnu.org; Mon, 27 Nov 2017 08:05:35 -0500 Received: from mail-eopbgr20114.outbound.protection.outlook.com ([40.107.2.114]:24928 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJJ6K-00017r-S8 for qemu-devel@nongnu.org; Mon, 27 Nov 2017 08:05:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SMcSbmzVSqSoO+9WPbdT5TVIMT10k8oxn7Boh7Yva4Q=; b=WhL54n4VnIGS4UF8ZBVKJ00XtjrvimXePT+IVJ5tboNFe2HSlBTD7PpsOUKVDBM3xcHvlddxE5XgG+xRI5gNDTbr90nHcZcKNFpfWqqHkiwt5MRUShq5UZUsMN9g72ScoCveLw3VsUKwf7SeZcRBK9pncJzs7gNQ2J3JV+tez10= Received: from rkaganb.sw.ru (195.214.232.6) by VI1PR08MB0845.eurprd08.prod.outlook.com (2a01:111:e400:5a05::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Mon, 27 Nov 2017 13:05:30 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ben Warren Date: Mon, 27 Nov 2017 16:05:18 +0300 Message-Id: <20171127130518.26703-3-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171127130518.26703-1-rkagan@virtuozzo.com> References: <20171127130518.26703-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR0202CA0007.eurprd02.prod.outlook.com (2603:10a6:4:29::17) To VI1PR08MB0845.eurprd08.prod.outlook.com (2a01:111:e400:5a05::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e0a1b1a-7bd4-4a53-9825-08d535978a0b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603258); SRVR:VI1PR08MB0845; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0845; 3:W80O/nZJU3ZxdOzmwdFMWDlKQ3PlVqJcpV9Il9gGUnlgGXwHgfp2/mz2C4MDu/bgflYi8NKGZ1V0NxqC8rzuJAS/X6VlnOvV9eHWM5ptUKE/mFtdKc88NBI1zl2MBmiLJjOYEJ2+SwSjfg6FCLvJhePvOkn12CKF9uysq6sz2hGBihXxHcAxYZPZvjjdX1YehJufRlURI9Mifqdw8X+JxDNRv/J12Fbo1g15vsyc71iyb0j2zZPhOPkNV5o23hIe; 25:eMyLrZxS88mwknW0PftkAniwrFG3MlzYsxwWsxTixdYR95AYrN40ZtaGxdIvtvdFVLIHNRiqDePLgmSeTtqK7kaIeikQFNiq49Zm6nXuSS+TUC4P9Ekf1ODUDx4Ir95svup0n/FB1nIvmuP8kblKlE+XyGLWL4nqIVbqEQMnM9jOmt68lZ5JPKdprh+p29HeGSL7nYvwGzZPIk6TvZ1W229T/6wrNQWZEFnBkkPRPA3MPx2hFJ3+MERAyV//s7ZclG4YNPerJ4B3rkrsgxha9eN55bn6rZ74PoSe8ZMS9AAUUM52iWOfkTymgd0MeDDre9WdmkzH+COIeKjcKPagoA==; 31:wLMDyFGPO9RrVXrndLt99ZzyhN8jaSs1CEVywLikX0iQR5poEIHOTeJmKRNd2NCU9AQzXIXAPTPik4KHONS2+sF3bhzIg+0/9ElQPuzu/fIFoz4GRDgC/ndAW+FEIxwOk1ZPx8fcHDXx5BaoGTe1Cbtx3uFp44oW7i3xi2zRRo9NEguzxiYVat/mGe6INZ4zgDfkUK1qlFn69VMPTLkPLAGo7SuvdMv0IztJIUJREUw= X-MS-TrafficTypeDiagnostic: VI1PR08MB0845: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0845; 20:Ks1a3/oNQLA7kMSLN4lf8t45K8NquOykzG9ERxDwz2bkl5HA/GQh02oMeJZxisdfLfof0i3sVlAYrpuXlChPxKj9eI8SVjcQ6bFPN84mg0Z/S7Xx3fQx6+M3xLXfbLo0OVXr8eS3YPX871qALW+sYP1Q5vDzabZURPyG2U/tFvLX1hhMdfdcds4k6tu1nAcwqpD29+wyD1lbPxzvEwMCtbA7u3eBztWOz5KeFlXUgcLZzhjU9PJ27FSDZIZG7M4U9VitfwfDL9Bq2ZDms742uRNwhaLpLKwKHvaA/Bhr+j98Bju7St8QREHSo9GdPsWVNCeMXjbRmt9duI3GDYGoEYgYsoqLPjEgnqvyzrRNzG1+XrOL6KdZjSO0CfPdfuJK6/r33WtEtGXlgqrCqsU4LgI+V45wRfLq3QJkF0laZOU=; 4:YR3j1pUOVNEp0AsNjvsQL4YQLdq76mSSGaHmTGhHu+hrYczl0+EnSsZX+6ELrIozjJNYszNwrimN+hCgv47Hkj/WDzUzd9300+yV/7mgwxve6/aJhr5dkd8sSfZ85/eQ4yOl6SNrecublOKJgP4aMLEFO9qiyD7qC+th0RgrolqwlJHwNYLw9JeapuLHQtBmWxS+opjDjhb2O8/LZiOEJjcaGt2GLhKwBhCJssBf5ny1vn+3icSTaQ5naow35NWA4O1T60vz5Ivg3JwYaIajoA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231022)(6041248)(20161123555025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR08MB0845; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR08MB0845; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(366004)(346002)(376002)(39830400002)(189002)(199003)(8936002)(7736002)(305945005)(478600001)(54906003)(110136005)(86362001)(6666003)(2950100002)(33646002)(8676002)(81166006)(316002)(81156014)(16526018)(69596002)(6506006)(50226002)(55236003)(6486002)(25786009)(52116002)(68736007)(50466002)(97736004)(36756003)(51416003)(105586002)(2906002)(101416001)(53416004)(76176999)(50986999)(3846002)(6116002)(1076002)(6512007)(47776003)(106356001)(16586007)(48376002)(189998001)(53936002)(4326008)(66066001)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR08MB0845; H:rkaganb.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR08MB0845; 23:NhD1yf7eB9/RuiniDz9WKcFDX/6k93ttuTWnTnO2M?= =?us-ascii?Q?+K2TojIv9bL5/++9DdkIHNx7VckZuXxdSV8nqt91nKNUKzPYyl4nBl671f14?= =?us-ascii?Q?KhWp4zUpGta8TzHSWTZyOhBtbg/x+Nt89mVrz0ioctnW+LiUA5wEozC2fMYo?= =?us-ascii?Q?ak6Lg3XhmRNufRdj/EV5Etl1AfVWEuWeSqSODFaNSqroyudEVumRNJOzO7gm?= =?us-ascii?Q?wF40Ii7QWZs/jH1gIeDcaJYwJZSN6fxjrPafzkph6v2gczxp3PtLQgS581WM?= =?us-ascii?Q?7+xY1hGiWi47CzcSj/z+CqFLM32hTLOLPFDCunlw3DTPZoULWrOaeGlNUb4f?= =?us-ascii?Q?Y7SqcHuz5bEoAyzxLGftYjychlWkA9JrqrD2Q3q/I0oT2rkbZGgP9EXBjmfe?= =?us-ascii?Q?BoE9eaVdkysTZ/uD22lWDFwBH9kgyMh1vdAcOYlm/UvqNrc5FQzGyKye3T1Q?= =?us-ascii?Q?y7SWwEZIS3bwf93VLTqClkXQoofhVef+KrJGiw7x5glSbw2t03CyvE2jaP6h?= =?us-ascii?Q?JNFOwm1LyuysnNOuv29QQ83TkUVp6NTik9/165RebVJI2TG0e0ZFGNGLphqK?= =?us-ascii?Q?AhUrLALRLSEXMJv/oFcrmzy1Nas8VANEEx5Lw800l8IIZ6Q2UjsG4w3TQ0RE?= =?us-ascii?Q?DuBvezEEKSfoySg5e3QgwFXp4fhj9e5wDV54BwndiF4uWhOTx7PAPaWG1oQ8?= =?us-ascii?Q?6iqFOQsO3iRNpLyL7PaM/fJm0j+9s2UslHVLAmgDilDK2CeTnu7Hor8Tb0Pz?= =?us-ascii?Q?9ykKuePGiYxGsImFRfeFxvmQNJSbAzAPOGgZ+2vTg2dFTgs0Q9SpnoyY+4sf?= =?us-ascii?Q?UAYV85oJazbvGnINQ+eAp+qIe5Ag2ujzybhz49erAWzoI548gfYVwviiL6If?= =?us-ascii?Q?U6UAsGRB3lowh4W5QWTC2h3flBF9d9ldypOPtYCLcRmu5eTjUwuEV6cydkWB?= =?us-ascii?Q?wupVjDLki5Ymtk91+StaTHxVW50/I8gbJAJjTNJpR4AsYR/Sjowp3kleVtgr?= =?us-ascii?Q?PTtNOo2DHoqY9qOILqC3uAV7aJ9JcMeyOUjveZMK8p/CwRHT1yA5oApPXGbD?= =?us-ascii?Q?LjXD/z4nbqZoT+ftY/QLV08+/3vpZNbCJ5J5qilW3x3dqCZvz+153oD00FCd?= =?us-ascii?Q?JtjgYLffpoB//SENF8++CdLQmF8jO9/0RFM0CCTmpy6XuUa5r65cdpC6clMR?= =?us-ascii?Q?z5zI2NSxSZZmGdUDYXuI/MCUPM1oleWcS5MGqhE5LZ01/+G02HwLzQo4Q=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0845; 6:Q616fyLdB2QGJBSLYuK9aXUwWbbJ67UvtLoUnQFwgBoy2l0rLs3on3cRnYgeJOrEK1GJs62JcpX8L0+AHh9iloLkss+yOdbIwZ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o.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2017 13:05:30.4361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e0a1b1a-7bd4-4a53-9825-08d535978a0b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0845 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.2.114 Subject: [Qemu-devel] [PATCH v2 2/2] vmgenid: use UUID property type 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , minyard@acm.org, "Denis V. Lunev" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Switch vmgenid device to use the UUID property type introduced in the previous patch for its 'guid' property. One semantic change it introduces is that post-realize modification of 'guid' via HMP or QMP will now be rejected with an error; however, according to docs/specs/vmgenid.txt this is actually desirable. Signed-off-by: Roman Kagan Reviewed-by: Marc-André Lureau --- v1 -> v2: - use the corresponding define for "guid" field name hw/acpi/vmgenid.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 105044f666..ba6f47b67b 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -162,21 +162,6 @@ static void vmgenid_update_guest(VmGenIdState *vms) } } -static void vmgenid_set_guid(Object *obj, const char *value, Error **errp) -{ - VmGenIdState *vms = VMGENID(obj); - - if (!strcmp(value, "auto")) { - qemu_uuid_generate(&vms->guid); - } else if (qemu_uuid_parse(value, &vms->guid) < 0) { - error_setg(errp, "'%s. %s': Failed to parse GUID string: %s", - object_get_typename(OBJECT(vms)), VMGENID_GUID, value); - return; - } - - vmgenid_update_guest(vms); -} - /* After restoring an image, we need to update the guest memory and notify * it of a potential change to VM Generation ID */ @@ -224,23 +209,24 @@ static void vmgenid_realize(DeviceState *dev, Error **errp) } qemu_register_reset(vmgenid_handle_reset, vms); + + vmgenid_update_guest(vms); } +static Property vmgenid_device_properties[] = { + DEFINE_PROP_UUID(VMGENID_GUID, VmGenIdState, guid), + DEFINE_PROP_END_OF_LIST(), +}; + static void vmgenid_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_vmgenid; dc->realize = vmgenid_realize; + dc->props = vmgenid_device_properties; dc->hotpluggable = false; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - - object_class_property_add_str(klass, VMGENID_GUID, NULL, - vmgenid_set_guid, NULL); - object_class_property_set_description(klass, VMGENID_GUID, - "Set Global Unique Identifier " - "(big-endian) or auto for random value", - NULL); } static const TypeInfo vmgenid_device_info = {