From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 1/2] QEMU/KVM: provide a reset method for virtio Date: Fri, 18 Apr 2008 19:20:41 -0300 Message-ID: <20080418222407.311375085@localhost.localdomain> References: <20080418222040.988332630@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Gerd von Egidy , Marcelo Tosatti To: Anthony Liguori , Avi Kivity Return-path: Content-Disposition: inline; filename=virtio-reset List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org So drivers can do whatever necessary on reset. Signed-off-by: Marcelo Tosatti Index: kvm-userspace.aio/qemu/hw/virtio.c =================================================================== --- kvm-userspace.aio.orig/qemu/hw/virtio.c +++ kvm-userspace.aio/qemu/hw/virtio.c @@ -166,6 +166,9 @@ void virtio_reset(void *opaque) VirtIODevice *vdev = opaque; int i; + if (vdev->reset) + vdev->reset(vdev); + vdev->features = 0; vdev->queue_sel = 0; vdev->status = 0; Index: kvm-userspace.aio/qemu/hw/virtio.h =================================================================== --- kvm-userspace.aio.orig/qemu/hw/virtio.h +++ kvm-userspace.aio/qemu/hw/virtio.h @@ -119,6 +119,7 @@ struct VirtIODevice uint32_t (*get_features)(VirtIODevice *vdev); void (*set_features)(VirtIODevice *vdev, uint32_t val); void (*update_config)(VirtIODevice *vdev, uint8_t *config); + void (*reset)(VirtIODevice *vdev); VirtQueue vq[VIRTIO_PCI_QUEUE_MAX]; }; -- ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone