Revision e5793395
b/lib/hypervisor/hv_kvm/__init__.py | ||
---|---|---|
1883 | 1883 |
runtime[index].append(entry) |
1884 | 1884 |
self._SaveKVMRuntime(instance, runtime) |
1885 | 1885 |
|
1886 |
@_with_qmp |
|
1886 | 1887 |
def HotDelDevice(self, instance, dev_type, device, _, seq): |
1887 | 1888 |
""" Helper method for hot-del device |
1888 | 1889 |
|
... | ... | |
1895 | 1896 |
kvm_device = _RUNTIME_DEVICE[dev_type](entry) |
1896 | 1897 |
kvm_devid = _GenerateDeviceKVMId(dev_type, kvm_device) |
1897 | 1898 |
if dev_type == constants.HOTPLUG_TARGET_DISK: |
1898 |
cmds = ["device_del %s" % kvm_devid] |
|
1899 |
cmds += ["drive_del %s" % kvm_devid] |
|
1899 |
self.qmp.HotDelDisk(kvm_devid) |
|
1900 |
# drive_del is not implemented yet in qmp |
|
1901 |
command = "drive_del %s\n" % kvm_devid |
|
1902 |
self._CallMonitorCommand(instance.name, command) |
|
1900 | 1903 |
elif dev_type == constants.HOTPLUG_TARGET_NIC: |
1901 |
cmds = ["device_del %s" % kvm_devid] |
|
1902 |
cmds += ["netdev_del %s" % kvm_devid] |
|
1904 |
self.qmp.HotDelNic(kvm_devid) |
|
1903 | 1905 |
utils.RemoveFile(self._InstanceNICFile(instance.name, seq)) |
1904 |
self._CallHotplugCommands(instance.name, cmds) |
|
1905 | 1906 |
self._VerifyHotplugCommand(instance, kvm_device, kvm_devid, False) |
1906 | 1907 |
index = _DEVICE_RUNTIME_INDEX[dev_type] |
1907 | 1908 |
runtime[index].remove(entry) |
Also available in: Unified diff