> -----Original Message----- > From: Anthony PERARD [mailto:anthony.per...@citrix.com] > Sent: 17 June 2019 18:37 > To: Paul Durrant <paul.durr...@citrix.com> > Cc: qemu-devel@nongnu.org; xen-de...@lists.xenproject.org; Stefano Stabellini > <sstabell...@kernel.org> > Subject: Re: [PATCH 4/4] xen: Avoid VLA > > On Mon, Jun 17, 2019 at 05:39:09PM +0100, Paul Durrant wrote: > > > @@ -632,6 +633,8 @@ static void xen_sync_dirty_bitmap(XenIOState *state, > > > return; > > > } > > > > > > + bitmap = g_new0(unsigned long, bitmap_size); > > > + > > > > How hot is this function? It looks (unsurprisingly) like the section > > size determines the map size so I wonder whether it can instead be > > allocated once when the section is added? > > I think we can store the bitmap buffer into the `state' where > `log_for_dirtybit' is already present, and free the bitmap when > `log_for_dirtybit' is cleared.
That sounds better :-) Cheers, Paul > > Thanks, > > -- > Anthony PERARD