From: "Daniel P. Berrange" <berrange@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Hannes Reinecke <hare@suse.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] scsi: Make LUN 0 a simple enclosure
Date: Thu, 3 Aug 2017 14:32:53 +0100 [thread overview]
Message-ID: <20170803133253.GF9141@redhat.com> (raw)
In-Reply-To: <1501766821-76419-2-git-send-email-hare@suse.de>
On Thu, Aug 03, 2017 at 03:27:00PM +0200, Hannes Reinecke wrote:
> Instead of having an 'invisible' LUN0 (in case LUN 0 is not connected)
> this patch maks LUN0 a enclosure service, exposing it to the OS.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> hw/scsi/scsi-bus.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 55 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
> index 23c51de..c89e82d 100644
> --- a/hw/scsi/scsi-bus.c
> +++ b/hw/scsi/scsi-bus.c
> @@ -493,10 +493,11 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r)
> if (r->req.lun != 0) {
> r->buf[0] = TYPE_NO_LUN;
> } else {
> - r->buf[0] = TYPE_NOT_PRESENT | TYPE_INACTIVE;
> + r->buf[0] = TYPE_ENCLOSURE;
> r->buf[2] = 5; /* Version */
> r->buf[3] = 2 | 0x10; /* HiSup, response data format */
> r->buf[4] = r->len - 5; /* Additional Length = (Len - 1) - 4 */
> + r->buf[6] = 0x40; /* Enclosure service */
> r->buf[7] = 0x10 | (r->req.bus->info->tcq ? 0x02 : 0); /* Sync, TCQ. */
> memcpy(&r->buf[8], "QEMU ", 8);
> memcpy(&r->buf[16], "QEMU TARGET ", 16);
I would think this needs to be tied into machine type version, otherwise
when you migrate old to new QEMU, LUN0 is suddenly going to change beneath
the running guest ?
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-08-03 13:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 13:26 [Qemu-devel] [PATCH 0/2] scsi: enclosure support Hannes Reinecke
2017-08-03 13:27 ` [Qemu-devel] [PATCH 1/2] scsi: Make LUN 0 a simple enclosure Hannes Reinecke
2017-08-03 13:32 ` Daniel P. Berrange [this message]
2017-08-03 13:37 ` Hannes Reinecke
2017-08-03 13:27 ` [Qemu-devel] [PATCH 2/2] scsi: use qemu_uuid to generate logical identifier for SES Hannes Reinecke
2017-08-03 15:10 ` [Qemu-devel] [PATCH 0/2] scsi: enclosure support Paolo Bonzini
2017-08-04 5:47 ` Hannes Reinecke
2017-08-04 6:10 ` Paolo Bonzini
2017-08-04 7:34 ` Hannes Reinecke
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=20170803133253.GF9141@redhat.com \
--to=berrange@redhat.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=pbonzini@redhat.com \
--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 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.