diff options
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r-- | hw/scsi-disk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 0f029f897d..3940726f2b 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -936,6 +936,13 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, } } +static void scsi_destroy(SCSIDevice *dev) +{ + SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev); + + drive_uninit(s->dinfo); +} + static int scsi_disk_initfn(SCSIDevice *dev) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev); @@ -969,6 +976,7 @@ static SCSIDeviceInfo scsi_disk_info = { .qdev.desc = "virtual scsi disk or cdrom", .qdev.size = sizeof(SCSIDiskState), .init = scsi_disk_initfn, + .destroy = scsi_destroy, .send_command = scsi_send_command, .read_data = scsi_read_data, .write_data = scsi_write_data, |