aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_vscsi.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-15 16:31:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:49 -0600
commit3954d33ab7f82f5a5fa0ced231849920265a5fec (patch)
tree2535349de87b099d02c5bf6cb328191ef23f593b /hw/spapr_vscsi.c
parentb9eea3e6a435a79fe308212157e0875442b760e4 (diff)
spapr: convert to QEMU Object Model (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - use QOM to check for the default console
Diffstat (limited to 'hw/spapr_vscsi.c')
-rw-r--r--hw/spapr_vscsi.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index 21d946e2c5..b83bb7f341 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -947,19 +947,28 @@ static int spapr_vscsi_devnode(VIOsPAPRDevice *dev, void *fdt, int node_off)
return 0;
}
-static VIOsPAPRDeviceInfo spapr_vscsi_info = {
- .init = spapr_vscsi_init,
- .devnode = spapr_vscsi_devnode,
- .dt_name = "v-scsi",
- .dt_type = "vscsi",
- .dt_compatible = "IBM,v-scsi",
- .signal_mask = 0x00000001,
- .qdev.name = "spapr-vscsi",
- .qdev.size = sizeof(VSCSIState),
- .qdev.props = (Property[]) {
- DEFINE_SPAPR_PROPERTIES(VSCSIState, vdev, 0x2000, 0x10000000),
- DEFINE_PROP_END_OF_LIST(),
- },
+static Property spapr_vscsi_properties[] = {
+ DEFINE_SPAPR_PROPERTIES(VSCSIState, vdev, 0x2000, 0x10000000),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void spapr_vscsi_class_init(ObjectClass *klass, void *data)
+{
+ VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass);
+
+ k->init = spapr_vscsi_init;
+ k->devnode = spapr_vscsi_devnode;
+ k->dt_name = "v-scsi";
+ k->dt_type = "vscsi";
+ k->dt_compatible = "IBM,v-scsi";
+ k->signal_mask = 0x00000001;
+}
+
+static DeviceInfo spapr_vscsi_info = {
+ .name = "spapr-vscsi",
+ .size = sizeof(VSCSIState),
+ .props = spapr_vscsi_properties,
+ .class_init = spapr_vscsi_class_init,
};
static void spapr_vscsi_register(void)