From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway.
Date: Sat, 26 May 2012 09:36:55 +0200 [thread overview]
Message-ID: <jpq16n$7jd$1@dough.gmane.org> (raw)
In-Reply-To: <1338008201-29078-5-git-send-email-ronniesahlberg@gmail.com>
Il 26/05/2012 06:56, Ronnie Sahlberg ha scritto:
> Forcing sg also makes qemu skip trying to read from the device to guess the image format by reading from the device (find_image_format()).
> SMC devices do not implement READ6/10/12/16 so it is noit possible to read from them.
>
> With this patch I can successfully manage a SMC device wiht iscsi in passthrough mode.
>
> Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> ---
> block/iscsi.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index a015a52..9ce38b5 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1032,6 +1032,15 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
> if (iscsi_url != NULL) {
> iscsi_destroy_url(iscsi_url);
> }
> +
> + /* Medium changer. We dont have any emulation for this so this must
> + be sg ioctl compatible. We force it to be sg, otherwise qemu will try
> + to read from the device to guess the image format.
> + */
> + if (iscsilun->type == TYPE_MEDIUM_CHANGER) {
> + bs->sg = 1;
> + }
> +
> return 0;
>
> failed:
Modified to also do the same for tapes, applied to scsi-next branch for 1.2.
Paolo
next prev parent reply other threads:[~2012-05-26 7:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-26 4:56 [Qemu-devel] [PATCH 0/4] ISCSI: Passthough updates Ronnie Sahlberg
2012-05-26 4:56 ` [Qemu-devel] [PATCH 1/4] ISCSI: Only call READCAPACITY16 for SBC devices Ronnie Sahlberg
2012-05-26 4:56 ` [Qemu-devel] [PATCH 2/4] ISCSI: Use READCAPACITY10 for MMC devices Ronnie Sahlberg
2012-05-26 4:56 ` [Qemu-devel] [PATCH 3/4] ISCSI: Only use READ16 for SBC devices. Use READ10 for other device types such as MMC Ronnie Sahlberg
2012-05-26 4:56 ` [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway Ronnie Sahlberg
2012-05-26 7:36 ` Paolo Bonzini [this message]
2012-05-27 13:12 ` Andreas Färber
2012-05-28 6:48 ` Paolo Bonzini
2012-05-28 11:55 ` ronnie sahlberg
2012-05-28 12:05 ` Paolo Bonzini
2012-05-26 7:37 ` [Qemu-devel] [PATCH 0/4] ISCSI: Passthough updates Paolo Bonzini
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='jpq16n$7jd$1@dough.gmane.org' \
--to=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.