mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00: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)
|
if (qemuCheckDiskConfig(disk, qemuCaps) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(def, disk->info, qemuCaps, disk->dst))
|
if (!qemuDomainCheckCCWS390AddressSupport(def, &disk->info, qemuCaps, disk->dst))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (disk->iothread && !qemuCheckIOThreads(def, disk))
|
if (disk->iothread && !qemuCheckIOThreads(def, disk))
|
||||||
@ -5961,7 +5961,7 @@ qemuBuildRNGDevStr(const virDomainDef *def,
|
|||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(def, dev->info, qemuCaps,
|
if (!qemuDomainCheckCCWS390AddressSupport(def, &dev->info, qemuCaps,
|
||||||
dev->source.file))
|
dev->source.file))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -5807,7 +5807,7 @@ qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(def, controller->info, qemuCaps,
|
if (!qemuDomainCheckCCWS390AddressSupport(def, &controller->info, qemuCaps,
|
||||||
"controller"))
|
"controller"))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -5861,7 +5861,7 @@ qemuDomainDeviceDefValidateVsock(const virDomainVsockDef *vsock,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(def, vsock->info, qemuCaps,
|
if (!qemuDomainCheckCCWS390AddressSupport(def, &vsock->info, qemuCaps,
|
||||||
"vsock"))
|
"vsock"))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -13489,11 +13489,11 @@ qemuDomainGetMachineName(virDomainObjPtr vm)
|
|||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||||
virDomainDeviceInfo info,
|
const virDomainDeviceInfo *info,
|
||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
const char *devicename)
|
const char *devicename)
|
||||||
{
|
{
|
||||||
if (info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
|
||||||
if (!qemuDomainIsS390CCW(def)) {
|
if (!qemuDomainIsS390CCW(def)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("cannot use CCW address type for device "
|
_("cannot use CCW address type for device "
|
||||||
@ -13506,7 +13506,7 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
|||||||
"this QEMU"));
|
"this QEMU"));
|
||||||
return false;
|
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)) {
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("virtio S390 address type is not supported by "
|
_("virtio S390 address type is not supported by "
|
||||||
|
@ -1065,8 +1065,9 @@ int
|
|||||||
qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
||||||
virTristateBool *allowReboot);
|
virTristateBool *allowReboot);
|
||||||
|
|
||||||
bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
bool
|
||||||
virDomainDeviceInfo info,
|
qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def,
|
||||||
|
const virDomainDeviceInfo *info,
|
||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
const char *devicename);
|
const char *devicename);
|
||||||
|
|
||||||
|
@ -3226,7 +3226,7 @@ qemuDomainEnsureVirtioAddress(bool *releaseAddr,
|
|||||||
else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390))
|
else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390))
|
||||||
info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390;
|
info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390;
|
||||||
} else {
|
} else {
|
||||||
if (!qemuDomainCheckCCWS390AddressSupport(vm->def, *info, priv->qemuCaps,
|
if (!qemuDomainCheckCCWS390AddressSupport(vm->def, info, priv->qemuCaps,
|
||||||
devicename))
|
devicename))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user