ide: add calling add_boot_device_patch in bootindex setter function
commitd2b186f96d19c1f8a6b7e528ff32c24096d5b204
authorGonglei <arei.gonglei@huawei.com>
Tue, 7 Oct 2014 08:00:35 +0000 (7 16:00 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Oct 2014 08:45:51 +0000 (15 10:45 +0200)
tree374ba75e25297bf22c16921a8b0b40d12fd1ce6b
parent33739c712982929a7763f0ae42a0a9c3b3f21796
ide: add calling add_boot_device_patch in bootindex setter function

On this way, we can assure the new bootindex take effect
during vm rebooting. Meanwhile set the initial value of
bootindex to -1.

Because ide devcies's unit property maybe
do not initialize when set_bootindex function is called,
so that we don't know its suffix. So we have to save the
call add_boot_device_path() on ide realize/init function.
When we want to change bootindex during vm rebooting, we
can call it in setter function.

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