unsigned int flags = 0;
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
- goto cleanup;
+ return -1;
if (!cfg->relaxedACS)
flags |= VIR_HOSTDEV_STRICT_ACS_CHECK;
if (qemuHostdevPreparePCIDevices(driver, vm->def->name, vm->def->uuid,
&hostdev, 1, priv->qemuCaps, flags) < 0)
- goto cleanup;
+ return -1;
/* this could have been changed by qemuHostdevPreparePCIDevices */
backend = hostdev->source.subsys.u.pci.backend;
qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1);
- cleanup:
return -1;
}
virDomainObjPtr vm,
virDomainLeaseDefPtr lease)
{
- int ret = -1;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
if (virDomainLeaseInsertPreAlloc(vm->def) < 0)
- goto cleanup;
+ return -1;
if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri,
vm, lease) < 0) {
virDomainLeaseInsertPreAlloced(vm->def, NULL);
- goto cleanup;
+ return -1;
}
virDomainLeaseInsertPreAlloced(vm->def, lease);
- ret = 0;
-
- cleanup:
- return ret;
+ return 0;
}
if (!oldbridge || !newbridge) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing bridge name"));
- goto cleanup;
+ return ret;
}
VIR_DEBUG("Change bridge for interface %s: %s -> %s",
if (virNetDevExists(newbridge) != 1) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("bridge %s doesn't exist"), newbridge);
- goto cleanup;
+ return ret;
}
ret = virNetDevBridgeRemovePort(oldbridge, olddev->ifname);
_("unable to recover former state by adding port "
"to bridge %s"), oldbridge);
}
- goto cleanup;
+ return ret;
}
/* caller will replace entire olddev with newdev in domain nets list */
- ret = 0;
- cleanup:
- return ret;
+ return 0;
}
static int
virReportError(VIR_ERR_DEVICE_MISSING,
_("cannot find existing graphics device to modify of "
"type '%s'"), type);
- goto cleanup;
+ return ret;
}
if (dev->nListens != olddev->nListens) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot change the number of listen addresses "
"on '%s' graphics"), type);
- goto cleanup;
+ return ret;
}
for (i = 0; i < dev->nListens; i++) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot change the type of listen address "
"on '%s' graphics"), type);
- goto cleanup;
+ return ret;
}
switch (newlisten->type) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot change listen address setting "
"on '%s' graphics"), type);
- goto cleanup;
+ return ret;
}
break;
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot change listen address setting "
"on '%s' graphics"), type);
- goto cleanup;
+ return ret;
}
break;
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("cannot change listen socket setting "
"on '%s' graphics"), type);
- goto cleanup;
+ return ret;
}
break;
(olddev->data.vnc.port != dev->data.vnc.port))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change port settings on vnc graphics"));
- goto cleanup;
+ return ret;
}
if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change keymap setting on vnc graphics"));
- goto cleanup;
+ return ret;
}
/* If a password lifetime was, or is set, or action if connected has
cfg->vncPassword,
QEMU_ASYNC_JOB_NONE);
if (ret < 0)
- goto cleanup;
+ return ret;
/* Steal the new dev's char * reference */
VIR_FREE(olddev->data.vnc.auth.passwd);
(olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change port settings on spice graphics"));
- goto cleanup;
+ return ret;
}
if (STRNEQ_NULLABLE(olddev->data.spice.keymap,
dev->data.spice.keymap)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change keymap setting on spice graphics"));
- goto cleanup;
+ return ret;
}
/* We must reset the password if it has changed but also if:
QEMU_ASYNC_JOB_NONE);
if (ret < 0)
- goto cleanup;
+ return ret;
/* Steal the new dev's char * reference */
VIR_FREE(olddev->data.spice.auth.passwd);
break;
}
- cleanup:
return ret;
}