mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
qemu: move qemuDomainCCWAddrSetCreateFromDomain
from src/qemu/qemu_domain_address.c to src/conf/domain_addr.c and rename to virDomainCCWAddressSetCreateFromDomain (rename to have Address in full instead of Addr to follow the naming convention of other virDomainCCWAddress functions) Signed-off-by: Anya Harter <aharter@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
2625722cbc
commit
7bdd06b4e1
@ -1185,6 +1185,30 @@ virDomainCCWAddressSetCreate(void)
|
||||
}
|
||||
|
||||
|
||||
virDomainCCWAddressSetPtr
|
||||
virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def)
|
||||
{
|
||||
virDomainCCWAddressSetPtr addrs = NULL;
|
||||
|
||||
if (!(addrs = virDomainCCWAddressSetCreate()))
|
||||
goto error;
|
||||
|
||||
if (virDomainDeviceInfoIterate(def, virDomainCCWAddressValidate,
|
||||
addrs) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainDeviceInfoIterate(def, virDomainCCWAddressAllocate,
|
||||
addrs) < 0)
|
||||
goto error;
|
||||
|
||||
return addrs;
|
||||
|
||||
error:
|
||||
virDomainCCWAddressSetFree(addrs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#define VIR_DOMAIN_DEFAULT_VIRTIO_SERIAL_PORTS 31
|
||||
|
||||
|
||||
|
@ -202,6 +202,10 @@ int virDomainCCWAddressValidate(virDomainDefPtr def,
|
||||
|
||||
virDomainCCWAddressSetPtr virDomainCCWAddressSetCreate(void);
|
||||
|
||||
virDomainCCWAddressSetPtr
|
||||
virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
struct _virDomainVirtioSerialController {
|
||||
unsigned int idx;
|
||||
virBitmapPtr ports;
|
||||
|
@ -107,6 +107,7 @@ virPCIDeviceAddressParseXML;
|
||||
virDomainCCWAddressAllocate;
|
||||
virDomainCCWAddressAssign;
|
||||
virDomainCCWAddressSetCreate;
|
||||
virDomainCCWAddressSetCreateFromDomain;
|
||||
virDomainCCWAddressSetFree;
|
||||
virDomainCCWAddressValidate;
|
||||
virDomainPCIAddressAsString;
|
||||
|
@ -376,28 +376,6 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
|
||||
}
|
||||
}
|
||||
|
||||
virDomainCCWAddressSetPtr
|
||||
qemuDomainCCWAddrSetCreateFromDomain(virDomainDefPtr def)
|
||||
{
|
||||
virDomainCCWAddressSetPtr addrs = NULL;
|
||||
|
||||
if (!(addrs = virDomainCCWAddressSetCreate()))
|
||||
goto error;
|
||||
|
||||
if (virDomainDeviceInfoIterate(def, virDomainCCWAddressValidate,
|
||||
addrs) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainDeviceInfoIterate(def, virDomainCCWAddressAllocate,
|
||||
addrs) < 0)
|
||||
goto error;
|
||||
|
||||
return addrs;
|
||||
|
||||
error:
|
||||
virDomainCCWAddressSetFree(addrs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Three steps populating CCW devnos
|
||||
@ -420,7 +398,7 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def,
|
||||
qemuDomainPrimeVirtioDeviceAddresses(
|
||||
def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW);
|
||||
|
||||
if (!(addrs = qemuDomainCCWAddrSetCreateFromDomain(def)))
|
||||
if (!(addrs = virDomainCCWAddressSetCreateFromDomain(def)))
|
||||
goto cleanup;
|
||||
|
||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
|
||||
@ -3027,7 +3005,7 @@ qemuDomainEnsureVirtioAddress(bool *releaseAddr,
|
||||
}
|
||||
|
||||
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||
if (!(ccwaddrs = qemuDomainCCWAddrSetCreateFromDomain(vm->def)))
|
||||
if (!(ccwaddrs = virDomainCCWAddressSetCreateFromDomain(vm->def)))
|
||||
goto cleanup;
|
||||
if (virDomainCCWAddressAssign(info, ccwaddrs,
|
||||
!info->addr.ccw.assigned) < 0)
|
||||
|
@ -59,10 +59,6 @@ void qemuDomainReleaseDeviceAddress(virDomainObjPtr vm,
|
||||
virDomainDeviceInfoPtr info,
|
||||
const char *devstr);
|
||||
|
||||
virDomainCCWAddressSetPtr
|
||||
qemuDomainCCWAddrSetCreateFromDomain(virDomainDefPtr def)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
int qemuDomainAssignMemoryDeviceSlot(virDomainDefPtr def,
|
||||
virDomainMemoryDefPtr mem);
|
||||
|
||||
|
@ -964,7 +964,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
|
||||
if (qemuDomainIsS390CCW(vm->def) &&
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CCW)) {
|
||||
net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW;
|
||||
if (!(ccwaddrs = qemuDomainCCWAddrSetCreateFromDomain(vm->def)))
|
||||
if (!(ccwaddrs = virDomainCCWAddressSetCreateFromDomain(vm->def)))
|
||||
goto cleanup;
|
||||
if (virDomainCCWAddressAssign(&net->info, ccwaddrs,
|
||||
!net->info.addr.ccw.assigned) < 0)
|
||||
@ -2376,7 +2376,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
|
||||
if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0)
|
||||
goto cleanup;
|
||||
} else if (hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||
if (!(ccwaddrs = qemuDomainCCWAddrSetCreateFromDomain(vm->def)))
|
||||
if (!(ccwaddrs = virDomainCCWAddressSetCreateFromDomain(vm->def)))
|
||||
goto cleanup;
|
||||
if (virDomainCCWAddressAssign(hostdev->info, ccwaddrs,
|
||||
!hostdev->info->addr.ccw.assigned) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user