[Spice-devel] [PATCH 2/2] spice-{vmc,vdi}: implement subtype

Alon Levy alevy at redhat.com
Thu Aug 26 07:06:49 PDT 2010


----- "Alexander Larsson" <alexl at redhat.com> wrote:

> On Thu, 2010-08-26 at 04:46 -0400, Alon Levy wrote:
> > ---
> >  hw/spice-vdi.c |    6 ++++++
> >  hw/spice-vmc.c |   47
> +++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 53 insertions(+), 0 deletions(-)
> > 
> > diff --git a/hw/spice-vdi.c b/hw/spice-vdi.c
> > index 415932b..f5fda4d 100644
> > --- a/hw/spice-vdi.c
> > +++ b/hw/spice-vdi.c
> > @@ -290,12 +290,18 @@ static int
> vdi_port_interface_read(SpiceCharDeviceInstance *sin,
> >      return actual_read;
> >  }
> >  
> > +static const char* vdi_port_subtype(SpiceCharDeviceInstance* sin)
> > +{
> > +    return "vdagent";
> > +}
> > +
> >  static SpiceCharDeviceInterface vdi_port_interface = {
> >      .base.type          = SPICE_INTERFACE_CHAR_DEVICE,
> >      .base.description   = "vdi port",
> >      .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
> >      .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
> >  
> > +    .subtype            = vdi_port_subtype,
> 
> Should be just 
>        .subtype            = "vdagent",
> 

But now I'm putting the subtype into the Instance, this is the Interface.
It's still just going to be

static int vdi_port_init(PCIDevice *dev)
 +    vdi->sin.subtype = "vdagent";


> >      .write              = vdi_port_interface_write,
> >      .read               = vdi_port_interface_read,
> >  };


More information about the Spice-devel mailing list