From patchwork Mon Oct 24 15:35:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rafael Tinoco X-Patchwork-Id: 9392395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A89C660762 for ; Mon, 24 Oct 2016 15:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A6929145 for ; Mon, 24 Oct 2016 15:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84D8029165; Mon, 24 Oct 2016 15:45:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F111929145 for ; Mon, 24 Oct 2016 15:45:39 +0000 (UTC) Received: from localhost ([::1]:47583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byhRS-0003mo-Qs for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Oct 2016 11:45:38 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LS/MMZY5Z/DFe00p+XiOMtKVnqdPs8NcmRVIt51oBFA=; b=TAU/89jFK7q7ImXaB2RhP6/wwTNjgwQEQwlsbFMXp4xbhf/Oa9kpe657IWz6s5h4zr qDt05BLw1Qx7MMC4QOFXWInAo/dN/t7cWPDS+kynm3U7m6OuuYJgok2zVGRsPRx41vFJ KkAooiR/zXutUKo/Oa5iwlsdjmmAoBJ++BotyjqTgo9PPKyWgYKVK+HkRhDbTqjvb0Mg QAMIPW0iH4OZcPDLVDMvf6zlf8LLyWmctxcAgUXgzDswmx2v0+UHOEDwPDFVAZtL0tMu niM1+vVMKgKp26jc7VtqrHNHDfI4Pf0Bcs2TZ/4HaJsNg76Hwz7BFzG06C5GYSmAUVTU ywFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LS/MMZY5Z/DFe00p+XiOMtKVnqdPs8NcmRVIt51oBFA=; b=CN/gWSxWtIkx/2LFLFNIDaG6XalnB/7LFYDsWS9gybdEg55ZrupFyTUHcSRUMhOZ4t DXh1sy7DF0QRHdwI7MxkD4b7/1MLkxLlfiaSwJqNPGUwNrqshVP8/LjNjgrpfkFtf1m4 1Oz0XA/tLvFWewwBDClCTRb1hdAuIAnfNDQApRJ+AJqW+eBrs7aTS+z2Sl+mp5DM9yCm ysTH1EJdVYjk8+tcFdVmYzufM/uuZ3OtMfKZ0U6MtOCXKRH9XFxNTTGGnMq9tPbjkUWH qEN0LTe9opx7AEWhoGaHjM1mLR2KRbVH8+qUt5yy3r47VnI083JMKXtfHUO4fzDMNF0y wrPw== X-Gm-Message-State: ABUngvceHogPPqBxjTZsocDItOqubPvTWB2v1DNiYhdP6eYEQI0yvToPi0T4zgGK8bi0uicy X-Received: by 10.37.231.18 with SMTP id e18mr16757765ybh.13.1477323306512; Mon, 24 Oct 2016 08:35:06 -0700 (PDT) Received: from qemulivefail.internal.cu ([167.160.113.41]) by smtp.gmail.com with ESMTPSA id c126sm3149619ywf.50.2016.10.24.08.35.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 08:35:06 -0700 (PDT) From: Rafael David Tinoco To: qemu-devel@nongnu.org Date: Mon, 24 Oct 2016 15:35:03 +0000 Message-Id: <20161024153503.25914-1-rafael.tinoco@canonical.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c09::229 Subject: [Qemu-devel] [PATCH] vhost: migration blocker only if shared log is used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, rafael.tinoco@canonical.com, 1626972@bugs.launchpad.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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"); }