[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 06/28] vhost: add vhost device only after all suc
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v3 06/28] vhost: add vhost device only after all success |
Date: |
Wed, 6 Jul 2016 20:46:59 +0200 |
From: Marc-André Lureau <address@hidden>
This helps following vhost_dev_cleanup() patch to check if the device
was added before removing it from the list.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/virtio/vhost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 81dc191..ebdd1da 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1011,7 +1011,6 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
r = -1;
goto fail;
}
- QLIST_INSERT_HEAD(&vhost_devices, hdev, entry);
r = hdev->vhost_ops->vhost_set_owner(hdev);
if (r < 0) {
@@ -1070,6 +1069,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
hdev->started = false;
hdev->memory_changed = false;
memory_listener_register(&hdev->memory_listener, &address_space_memory);
+ QLIST_INSERT_HEAD(&vhost_devices, hdev, entry);
return 0;
fail_vq:
while (--i >= 0) {
--
2.9.0
- [Qemu-devel] [PATCH v3 00/28] vhost-user reconnect fixes, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 01/28] misc: indentation, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 02/28] vhost-user: minor simplification, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 03/28] vhost: don't assume opaque is a fd, use backend cleanup, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 04/28] vhost: make vhost_log_put() idempotent, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 06/28] vhost: add vhost device only after all success,
marcandre . lureau <=
- [Qemu-devel] [PATCH v3 07/28] vhost: make vhost_dev_cleanup() idempotent, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 08/28] vhost-net: always call vhost_dev_cleanup() on failure, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 09/28] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init(), marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 05/28] vhost: call vhost_log_put() on cleanup, marcandre . lureau, 2016/07/06
- [Qemu-devel] [PATCH v3 10/28] vhost: change some assert() for error_report() or silent fail, marcandre . lureau, 2016/07/06