From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0mdP-0001eH-Bc for qemu-devel@nongnu.org; Tue, 16 Dec 2014 02:33:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0mdK-0002Xn-I2 for qemu-devel@nongnu.org; Tue, 16 Dec 2014 02:33:31 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:15219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0mdJ-0002WU-Kv for qemu-devel@nongnu.org; Tue, 16 Dec 2014 02:33:26 -0500 From: zhanghailiang Date: Tue, 16 Dec 2014 15:30:37 +0800 Message-ID: <1418715038-4664-2-git-send-email-zhang.zhanghailiang@huawei.com> In-Reply-To: <1418715038-4664-1-git-send-email-zhang.zhanghailiang@huawei.com> References: <1418715038-4664-1-git-send-email-zhang.zhanghailiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH 1/2] qga: Introduce guest-get-os-version command with stubs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zhanghailiang , peter.huangpeng@huawei.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, lersek@redhat.com, lilei@linux.vnet.ibm.com Signed-off-by: zhanghailiang --- qga/commands-posix.c | 7 +++++++ qga/commands-win32.c | 6 ++++++ qga/qapi-schema.json | 26 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index f6f3e3c..b4d5c29 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -1912,6 +1912,12 @@ int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp) #endif +struct GuestOSVersion *qmp_guest_get_os_version(Error **errp) +{ + error_set(errp, QERR_UNSUPPORTED); + return NULL; +} + #if !defined(CONFIG_FSFREEZE) GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp) @@ -1993,6 +1999,7 @@ GList *ga_command_blacklist_init(GList *blacklist) blacklist = g_list_append(blacklist, (char *)"guest-fstrim"); #endif + blacklist = g_list_append(blacklist, (char *)"guest-get-os-version"); return blacklist; } diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 3bcbeae..d133082 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -446,6 +446,12 @@ int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp) return -1; } +struct GuestOSVersion *qmp_guest_get_os_version(Error **errp) +{ + error_set(errp, QERR_UNSUPPORTED); + return NULL; +} + /* add unsupported commands to the blacklist */ GList *ga_command_blacklist_init(GList *blacklist) { diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 376e79f..f94404d 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -738,3 +738,29 @@ ## { 'command': 'guest-get-fsinfo', 'returns': ['GuestFilesystemInfo'] } +## +# @GuestOSVersion: +# +# @name: system version. +# +# @:type: 64-bit or 32-bit. +# +# Since: 2.3 +## +{ 'type': 'GuestOSVersion', + 'data': {'name': 'str', 'type': 'int'} } + +## +# @guest-get-os-version: +# +# Get the guest's operating system version and bit. +# +# This is a read-only operation. +# +# Returns: version +# +# Since: 2.3 +## +{ 'command': 'guest-get-os-version', + 'returns': 'GuestOSVersion' } + -- 1.7.12.4