diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index de3e49f0be..26f029ca5d 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1660,7 +1660,6 @@ esxDomainLookupByName(virConnectPtr conn, const char *name) goto cleanup; } - if (esxVI_GetVirtualMachineIdentity(virtualMachine, &id, NULL, uuid) < 0 || esxVI_GetVirtualMachinePowerState(virtualMachine, &powerState) < 0) { goto cleanup; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index c4fe936839..df693ec682 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -2491,7 +2491,7 @@ static int lxcDomainSetAutostart(virDomainPtr dom, } if (!vm->persistent) { - lxcError(VIR_ERR_INTERNAL_ERROR, + lxcError(VIR_ERR_OPERATION_INVALID, "%s", _("Cannot set autostart for transient domain")); goto cleanup; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 3f63afd9f1..c098ab53e0 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1537,7 +1537,7 @@ networkStartNetworkDaemon(struct network_driver *driver, virNetworkIpDefPtr ipdef; if (virNetworkObjIsActive(network)) { - networkReportError(VIR_ERR_INTERNAL_ERROR, + networkReportError(VIR_ERR_OPERATION_INVALID, "%s", _("network is already active")); return -1; } diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c index b88f44ffb4..4febb46b0f 100644 --- a/src/opennebula/one_driver.c +++ b/src/opennebula/one_driver.c @@ -291,7 +291,7 @@ static int oneDomainUndefine(virDomainPtr dom) } if (!vm->persistent) { - oneError(VIR_ERR_INTERNAL_ERROR, "%s", + oneError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot undefine transient domain")); goto return_point; } diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 7728981a3f..fc6ae296d3 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1079,7 +1079,7 @@ openvzDomainUndefine(virDomainPtr dom) } if (virDomainObjIsActive(vm)) { - openvzError(VIR_ERR_INTERNAL_ERROR, "%s", + openvzError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot delete active domain")); goto cleanup; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 824e77602e..22dc272aac 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6401,7 +6401,7 @@ static int qemudDomainUndefine(virDomainPtr dom) { } if (!vm->persistent) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot undefine transient domain")); goto cleanup; } @@ -6848,7 +6848,7 @@ static int qemudDomainSetAutostart(virDomainPtr dom, } if (!vm->persistent) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot set autostart for transient domain")); goto cleanup; } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 601ecf84b4..7b077803b4 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3061,7 +3061,7 @@ static int testNetworkUndefine(virNetworkPtr network) { } if (virNetworkObjIsActive(privnet)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("Network '%s' is still running"), network->name); goto cleanup; } @@ -3094,7 +3094,7 @@ static int testNetworkStart(virNetworkPtr network) { } if (virNetworkObjIsActive(privnet)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("Network '%s' is already running"), network->name); goto cleanup; } @@ -3817,7 +3817,7 @@ testStoragePoolStart(virStoragePoolPtr pool, } if (virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is already active"), pool->name); goto cleanup; } @@ -3982,7 +3982,7 @@ testStoragePoolUndefine(virStoragePoolPtr pool) { } if (virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is already active"), pool->name); goto cleanup; } @@ -4015,7 +4015,7 @@ testStoragePoolBuild(virStoragePoolPtr pool, } if (virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is already active"), pool->name); goto cleanup; } @@ -4044,7 +4044,7 @@ testStoragePoolDestroy(virStoragePoolPtr pool) { } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4083,7 +4083,7 @@ testStoragePoolDelete(virStoragePoolPtr pool, } if (virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is already active"), pool->name); goto cleanup; } @@ -4115,7 +4115,7 @@ testStoragePoolRefresh(virStoragePoolPtr pool, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4267,7 +4267,7 @@ testStoragePoolNumVolumes(virStoragePoolPtr pool) { } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4302,7 +4302,7 @@ testStoragePoolListVolumes(virStoragePoolPtr pool, if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4348,7 +4348,7 @@ testStorageVolumeLookupByName(virStoragePoolPtr pool, if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4459,7 +4459,7 @@ testStorageVolumeCreateXML(virStoragePoolPtr pool, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4540,7 +4540,7 @@ testStorageVolumeCreateXMLFrom(virStoragePoolPtr pool, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), pool->name); goto cleanup; } @@ -4640,7 +4640,7 @@ testStorageVolumeDelete(virStorageVolPtr vol, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), vol->pool); goto cleanup; } @@ -4718,7 +4718,7 @@ testStorageVolumeGetInfo(virStorageVolPtr vol, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), vol->pool); goto cleanup; } @@ -4763,7 +4763,7 @@ testStorageVolumeGetXMLDesc(virStorageVolPtr vol, } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), vol->pool); goto cleanup; } @@ -4803,7 +4803,7 @@ testStorageVolumeGetPath(virStorageVolPtr vol) { } if (!virStoragePoolObjIsActive(privpool)) { - testError(VIR_ERR_INTERNAL_ERROR, + testError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), vol->pool); goto cleanup; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index c6df0a1de0..57f50f6d87 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -819,7 +819,7 @@ static int umlStartVMDaemon(virConnectPtr conn, virCommandPtr cmd = NULL; if (virDomainObjIsActive(vm)) { - umlReportError(VIR_ERR_INTERNAL_ERROR, "%s", + umlReportError(VIR_ERR_OPERATION_INVALID, "%s", _("VM is already active")); return -1; } @@ -1462,7 +1462,7 @@ static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem) { } if (virDomainObjIsActive(vm)) { - umlReportError(VIR_ERR_NO_SUPPORT, "%s", + umlReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot set memory of an active domain")); goto cleanup; } @@ -1656,13 +1656,13 @@ static int umlDomainUndefine(virDomainPtr dom) { } if (virDomainObjIsActive(vm)) { - umlReportError(VIR_ERR_INTERNAL_ERROR, "%s", + umlReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot delete active domain")); goto cleanup; } if (!vm->persistent) { - umlReportError(VIR_ERR_INTERNAL_ERROR, "%s", + umlReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot undefine transient domain")); goto cleanup; } @@ -1954,7 +1954,7 @@ static int umlDomainSetAutostart(virDomainPtr dom, } if (!vm->persistent) { - umlReportError(VIR_ERR_INTERNAL_ERROR, "%s", + umlReportError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot set autostart for transient domain")); goto cleanup; } diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 47314f8083..f176c2f4f6 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -622,7 +622,7 @@ vmwareDomainUndefine(virDomainPtr dom) } if (!vm->persistent) { - vmwareError(VIR_ERR_INTERNAL_ERROR, + vmwareError(VIR_ERR_OPERATION_INVALID, "%s", _("cannot undefine transient domain")); goto cleanup; }