Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-09 Thread Peter Lieven
Am 08.03.2013 12:56, schrieb Kevin Wolf: > Am 08.03.2013 um 12:46 hat Peter Lieven geschrieben: >> >> Am 08.03.2013 um 10:35 schrieb Kevin Wolf : >> >>> Am 08.03.2013 um 10:23 hat Paolo Bonzini geschrieben: Il 08/03/2013 08:53, Peter Lieven ha scritto: >> >> I think the fix is to only

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-08 Thread Kevin Wolf
Am 08.03.2013 um 12:46 hat Peter Lieven geschrieben: > > Am 08.03.2013 um 10:35 schrieb Kevin Wolf : > > > Am 08.03.2013 um 10:23 hat Paolo Bonzini geschrieben: > >> Il 08/03/2013 08:53, Peter Lieven ha scritto: > > I think the fix is to only call it for the monitor command. Optionall

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-08 Thread Peter Lieven
Am 08.03.2013 um 10:35 schrieb Kevin Wolf : > Am 08.03.2013 um 10:23 hat Paolo Bonzini geschrieben: >> Il 08/03/2013 08:53, Peter Lieven ha scritto: I think the fix is to only call it for the monitor command. Optionally, when shrinking, assert that there are no requests in flight

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-08 Thread Kevin Wolf
Am 08.03.2013 um 10:23 hat Paolo Bonzini geschrieben: > Il 08/03/2013 08:53, Peter Lieven ha scritto: > >> > >> I think the fix is to only call it for the monitor command. Optionally, > >> when shrinking, assert that there are no requests in flight. > > > > Okay. > > > > What is the plan? just f

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-08 Thread Paolo Bonzini
Il 08/03/2013 08:53, Peter Lieven ha scritto: >> >> I think the fix is to only call it for the monitor command. Optionally, >> when shrinking, assert that there are no requests in flight. > > Okay. > > What is the plan? just fix this or fix the whole thing (which seems to > be some > work). > >

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
On 07.03.2013 17:09, Paolo Bonzini wrote: Il 07/03/2013 09:53, Peter Lieven ha scritto: Then we can add bdrv_revalidate and, for block_resize, call bdrv_revalidate+bdrv_truncate. For bs->growable = 0 && !bs->drv->bdrv_truncate, bdrv_truncate can just check that the actual size is the same or b

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Paolo Bonzini
Il 07/03/2013 09:50, Kevin Wolf ha scritto: > Am 06.03.2013 um 21:39 hat Paolo Bonzini geschrieben: >> Il 06/03/2013 20:03, Peter Lieven ha scritto: >>> Am 06.03.2013 19:48, schrieb Jeff Cody: On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: > Il 06/03/2013 19:14, Jeff Cody h

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Paolo Bonzini
Il 07/03/2013 09:53, Peter Lieven ha scritto: >> >> Then we can add bdrv_revalidate and, for block_resize, call >> bdrv_revalidate+bdrv_truncate. For bs->growable = 0 && >> !bs->drv->bdrv_truncate, bdrv_truncate can just check that the actual >> size is the same or bigger as the one requested, and

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
Am 07.03.2013 um 11:00 schrieb Kevin Wolf : > Am 07.03.2013 um 10:25 hat Peter Lieven geschrieben: >> >> Am 07.03.2013 um 10:22 schrieb Kevin Wolf : >> >>> Am 07.03.2013 um 10:16 hat Peter Lieven geschrieben: >> If bs->growable is 1 for all drivers, whats the fix status of >> CVE-2008-

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 07.03.2013 um 10:25 hat Peter Lieven geschrieben: > > Am 07.03.2013 um 10:22 schrieb Kevin Wolf : > > > Am 07.03.2013 um 10:16 hat Peter Lieven geschrieben: > If bs->growable is 1 for all drivers, whats the fix status of > CVE-2008-0928? This > flag was introduced as a fix for

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
Am 07.03.2013 um 10:22 schrieb Kevin Wolf : > Am 07.03.2013 um 10:16 hat Peter Lieven geschrieben: If bs->growable is 1 for all drivers, whats the fix status of CVE-2008-0928? This flag was introduced as a fix for this problem. bdrv_check_byte_request() does nothing use

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 07.03.2013 um 10:16 hat Peter Lieven geschrieben: > >> If bs->growable is 1 for all drivers, whats the fix status of > >> CVE-2008-0928? This > >> flag was introduced as a fix for this problem. > >> > >> bdrv_check_byte_request() does nothing useful if bs->growable is 1. > > > > Don't ignore

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
Am 07.03.2013 um 10:03 schrieb Kevin Wolf : > Am 07.03.2013 um 09:56 hat Peter Lieven geschrieben: >> On 07.03.2013 09:50, Kevin Wolf wrote: >>> Am 06.03.2013 um 21:39 hat Paolo Bonzini geschrieben: Il 06/03/2013 20:03, Peter Lieven ha scritto: > Am 06.03.2013 19:48, schrieb Jeff Cody: >

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 07.03.2013 um 09:56 hat Peter Lieven geschrieben: > On 07.03.2013 09:50, Kevin Wolf wrote: > >Am 06.03.2013 um 21:39 hat Paolo Bonzini geschrieben: > >>Il 06/03/2013 20:03, Peter Lieven ha scritto: > >>>Am 06.03.2013 19:48, schrieb Jeff Cody: > On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 07.03.2013 um 09:53 hat Peter Lieven geschrieben: > On 06.03.2013 21:39, Paolo Bonzini wrote: > >Il 06/03/2013 20:03, Peter Lieven ha scritto: > >>Am 06.03.2013 19:48, schrieb Jeff Cody: > >>>On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: > Il 06/03/2013 19:14, Jeff Cody ha s

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 06.03.2013 um 19:27 hat Peter Lieven geschrieben: > Am 06.03.2013 19:06, schrieb Paolo Bonzini: > > Il 06/03/2013 18:50, Peter Lieven ha scritto: > Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this > breaks > QCOW images, as well other future image formats (suc

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
On 07.03.2013 09:50, Kevin Wolf wrote: Am 06.03.2013 um 21:39 hat Paolo Bonzini geschrieben: Il 06/03/2013 20:03, Peter Lieven ha scritto: Am 06.03.2013 19:48, schrieb Jeff Cody: On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: Il 06/03/2013 19:14, Jeff Cody ha scritto: QCOW br

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Peter Lieven
On 06.03.2013 21:39, Paolo Bonzini wrote: Il 06/03/2013 20:03, Peter Lieven ha scritto: Am 06.03.2013 19:48, schrieb Jeff Cody: On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: Il 06/03/2013 19:14, Jeff Cody ha scritto: QCOW breaks with it using a normal raw posix file as a devi

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-07 Thread Kevin Wolf
Am 06.03.2013 um 21:39 hat Paolo Bonzini geschrieben: > Il 06/03/2013 20:03, Peter Lieven ha scritto: > > Am 06.03.2013 19:48, schrieb Jeff Cody: > >> On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: > >>> Il 06/03/2013 19:14, Jeff Cody ha scritto: > QCOW breaks with it using a n

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Paolo Bonzini
Il 06/03/2013 20:03, Peter Lieven ha scritto: > Am 06.03.2013 19:48, schrieb Jeff Cody: >> On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: >>> Il 06/03/2013 19:14, Jeff Cody ha scritto: QCOW breaks with it using a normal raw posix file as a device. As a test: qemu-img crea

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Paolo Bonzini
Il 06/03/2013 19:32, Jeff Cody ha scritto: > On Wed, Mar 06, 2013 at 06:50:56PM +0100, Peter Lieven wrote: >> Looking at the source I have not found a place where bs->growable is set to >> 0 for any >> block driver, maybe I miss something. Having bs->growable for iSCSI would >> also be ok. >> >>

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Paolo Bonzini
Il 06/03/2013 18:50, Peter Lieven ha scritto: >> > Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this breaks >> > QCOW images, as well other future image formats (such as VHDX) that may >> > call >> > bdrv_truncate(bs->file) from within a read/write operation. For example, >> >

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Peter Lieven
Am 06.03.2013 19:48, schrieb Jeff Cody: > On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: >> Il 06/03/2013 19:14, Jeff Cody ha scritto: >>> QCOW breaks with it using a normal raw posix file as a device. As a >>> test: qemu-img create -f qcow test.qcow 5G. Now run qemu with that >>>

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Jeff Cody
On Wed, Mar 06, 2013 at 07:31:51PM +0100, Paolo Bonzini wrote: > Il 06/03/2013 19:14, Jeff Cody ha scritto: > > QCOW breaks with it using a normal raw posix file as a device. As a > > test: qemu-img create -f qcow test.qcow 5G. Now run qemu with that > > drive mounted, and try to partition and fo

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Paolo Bonzini
Il 06/03/2013 19:14, Jeff Cody ha scritto: > QCOW breaks with it using a normal raw posix file as a device. As a > test: qemu-img create -f qcow test.qcow 5G. Now run qemu with that > drive mounted, and try to partition and format it. QEMU now asserts. > > The nicety of being able to using trun

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Jeff Cody
On Wed, Mar 06, 2013 at 06:50:56PM +0100, Peter Lieven wrote: > Am 06.03.2013 15:47, schrieb Jeff Cody: > > Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this breaks > > QCOW images, as well other future image formats (such as VHDX) that may call > > bdrv_truncate(bs->file) from w

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Peter Lieven
Am 06.03.2013 15:47, schrieb Jeff Cody: > Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this breaks > QCOW images, as well other future image formats (such as VHDX) that may call > bdrv_truncate(bs->file) from within a read/write operation. For example, QCOW > will cause an asser

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Jeff Cody
On Wed, Mar 06, 2013 at 07:06:24PM +0100, Paolo Bonzini wrote: > Il 06/03/2013 18:50, Peter Lieven ha scritto: > >> > Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this > >> > breaks > >> > QCOW images, as well other future image formats (such as VHDX) that may > >> > call > >>

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Peter Lieven
Am 06.03.2013 19:42, schrieb Jeff Cody: > On Wed, Mar 06, 2013 at 07:25:39PM +0100, Peter Lieven wrote: >> Am 06.03.2013 19:14, schrieb Jeff Cody: >>> On Wed, Mar 06, 2013 at 07:06:24PM +0100, Paolo Bonzini wrote: Il 06/03/2013 18:50, Peter Lieven ha scritto: >>> Commit 9a665b2b made bdrv_

Re: [Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Peter Lieven
Am 06.03.2013 19:06, schrieb Paolo Bonzini: > Il 06/03/2013 18:50, Peter Lieven ha scritto: Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this breaks QCOW images, as well other future image formats (such as VHDX) that may call bdrv_truncate(bs->file) from with

[Qemu-devel] [PATCH 1/7] block: only force IO completion in .bdrv_truncate if we are shrinking

2013-03-06 Thread Jeff Cody
Commit 9a665b2b made bdrv_truncate() call bdrv_drain_all(), but this breaks QCOW images, as well other future image formats (such as VHDX) that may call bdrv_truncate(bs->file) from within a read/write operation. For example, QCOW will cause an assert, due to tracked_requests not being empty (sinc