From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL3ST-0004Am-Fm for qemu-devel@nongnu.org; Tue, 10 Feb 2015 00:34:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YL3SO-00049Y-MZ for qemu-devel@nongnu.org; Tue, 10 Feb 2015 00:34:01 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:14380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL3SO-00049H-1q for qemu-devel@nongnu.org; Tue, 10 Feb 2015 00:33:56 -0500 Message-ID: <54D99826.9080908@huawei.com> Date: Tue, 10 Feb 2015 13:33:26 +0800 From: Linhaifeng 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> <54D98193.3050709@huawei.com> In-Reply-To: <54D98193.3050709@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: Gonglei , qemu-devel@nongnu.org Cc: mst@redhat.com On 2015/2/10 11:57, Gonglei wrote: > 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. Hi Gonglei Thank you for your review. Yes, error_report has printed '\n'. I will remove it. >> + 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; >> > > > > . > -- Regards, Haifeng