Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Kevin Wolf
Am 28.01.2019 um 17:15 hat Alberto Garcia geschrieben: > On Mon 28 Jan 2019 05:01:09 PM CET, Kevin Wolf wrote: > > > And actually... if you move the first virtio-blk device to an > > iothread, then downgrading the others isn't going to save us, because > > that would still be using the backend fro

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Alberto Garcia
On Mon 28 Jan 2019 05:01:09 PM CET, Kevin Wolf wrote: > And actually... if you move the first virtio-blk device to an > iothread, then downgrading the others isn't going to save us, because > that would still be using the backend from two threads (one > successfully enabled iothread, and the main

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Kevin Wolf
Am 28.01.2019 um 16:46 hat Alberto Garcia geschrieben: > On Mon 28 Jan 2019 03:57:43 PM CET, Kevin Wolf wrote: > > >> > I think the proper solution on the block layer level would be that > >> > AioContext is managed per BdrvChild and only BdrvChild objects with > >> > the same AioContext can be at

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Alberto Garcia
On Mon 28 Jan 2019 03:57:43 PM CET, Kevin Wolf wrote: >> > I think the proper solution on the block layer level would be that >> > AioContext is managed per BdrvChild and only BdrvChild objects with >> > the same AioContext can be attached to the same node. >> > bdrv_set_aio_context() would then f

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Kevin Wolf
Am 28.01.2019 um 15:42 hat Alberto Garcia geschrieben: > On Thu 24 Jan 2019 10:12:22 AM CET, Kevin Wolf wrote: > > Am 23.01.2019 um 17:16 hat Alberto Garcia geschrieben: > >> On Wed 23 Jan 2019 04:47:30 PM CET, Paolo Bonzini wrote: > >> >> You mean a common function with the code below? > >> >> >

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-28 Thread Alberto Garcia
On Thu 24 Jan 2019 10:12:22 AM CET, Kevin Wolf wrote: > Am 23.01.2019 um 17:16 hat Alberto Garcia geschrieben: >> On Wed 23 Jan 2019 04:47:30 PM CET, Paolo Bonzini wrote: >> >> You mean a common function with the code below? >> >> >> +ctx = blk_get_aio_context(sd->conf.blk); >> +

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-24 Thread Kevin Wolf
Am 23.01.2019 um 17:16 hat Alberto Garcia geschrieben: > On Wed 23 Jan 2019 04:47:30 PM CET, Paolo Bonzini wrote: > >> You mean a common function with the code below? > >> > +ctx = blk_get_aio_context(sd->conf.blk); > +if (ctx != s->ctx && ctx != qemu_get_aio_context()) {

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-23 Thread Alberto Garcia
On Wed 23 Jan 2019 04:47:30 PM CET, Paolo Bonzini wrote: >> You mean a common function with the code below? >> +ctx = blk_get_aio_context(sd->conf.blk); +if (ctx != s->ctx && ctx != qemu_get_aio_context()) { +error_setg(errp, "Cannot attach a blockdev tha

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-23 Thread Paolo Bonzini
On 23/01/19 16:09, Alberto Garcia wrote: > On Wed 23 Jan 2019 10:46:54 AM CET, Paolo Bonzini wrote: >> On 22/01/19 16:53, Alberto Garcia wrote: >>> This patch forbids attaching a disk to a SCSI device if its using a >>> different AioContext. Test case included. >>> >>> Signed-off-by: Alberto Garcia

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-23 Thread Alberto Garcia
On Wed 23 Jan 2019 10:46:54 AM CET, Paolo Bonzini wrote: > On 22/01/19 16:53, Alberto Garcia wrote: >> This patch forbids attaching a disk to a SCSI device if its using a >> different AioContext. Test case included. >> >> Signed-off-by: Alberto Garcia > > Should this be handled in common code? H

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-23 Thread Paolo Bonzini
On 22/01/19 16:53, Alberto Garcia wrote: > This patch forbids attaching a disk to a SCSI device if its using a > different AioContext. Test case included. > > Signed-off-by: Alberto Garcia Should this be handled in common code? However, everything else looks good. Thanks! Paolo > --- > hw/s

[Qemu-devel] [PATCH 3/3] virtio-scsi: Forbid devices with different iothreads sharing a blockdev

2019-01-22 Thread Alberto Garcia
This patch forbids attaching a disk to a SCSI device if its using a different AioContext. Test case included. Signed-off-by: Alberto Garcia --- hw/scsi/virtio-scsi.c | 7 +++ tests/qemu-iotests/240 | 22 ++ tests/qemu-iotests/240.out | 20 3