Re: [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows

2014-12-17 Thread zhanghailiang

On 2014/12/17 0:25, Eric Blake wrote:

On 12/16/2014 12:30 AM, zhanghailiang wrote:

Hi,

This patch series add a new guest command 'guest-get-os-version'.
It is now only available for windows guest.


Why not also supply it for Linux guests?  uname() is your friend; it
should be fairly easy to wire up.



Er, this patch is RFC, i don't know if this idea (support get-os-version 
command) is acceptable,
I will add it in next formal version if it is acceptable. ;)



It will return guest's OS version name and type, like bellow:
'{return:{name:Microsoft Windows Server 2012 R2,type:64}}'

Sometimes we need to know guest's OS version info.
(Actually, we need this info when we update guest's applications and drivers
in our project.)


Have you looked into libguestfs' ability to get this information from an
(offline) guest image?  I'm not rejecting this command, but trying to
make sure that it is not duplicating something that can already be done.



I have look into libgustfs codes, and yes, it supports get this info from 
offline guest image,
but unfortunately we don't use libguestfs in our project.
(I also make a simple test to get proudct name by using
virt-inspector -d redhat-6.4  | virt-inspector --xpath '//product_name',
it is a little  time consuming (about 12s)).

So, what's your suggestion?

Thanks,
zhanghailiang




Re: [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows

2014-12-16 Thread Yan Vugenfirer
Hi,

My suggestion is to handle the case when the newer OS will be installed in the 
guest as well.

Please look at version helper API - 
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx 
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx
 
and keep in mind that the usual GetVersion and GetVersionEx (that returned 
major, minor versions and build number) will be deprecated or changed after 
Windows 8.1.

Thanks,
Yan.



 On Dec 16, 2014, at 9:30 AM, zhanghailiang zhang.zhanghaili...@huawei.com 
 wrote:
 
 Hi,
 
 This patch series add a new guest command 'guest-get-os-version'.
 It is now only available for windows guest.
 
 It will return guest's OS version name and type, like bellow:
 '{return:{name:Microsoft Windows Server 2012 R2,type:64}}'
 
 Sometimes we need to know guest's OS version info.
 (Actually, we need this info when we update guest's applications and drivers 
 in our project.)
 
 This patch is only RFC, it is another try to add more commands for qemu-ga.
 Though qemu-ga has supported some commands now, but it is not enough and some
 of them only support for linux ...
 
 I would like to enrich it, if someone think it is acceptable.
 
 So, any comments will be welcome! Thanks ;)
 
 zhanghailiang (2):
  qga: Introduce guest-get-os-version command with stubs
  qga: implement qmp_guest_get_os_version for windows
 
 qga/commands-posix.c |   7 +++
 qga/commands-win32.c | 125 +++
 qga/qapi-schema.json |  26 +++
 3 files changed, 158 insertions(+)
 
 -- 
 1.7.12.4
 
 
 



Re: [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows

2014-12-16 Thread zhanghailiang

On 2014/12/16 17:38, Yan Vugenfirer wrote:

Hi,

My suggestion is to handle the case when the newer OS will be installed in the 
guest as well.



Yes, we can do this when we install guest OS, save the version info into some 
places,
and get the info when we need, But it is not so flexible, especially when we 
manage the OS image directly,
we have to record the relationship between image name and its OS version, 
besides, we need to apply an API to
return image's OS version.

So IMHO, get the OS version info from guest and use qga command to get the info 
are more flexible and reliable.



Please look at version helper API - 
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx 
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx
and keep in mind that the usual GetVersion and GetVersionEx (that returned 
major, minor versions and build number) will be deprecated or changed after 
Windows 8.1.



Hmm, i noticed this ;), i have handle it specially for windows 8.1 in this 
patch.
We can still get its real version by other method.

And here i just add a framework for get-os-version, we can improve it when new 
OS comes out.

Thanks,
zhanghailiang





On Dec 16, 2014, at 9:30 AM, zhanghailiang zhang.zhanghaili...@huawei.com 
wrote:

Hi,

This patch series add a new guest command 'guest-get-os-version'.
It is now only available for windows guest.

It will return guest's OS version name and type, like bellow:
'{return:{name:Microsoft Windows Server 2012 R2,type:64}}'

Sometimes we need to know guest's OS version info.
(Actually, we need this info when we update guest's applications and drivers
in our project.)

This patch is only RFC, it is another try to add more commands for qemu-ga.
Though qemu-ga has supported some commands now, but it is not enough and some
of them only support for linux ...

I would like to enrich it, if someone think it is acceptable.

So, any comments will be welcome! Thanks ;)

zhanghailiang (2):
  qga: Introduce guest-get-os-version command with stubs
  qga: implement qmp_guest_get_os_version for windows

qga/commands-posix.c |   7 +++
qga/commands-win32.c | 125 +++
qga/qapi-schema.json |  26 +++
3 files changed, 158 insertions(+)

--
1.7.12.4












Re: [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows

2014-12-16 Thread Eric Blake
On 12/16/2014 12:30 AM, zhanghailiang wrote:
 Hi,
 
 This patch series add a new guest command 'guest-get-os-version'.
 It is now only available for windows guest.

Why not also supply it for Linux guests?  uname() is your friend; it
should be fairly easy to wire up.

 
 It will return guest's OS version name and type, like bellow:
 '{return:{name:Microsoft Windows Server 2012 R2,type:64}}'
 
 Sometimes we need to know guest's OS version info.
 (Actually, we need this info when we update guest's applications and drivers 
 in our project.)

Have you looked into libguestfs' ability to get this information from an
(offline) guest image?  I'm not rejecting this command, but trying to
make sure that it is not duplicating something that can already be done.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows

2014-12-15 Thread zhanghailiang
Hi,

This patch series add a new guest command 'guest-get-os-version'.
It is now only available for windows guest.

It will return guest's OS version name and type, like bellow:
'{return:{name:Microsoft Windows Server 2012 R2,type:64}}'

Sometimes we need to know guest's OS version info.
(Actually, we need this info when we update guest's applications and drivers 
in our project.)

This patch is only RFC, it is another try to add more commands for qemu-ga.
Though qemu-ga has supported some commands now, but it is not enough and some
of them only support for linux ...

I would like to enrich it, if someone think it is acceptable.

So, any comments will be welcome! Thanks ;)

zhanghailiang (2):
  qga: Introduce guest-get-os-version command with stubs
  qga: implement qmp_guest_get_os_version for windows

 qga/commands-posix.c |   7 +++
 qga/commands-win32.c | 125 +++
 qga/qapi-schema.json |  26 +++
 3 files changed, 158 insertions(+)

-- 
1.7.12.4