Re: [libvirt] [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 guests (which

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

2011-04-05 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 a...@redhat.com 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

Re: [libvirt] [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 -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [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: [libvirt] [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 amit.s...@redhat.com wrote: On (Mon) 04 Apr 2011 [16:09:05], Stefan Hajnoczi wrote: On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity a...@redhat.com wrote: On 04/04/2011 04:38 PM, Anthony Liguori wrote: On 04/04/2011 08:22 AM, Avi Kivity wrote: On

Re: [libvirt] [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-disk).

Re: [libvirt] [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 should

Re: [libvirt] [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. What are the

Re: [libvirt] [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/msg51504.html

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

2011-04-05 Thread Stefan Hajnoczi
On Mon, Apr 4, 2011 at 6:54 PM, David Ahern dsah...@gmail.com 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: [libvirt] [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change

2011-04-05 Thread David Ahern
On 04/04/11 23:33, Stefan Hajnoczi wrote: On Mon, Apr 4, 2011 at 6:54 PM, David Ahern dsah...@gmail.com 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

Re: [libvirt] [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 dsah...@gmail.com wrote: On 04/04/11 23:33, Stefan Hajnoczi wrote: On Mon, Apr 4, 2011 at 6:54 PM, David Ahern dsah...@gmail.com 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,

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 blauwir...@gmail.com wrote: On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi stefa...@linux.vnet.ibm.com

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 berra...@redhat.com 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 blauwir...@gmail.com wrote: On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On

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 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 reopening host

Re: [libvirt] [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

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: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

Re: [libvirt] [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

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

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:disk.

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

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 2:49 PM, Avi Kivity a...@redhat.com 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 reopen the

Re: [libvirt] [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 Kivitya...@redhat.com 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 anth...@codemonkey.ws 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

Re: [libvirt] [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 issue with

Re: [libvirt] [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 stefa...@linux.vnet.ibm.com 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

Re: [libvirt] [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 stefa...@gmail.com wrote: On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi stefa...@linux.vnet.ibm.com 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

Re: [libvirt] [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 blauwir...@gmail.com wrote: On Sun, Apr 3, 2011 at 2:57 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Tue, Mar 29, 2011 at 8:04 PM, Stefan Hajnoczi stefa...@linux.vnet.ibm.com wrote: Piggy-back on the guest CD-ROM polling to poll on the host.  Open