From patchwork Mon Dec 19 22:46:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ben@skyportsystems.com X-Patchwork-Id: 9480839 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 6C9C5606DB for ; Mon, 19 Dec 2016 22:50:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CD8B28391 for ; Mon, 19 Dec 2016 22:50:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FC14284EC; Mon, 19 Dec 2016 22:50:02 +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=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 9C84328391 for ; Mon, 19 Dec 2016 22:50:01 +0000 (UTC) Received: from localhost ([::1]:48120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ6kq-0007WW-KA for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Dec 2016 17:50:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ6hf-0004nx-H9 for qemu-devel@nongnu.org; Mon, 19 Dec 2016 17:46:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJ6hd-0008CH-VA for qemu-devel@nongnu.org; Mon, 19 Dec 2016 17:46:43 -0500 Received: from mail-it0-x22d.google.com ([2607:f8b0:4001:c0b::22d]:36963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJ6hd-0008C2-Pw for qemu-devel@nongnu.org; Mon, 19 Dec 2016 17:46:41 -0500 Received: by mail-it0-x22d.google.com with SMTP id y23so96660576itc.0 for ; Mon, 19 Dec 2016 14:46:41 -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=t1QiUmSnVvoHiJwKRiKphTo0Y5MU0mkcWrr/0ZsHUhQ=; b=e/5qNKBOSvzGTB9m0VSDSg7/BhRF+5XwjMGKcW0Br6EMQresmSyg7j70LqH/oeZ5z6 98XUZ4NX4viq+VWD1q/K1K3+18hZn9rytDCUlUkwES92y5aQjE3f7X0X10mUmDi9VRgu mlB0VFhX8XXMKrRkTFUwNCMD/lWt24BddaPnk= 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=t1QiUmSnVvoHiJwKRiKphTo0Y5MU0mkcWrr/0ZsHUhQ=; b=dYVGeA2q/fL2C9NR29hOQuSJxYIaou3aMFNI9mmBvfKn5Doh93hPCCdYn9EJGJpDXu 3wNhvuftLVB4FKppP9XQb/wbcXKV+YHtzVdJq1HYvpi/wWakfUtbK082ZDgn1su8CdnU Q4qHOIXZJq3IIPWtGD+qcINQTqYPIPt2RaGg+9guTKQX85nGq+v44ta6jysa9zuI0Ggo YbQ18qVH0X1YNsEvWJt3KZ8WSbFMY7Ehjqir9Qrelc545Ppu562jocv/gLK339ZF5G0k VgxNm50j4rcnge9g0Mz3M/VG6NAlmWKtBFZkLr4kfDL932hxgnNAL+pPbDVesJitrl4x 0xHg== X-Gm-Message-State: AKaTC01wZtvVfTeaV3Fw3zU0txoUPEbcOFj3y8mXBlIWiYW7dR6kNeBYEEPnpGg375gYIl5h X-Received: by 10.36.19.67 with SMTP id 64mr18174458itz.120.1482187601145; Mon, 19 Dec 2016 14:46:41 -0800 (PST) Received: from Arrow.corp.skyportsystems.com (67-207-112-138.static.wiline.com. [67.207.112.138]) by smtp.gmail.com with ESMTPSA id p20sm7773759itc.8.2016.12.19.14.46.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 19 Dec 2016 14:46:40 -0800 (PST) From: ben@skyportsystems.com To: qemu-devel@nongnu.org Date: Mon, 19 Dec 2016 14:46:33 -0800 Message-Id: <1d3de728e42cfeda1820d4249a874752a769d99a.1482187052.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:4001:c0b::22d Subject: [Qemu-devel] [PATCH 4/5] qmp/hmp: add query-vm-generation-id and 'info 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mammedov Add commands to query Virtual Machine Generation ID counter. QMP command example: { "execute": "query-vm-generation-id" } HMP command example: info vm-generation-id Signed-off-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Ben Warren --- hmp-commands-info.hx | 13 +++++++++++++ hmp.c | 9 +++++++++ hmp.h | 1 + qapi-schema.json | 20 ++++++++++++++++++++ stubs/Makefile.objs | 1 + stubs/vmgenid.c | 8 ++++++++ 6 files changed, 52 insertions(+) create mode 100644 stubs/vmgenid.c diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 55d50c4..b0bb052 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -802,6 +802,19 @@ Show information about hotpluggable CPUs ETEXI STEXI +@item info vm-generation-id +Show Virtual Machine Generation ID +ETEXI + + { + .name = "vm-generation-id", + .args_type = "", + .params = "", + .help = "Show Virtual Machine Generation ID", + .cmd = hmp_info_vm_generation_id, + }, + +STEXI @end table ETEXI diff --git a/hmp.c b/hmp.c index b869617..9ec27ae 100644 --- a/hmp.c +++ b/hmp.c @@ -2570,3 +2570,12 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) qapi_free_HotpluggableCPUList(saved); } + +void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict) +{ + GuidInfo *info = qmp_query_vm_generation_id(NULL); + if (info) { + monitor_printf(mon, "%s\n", info->guid); + } + qapi_free_GuidInfo(info); +} diff --git a/hmp.h b/hmp.h index 05daf7c..799fd37 100644 --- a/hmp.h +++ b/hmp.h @@ -137,5 +137,6 @@ void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict); 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); #endif diff --git a/qapi-schema.json b/qapi-schema.json index a0d3b5d..2348391 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4776,3 +4776,23 @@ # Since: 2.7 ## { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] } + +## +# @GuidInfo: +# +# GUID information. +# +# @guid: the globally unique identifier +# +# Since: 2.9 +## +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } + +## +# @query-vm-generation-id +# +# Show Virtual Machine Generation ID +# +# Since 2.9 +## +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 2b5bb74..988d5d7 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -50,3 +50,4 @@ stub-obj-y += smbios_type_38.o stub-obj-y += ipmi.o stub-obj-y += pc_madt_cpu_entry.o stub-obj-y += migration-colo.o +stub-obj-y += vmgenid.o diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c new file mode 100644 index 0000000..8c448ac --- /dev/null +++ b/stubs/vmgenid.c @@ -0,0 +1,8 @@ +#include "qemu/osdep.h" +#include "qmp-commands.h" + +GuidInfo *qmp_query_vm_generation_id(Error **errp) +{ + error_setg(errp, "this command is not currently supported"); + return NULL; +}