usb-storage: add bootindex to qom property
commit89f0762dde298aac6949e1cefe06ab4ed13b1135
authorGonglei <arei.gonglei@huawei.com>
Tue, 7 Oct 2014 08:00:33 +0000 (7 16:00 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Oct 2014 08:27:07 +0000 (15 10:27 +0200)
tree212e08b7ea912b7305a0909616fb23b99742aef7
parentaeb98ddc50defe9479d81fcb2afb9aa0c5b61bc8
usb-storage: add bootindex to qom property

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.

Because usb-storage rely on scsi-disk which is created
in usb_msg_realize_storage(), so we should store the SCSIDevice
pointer in MSDState struct. Only in this way, we can change
the global boot_order_list when we want to change the bootindex
during vm rebooting by calling object_property_set_int(Object(SCSIDevice),).

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-storage.c