All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: mukawa@igel.co.jp, yuanhan.liu@linux.intel.com,
	victork@redhat.com, jonshin@cisco.com, mst@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v2 06/23] vhost: add vhost device only after all success
Date: Fri, 24 Jun 2016 15:50:53 +0200	[thread overview]
Message-ID: <20160624135110.17260-7-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20160624135110.17260-1-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

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 <marcandre.lureau@redhat.com>
---
 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 ce930cb..9c8c9f8 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

  parent reply	other threads:[~2016-06-24 13:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 13:50 [Qemu-devel] [PATCH v2 00/23] vhost-user reconnect fixes marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 01/23] misc: indentation marcandre.lureau
2016-06-24 14:19   ` Eric Blake
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 02/23] vhost-user: minor simplification marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 03/23] vhost: don't assume opaque is a fd, use backend cleanup marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 04/23] vhost: make vhost_log_put() idempotent marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 05/23] vhost: call vhost_log_put() on cleanup marcandre.lureau
2016-06-24 13:50 ` marcandre.lureau [this message]
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 07/23] vhost: make vhost_dev_cleanup() idempotent marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 08/23] vhost-net: always call vhost_dev_cleanup() on failure marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 09/23] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init() marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 10/23] vhost: change some assert() for error_report() or silent fail marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 11/23] vhost: use error_report() instead of fprintf(stderr, ...) marcandre.lureau
2016-06-24 13:50 ` [Qemu-devel] [PATCH v2 12/23] vhost-user: check qemu_chr_fe_set_msgfds() return value marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 13/23] vhost-user: check vhost_user_{read, write}() " marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 14/23] qemu-char: check socket is actually connected marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 15/23] vhost-user: keep vhost_net after a disconnection marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 16/23] Revert "vhost-net: do not crash if backend is not present" marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 17/23] get_vhost_net() should be != null after vhost_user_init marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 18/23] vhost-net: success if backend has no ops->vhost_migration_done marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 19/23] vhost: add assert() to check runtime behaviour marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 20/23] char: add chr_wait_connected callback marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 21/23] char: add and use tcp_chr_wait_connected marcandre.lureau
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 22/23] vhost-user: wait until backend init is completed marcandre.lureau
2016-06-30  6:38   ` Yuanhan Liu
2016-06-30  9:22     ` Marc-André Lureau
2016-06-30 13:02       ` Yuanhan Liu
2016-06-24 13:51 ` [Qemu-devel] [PATCH v2 23/23] tests: add /vhost-user/connect-fail test marcandre.lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160624135110.17260-7-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=jonshin@cisco.com \
    --cc=mst@redhat.com \
    --cc=mukawa@igel.co.jp \
    --cc=qemu-devel@nongnu.org \
    --cc=victork@redhat.com \
    --cc=yuanhan.liu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.