qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	"Justin M. Forbes" <jforbes@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH] usb-msd: Add usb-storage, removable=on|off property
Date: Mon, 17 Jan 2011 10:04:05 +0000	[thread overview]
Message-ID: <20110117100405.GA7123@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <20110117092126.GB19683@lst.de>

On Mon, Jan 17, 2011 at 10:21:26AM +0100, Christoph Hellwig wrote:
> The actual removable bit looks fine, but I don't think the connection of
> the change callback looks sane.  What's the rationale for it?

Since we're using bdrv_set_removable(), the user may try to eject the
block device from the QEMU monitor.  At that point we have a closed
BlockDriverState and all operations will (at best) error since there is
no medium.

The callback removes the USB MSD so that eject is equivalent to removing
the device.  It's a hack and we could remove it, but then we're left
with a weird guest-visible state that you can't get into with a physical
USB thumbdrive.

I was considering not using bdrv_set_removable() and instead adding a
hint to the BlockDriverState which gets checked when constructing the
SCSI INQUIRY response.  If we take that approach, then QEMU doesn't
consider the block device removable in the eject/change medium sense.

Stefan

  reply	other threads:[~2011-01-17 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-15  0:00 [Qemu-devel] [PATCH] usb-msd: Add usb-storage, removable=on|off property Stefan Hajnoczi
2011-01-17  9:21 ` [Qemu-devel] " Christoph Hellwig
2011-01-17 10:04   ` Stefan Hajnoczi [this message]
2011-01-17 16:01     ` Christoph Hellwig
2011-01-17 18:08       ` Stefan Hajnoczi

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=20110117100405.GA7123@stefanha-thinkpad.localdomain \
    --to=stefanha@gmail.com \
    --cc=hch@lst.de \
    --cc=jforbes@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /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).