From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL1yL-0005HK-CY for qemu-devel@nongnu.org; Mon, 09 Feb 2015 22:58:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YL1yD-0005VF-Lw for qemu-devel@nongnu.org; Mon, 09 Feb 2015 22:58:49 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:48264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL1yD-0005TW-49 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 22:58:41 -0500 Message-ID: <54D98193.3050709@huawei.com> Date: Tue, 10 Feb 2015 11:57:07 +0800 From: Gonglei MIME-Version: 1.0 References: <1423538687-4784-1-git-send-email-haifeng.lin@huawei.com> <1423538687-4784-2-git-send-email-haifeng.lin@huawei.com> In-Reply-To: <1423538687-4784-2-git-send-email-haifeng.lin@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: linhaifeng , qemu-devel@nongnu.org Cc: mst@redhat.com On 2015/2/10 11:24, linhaifeng wrote: > From: Linhaifeng > > If u64 is not 0 we should return -1 to tell qemu not going on. > > Signed-off-by: Linhaifeng > --- > hw/virtio/vhost-user.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > index aefe0bb..a68ce36 100644 > --- a/hw/virtio/vhost-user.c > +++ b/hw/virtio/vhost-user.c > @@ -243,7 +243,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request, > msg.size = sizeof(m.memory.nregions); > msg.size += sizeof(m.memory.padding); > msg.size += fd_num * sizeof(VhostUserMemoryRegion); > - > + need_reply = 1; > break; > > case VHOST_SET_LOG_FD: > @@ -315,6 +315,17 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request, > } > memcpy(arg, &msg.state, sizeof(struct vhost_vring_state)); > break; > + case VHOST_SET_MEM_TABLE: > + if (msg.size != sizeof(m.u64)) { > + error_report("Received bad msg size.\n"); A superfluous "\n" character. > + return -1; > + } else { > + if (m.u64) { > + error_report("Failed to set memory table.\n"); A superfluous "\n" character. Regards, -Gonglei > + return -1; > + } > + } > + break; > default: > error_report("Received unexpected msg type.\n"); > return -1; >