[libvirt] [PATCH] qemu: Use atomic ops for driver->nactive

Daniel P. Berrange berrange at redhat.com
Tue Feb 19 14:19:32 UTC 2013


On Tue, Feb 19, 2013 at 03:13:44PM +0100, Michal Privoznik wrote:
> On 19.02.2013 14:58, Jiri Denemark wrote:
> > ---
> >  src/qemu/qemu_conf.h    |  2 +-
> >  src/qemu/qemu_process.c | 13 +++++--------
> >  2 files changed, 6 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
> > index b5a3281..a6bd527 100644
> > --- a/src/qemu/qemu_conf.h
> > +++ b/src/qemu/qemu_conf.h
> > @@ -168,7 +168,7 @@ struct _virQEMUDriver {
> >      virCgroupPtr cgroup;
> >  
> >      /* Atomic inc/dec only */
> > -    size_t nactive;
> > +    unsigned int nactive;
> 
> Hopefully nobody gets an overflow here.

The limit on number of guests in the RPC protocol is way
lower than 2^32, so you can't get there.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list