mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Change parameters to qemuDomainAttachDeviceLive
We want to be able to pass a NULL instead of the connection and use this function in tests. To achieve this, the virConnectPtr is passed instead of virDomainPtr, and the driver is a new separate parameter. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
ed8f236491
commit
d259e825bc
@ -7327,16 +7327,16 @@ qemuDomainUndefine(virDomainPtr dom)
|
|||||||
static int
|
static int
|
||||||
qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
||||||
virDomainDeviceDefPtr dev,
|
virDomainDeviceDefPtr dev,
|
||||||
virDomainPtr dom)
|
virConnectPtr conn,
|
||||||
|
virQEMUDriverPtr driver)
|
||||||
{
|
{
|
||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
const char *alias = NULL;
|
const char *alias = NULL;
|
||||||
|
|
||||||
switch ((virDomainDeviceType) dev->type) {
|
switch ((virDomainDeviceType) dev->type) {
|
||||||
case VIR_DOMAIN_DEVICE_DISK:
|
case VIR_DOMAIN_DEVICE_DISK:
|
||||||
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL);
|
qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL);
|
||||||
ret = qemuDomainAttachDeviceDiskLive(dom->conn, driver, vm, dev);
|
ret = qemuDomainAttachDeviceDiskLive(conn, driver, vm, dev);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
alias = dev->data.disk->info.alias;
|
alias = dev->data.disk->info.alias;
|
||||||
dev->data.disk = NULL;
|
dev->data.disk = NULL;
|
||||||
@ -7369,7 +7369,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
|
|||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_HOSTDEV:
|
case VIR_DOMAIN_DEVICE_HOSTDEV:
|
||||||
qemuDomainObjCheckHostdevTaint(driver, vm, dev->data.hostdev, NULL);
|
qemuDomainObjCheckHostdevTaint(driver, vm, dev->data.hostdev, NULL);
|
||||||
ret = qemuDomainAttachHostDevice(dom->conn, driver, vm,
|
ret = qemuDomainAttachHostDevice(conn, driver, vm,
|
||||||
dev->data.hostdev);
|
dev->data.hostdev);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
alias = dev->data.hostdev->info->alias;
|
alias = dev->data.hostdev->info->alias;
|
||||||
@ -8151,7 +8151,8 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
|||||||
VIR_DOMAIN_DEVICE_ACTION_ATTACH) < 0)
|
VIR_DOMAIN_DEVICE_ACTION_ATTACH) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if ((ret = qemuDomainAttachDeviceLive(vm, dev_copy, dom)) < 0)
|
if ((ret = qemuDomainAttachDeviceLive(vm, dev_copy, dom->conn,
|
||||||
|
driver)) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
/*
|
/*
|
||||||
* update domain status forcibly because the domain status may be
|
* update domain status forcibly because the domain status may be
|
||||||
|
Loading…
Reference in New Issue
Block a user