From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeUFy-0002Fh-2O for qemu-devel@nongnu.org; Tue, 22 Sep 2015 16:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeUFx-0006ew-3g for qemu-devel@nongnu.org; Tue, 22 Sep 2015 16:33:41 -0400 References: <1442952987-20187-1-git-send-email-ehabkost@redhat.com> <1442952987-20187-4-git-send-email-ehabkost@redhat.com> From: Laszlo Ersek Message-ID: <5601BB1C.4040406@redhat.com> Date: Tue, 22 Sep 2015 22:33:32 +0200 MIME-Version: 1.0 In-Reply-To: <1442952987-20187-4-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , Marcel Apfelbaum , Hannes Reinecke , qemu-block@nongnu.org, "Michael S. Tsirkin" On 09/22/15 22:16, Eduardo Habkost wrote: > Guest visible data shouldn't change with a simple QEMU upgrade, so use > qemu_hw_version() to ensure it won't change (as long as the machine > class being used has hw_version set). > > Cc: Hannes Reinecke > Cc: Paolo Bonzini > Cc: qemu-block@nongnu.org > Signed-off-by: Eduardo Habkost > --- > hw/scsi/megasas.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c > index a04369c..e0529b1 100644 > --- a/hw/scsi/megasas.c > +++ b/hw/scsi/megasas.c > @@ -757,7 +757,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) > > memcpy(info.product_name, base_class->product_name, 24); > snprintf(info.serial_number, 32, "%s", s->hba_serial); > - snprintf(info.package_version, 0x60, "%s-QEMU", QEMU_VERSION); > + snprintf(info.package_version, 0x60, "%s-QEMU", qemu_hw_version()); > memcpy(info.image_component[0].name, "APP", 3); > snprintf(info.image_component[0].version, 10, "%s-QEMU", > base_class->product_version); > I assume you audited all uses of QEMU_VERSION, and this was the only one exposed to the guest directly. However, in "hw/usb/redirect.c", QEMU_VERSION is embedded in VERSION, and the latter is then passed to usbredirparser_init() in usbredir_create_parser(). I tried to look up the documentation for usbredirparser_init() in "/usr/include/usbredirparser.h", but I still have no clue what that "version" parameter controls. Hm... from the source code of usbredir, and stating "usbredir is the name of a network protocol for sending usb device traffic over a network connection", it looks like the version number is embedded in the hello message of that network protocol; so it shouldn't be exposed to the guest indeed. Acked-by: Laszlo Ersek Thanks Laszlo