Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-12 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 07:42:02PM +0200, Laurent Vivier wrote: > On 11/04/2017 19:02, Stefan Hajnoczi wrote: > > On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote: > >> diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c > >> index 9639f4e..d270d56 100644 > >> --- a/hw/virtio

Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-11 Thread Laurent Vivier
On 11/04/2017 19:02, Stefan Hajnoczi wrote: > On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote: >> diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c >> index 9639f4e..d270d56 100644 >> --- a/hw/virtio/virtio-rng.c >> +++ b/hw/virtio/virtio-rng.c >> @@ -53,6 +53,15 @@ static

Re: [Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-11 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 03:17:33PM +0200, Laurent Vivier wrote: > diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c > index 9639f4e..d270d56 100644 > --- a/hw/virtio/virtio-rng.c > +++ b/hw/virtio/virtio-rng.c > @@ -53,6 +53,15 @@ static void chr_read(void *opaque, const void *buf, size_

[Qemu-devel] [PATCH 2/2] virtio-rng: stop virtqueue while the CPU is stopped

2017-04-11 Thread Laurent Vivier
If we modify the virtio-rng virqueue while the vmstate is already migrated we can have some inconsistencies between the virtqueue state and the memory content. To avoid this, stop the virtqueue while the CPU is stopped. Signed-off-by: Laurent Vivier --- hw/virtio/trace-events | 2 ++ hw/virtio