Received: from eggs.gnu.org ([2001:4830:134:3::10]:45776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byhHN-0002vl-7d for qemu-devel@nongnu.org; Mon, 24 Oct 2016 11:35:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byhHI-0005on-Aq for qemu-devel@nongnu.org; Mon, 24 Oct 2016 11:35:13 -0400 Received: from mail-yb0-x229.google.com ([2607:f8b0:4002:c09::229]:34321) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byhHI-0005lp-4Q for qemu-devel@nongnu.org; Mon, 24 Oct 2016 11:35:08 -0400 Received: by mail-yb0-x229.google.com with SMTP id f97so79191378ybi.1 for ; Mon, 24 Oct 2016 08:35:07 -0700 (PDT) From: Rafael David Tinoco Date: Mon, 24 Oct 2016 15:35:03 +0000 Message-Id: <20161024153503.25914-1-rafael.tinoco@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] vhost: migration blocker only if shared log is used List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, 1626972@bugs.launchpad.net, rafael.tinoco@canonical.com Commit 31190ed7 added a migration blocker in vhost_dev_init() to check if memfd would succeed. It is better if this blocker first checks if vhost backend requires shared log. This will avoid a situation where a blocker is added inappropriately (e.g. shared log allocation fails when vhost backend doesn't support it). Signed-off-by: Rafael David Tinoco Reviewed-by: Marc-André Lureau --- 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 bd051ab..742d0aa 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1122,7 +1122,7 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, if (!(hdev->features & (0x1ULL << VHOST_F_LOG_ALL))) { error_setg(&hdev->migration_blocker, "Migration disabled: vhost lacks VHOST_F_LOG_ALL feature."); - } else if (!qemu_memfd_check()) { + } else if (vhost_dev_log_is_shared(hdev) && !qemu_memfd_check()) { error_setg(&hdev->migration_blocker, "Migration disabled: failed to allocate shared memory"); } -- 2.9.3