diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-18 17:45:47 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-23 10:32:35 +0200 |
commit | 6f2b9a5b24c488d38ace01910c684749ff922e26 (patch) | |
tree | 0e894aa7404967de69228d90efaa00e322c8c00d /hw/input/virtio-input.c | |
parent | 0c8ff723bd29e5c8b2ca989f857ae5c37ec49c4e (diff) |
virtio-input: move properties, use virtio_instance_init_common
Move properties from virtio-*-pci to virtio-*-device.
Also make better use of QOM and attach common properties
to the abstract parent classes (virtio-input-device and
virtio-input-pci-device).
Switch the hid device instance init functions over to use
virtio_instance_init_common, so we get the properties of the
virtio device aliased properly to the virtio pci proxy.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/input/virtio-input.c')
-rw-r--r-- | hw/input/virtio-input.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c index c4f4b3c150..7f5b8d6000 100644 --- a/hw/input/virtio-input.c +++ b/hw/input/virtio-input.c @@ -216,7 +216,7 @@ static void virtio_input_device_realize(DeviceState *dev, Error **errp) } virtio_input_idstr_config(vinput, VIRTIO_INPUT_CFG_ID_SERIAL, - vinput->input.serial); + vinput->serial); QTAILQ_FOREACH(cfg, &vinput->cfg_list, node) { if (vinput->cfg_size < cfg->config.size) { @@ -248,11 +248,17 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp) virtio_cleanup(vdev); } +static Property virtio_input_properties[] = { + DEFINE_PROP_STRING("serial", VirtIOInput, serial), + DEFINE_PROP_END_OF_LIST(), +}; + static void virtio_input_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); + dc->props = virtio_input_properties; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); vdc->realize = virtio_input_device_realize; vdc->unrealize = virtio_input_device_unrealize; |