mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 13:17:58 +03:00
qemu: pass virDomainDeviceInfo by reference
The virDomainDeviceInfo parameter is a large struct so it is preferrable to pass it by reference instead of by value. Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
72e8c721eb
commit
a507edef33
@ -1894,7 +1894,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
||||
if (qemuCheckDiskConfig(disk, qemuCaps) < 0)
|
||||
goto error;
|
||||
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, disk->info, qemuCaps, disk->dst))
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, &disk->info, qemuCaps, disk->dst))
|
||||
goto error;
|
||||
|
||||
if (disk->iothread && !qemuCheckIOThreads(def, disk))
|
||||
@ -5961,7 +5961,7 @@ qemuBuildRNGDevStr(const virDomainDef *def,
|
||||
{
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, dev->info, qemuCaps,
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, &dev->info, qemuCaps,
|
||||
dev->source.file))
|
||||
goto error;
|
||||
|
||||
|
@ -5807,7 +5807,7 @@ qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, controller->info, qemuCaps,
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, &controller->info, qemuCaps,
|
||||
"controller"))
|
||||
return -1;
|
||||
|
||||
@ -5861,7 +5861,7 @@ qemuDomainDeviceDefValidateVsock(const virDomainVsockDef *vsock,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, vsock->info, qemuCaps,
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(def, &vsock->info, qemuCaps,
|
||||
"vsock"))
|
||||
return -1;
|
||||
|
||||
@ -13489,11 +13489,11 @@ qemuDomainGetMachineName(virDomainObjPtr vm)
|
||||
*/
|
||||
bool
|
||||
qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||
virDomainDeviceInfo info,
|
||||
const virDomainDeviceInfo *info,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
const char *devicename)
|
||||
{
|
||||
if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||
if (!qemuDomainIsS390CCW(def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("cannot use CCW address type for device "
|
||||
@ -13506,7 +13506,7 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||
"this QEMU"));
|
||||
return false;
|
||||
}
|
||||
} else if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
|
||||
} else if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio S390 address type is not supported by "
|
||||
|
@ -1065,10 +1065,11 @@ int
|
||||
qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
||||
virTristateBool *allowReboot);
|
||||
|
||||
bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||
virDomainDeviceInfo info,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
const char *devicename);
|
||||
bool
|
||||
qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||
const virDomainDeviceInfo *info,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
const char *devicename);
|
||||
|
||||
int
|
||||
qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk,
|
||||
|
@ -3226,7 +3226,7 @@ qemuDomainEnsureVirtioAddress(bool *releaseAddr,
|
||||
else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390))
|
||||
info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390;
|
||||
} else {
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(vm->def, *info, priv->qemuCaps,
|
||||
if (!qemuDomainCheckCCWS390AddressSupport(vm->def, info, priv->qemuCaps,
|
||||
devicename))
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user