From patchwork Wed Jan 25 01:43:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ben@skyportsystems.com X-Patchwork-Id: 719481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v7SYT5x39z9t0p for ; Wed, 25 Jan 2017 12:45:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=skyportsystems.com header.i=@skyportsystems.com header.b="5vJitjpD"; dkim-atps=neutral Received: from localhost ([::1]:56745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWCeR-0004u7-Aq for incoming@patchwork.ozlabs.org; Tue, 24 Jan 2017 20:45:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWCcy-0003hX-8j for qemu-devel@nongnu.org; Tue, 24 Jan 2017 20:44:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWCcx-0005OD-ET for qemu-devel@nongnu.org; Tue, 24 Jan 2017 20:44:00 -0500 Received: from mail-yw0-x232.google.com ([2607:f8b0:4002:c05::232]:32968) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWCcx-0005O8-Aj for qemu-devel@nongnu.org; Tue, 24 Jan 2017 20:43:59 -0500 Received: by mail-yw0-x232.google.com with SMTP id u68so3013435ywg.0 for ; Tue, 24 Jan 2017 17:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skyportsystems.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=EEc/ty4ZcEor3w3jf/h/SYzeCu4ytyy2mdiPgAmJ1O4=; b=5vJitjpDod5AiD6lgMyqaa3FU/z1v3oBlseMmBZayU1QNsTvJORIT6sSAZMmVcrf7K e9vz7E8o47ADxq1/94PwgG7JDFv6llQxyWRCMj6EO0b/8CD6bFKhwOmu2wuLnAecfI3D zKtvU58UZTFG3/kr8REHqBgPrfeVAcDHGFzyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=EEc/ty4ZcEor3w3jf/h/SYzeCu4ytyy2mdiPgAmJ1O4=; b=VArrXu2sz8i5X/Pc+hCnGZaGwQNzDffM54BF/RQOWV8ciQ/1ZzLNErUf5Z8/g45PCM hLBsJEiuTRR61EUl+nFoQ6z54LwQ+r3KT1fUTRy1ACsvdTGaz9a+r9RxB+ydP+sMiGF1 CSQy6ZDNFe/RFhxPbkyvefDGk0I7gHNz2DUHyE+RCi5FnIjrNS3OFTEQNF8Yumz2h1JK 7cO5AwuhvL08ibc/vHGY+SV4EPoRhozTlY9X3cbnVj+RxgXyLEOZtTTUFrnPGVlPm4/e 9VNJJxb1yDCryX/tWl0lCU2ugLrcKXUTqdz14kuJOpfT1VJosj50gN36kZBRo7cam9+1 rqBA== X-Gm-Message-State: AIkVDXInfykey0P3A8xfC7Xrcuxxda6fB1iarePzcWdtUr1ZKLFT0kSCQCmRZQQfxGaP7eey X-Received: by 10.129.173.10 with SMTP id l10mr28479558ywh.175.1485308638708; Tue, 24 Jan 2017 17:43:58 -0800 (PST) Received: from Arrow.corp.skyportsystems.com (162-199-88-38.lightspeed.sntcca.sbcglobal.net. [162.199.88.38]) by smtp.gmail.com with ESMTPSA id w126sm10757317yww.41.2017.01.24.17.43.57 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Jan 2017 17:43:58 -0800 (PST) From: ben@skyportsystems.com To: qemu-devel@nongnu.org Date: Tue, 24 Jan 2017 17:43:25 -0800 Message-Id: <3bce614f2babb3b4d3c7d9446223c389a28d1080.1485308342.git.ben@skyportsystems.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::232 Subject: [Qemu-devel] [PATCH v4 6/9] qmp/hmp: add set-vm-generation-id commands 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: Igor Mammedov , Ben Warren Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Add set-vm-generation-id command to set Virtual Machine Generation ID counter. QMP command example: { "execute": "set-vm-generation-id", "arguments": { "guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" } } HMP command example: set-vm-generation-id guid=324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87 Signed-off-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Ben Warren --- hmp-commands.hx | 13 +++++++++++++ hmp.c | 12 ++++++++++++ hmp.h | 1 + qapi-schema.json | 11 +++++++++++ stubs/vmgenid.c | 6 ++++++ 5 files changed, 43 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8819281..56744aa 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1775,5 +1775,18 @@ ETEXI }, STEXI +@item set-vm-generation-id @var{uuid} +Set Virtual Machine Generation ID counter to @var{guid} +ETEXI + + { + .name = "set-vm-generation-id", + .args_type = "guid:s", + .params = "guid", + .help = "Set Virtual Machine Generation ID counter", + .cmd = hmp_set_vm_generation_id, + }, + +STEXI @end table ETEXI diff --git a/hmp.c b/hmp.c index c2280e0..3a4db8b 100644 --- a/hmp.c +++ b/hmp.c @@ -2573,3 +2573,15 @@ void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict) } qapi_free_GuidInfo(info); } + +void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict) +{ + Error *errp = NULL; + const char *guid = qdict_get_str(qdict, "guid"); + + qmp_set_vm_generation_id(guid, &errp); + if (errp) { + hmp_handle_error(mon, &errp); + return; + } +} diff --git a/hmp.h b/hmp.h index 799fd37..e0ac1e8 100644 --- a/hmp.h +++ b/hmp.h @@ -138,5 +138,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict); void hmp_info_dump(Monitor *mon, const QDict *qdict); void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict); void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict); +void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict); #endif diff --git a/qapi-schema.json b/qapi-schema.json index 413ac52..e2ed75c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -6046,3 +6046,14 @@ # Since 2.9 ## { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } + +## +# @set-vm-generation-id: +# +# Set Virtual Machine Generation ID +# +# @guid: new GUID to set as Virtual Machine Generation ID +# +# Since 2.9 +## +{ 'command': 'set-vm-generation-id', 'data': {'guid': 'str'} } diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c index 8c448ac..d25d41b 100644 --- a/stubs/vmgenid.c +++ b/stubs/vmgenid.c @@ -6,3 +6,9 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp) error_setg(errp, "this command is not currently supported"); return NULL; } + +void qmp_set_vm_generation_id(const char *guid, Error **errp) +{ + error_setg(errp, "this command is not currently supported"); + return; +}