提交 aa2be136 编写于 作者: P Peter Krempa

qemu: hotplug: Add wrapper for disk hotplug code

The disk hotplug code also overloads media change which is not ideal.
This will allow splitting out of the media change code.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 49272e51
......@@ -1065,10 +1065,10 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
}
int
qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
static int
qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
size_t i;
virDomainDiskDefPtr disk = dev->data.disk;
......@@ -1161,6 +1161,25 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
}
/**
* qemuDomainAttachDeviceDiskLive:
* @driver: qemu driver struct
* @vm: domain object
* @dev: device to attach (expected type is DISK)
*
* Attach a new disk or in case of cdroms/floppies change the media in the drive.
* This function handles all the necessary steps to attach a new storage source
* to the VM.
*/
int
qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev)
{
return qemuDomainAttachDeviceDiskLiveInternal(driver, vm, dev);
}
static void
qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册