ide: Add resize callback to ide/core
authorJohn Snow <jsnow@redhat.com>
Fri, 5 Sep 2014 03:42:17 +0000 (23:42 -0400)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 8 Sep 2014 10:12:44 +0000 (11:12 +0100)
commit01ce352e62c3f86df6f4ad32c3ab9353e55af799
treecd90e523bbf1b752826bec98a927c95f6e6157cc
parent4bf6637d35723f92e03f427c78d7ad130be41e6f
ide: Add resize callback to ide/core

Currently, if the block device backing the IDE drive is resized,
the information about the device as cached inside of the IDEState
structure is not updated, thus when a guest OS re-queries the drive,
it is unable to see the expanded size.

This patch adds a resize callback that updates the IDENTIFY data
buffer in order to correct this.

Lastly, a Linux guest as-is cannot resize a libata drive while in-use,
but it can see the expanded size as part of a bus rescan event.
This patch also allows guests such as Linux to see the new drive size
after a soft reboot event, without having to exit the QEMU process.

Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ide/core.c