diff options
author | 2009-12-10 11:11:07 +0100 | |
---|---|---|
committer | 2009-12-12 08:17:30 -0600 | |
commit | 6e792a557e5c710c9ccb3507bf5aa4e457a49318 (patch) | |
tree | c1e3f2ce98963590f0e4ca57f91d0e79010febb0 /hw | |
parent | pci: don't hw_error() when no slot is available. (diff) | |
download | qemu-kvm-6e792a557e5c710c9ccb3507bf5aa4e457a49318.tar.gz qemu-kvm-6e792a557e5c710c9ccb3507bf5aa4e457a49318.tar.bz2 qemu-kvm-6e792a557e5c710c9ccb3507bf5aa4e457a49318.zip |
scsi: fix drive hotplug.
This patch fills the DriveInfo->unit after hotplugging a scsi disk.
It makes a difference when auto-assigning a scsi id, where unit was
left filled with '-1' instead of the actual scsi id.
With this patch applied the the drive naming logic in drive_init() works
as good as it did in previous releases. Which means it works fine with
a single scsi bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 11f4d7f483d9ca3a8979abd605cf1468b3e96aa2)
Diffstat (limited to 'hw')
-rw-r--r-- | hw/pci-hotplug.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 7e5c51dfe..9e8e6ed42 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -93,6 +93,7 @@ static int scsi_hot_add(DeviceState *adapter, DriveInfo *dinfo, int printinfo) */ dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1); scsidev = scsi_bus_legacy_add_drive(scsibus, dinfo, dinfo->unit); + dinfo->unit = scsidev->id; if (printinfo) qemu_error("OK bus %d, unit %d\n", scsibus->busnr, scsidev->id); |