On Sat, 22 Jun 2013 16:50:33 +0800 Hu Tao <hu...@cn.fujitsu.com> wrote:
> Cc: qemu-devel@nongnu.org > Cc: "Andreas Färber" <afaer...@suse.de> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Anthony Liguori <aligu...@us.ibm.com> > Cc: Igor Mammedov <imamm...@redhat.com> > Cc: Eduardo Habkost <ehabk...@redhat.com> > Signed-off-by: Hu Tao <hu...@cn.fujitsu.com> > --- > hw/i386/kvm/clock.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c > index 87d4d0f..74aa240 100644 > --- a/hw/i386/kvm/clock.c > +++ b/hw/i386/kvm/clock.c > @@ -87,12 +87,11 @@ static void kvmclock_vm_state_change(void *opaque, int > running, > } > } > > -static int kvmclock_init(SysBusDevice *dev) > +static void kvmclock_realize(DeviceState *dev, Error **errp) > { > - KVMClockState *s = FROM_SYSBUS(KVMClockState, dev); > + KVMClockState *s = DO_UPCAST(KVMClockState, busdev.qdev, dev); it would be better to swap this patch with 22/26 and use KVM_CLOCK() cast here > > qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s); > - return 0; > } > > static const VMStateDescription kvmclock_vmsd = { > @@ -111,9 +110,8 @@ static const VMStateDescription kvmclock_vmsd = { > static void kvmclock_class_init(ObjectClass *klass, void *data) > { > DeviceClass *dc = DEVICE_CLASS(klass); > - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); > > - k->init = kvmclock_init; > + dc->realize = kvmclock_realize; > dc->no_user = 1; > dc->vmsd = &kvmclock_vmsd; > }