virtio-blk: add bootindex to qom property
authorGonglei <arei.gonglei@huawei.com>
Tue, 7 Oct 2014 08:00:30 +0000 (16:00 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Oct 2014 07:52:55 +0000 (09:52 +0200)
Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/block/virtio-blk.c

index 45e0c8f6e9731de20caed6d0603071451187d7bc..fd1ad3abbe803b5bfa0f860f167b59a8b12eef9f 100644 (file)
@@ -794,6 +794,9 @@ static void virtio_blk_instance_init(Object *obj)
                              (Object **)&s->blk.iothread,
                              qdev_prop_allow_set_link_before_realize,
                              OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
+    device_add_bootindex_property(obj, &s->blk.conf.bootindex,
+                                  "bootindex", "/disk@0,0",
+                                  DEVICE(obj), NULL);
 }
 
 static Property virtio_blk_properties[] = {