[libvirt] [PATCH] Convert qemu command line flags to 64-bit int

Daniel Veillard veillard at redhat.com
Wed Feb 10 11:03:07 UTC 2010


On Wed, Feb 10, 2010 at 11:45:45AM +0100, Matthias Bolte wrote:
> 2010/2/10 Daniel Veillard <veillard at redhat.com>:
> > On Tue, Feb 09, 2010 at 07:04:24PM +0000, Daniel P. Berrange wrote:
> >> The QEMU flags are commonly stored as a signed or unsigned int,
> >> allowing only 31 flags. This limit is rather close, so to aid
> >> future patches, change it to a 64-bit int
> >>
> >> * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
> >>   tests/qemuargv2xmltest.c, tests/qemuhelptest.c, tests/qemuxml2argvtest.c:
> >>   Use 'unsigned long long' for QEMU flags
> >> ---
> 
> >
> >  ACK, that was something I was about to look at :-)
> > hopefully the enum definition for the flags will allow to go over
> > 32 bits too, I think the patch should also change all the
> > QEMUD_CMD_FLAG_ in /src/qemu/qemu_conf.h to be redefined from
> > (1 << x) into (1UUL << x),
> >
> > Daniel
> >
> 
> I missed the fact that the flags are defined as enum members. This
> maybe an issue. IIRC enum members are ints. We should test this to
> make sure it works as expected on 32bit and 64bit systems.

  or just convert all for them as #define !
We don't use any of the properties of an enum anyway, it's just bitfield
enumerations,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list