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:
Ján Tomko 2016-10-21 12:58:54 +02:00
parent eacecd7437
commit 0512dd26ee
5 changed files with 17 additions and 15 deletions

View File

@ -1188,7 +1188,7 @@ virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addr
* or assign a virtio serial address to the device * or assign a virtio serial address to the device
*/ */
int int
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def, virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs, virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info, virDomainDeviceInfoPtr info,
bool allowZero) bool allowZero)

View File

@ -224,7 +224,7 @@ virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
bool bool
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info); virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info);
int int
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def, virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs, virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info, virDomainDeviceInfoPtr info,
bool allowZero) bool allowZero)

View File

@ -123,7 +123,7 @@ virDomainUSBAddressSetAddHub;
virDomainUSBAddressSetCreate; virDomainUSBAddressSetCreate;
virDomainUSBAddressSetFree; virDomainUSBAddressSetFree;
virDomainVirtioSerialAddrAssign; virDomainVirtioSerialAddrAssign;
virDomainVirtioSerialAddrAutoAssign; virDomainVirtioSerialAddrAutoAssignFromCache;
virDomainVirtioSerialAddrIsComplete; virDomainVirtioSerialAddrIsComplete;
virDomainVirtioSerialAddrRelease; virDomainVirtioSerialAddrRelease;
virDomainVirtioSerialAddrReserve; virDomainVirtioSerialAddrReserve;

View File

@ -122,7 +122,8 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def)
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO && chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO &&
!virDomainVirtioSerialAddrIsComplete(&chr->info) && !virDomainVirtioSerialAddrIsComplete(&chr->info) &&
virDomainVirtioSerialAddrAutoAssign(def, addrs, &chr->info, true) < 0) virDomainVirtioSerialAddrAutoAssignFromCache(def, addrs,
&chr->info, true) < 0)
goto cleanup; goto cleanup;
} }
@ -131,7 +132,8 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def)
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO && chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO &&
!virDomainVirtioSerialAddrIsComplete(&chr->info) && !virDomainVirtioSerialAddrIsComplete(&chr->info) &&
virDomainVirtioSerialAddrAutoAssign(def, addrs, &chr->info, false) < 0) virDomainVirtioSerialAddrAutoAssignFromCache(def, addrs,
&chr->info, false) < 0)
goto cleanup; goto cleanup;
} }

View File

@ -1770,7 +1770,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm,
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) { chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
if (virDomainVirtioSerialAddrAutoAssign(NULL, vioaddrs, if (virDomainVirtioSerialAddrAutoAssignFromCache(NULL, vioaddrs,
&chr->info, true) < 0) &chr->info, true) < 0)
goto cleanup; goto cleanup;
ret = 1; ret = 1;
@ -1789,7 +1789,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm,
} else if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && } else if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) {
if (virDomainVirtioSerialAddrAutoAssign(NULL, vioaddrs, if (virDomainVirtioSerialAddrAutoAssignFromCache(NULL, vioaddrs,
&chr->info, false) < 0) &chr->info, false) < 0)
goto cleanup; goto cleanup;
ret = 1; ret = 1;