Re: [Qemu-devel] [RFC PATCH 3/6] RAMBlock: Add a name field

Paul Brook
2010-06-09T20:37:38Z

> > Not really. This identifier is device and bus independent, which is why
> > I suggested passing the device to qemu_ram_alloc. This can then figure
> > out how to the identify the device. It should probably do this the same
> > way that we identify the saved state for the device. Currently I think
> > this is an arbitrary vmstate name/id, but I expect this to change to a
> > qdev address (e.g. /i440FX-pcihost/pci.0/_addr_04.0").
>
> Ok, that seems fairly reasonable, so from a device pointer we can get
> something like "/i440FX-pcihost/pci.0/_addr_04.0", then we can add
> something like ":rom" or ":bar.0" to it via an extra string.
>
> qemu_ram_alloc(DeviceState *dev, const char *info, size)

Exactly - though personally I wouldn't call the second argument "info".

> Does a function already exist to print out a qdev address path?

No.

I may have been a bit misleading here. What we really want to do is use the
same matching algorithm as is used by the rest of the device state. Currently
this is a vmstate name and [arbitrary] numeric id. I don't remember whether
there's a convenient link from a device to its associated vmstate - if there
isn't there probably should be.

Paul