mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
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: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
49272e5162
commit
aa2be13674
@ -1065,10 +1065,10 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
static int
|
||||||
qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
|
qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virDomainDeviceDefPtr dev)
|
virDomainDeviceDefPtr dev)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
virDomainDiskDefPtr disk = dev->data.disk;
|
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
|
static void
|
||||||
qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net)
|
qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user