From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y19kr-0007DT-NL for qemu-devel@nongnu.org; Wed, 17 Dec 2014 03:14:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y19kl-0008SM-Ho for qemu-devel@nongnu.org; Wed, 17 Dec 2014 03:14:45 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:32494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y19kk-0008FP-Ty for qemu-devel@nongnu.org; Wed, 17 Dec 2014 03:14:39 -0500 Message-ID: <54913AFB.2030906@huawei.com> Date: Wed, 17 Dec 2014 16:12:43 +0800 From: zhanghailiang MIME-Version: 1.0 References: <1418715038-4664-1-git-send-email-zhang.zhanghailiang@huawei.com> <54905CFE.3070805@redhat.com> In-Reply-To: <54905CFE.3070805@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: hangaohuai@huawei.com, lilei@linux.vnet.ibm.com, peter.huangpeng@huawei.com, lcapitulino@redhat.com, lersek@redhat.com, mdroth@linux.vnet.ibm.com 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