qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	Hannes Reinecke <hare@suse.de>,
	qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION
Date: Tue, 22 Sep 2015 22:33:32 +0200	[thread overview]
Message-ID: <5601BB1C.4040406@redhat.com> (raw)
In-Reply-To: <1442952987-20187-4-git-send-email-ehabkost@redhat.com>

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 <hare@suse.de>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: qemu-block@nongnu.org
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  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
<http://www.spice-space.org/page/UsbRedir> 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 <lersek@redhat.com>

Thanks
Laszlo

  parent reply	other threads:[~2015-09-22 20:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 20:16 [Qemu-devel] [PATCH 0/3] pc: Set hw_version on all machine classes Eduardo Habkost
2015-09-22 20:16 ` [Qemu-devel] [PATCH 1/3] " Eduardo Habkost
2015-09-22 20:26   ` Laszlo Ersek
2015-09-22 20:34     ` Eduardo Habkost
2015-09-22 20:16 ` [Qemu-devel] [PATCH 2/3] osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version() Eduardo Habkost
2015-09-22 20:21   ` John Snow
2015-09-22 20:16 ` [Qemu-devel] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION Eduardo Habkost
2015-09-22 20:21   ` Hannes Reinecke
2015-09-22 20:33   ` Laszlo Ersek [this message]
2015-09-22 20:36     ` Eduardo Habkost
2015-09-23  8:04 ` [Qemu-devel] [PATCH 0/3] pc: Set hw_version on all machine classes Igor Mammedov
2015-09-23 10:37   ` Laszlo Ersek
2015-09-23 11:47     ` Igor Mammedov
2015-09-23 12:31       ` Laszlo Ersek

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=5601BB1C.4040406@redhat.com \
    --to=lersek@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hare@suse.de \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).