Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-06 Thread Amit Shah
On (Tue) 05 Apr 2011 [12:17:30], Avi Kivity wrote: > >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 gues

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Stefan Hajnoczi
On Tue, Apr 5, 2011 at 6:42 AM, David Ahern wrote: > On 04/04/11 23:33, Stefan Hajnoczi wrote: >> On Mon, Apr 4, 2011 at 6:54 PM, David Ahern wrote: >>> On 04/04/11 07:38, Anthony Liguori wrote: On 04/04/2011 08:22 AM, Avi Kivity wrote: > On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: >>

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Amit Shah
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 w

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Avi Kivity
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/msg5

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Amit Shah
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.

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Avi Kivity
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 sho

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Amit Shah
On (Tue) 05 Apr 2011 [09:40:05], Stefan Hajnoczi wrote: > > See http://www.spinics.net/lists/linux-scsi/msg51504.html > > I don't think that patch updates the block inode size. We'd need to > call fs/block_dev.c:revalidate_disk() instead of directly calling > cdi->disk->fops->revalidate_disk(cdi-

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Stefan Hajnoczi
On Tue, Apr 5, 2011 at 7:41 AM, Amit Shah wrote: > On (Mon) 04 Apr 2011 [16:09:05], Stefan Hajnoczi wrote: >> On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity wrote: >> > On 04/04/2011 04:38 PM, Anthony Liguori wrote: >> >> >> >> On 04/04/2011 08:22 AM, Avi Kivity wrote: >> >>> >> >>> On 04/03/2011 02:

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread Avi Kivity
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? -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Amit Shah
On (Mon) 04 Apr 2011 [16:09:05], Stefan Hajnoczi wrote: > On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity wrote: > > On 04/04/2011 04:38 PM, Anthony Liguori wrote: > >> > >> On 04/04/2011 08:22 AM, Avi Kivity wrote: > >>> > >>> On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: > > In order for m

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread David Ahern
On 04/04/11 23:33, Stefan Hajnoczi wrote: > On Mon, Apr 4, 2011 at 6:54 PM, David Ahern wrote: >> On 04/04/11 07:38, Anthony Liguori wrote: >>> On 04/04/2011 08:22 AM, Avi Kivity wrote: On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: > In order for media change to work with Linux host CD-R

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Stefan Hajnoczi
On Mon, Apr 4, 2011 at 6:54 PM, David Ahern wrote: > > > On 04/04/11 07:38, Anthony Liguori wrote: >> On 04/04/2011 08:22 AM, Avi Kivity wrote: >>> On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work with Linux host CD-ROM it is necessary to reopen the file (

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread David Ahern
On 04/04/11 07:38, Anthony Liguori wrote: > On 04/04/2011 08:22 AM, Avi Kivity wrote: >> On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: >>> In order for media change to work with Linux host CD-ROM it is >>> necessary to reopen the file (otherwise the inode size will not >>> refresh, this is an is

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Stefan Hajnoczi
On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity wrote: > On 04/04/2011 04:38 PM, Anthony Liguori wrote: >> >> On 04/04/2011 08:22 AM, Avi Kivity wrote: >>> >>> On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work with Linux host CD-ROM it is necessary to reope

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Avi Kivity
On 04/04/2011 06:09 PM, Stefan Hajnoczi wrote: On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity wrote: > On 04/04/2011 04:38 PM, Anthony Liguori wrote: >> >> On 04/04/2011 08:22 AM, Avi Kivity wrote: >>> >>> On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Blue Swirl
On Mon, Apr 4, 2011 at 5:43 PM, Anthony Liguori wrote: > On 04/04/2011 09:26 AM, Daniel P. Berrange wrote: >> >> On Mon, Apr 04, 2011 at 09:19:36AM -0500, Anthony Liguori wrote: >>> >>> On 04/04/2011 08:16 AM, Daniel P. Berrange wrote: That doesn't really have any impact. If a desktop us

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Anthony Liguori
On 04/04/2011 09:26 AM, Daniel P. Berrange wrote: On Mon, Apr 04, 2011 at 09:19:36AM -0500, Anthony Liguori wrote: On 04/04/2011 08:16 AM, Daniel P. Berrange wrote: That doesn't really have any impact. If a desktop user is logged in, udev may change the ownership to match that user, but if they

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Daniel P. Berrange
On Mon, Apr 04, 2011 at 09:19:36AM -0500, Anthony Liguori wrote: > On 04/04/2011 08:16 AM, Daniel P. Berrange wrote: > >That doesn't really have any impact. If a desktop user is logged > >in, udev may change the ownership to match that user, but if they > >aren't, then udev may reset it to root:dis

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Anthony Liguori
On 04/04/2011 08:16 AM, Daniel P. Berrange wrote: That doesn't really have any impact. If a desktop user is logged in, udev may change the ownership to match that user, but if they aren't, then udev may reset it to root:disk. Either way, QEMU may loose permissions to the disk. Then if you creat

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Avi Kivity
On 04/04/2011 04:38 PM, Anthony Liguori wrote: On 04/04/2011 08:22 AM, Avi Kivity wrote: On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work with Linux host CD-ROM it is necessary to reopen the file (otherwise the inode size will not refresh, this is an issue with e

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Anthony Liguori
On 04/04/2011 08:22 AM, Avi Kivity wrote: On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work with Linux host CD-ROM it is necessary to reopen the file (otherwise the inode size will not refresh, this is an issue with existing kernels). Maybe we should fix the bug

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Daniel P. Berrange
On Mon, Apr 04, 2011 at 08:02:26AM -0500, Anthony Liguori wrote: > On 04/04/2011 05:47 AM, Daniel P. Berrange wrote: > >>I'm hoping libvirt's behavior can be made to just work rather than > >>adding new features to QEMU. But perhaps passing file descriptors is > >>useful for more than just reopeni

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Avi Kivity
On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote: In order for media change to work with Linux host CD-ROM it is necessary to reopen the file (otherwise the inode size will not refresh, this is an issue with existing kernels). Maybe we should fix the bug in Linux (and backport as necessary)? I t

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Anthony Liguori
On 04/04/2011 05:47 AM, Daniel P. Berrange wrote: I'm hoping libvirt's behavior can be made to just work rather than adding new features to QEMU. But perhaps passing file descriptors is useful for more than just reopening host devices. This would basically be a privilege separation model where

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Stefan Hajnoczi
On Mon, Apr 4, 2011 at 11:47 AM, Daniel P. Berrange wrote: > On Sun, Apr 03, 2011 at 07:06:17PM +0100, Stefan Hajnoczi wrote: >> On Sun, Apr 3, 2011 at 2:12 PM, Blue Swirl wrote: >> > On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi wrote: >> >> On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi >>

Re: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-04 Thread Daniel P. Berrange
On Sun, Apr 03, 2011 at 07:06:17PM +0100, Stefan Hajnoczi wrote: > On Sun, Apr 3, 2011 at 2:12 PM, Blue Swirl wrote: > > On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi wrote: > >> On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi > >> wrote: > >>> Piggy-back on the guest CD-ROM polling to poll o

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-03 Thread Stefan Hajnoczi
On Sun, Apr 3, 2011 at 2:12 PM, Blue Swirl wrote: > On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi wrote: >> On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi >> wrote: >>> Piggy-back on the guest CD-ROM polling to poll on the host.  Open and >>> close the host CD-ROM file descriptor to ensure w

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-03 Thread Blue Swirl
On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi wrote: > On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi > wrote: >> Piggy-back on the guest CD-ROM polling to poll on the host.  Open and >> close the host CD-ROM file descriptor to ensure we read the new size and >> not a stale size. >> >> Two th

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-03 Thread Stefan Hajnoczi
On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi wrote: > Piggy-back on the guest CD-ROM polling to poll on the host.  Open and > close the host CD-ROM file descriptor to ensure we read the new size and > not a stale size. > > Two things are going on here: > > 1. If hald/udisks is not already poll

[Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-03-29 Thread Stefan Hajnoczi
Piggy-back on the guest CD-ROM polling to poll on the host. Open and close the host CD-ROM file descriptor to ensure we read the new size and not a stale size. Two things are going on here: 1. If hald/udisks is not already polling CD-ROMs on the host then re-opening the CD-ROM causes the host