mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: Prepare to cater for more general address assignment
Currently qemuDomainAssignPCIAddresses() is called to assign addresses to PCI devices. We need to do something similar for devices with spapr-vio addresses. So create one place where address assignment will be done, that is qemuDomainAssignAddresses(). Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
This commit is contained in:
parent
2a994a3b1e
commit
9f406c5838
@ -810,6 +810,10 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int qemuDomainAssignAddresses(virDomainDefPtr def)
|
||||
{
|
||||
return qemuDomainAssignPCIAddresses(def);
|
||||
}
|
||||
|
||||
static void
|
||||
qemuDomainPCIAddressSetFreeEntry(void *payload,
|
||||
|
@ -174,6 +174,8 @@ virDomainDefPtr qemuParseCommandLinePid(virCapsPtr caps,
|
||||
virDomainChrSourceDefPtr *monConfig,
|
||||
bool *monJSON);
|
||||
|
||||
int qemuDomainAssignAddresses(virDomainDefPtr def);
|
||||
|
||||
int qemuDomainAssignPCIAddresses(virDomainDefPtr def);
|
||||
qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def);
|
||||
int qemuDomainPCIAddressReserveFunction(qemuDomainPCIAddressSetPtr addrs,
|
||||
|
@ -1317,7 +1317,7 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
|
||||
if (qemudCanonicalizeMachine(driver, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainAssignPCIAddresses(def) < 0)
|
||||
if (qemuDomainAssignAddresses(def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = virDomainAssignDef(driver->caps,
|
||||
@ -4903,7 +4903,7 @@ static virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) {
|
||||
if (qemudCanonicalizeMachine(driver, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainAssignPCIAddresses(def) < 0)
|
||||
if (qemuDomainAssignAddresses(def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = virDomainAssignDef(driver->caps,
|
||||
@ -5372,7 +5372,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
|
||||
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
|
||||
if (virDomainDefAddImplicitControllers(vmdef) < 0)
|
||||
return -1;
|
||||
if (qemuDomainAssignPCIAddresses(vmdef) < 0)
|
||||
if (qemuDomainAssignAddresses(vmdef) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
@ -5390,7 +5390,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
|
||||
return -1;
|
||||
}
|
||||
dev->data.net = NULL;
|
||||
if (qemuDomainAssignPCIAddresses(vmdef) < 0)
|
||||
if (qemuDomainAssignAddresses(vmdef) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
@ -5526,7 +5526,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
|
||||
vmdef->nets[pos] = net;
|
||||
dev->data.net = NULL;
|
||||
|
||||
if (qemuDomainAssignPCIAddresses(vmdef) < 0)
|
||||
if (qemuDomainAssignAddresses(vmdef) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
@ -10794,7 +10794,7 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn,
|
||||
if (qemudCanonicalizeMachine(driver, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainAssignPCIAddresses(def) < 0)
|
||||
if (qemuDomainAssignAddresses(def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = virDomainAssignDef(driver->caps,
|
||||
|
Loading…
Reference in New Issue
Block a user