From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgv3L-0002Vk-Da for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgv3G-0003mz-HT for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:34:43 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:58620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgv3G-0003mX-B8 for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:34:38 -0400 Date: Tue, 29 Sep 2015 09:34:26 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <1503566733.19681736.1443533666899.JavaMail.zimbra@redhat.com> In-Reply-To: <560A9301.8080701@huawei.com> References: <1443094669-4144-1-git-send-email-marcandre.lureau@redhat.com> <1443094669-4144-26-git-send-email-marcandre.lureau@redhat.com> <560A9301.8080701@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana Cc: drjones@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, marcandre lureau , cam@cs.ualberta.ca Hi ----- Original Message ----- > On 24.09.2015 13:37, marcandre.lureau@redhat.com wrote: > > From: Marc-Andr=C3=A9 Lureau > >=20 > > The server should not change the shm, and this isn't handled by qemu. >=20 > "..., and we should verify this in QEMU?" ok, I'll add that >=20 > >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > hw/misc/ivshmem.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > >=20 > > diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c > > index ea80548..21ef260 100644 > > --- a/hw/misc/ivshmem.c > > +++ b/hw/misc/ivshmem.c > > @@ -533,6 +533,12 @@ static void ivshmem_read(void *opaque, const uint8= _t > > *buf, int size) > > if (incoming_posn =3D=3D -1) { > > void * map_ptr; > > =20 > > + if (s->shm_fd >=3D 0) { > > + error_report("shm already initialized"); > > + close(incoming_fd); > > + return; > > + } > > + > > if (check_shm_size(s, incoming_fd, &err) =3D=3D -1) { > > error_report_err(err); > > close(incoming_fd); > >=20 >=20 > Reviewed-by: Claudio Fontana >=20 >=20