qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Chen HanXiao <chenhanxiao@cn.fujitsu.com>
Cc: 'Christoph Hellwig' <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Use SCSI command to get size of SG device
Date: Wed, 10 Oct 2012 08:33:57 +0200	[thread overview]
Message-ID: <507516D5.8040609@redhat.com> (raw)
In-Reply-To: <014001cda68c$94a58480$bdf08d80$@cn.fujitsu.com>

Il 10/10/2012 04:11, Chen HanXiao ha scritto:
>> > 
>> > On Tue, Oct 09, 2012 at 05:42:01PM +0800, Chen HanXiao wrote:
>>> > > When we use SCSI generic device as disk image, function lseek could
>>> > > not get the size of this kind of device.
>>> > > So try to use SCSI command Read Capacity(10) when lseek failed to get
>>> > > the size of SCSI generic device.
>> > 
>> > Eww, this is ugly as hell.  Why would you even need the size for a raw
>> > passthrough device?
>
> If we want to enable snapshot for SCSI generic device as disk image, the size
> of SCSI generic device is needed. Function lseek could not get this, SCSI
> command can finish the job.
> Only when lseek failed would Read Capacity command be sent. 

You need to use scsi-block instead of scsi-generic.  However, I don't
see how this can work.  After the snapshot, the image will be qcow2, not
raw, and thus it will not support bdrv_aio_ioctl.  Hence any SCSI
command (for scsi-generic) or any non-data SCSI command (for scsi-block)
will fail.

Can you give an example of what exactly you are trying to do?

Paolo

  reply	other threads:[~2012-10-10  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  9:42 [Qemu-devel] [PATCH] Use SCSI command to get size of SG device Chen HanXiao
2012-10-09 17:21 ` Christoph Hellwig
2012-10-10  2:11   ` Chen HanXiao
2012-10-10  6:33     ` Paolo Bonzini [this message]
2012-10-10  8:33       ` Chen HanXiao
2012-10-10  9:01         ` 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=507516D5.8040609@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=chenhanxiao@cn.fujitsu.com \
    --cc=hch@lst.de \
    --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).