mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Add 'FromCache' to virDomainVirtioSerialAddrAutoAssign
Commit 19a148b
dropped the cache from QEMU's private domain object.
Assume the callers do not have the cache by default and use
a longer name for the internal ones that do.
This makes the shorter 'virDomainVirtioSerialAddrAutoAssign'
name availabe for a function that will not require the cache.
This commit is contained in:
parent
eacecd7437
commit
0512dd26ee
@ -1188,10 +1188,10 @@ virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addr
|
||||
* or assign a virtio serial address to the device
|
||||
*/
|
||||
int
|
||||
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
|
||||
virDomainVirtioSerialAddrSetPtr addrs,
|
||||
virDomainDeviceInfoPtr info,
|
||||
bool allowZero)
|
||||
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
|
||||
virDomainVirtioSerialAddrSetPtr addrs,
|
||||
virDomainDeviceInfoPtr info,
|
||||
bool allowZero)
|
||||
{
|
||||
bool portOnly = info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL;
|
||||
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL &&
|
||||
|
@ -224,10 +224,10 @@ virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
|
||||
bool
|
||||
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info);
|
||||
int
|
||||
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
|
||||
virDomainVirtioSerialAddrSetPtr addrs,
|
||||
virDomainDeviceInfoPtr info,
|
||||
bool allowZero)
|
||||
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
|
||||
virDomainVirtioSerialAddrSetPtr addrs,
|
||||
virDomainDeviceInfoPtr info,
|
||||
bool allowZero)
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
||||
|
||||
int
|
||||
|
@ -123,7 +123,7 @@ virDomainUSBAddressSetAddHub;
|
||||
virDomainUSBAddressSetCreate;
|
||||
virDomainUSBAddressSetFree;
|
||||
virDomainVirtioSerialAddrAssign;
|
||||
virDomainVirtioSerialAddrAutoAssign;
|
||||
virDomainVirtioSerialAddrAutoAssignFromCache;
|
||||
virDomainVirtioSerialAddrIsComplete;
|
||||
virDomainVirtioSerialAddrRelease;
|
||||
virDomainVirtioSerialAddrReserve;
|
||||
|
@ -122,7 +122,8 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def)
|
||||
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
|
||||
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO &&
|
||||
!virDomainVirtioSerialAddrIsComplete(&chr->info) &&
|
||||
virDomainVirtioSerialAddrAutoAssign(def, addrs, &chr->info, true) < 0)
|
||||
virDomainVirtioSerialAddrAutoAssignFromCache(def, addrs,
|
||||
&chr->info, true) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -131,7 +132,8 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def)
|
||||
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
|
||||
chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
|
||||
!virDomainVirtioSerialAddrIsComplete(&chr->info) &&
|
||||
virDomainVirtioSerialAddrAutoAssign(def, addrs, &chr->info, false) < 0)
|
||||
virDomainVirtioSerialAddrAutoAssignFromCache(def, addrs,
|
||||
&chr->info, false) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -1770,8 +1770,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm,
|
||||
|
||||
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
|
||||
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
|
||||
if (virDomainVirtioSerialAddrAutoAssign(NULL, vioaddrs,
|
||||
&chr->info, true) < 0)
|
||||
if (virDomainVirtioSerialAddrAutoAssignFromCache(NULL, vioaddrs,
|
||||
&chr->info, true) < 0)
|
||||
goto cleanup;
|
||||
ret = 1;
|
||||
|
||||
@ -1789,8 +1789,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm,
|
||||
|
||||
} else if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
|
||||
chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) {
|
||||
if (virDomainVirtioSerialAddrAutoAssign(NULL, vioaddrs,
|
||||
&chr->info, false) < 0)
|
||||
if (virDomainVirtioSerialAddrAutoAssignFromCache(NULL, vioaddrs,
|
||||
&chr->info, false) < 0)
|
||||
goto cleanup;
|
||||
ret = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user