On Wed, 2010-08-25 at 11:19 -0400, Alon Levy wrote: > ----- "Alexander Larsson" <al...@redhat.com> wrote: > > > + const char* (*subtype)(SpiceCharDeviceInstance *sin); > > > > I don't think we need a callback here. Just make this a const char *. > > > > No, that doesn't work - the subtype is not a feature of the interface, it's a > feature > of the specific instance: > > typedef struct SpiceVirtualChannel { > VirtIOSerialPort port; > VMChangeStateEntry *vmstate; > SpiceCharDeviceInstance sin; > ... > } > > and then: > > static const char* vmc_subtype(SpiceCharDeviceInstance* sin) > { > SpiceVirtualChannel *scd = container_of(sin, SpiceVirtualChannel, sin); > > dprintf(scd, 2, "%s\n", __func__); > return scd->subtype; > }
I see. So, make the const char *subtype member be a member of SpiceCharDeviceInstance then. Just like "int id" is in QXLInstance. _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel