Re: [Qemu-block] [Qemu-devel] [PATCH] m25p80: provide a realize to support late inits.
On 06/15/2016 04:07 PM, Peter Maydell wrote: > On 15 June 2016 at 15:00, Cédric Le Goaterwrote: >> We also need to realize() the SSISlave part of the object. This is why >> the previous realize() ops is stored in M25P80Class and called in the >> object realize() ops. >> >> This is fully compatible with the existing users of m25p80 and it >> provides a way to handle errors on the drive backend. >> >> Signed-off-by: Cédric Le Goater >> --- > >> +static void m25p80_realize(DeviceState *dev, Error **errp) >> +{ >> +Flash *s = M25P80(dev); >> +M25P80Class *mc = M25P80_GET_CLASS(s); >> +DriveInfo *dinfo; >> + >> +/* initialize the SSISlave part */ >> +mc->parent_dc_realize(dev, errp); >> >> -/* FIXME use a qdev drive property instead of drive_get_next() */ >> dinfo = drive_get_next(IF_MTD); > > Why have you removed the FIXME comment ? This is an error. I should not have removed this one. Only the one related on late-init :/ C.
Re: [Qemu-block] [Qemu-devel] [PATCH] m25p80: provide a realize to support late inits.
On 15 June 2016 at 15:00, Cédric Le Goaterwrote: > We also need to realize() the SSISlave part of the object. This is why > the previous realize() ops is stored in M25P80Class and called in the > object realize() ops. > > This is fully compatible with the existing users of m25p80 and it > provides a way to handle errors on the drive backend. > > Signed-off-by: Cédric Le Goater > --- > +static void m25p80_realize(DeviceState *dev, Error **errp) > +{ > +Flash *s = M25P80(dev); > +M25P80Class *mc = M25P80_GET_CLASS(s); > +DriveInfo *dinfo; > + > +/* initialize the SSISlave part */ > +mc->parent_dc_realize(dev, errp); > > -/* FIXME use a qdev drive property instead of drive_get_next() */ > dinfo = drive_get_next(IF_MTD); Why have you removed the FIXME comment ? thanks -- PMM