All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Huang Yong <huang.yong@zte.com.cn>, mdroth@linux.vnet.ibm.com
Cc: qemu-devel@nongnu.org,
	Vinzenz 'evilissimo' Feenstra <vfeenstr@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] QEMU Guest Agent: Add an interface to determine guest os type
Date: Wed, 12 Apr 2017 11:28:24 +0000	[thread overview]
Message-ID: <CAJ+F1CLukvP9EcdJXBGcBuNhfYAs3EBe_4cLbcdJx2N-xxQdfg@mail.gmail.com> (raw)
In-Reply-To: <1491995456-6411-1-git-send-email-huang.yong@zte.com.cn>

Hi

On Wed, Apr 12, 2017 at 1:12 PM Huang Yong <huang.yong@zte.com.cn> wrote:

> vm management tools (e.g.libvirt) may tell if guest os is linux or windows,
> so they can design a customized application accordingly, we suggest to add
> an interface (guest-ostype) in QEMU.
>

This proposal is probably redundant with "qemu-ga: add guest-get-osrelease
command" http://patchew.org/QEMU/20170331101947.2046-2-vfeenstr@redhat.com



> Signed-off-by: Huang Yong <huang.yong@zte.com.cn>
> ---
>  qga/commands-posix.c | 10 ++++++++++
>  qga/commands-win32.c | 10 ++++++++++
>  qga/qapi-schema.json | 12 ++++++++++++
>  3 files changed, 32 insertions(+)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 915df9e..24ec2b6 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -49,6 +49,11 @@ extern char **environ;
>  #endif
>  #endif
>
> +typedef enum GuestArch {
> +    ARCH_WINDOWS = 0,
> +    ARCH_LINUX = 1,
> +} GuestArch;
> +
>  static void ga_wait_child(pid_t pid, int *status, Error **errp)
>  {
>      pid_t rpid;
> @@ -2470,6 +2475,11 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum,
> Error **errp)
>  }
>  #endif
>
> +int64_t qmp_guest_ostype(Error **errp)
> +{
> +    return ARCH_LINUX;
> +}
> +
>  /* add unsupported commands to the blacklist */
>  GList *ga_command_blacklist_init(GList *blacklist)
>  {
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index 19d72b2..a6639dd 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -58,6 +58,11 @@ static struct {
>      .filehandles = QTAILQ_HEAD_INITIALIZER(guest_file_state.filehandles),
>  };
>
> +typedef enum GuestArch {
> +    ARCH_WINDOWS = 0,
> +    ARCH_LINUX = 1,
> +} GuestArch;
> +
>  #define FILE_GENERIC_APPEND (FILE_GENERIC_WRITE & ~FILE_WRITE_DATA)
>
>  typedef struct OpenFlags {
> @@ -214,6 +219,11 @@ void qmp_guest_file_close(int64_t handle, Error
> **errp)
>      g_free(gfh);
>  }
>
> +int64_t qmp_guest_ostype(Error **errp)
> +{
> +    return ARCH_WINDOWS;
> +}
> +
>  static void acquire_privilege(const char *name, Error **errp)
>  {
>      HANDLE token = NULL;
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index a02dbf2..496ae55 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -26,6 +26,7 @@
>          'guest-get-time',
>          'guest-set-vcpus',
>          'guest-sync',
> +        'guest-ostype',
>          'guest-sync-delimited' ] } }
>
>  ##
> @@ -1042,3 +1043,14 @@
>    'data':    { 'path': 'str', '*arg': ['str'], '*env': ['str'],
>                 '*input-data': 'str', '*capture-output': 'bool' },
>    'returns': 'GuestExec' }
> +
> +##
> +# @guest-ostype:
> +#
> +# Get guest os type info
> +# Returns: os type, Linux/Windows
> +#
> +# Since: 2.5.0
> +##
> +{ 'command': 'guest-ostype',
> +  'returns': 'int' }
> --
> 1.8.3.1
>
>
>
> --
Marc-André Lureau

  reply	other threads:[~2017-04-12 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 11:10 [Qemu-devel] [PATCH] QEMU Guest Agent: Add an interface to determine guest os type Huang Yong
2017-04-12 11:28 ` Marc-André Lureau [this message]
2017-04-12 11:34   ` Vinzenz Feenstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ+F1CLukvP9EcdJXBGcBuNhfYAs3EBe_4cLbcdJx2N-xxQdfg@mail.gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=huang.yong@zte.com.cn \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vfeenstr@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.