qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	libvir-list@redhat.com, Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Ryan Harper <ryanh@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change
Date: Tue, 5 Apr 2011 14:56:48 +0530	[thread overview]
Message-ID: <20110405092648.GA28577@amit-x200.redhat.com> (raw)
In-Reply-To: <4D9ADE2A.2020201@redhat.com>

On (Tue) 05 Apr 2011 [12:17:30], Avi Kivity wrote:
> On 04/05/2011 12:12 PM, Amit Shah wrote:
> >On (Tue) 05 Apr 2011 [12:00:38], Avi Kivity wrote:
> >>  On 04/05/2011 11:09 AM, Amit Shah wrote:
> >>  >On (Tue) 05 Apr 2011 [10:48:16], Avi Kivity wrote:
> >>  >>   On 04/05/2011 09:41 AM, Amit Shah wrote:
> >>  >>   >See http://www.spinics.net/lists/linux-scsi/msg51504.html
> >>  >>
> >>  >>   I see this is quite fresh.  What are the plans here?
> >>  >
> >>  >We're still discussing where the fix should be, but it certainly is a
> >>  >kernel bug and should be fixed there, and then applied to stable.
> >>  >
> >>  >However, there are other bugs in qemu which will prevent the right
> >>  >size changes to be visible in the guest (the RFC series I sent out
> >>  >earlier in this thread need to be applied to QEMU at the least, the
> >>  >series has grown in my development tree since the time I sent that one
> >>  >out).  So essentially we need to update both, the hypervisor and the
> >>  >guest to get proper CDROM media change support.
> >>
> >>  Why do we need to update the guest for a qemu bug?  What is the qemu bug?
> >
> >Guest kernel bug: CDROM change event missed, so the the revalidate
> >call isn't made, which causes stale data (like disc size) to be used
> >on newer media.
> >
> >qemu bug: We don't handle the GET_EVENT_STATUS_NOTIFICATION command
> >from guests (which is a mandatory command acc. to scsi spec) which the
> >guest uses to detect CDROM changes.  Once this command is implemented,
> >QEMU sends the required info the guest needs to detect CDROM changes.
> >I have this implemented locally (also sent as RFC PATCH 2/3 in the
> >'cdrom bug roundup' thread.
> >
> >So: even if qemu is updated to handle this command, the guest won't
> >work correctly since it misses the event.
> 
> Okay.  We aren't responsible for guest kernel bugs, especially those
> which apply to real hardware (we should make more effort for virtio
> bugs).  It's enough that we fix qemu here.
> 
> >>  >It also looks like we can't have a workaround in QEMU to get older
> >>  >guests to work.
> >>
> >>  Older guests?  or older hosts?
> >
> >Older guests (not patched with fix for the bug described above).
> >
> >Since the guest kernel completely misses the disc change event in the
> >path that does the revalidation, there's nothing qemu can do that will
> >make such older guests notice disc change.
> >
> >Also: if only the guest kernel is updated by qemu is not, things still
> >won't work since qemu will never send valid information for the
> >GET_EVENT_STATUS_NOTIFICATION command.
> >
> >>  >However, a hack in the kernel can be used without any QEMU changes
> >>  >(revalidate disk on each sr_open() call, irrespective of detecting any
> >>  >media change).  I'm against doing that for upstream, but downstreams
> >>  >could do that for new guest - old hypervisor compat.
> >>
> >>  Seriously confused.  Please use the kernels "host kernel" and "qemu"
> >>  instead of "hypervisor" which is ambiguous.
> >
> >OK: this last bit says that forcefully revalidating discs in the guest
> >kernel when a guest userspace opens the disc will ensure size changes
> >are reflected properly for guest userspace.  So in this case, even if
> >we're using an older qemu which doesn't implement
> >GET_EVENT_STATUS_NOTIFICATION, guest userspace apps will work fine.
> >
> >This is obviously a hack.
> 
> Yes.  Thanks for the clarification.
> 
> (let's see if I really got it - we have a kernel bug that hit both
> the guest and the host, plus a qemu bug?)

Yes -- but just that we have many more qemu bugs.

Our cdrom emulation has a lot of holes when it comes to being
spec-compliant.  I have a few fixes, Markus is working on some as well.

		Amit

  reply	other threads:[~2011-04-05  9:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 19:04 [Qemu-devel] [PATCH v2 0/3] block: Correct size across CD-ROM media change Stefan Hajnoczi
2011-03-29 19:04 ` [Qemu-devel] [PATCH v2 1/3] trace: Trace bdrv_set_locked() Stefan Hajnoczi
2011-03-29 19:04 ` [Qemu-devel] [PATCH v2 2/3] block: Do not cache device size for removable media Stefan Hajnoczi
2011-03-29 19:04 ` [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change Stefan Hajnoczi
2011-03-31 10:05   ` [Qemu-devel] " Kevin Wolf
2011-04-01 14:09     ` Stefan Hajnoczi
2011-04-03 11:57   ` [Qemu-devel] " Stefan Hajnoczi
2011-04-03 13:12     ` Blue Swirl
2011-04-03 18:06       ` Stefan Hajnoczi
2011-04-04 10:47         ` [libvirt] " Daniel P. Berrange
2011-04-04 12:58           ` Stefan Hajnoczi
2011-04-04 13:02           ` Anthony Liguori
2011-04-04 13:16             ` Daniel P. Berrange
2011-04-04 14:19               ` Anthony Liguori
2011-04-04 14:26                 ` Daniel P. Berrange
2011-04-04 14:43                   ` Anthony Liguori
2011-04-04 16:38                     ` Blue Swirl
2011-04-04 13:22     ` Avi Kivity
2011-04-04 13:38       ` Anthony Liguori
2011-04-04 13:49         ` Avi Kivity
2011-04-04 15:09           ` Stefan Hajnoczi
2011-04-04 15:11             ` Avi Kivity
2011-04-05  6:41             ` Amit Shah
2011-04-05  7:48               ` Avi Kivity
2011-04-05  8:09                 ` Amit Shah
2011-04-05  9:00                   ` Avi Kivity
2011-04-05  9:12                     ` Amit Shah
2011-04-05  9:17                       ` Avi Kivity
2011-04-05  9:26                         ` Amit Shah [this message]
2011-04-06  8:07                         ` Amit Shah
2011-04-05  8:40               ` Stefan Hajnoczi
2011-04-05  8:58                 ` Amit Shah
2011-04-04 17:54         ` David Ahern
2011-04-05  5:33           ` Stefan Hajnoczi
2011-04-05  5:42             ` David Ahern
2011-04-05 12:41               ` Stefan Hajnoczi
2011-03-30  8:33 ` [Qemu-devel] [PATCH v2 0/3] block: Correct size across CD-ROM " Markus Armbruster
2011-03-30 10:06   ` 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=20110405092648.GA28577@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=avi@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=ryanh@us.ibm.com \
    --cc=stefanha@gmail.com \
    --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).