From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byKYL-0006ei-QH for qemu-devel@nongnu.org; Sun, 23 Oct 2016 11:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byKYI-0006DV-Ll for qemu-devel@nongnu.org; Sun, 23 Oct 2016 11:19:13 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:46346) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byKYI-0006DK-Ev for qemu-devel@nongnu.org; Sun, 23 Oct 2016 11:19:10 -0400 Date: Sun, 23 Oct 2016 11:19:02 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <860278709.2053670.1477235942276.JavaMail.zimbra@redhat.com> In-Reply-To: <20161022214635.24353-1-rafael.tinoco@canonical.com> References: <20161022214635.24353-1-rafael.tinoco@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vhost: secure vhost shared log files using argv paremeter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rafael David Tinoco Cc: qemu-devel@nongnu.org, marcandre lureau , 1626972@bugs.launchpad.net ----- Original Message ----- > 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). > --- > hw/virtio/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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"); > } You should update the patch title/summary, Reviewed-by: Marc-Andr=C3=A9 Lureau