From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePhjZ-0004wo-MB for qemu-devel@nongnu.org; Thu, 14 Dec 2017 23:36:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePhjV-0003C0-Ch for qemu-devel@nongnu.org; Thu, 14 Dec 2017 23:36:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56386) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePhjV-00039p-6I for qemu-devel@nongnu.org; Thu, 14 Dec 2017 23:36:25 -0500 Date: Fri, 15 Dec 2017 06:36:21 +0200 From: "Michael S. Tsirkin" Message-ID: <20171215063550-mutt-send-email-mst@kernel.org> References: <1513269392-23224-1-git-send-email-jianjay.zhou@huawei.com> <20171214202619-mutt-send-email-mst@kernel.org> <20171214194920.GH4380@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 0/2] vhost: two fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zhoujian (jay)" Cc: "Dr. David Alan Gilbert" , "qemu-devel@nongnu.org" , "Huangweidong (C)" , "Gonglei (Arei)" , "wangxin (U)" , "Liuzhe (Cloud Open Labs, NFV)" , Igor Mammedov On Fri, Dec 15, 2017 at 02:38:35AM +0000, Zhoujian (jay) wrote: > Hi Dave, > > > -----Original Message----- > > From: Dr. David Alan Gilbert [mailto:dgilbert@redhat.com] > > Sent: Friday, December 15, 2017 3:49 AM > > To: Michael S. Tsirkin > > Cc: Zhoujian (jay) ; qemu-devel@nongnu.org; > > Huangweidong (C) ; Gonglei (Arei) > > ; wangxin (U) ; > > Liuzhe (Cloud Open Labs, NFV) ; Igor Mammedov > > > > Subject: Re: [PATCH 0/2] vhost: two fixes > > > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > On Fri, Dec 15, 2017 at 12:36:30AM +0800, Jay Zhou wrote: > > > > Jay Zhou (2): > > > > vhost: add used memslot number for vhost-user > > > > vhost: double check memslot number > > > > > > > > hw/virtio/vhost-user.c | 31 +++++++++++++++++++++++++ > > > > hw/virtio/vhost.c | 49 > > ++++++++++++++++++++++++++++++++++----- > > > > include/hw/virtio/vhost-backend.h | 4 ++++ > > > > 3 files changed, 78 insertions(+), 6 deletions(-) > > > > > > Cc two developers working on these files right now. > > > > I have to admit to not understanding the 'used_memslots' variable. > > > > * It's a global in vhost.c > > * but set by vhost_set_memory that's called from the listener associated > > with each individual vhost > > * While they're probably always the same, the merging code calls > > the vhost_backend_can_merge method for each device, so the number > > of regions can be different. > > > > Your mean for some devices the new added MemoryRegionSection can be merged, > but for others it can not be merged? IIUC the vhost_mem for each vhost_dev > is the same. > > Meanwhile, I think it is more reasonable to add globals in vhost-backend.c > and vhost-user.c respectively instead of 'used_memslots'. The reason > is explained in patch 1. What do you think? > > Regards, > Jay I'd rather avoid globals completely if possible. -- MST