qemu_hotplug: separate Chr|Lease from other devices in DetachDevice switch
The Chr and Lease devices have detach code that is too different from the other device types to handle with common functionality (which will soon be added at the end of qemuDomainDetachDeviceLive(). In order to make this difference obvious, move the cases for those two device types to the top of the switch statement in qemuDomainDetachDeviceLive(), have the cases return immediately so the future common code at the end of the function will be skipped, and also include some hopefully helpful comments to remind future maintainers why these two device types are treated differently. Any attempt to detach an unsupported device type should also skip the future common code at the end of the function, so the case for unsupported types is similarly changed from a simple break to a return -1. Signed-off-by: NLaine Stump <laine@laine.org> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
Showing
想要评论请 注册 或 登录