On Mon, Jan 7, 2013 at 4:52 PM, Stefan Hajnoczi <stefa...@gmail.com> wrote:

> On Fri, Dec 07, 2012 at 01:15:09PM +0200, Dmitry Fleytman wrote:
> > +static void vmxnet3_get_ring_from_file(QEMUFile *f, Vmxnet3Ring *r)
> > +{
> > +#if HWADDR_BITS == 64
> > +    r->pa = qemu_get_be64(f);
> > +#else
> > +    r->pa = qemu_get_be32(f);
> > +#endif
>
> hw/virtio.c always uses be64 for its hwaddr pa field.  That way you
> avoid the #ifdefs.
>
>
Good point. Done.



> > +#if HWADDR_BITS == 64
> > +            VMSTATE_UINT64(drv_shmem, VMXNET3State),
> > +            VMSTATE_UINT64(temp_shared_guest_driver_memory,
> VMXNET3State),
> > +#else
> > +            VMSTATE_UINT32(drv_shmem, VMXNET3State),
> > +            VMSTATE_UINT32(temp_shared_guest_driver_memory,
> VMXNET3State),
> > +#endif
>
> The hardware register interface is 2 32-bit registers.  Can you use
> uint64_t for these fields and avoid the #ifdefs?
>

Done.



-- 
Dmitry Fleytman
Technology Expert and Consultant,

Daynix Computing Ltd.

Cell: +972-54-2819481
Skype: dmitry.fleytman

Reply via email to