Bug 1336225

Summary: qemu: some disk hotplug routines are missing drive_del on failure
Product: [Community] Virtualization Tools Reporter: Cole Robinson <crobinso>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jferlan, pkrempa, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: LibvirtFirstBug
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-02 18:26:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cole Robinson 2016-05-15 21:29:18 UTC
There's a could qemu hotplug implementations that are missing drive_del calls in their failure cleanup paths.

The good example to follow is 

1) src/qemu/qemu_hotplug.c: qemuDomainAttachSCSIDisk. It has a comment about missing drive_del, but drive_del has been around for a while. That comment and warning should be replaced with the logic from the failadddevice: label from qemuDomainAttachVirtioDiskDevice

2) src/qemu/qemu_hotplug.c: qemuDomainAttachUSBMassStorageDevice. The error pattern here should be updated to match what qemuDomainAttachVirtioDiskDevice does, which is a bit of a larger rework.

In fact, I think most of the disk hotplug code could be unified now to be shared between the three methods, since they all use the same monitor commands

Comment 1 John Ferlan 2016-08-02 16:08:58 UTC
Changes pushed upstream :

USB: commit id '190e22c06ba7e4b38e7690a7ef2ae4fc423a0b38'
SCSI: commit id '97ca6eed9a08d083cfc0428ddc30c2fb5ac2f3dd'

Comment 2 Peter Krempa 2016-08-02 18:26:03 UTC
Closing right now as it would probably be forgotten until next release.