All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost: enable log before starting vq
@ 2010-10-25  8:03 Michael S. Tsirkin
  0 siblings, 0 replies; only message in thread
From: Michael S. Tsirkin @ 2010-10-25  8:03 UTC (permalink / raw)
  To: qemu-devel

Log must be started before backend is enabled,
to make sure no memory changes are untracked.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/vhost.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/vhost.c b/hw/vhost.c
index 8586f66..e0152e2 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -650,15 +650,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
         r = -errno;
         goto fail_mem;
     }
-    for (i = 0; i < hdev->nvqs; ++i) {
-        r = vhost_virtqueue_init(hdev,
-                                 vdev,
-                                 hdev->vqs + i,
-                                 i);
-        if (r < 0) {
-            goto fail_vq;
-        }
-    }
 
     if (hdev->log_enabled) {
         hdev->log_size = vhost_get_log_size(hdev);
@@ -671,11 +662,19 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
             goto fail_log;
         }
     }
+    for (i = 0; i < hdev->nvqs; ++i) {
+        r = vhost_virtqueue_init(hdev,
+                                 vdev,
+                                 hdev->vqs + i,
+                                 i);
+        if (r < 0) {
+            goto fail_vq;
+        }
+    }
 
     hdev->started = true;
 
     return 0;
-fail_log:
 fail_vq:
     while (--i >= 0) {
         vhost_virtqueue_cleanup(hdev,
@@ -683,6 +682,7 @@ fail_vq:
                                 hdev->vqs + i,
                                 i);
     }
+fail_log:
 fail_mem:
 fail_features:
     vdev->binding->set_guest_notifiers(vdev->binding_opaque, false);
-- 
1.7.3-rc1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-25  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25  8:03 [Qemu-devel] [PATCH] vhost: enable log before starting vq Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.