* Zhoujian (jay) ([email protected]) wrote: > Hi Dave, > > > -----Original Message----- > > From: Dr. David Alan Gilbert [mailto:[email protected]] > > Sent: Friday, December 15, 2017 3:49 AM > > To: Michael S. Tsirkin <[email protected]> > > Cc: Zhoujian (jay) <[email protected]>; [email protected]; > > Huangweidong (C) <[email protected]>; Gonglei (Arei) > > <[email protected]>; wangxin (U) <[email protected]>; > > Liuzhe (Cloud Open Labs, NFV) <[email protected]>; Igor Mammedov > > <[email protected]> > > Subject: Re: [PATCH 0/2] vhost: two fixes > > > > * Michael S. Tsirkin ([email protected]) 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?
That's my understanding, because of the call to vhost_backend_can_merge > 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? If we need globals I'm not sure it matters that much where they live. Dave > Regards, > Jay -- Dr. David Alan Gilbert / [email protected] / Manchester, UK
