We 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.
---
src/conf/domain_addr.c | 8 ++++----
src/conf/domain_addr.h | 8 ++++----
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain_address.c | 6 ++++--
src/qemu/qemu_hotplug.c | 8 ++++----
5 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 1e96fe9..065baa7 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1154,10 +1154,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 &&
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
index 0072a08..b0fadc1 100644
--- a/src/conf/domain_addr.h
+++ b/src/conf/domain_addr.h
@@ -222,10 +222,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
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index bf503a5..8bc2584 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -123,7 +123,7 @@ virDomainUSBAddressSetAddHub;
virDomainUSBAddressSetCreate;
virDomainUSBAddressSetFree;
virDomainVirtioSerialAddrAssign;
-virDomainVirtioSerialAddrAutoAssign;
+virDomainVirtioSerialAddrAutoAssignFromCache;
virDomainVirtioSerialAddrIsComplete;
virDomainVirtioSerialAddrRelease;
virDomainVirtioSerialAddrReserve;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index dc67d51..7d92e0b 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -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;
}
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 2cb2267..7bd38ab 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1648,8 +1648,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainDefPtr def,
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;
@@ -1667,8 +1667,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainDefPtr def,
} 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;
}
--
2.7.3