提交 9f406c58 编写于 作者: M Michael Ellerman 提交者: Eric Blake

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: NMichael Ellerman <michael@ellerman.id.au>
上级 2a994a3b
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册