summaryrefslogtreecommitdiff
path: root/hw/block/dataplane
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13dataplane: replace internal thread with IOThreadStefan Hajnoczi1-42/+54
Today virtio-blk dataplane uses a 1:1 device-per-thread model. Now that IOThreads have been introduced we can generalize this to N:M devices per threads. This patch drops thread code from dataplane in favor of running inside an IOThread AioContext. As a bonus we solve the case where a guest keeps submitting I/O requests while dataplane is trying to stop. Previously the dataplane thread would continue to process requests until the request gave it a break. Now we can shut down in bounded time thanks to aio_context_acquire/release. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-09Add a 'name' parameter to qemu_thread_createDr. David Alan Gilbert1-1/+1
If enabled, set the thread name at creation (on GNU systems with pthread_set_np) Fix up all the callers with a thread name Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2014-01-31dataplane: Comment fixMarkus Armbruster1-1/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-20dataplane: change vring API to use VirtQueueElementPaolo Bonzini1-52/+33
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-20vring: factor common code for error exitsPaolo Bonzini1-0/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-09virtio-blk-dataplane: Improve error reportingAndreas Färber2-16/+19
Return an Error so that it can be propagated later. Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> [AF: Rebased] Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-06dataplane: Fix startup race.Cornelia Huck1-0/+9
Avoid trying to setup dataplane again if dataplane setup is already in progress. This may happen if an eventfd is triggered during setup. I saw this occasionally with an experimental s390 irqfd implementation: virtio_blk_handle_output -> virtio_blk_data_plane_start -> virtio_ccw_set_host_notifier ... -> virtio_queue_set_host_notifier_fd_handler -> virtio_queue_host_notifier_read -> virtio_queue_notify_vq -> virtio_blk_handle_output -> virtio_blk_data_plane_start -> vring_setup -> hostmem_init -> memory_listener_register -> BOOM As virtio-ccw tries to follow what virtio-pci does, it might be triggerable for other platforms as well. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19aio: drop io_flush argumentStefan Hajnoczi1-4/+4
The .io_flush() handler no longer exists and has no users. Drop the io_flush argument to aio_set_fd_handler() and related functions. The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no longer used and are dropped too. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19dataplane/virtio-blk: drop flush_true() and flush_io()Stefan Hajnoczi1-15/+2
.io_flush() is no longer called so drop flush_true() and flush_io(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-19dataplane/virtio-blk: check exit conditions before aio_poll()Stefan Hajnoczi1-2/+2
Check exit conditions before entering blocking aio_poll(). This is mainly for consistency since it's unlikely that we are stopping in the first event loop iteration. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-29dataplane: refuse to start if device is already in useStefan Hajnoczi1-0/+8
Dataplane must check whether a block device is in use before launching the dataplane thread. This is necessary since the thread does not synchronize with the main loop and I/O requests could cause corruption. One example is when a drive is added and a block job is started before hotplugging the virtio-blk-pci adapter. In this case we must not use dataplane mode. Cc: qemu-stable@nongnu.org Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-29dataplane: enable virtio-blk x-data-plane=on live migrationStefan Hajnoczi1-9/+0
Although the dataplane thread does not cooperate with dirty memory logging yet it's fairly easy to temporarily disable dataplane during live migration. This way virtio-blk can live migrate when x-data-plane=on. The dataplane thread will restart after migration is cancelled or if the guest resuming virtio-blk operation after migration completes. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-07-19dataplane: sync virtio.c and vring.c virtqueue stateStefan Hajnoczi1-1/+1
Load the virtio.c state into vring.c when we start dataplane mode and vice versa when stopping dataplane mode. This patch makes it possible to start and stop dataplane any time while the guest is running. This will eventually allow us to go back to QEMU main loop for bdrv_drain_all() and live migration. In the meantime, this patch makes the dataplane lifecycle more robust but should make no visible difference. It may be useful in the virtio-net dataplane effort. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-24virtio: remove virtiobindings.KONRAD Frederic1-6/+9
This remove virtio-bindings, and use class instead. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-08hw: move virtio devices to hw/ subdirectoriesPaolo Bonzini5-0/+744
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>