Message ID | 155023081228.1011724.12474992370439652538.stgit@bahia.lan (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xics: Get rid of KVM specific classes | expand |
On 2/15/19 12:40 PM, Greg Kurz wrote: > The KVM ICP class isn't used anymore. Drop it. Isn't migration complaining ? If not, Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > Signed-off-by: Greg Kurz <groug@kaod.org> > --- > hw/intc/xics_kvm.c | 18 ------------------ > include/hw/ppc/xics.h | 3 --- > 2 files changed, 21 deletions(-) > > diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c > index 4eebced516b6..fae4ac431f2f 100644 > --- a/hw/intc/xics_kvm.c > +++ b/hw/intc/xics_kvm.c > @@ -152,23 +152,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) > QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); > } > > -static void icp_kvm_class_init(ObjectClass *klass, void *data) > -{ > - DeviceClass *dc = DEVICE_CLASS(klass); > - ICPStateClass *icpc = ICP_CLASS(klass); > - > - device_class_set_parent_realize(dc, icp_kvm_realize, > - &icpc->parent_realize); > -} > - > -static const TypeInfo icp_kvm_info = { > - .name = TYPE_KVM_ICP, > - .parent = TYPE_ICP, > - .instance_size = sizeof(ICPState), > - .class_init = icp_kvm_class_init, > - .class_size = sizeof(ICPStateClass), > -}; > - > /* > * ICS-KVM > */ > @@ -425,7 +408,6 @@ fail: > static void xics_kvm_register_types(void) > { > type_register_static(&ics_kvm_info); > - type_register_static(&icp_kvm_info); > } > > type_init(xics_kvm_register_types) > diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > index ab61dc24010a..fae54e6f28ae 100644 > --- a/include/hw/ppc/xics.h > +++ b/include/hw/ppc/xics.h > @@ -50,9 +50,6 @@ typedef struct XICSFabric XICSFabric; > #define TYPE_ICP "icp" > #define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) > > -#define TYPE_KVM_ICP "icp-kvm" > -#define KVM_ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_KVM_ICP) > - > #define TYPE_PNV_ICP "pnv-icp" > #define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP) > >
On Fri, 15 Feb 2019 13:55:53 +0100 Cédric Le Goater <clg@kaod.org> wrote: > On 2/15/19 12:40 PM, Greg Kurz wrote: > > The KVM ICP class isn't used anymore. Drop it. > > Isn't migration complaining ? If not, > Hm.. no, but why would migration complain ? > Reviewed-by: Cédric Le Goater <clg@kaod.org> > > Thanks, > > C. > > > > > Signed-off-by: Greg Kurz <groug@kaod.org> > > --- > > hw/intc/xics_kvm.c | 18 ------------------ > > include/hw/ppc/xics.h | 3 --- > > 2 files changed, 21 deletions(-) > > > > diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c > > index 4eebced516b6..fae4ac431f2f 100644 > > --- a/hw/intc/xics_kvm.c > > +++ b/hw/intc/xics_kvm.c > > @@ -152,23 +152,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) > > QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); > > } > > > > -static void icp_kvm_class_init(ObjectClass *klass, void *data) > > -{ > > - DeviceClass *dc = DEVICE_CLASS(klass); > > - ICPStateClass *icpc = ICP_CLASS(klass); > > - > > - device_class_set_parent_realize(dc, icp_kvm_realize, > > - &icpc->parent_realize); > > -} > > - > > -static const TypeInfo icp_kvm_info = { > > - .name = TYPE_KVM_ICP, > > - .parent = TYPE_ICP, > > - .instance_size = sizeof(ICPState), > > - .class_init = icp_kvm_class_init, > > - .class_size = sizeof(ICPStateClass), > > -}; > > - > > /* > > * ICS-KVM > > */ > > @@ -425,7 +408,6 @@ fail: > > static void xics_kvm_register_types(void) > > { > > type_register_static(&ics_kvm_info); > > - type_register_static(&icp_kvm_info); > > } > > > > type_init(xics_kvm_register_types) > > diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > > index ab61dc24010a..fae54e6f28ae 100644 > > --- a/include/hw/ppc/xics.h > > +++ b/include/hw/ppc/xics.h > > @@ -50,9 +50,6 @@ typedef struct XICSFabric XICSFabric; > > #define TYPE_ICP "icp" > > #define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) > > > > -#define TYPE_KVM_ICP "icp-kvm" > > -#define KVM_ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_KVM_ICP) > > - > > #define TYPE_PNV_ICP "pnv-icp" > > #define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP) > > > > >
On 2/15/19 2:18 PM, Greg Kurz wrote: > On Fri, 15 Feb 2019 13:55:53 +0100 > Cédric Le Goater <clg@kaod.org> wrote: > >> On 2/15/19 12:40 PM, Greg Kurz wrote: >>> The KVM ICP class isn't used anymore. Drop it. >> >> Isn't migration complaining ? If not, >> > > Hm.. no, but why would migration complain ? You are changing the type name of the object being transferred: "icp-kcm" -> "icp" Isn't that an issue ? C. > >> Reviewed-by: Cédric Le Goater <clg@kaod.org> >> >> Thanks, >> >> C. >> >> >> >>> Signed-off-by: Greg Kurz <groug@kaod.org> >>> --- >>> hw/intc/xics_kvm.c | 18 ------------------ >>> include/hw/ppc/xics.h | 3 --- >>> 2 files changed, 21 deletions(-) >>> >>> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c >>> index 4eebced516b6..fae4ac431f2f 100644 >>> --- a/hw/intc/xics_kvm.c >>> +++ b/hw/intc/xics_kvm.c >>> @@ -152,23 +152,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) >>> QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); >>> } >>> >>> -static void icp_kvm_class_init(ObjectClass *klass, void *data) >>> -{ >>> - DeviceClass *dc = DEVICE_CLASS(klass); >>> - ICPStateClass *icpc = ICP_CLASS(klass); >>> - >>> - device_class_set_parent_realize(dc, icp_kvm_realize, >>> - &icpc->parent_realize); >>> -} >>> - >>> -static const TypeInfo icp_kvm_info = { >>> - .name = TYPE_KVM_ICP, >>> - .parent = TYPE_ICP, >>> - .instance_size = sizeof(ICPState), >>> - .class_init = icp_kvm_class_init, >>> - .class_size = sizeof(ICPStateClass), >>> -}; >>> - >>> /* >>> * ICS-KVM >>> */ >>> @@ -425,7 +408,6 @@ fail: >>> static void xics_kvm_register_types(void) >>> { >>> type_register_static(&ics_kvm_info); >>> - type_register_static(&icp_kvm_info); >>> } >>> >>> type_init(xics_kvm_register_types) >>> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h >>> index ab61dc24010a..fae54e6f28ae 100644 >>> --- a/include/hw/ppc/xics.h >>> +++ b/include/hw/ppc/xics.h >>> @@ -50,9 +50,6 @@ typedef struct XICSFabric XICSFabric; >>> #define TYPE_ICP "icp" >>> #define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) >>> >>> -#define TYPE_KVM_ICP "icp-kvm" >>> -#define KVM_ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_KVM_ICP) >>> - >>> #define TYPE_PNV_ICP "pnv-icp" >>> #define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP) >>> >>> >> >
On Fri, 15 Feb 2019 14:35:03 +0100 Cédric Le Goater <clg@kaod.org> wrote: > On 2/15/19 2:18 PM, Greg Kurz wrote: > > On Fri, 15 Feb 2019 13:55:53 +0100 > > Cédric Le Goater <clg@kaod.org> wrote: > > > >> On 2/15/19 12:40 PM, Greg Kurz wrote: > >>> The KVM ICP class isn't used anymore. Drop it. > >> > >> Isn't migration complaining ? If not, > >> > > > > Hm.. no, but why would migration complain ? > > You are changing the type name of the object being transferred: > > "icp-kcm" -> "icp" > AFAIK type names aren't part of the vmstate description. > Isn't that an issue ? > > C. > > > > >> Reviewed-by: Cédric Le Goater <clg@kaod.org> > >> > >> Thanks, > >> > >> C. > >> > >> > >> > >>> Signed-off-by: Greg Kurz <groug@kaod.org> > >>> --- > >>> hw/intc/xics_kvm.c | 18 ------------------ > >>> include/hw/ppc/xics.h | 3 --- > >>> 2 files changed, 21 deletions(-) > >>> > >>> diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c > >>> index 4eebced516b6..fae4ac431f2f 100644 > >>> --- a/hw/intc/xics_kvm.c > >>> +++ b/hw/intc/xics_kvm.c > >>> @@ -152,23 +152,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) > >>> QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); > >>> } > >>> > >>> -static void icp_kvm_class_init(ObjectClass *klass, void *data) > >>> -{ > >>> - DeviceClass *dc = DEVICE_CLASS(klass); > >>> - ICPStateClass *icpc = ICP_CLASS(klass); > >>> - > >>> - device_class_set_parent_realize(dc, icp_kvm_realize, > >>> - &icpc->parent_realize); > >>> -} > >>> - > >>> -static const TypeInfo icp_kvm_info = { > >>> - .name = TYPE_KVM_ICP, > >>> - .parent = TYPE_ICP, > >>> - .instance_size = sizeof(ICPState), > >>> - .class_init = icp_kvm_class_init, > >>> - .class_size = sizeof(ICPStateClass), > >>> -}; > >>> - > >>> /* > >>> * ICS-KVM > >>> */ > >>> @@ -425,7 +408,6 @@ fail: > >>> static void xics_kvm_register_types(void) > >>> { > >>> type_register_static(&ics_kvm_info); > >>> - type_register_static(&icp_kvm_info); > >>> } > >>> > >>> type_init(xics_kvm_register_types) > >>> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > >>> index ab61dc24010a..fae54e6f28ae 100644 > >>> --- a/include/hw/ppc/xics.h > >>> +++ b/include/hw/ppc/xics.h > >>> @@ -50,9 +50,6 @@ typedef struct XICSFabric XICSFabric; > >>> #define TYPE_ICP "icp" > >>> #define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) > >>> > >>> -#define TYPE_KVM_ICP "icp-kvm" > >>> -#define KVM_ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_KVM_ICP) > >>> - > >>> #define TYPE_PNV_ICP "pnv-icp" > >>> #define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP) > >>> > >>> > >> > > >
On Fri, Feb 15, 2019 at 02:35:03PM +0100, Cédric Le Goater wrote: > On 2/15/19 2:18 PM, Greg Kurz wrote: > > On Fri, 15 Feb 2019 13:55:53 +0100 > > Cédric Le Goater <clg@kaod.org> wrote: > > > >> On 2/15/19 12:40 PM, Greg Kurz wrote: > >>> The KVM ICP class isn't used anymore. Drop it. > >> > >> Isn't migration complaining ? If not, > >> > > > > Hm.. no, but why would migration complain ? > > You are changing the type name of the object being transferred: > > "icp-kcm" -> "icp" It's a little more complex than that. The way migration works, the state associated with the base class is transferred under the name "icp" and the state associated with the derived class is transferred under the name "icp-kvm". > Isn't that an issue ? It would be.. except that there is no extra state in the derived class, which is why we got away with this not-very-good solution at all in the first place.
On 2/18/19 12:37 AM, David Gibson wrote: > On Fri, Feb 15, 2019 at 02:35:03PM +0100, Cédric Le Goater wrote: >> On 2/15/19 2:18 PM, Greg Kurz wrote: >>> On Fri, 15 Feb 2019 13:55:53 +0100 >>> Cédric Le Goater <clg@kaod.org> wrote: >>> >>>> On 2/15/19 12:40 PM, Greg Kurz wrote: >>>>> The KVM ICP class isn't used anymore. Drop it. >>>> >>>> Isn't migration complaining ? If not, >>>> >>> >>> Hm.. no, but why would migration complain ? >> >> You are changing the type name of the object being transferred: >> >> "icp-kcm" -> "icp" > > It's a little more complex than that. The way migration works, the > state associated with the base class is transferred under the name > "icp" and the state associated with the derived class is transferred > under the name "icp-kvm". > >> Isn't that an issue ? > > It would be.. except that there is no extra state in the derived > class, which is why we got away with this not-very-good solution at > all in the first place. Ah good. Another reason to get rid of the sub-class. C.
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 4eebced516b6..fae4ac431f2f 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -152,23 +152,6 @@ void icp_kvm_realize(DeviceState *dev, Error **errp) QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); } -static void icp_kvm_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc = DEVICE_CLASS(klass); - ICPStateClass *icpc = ICP_CLASS(klass); - - device_class_set_parent_realize(dc, icp_kvm_realize, - &icpc->parent_realize); -} - -static const TypeInfo icp_kvm_info = { - .name = TYPE_KVM_ICP, - .parent = TYPE_ICP, - .instance_size = sizeof(ICPState), - .class_init = icp_kvm_class_init, - .class_size = sizeof(ICPStateClass), -}; - /* * ICS-KVM */ @@ -425,7 +408,6 @@ fail: static void xics_kvm_register_types(void) { type_register_static(&ics_kvm_info); - type_register_static(&icp_kvm_info); } type_init(xics_kvm_register_types) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index ab61dc24010a..fae54e6f28ae 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -50,9 +50,6 @@ typedef struct XICSFabric XICSFabric; #define TYPE_ICP "icp" #define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP) -#define TYPE_KVM_ICP "icp-kvm" -#define KVM_ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_KVM_ICP) - #define TYPE_PNV_ICP "pnv-icp" #define PNV_ICP(obj) OBJECT_CHECK(PnvICPState, (obj), TYPE_PNV_ICP)
The KVM ICP class isn't used anymore. Drop it. Signed-off-by: Greg Kurz <groug@kaod.org> --- hw/intc/xics_kvm.c | 18 ------------------ include/hw/ppc/xics.h | 3 --- 2 files changed, 21 deletions(-)