[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/12] vhost-scsi: Call virtio_scsi_common_unrealize(
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/12] vhost-scsi: Call virtio_scsi_common_unrealize() when device realize failed |
Date: |
Sat, 20 Jul 2019 17:18:38 +0200 |
From: Xie Yongji <address@hidden>
This avoids memory leak when device hotplug is failed.
Signed-off-by: Xie Yongji <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/vhost-scsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 76bb875..343ca8b 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -210,7 +210,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error
**errp)
if (err) {
error_propagate(errp, err);
error_free(vsc->migration_blocker);
- goto close_fd;
+ goto free_virtio;
}
}
@@ -240,6 +240,8 @@ static void vhost_scsi_realize(DeviceState *dev, Error
**errp)
migrate_del_blocker(vsc->migration_blocker);
}
g_free(vsc->dev.vqs);
+ free_virtio:
+ virtio_scsi_common_unrealize(dev);
close_fd:
close(vhostfd);
return;
--
1.8.3.1
- [Qemu-devel] [PULL 00/12] Misc patches for QEMU 4.0-rc2, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 01/12] target/i386: kvm: Demand nested migration kernel capabilities only when vCPU may have enabled VMX, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 02/12] target/i386: skip KVM_GET/SET_NESTED_STATE if VMX disabled, or for SVM, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 03/12] virtio-scsi: remove unused argument to virtio_scsi_common_realize, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 04/12] vhost-scsi: Call virtio_scsi_common_unrealize() when device realize failed,
Paolo Bonzini <=
- [Qemu-devel] [PULL 05/12] vhost-user-scsi: Call virtio_scsi_common_unrealize() when device realize failed, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 06/12] scsi-generic: Check sense key before request snooping and patching, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 07/12] test-bitmap: add test for bitmap_set, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 09/12] qmp: don't emit the RESET event on wakeup, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 08/12] hmp: Print if memory section is registered with an accelerator, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 11/12] i386: indicate that 'pconfig' feature was removed intentionally, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 12/12] target/i386: sev: fix failed message typos, Paolo Bonzini, 2019/07/20
- [Qemu-devel] [PULL 10/12] build-sys: do no support modules on Windows, Paolo Bonzini, 2019/07/20
- Re: [Qemu-devel] [PULL 00/12] Misc patches for QEMU 4.0-rc2, Peter Maydell, 2019/07/22