On Tue, Jun 27, 2017 at 06:05:55PM +0200, Alberto Garcia wrote: > On Mon 26 Jun 2017 06:58:32 PM CEST, Manos Pitsidianakis wrote: > > On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: > >>On Fri, Jun 23, 2017 at 03:46:56PM +0300, Manos Pitsidianakis wrote: > >>> +static bool throttle_group_exists(const char *name) > >>> +{ > >>> + ThrottleGroup *iter; > >>> + bool ret = false; > >>> + > >>> + qemu_mutex_lock(&throttle_groups_lock); > >> > >>Not sure if this lock or the throttle_groups list are necessary. > > As Manos says accesses to the throttle_groups list need to be locked.
Explicit locking is only necessary if the list is accessed outside the QEMU global mutex. If the monitor is the only thing that accesses the list then a lock is not necessary. Anyway, this point might be moot if every ThrottleGroup is a QOM object and we drop this code in favor of using QOM APIs to find and iterate over objects. Stefan
signature.asc
Description: PGP signature