mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_UNSUPPORTED
The VIR_ERR_NO_SUPPORT error code is reserved for cases where an API is not implemented in a driver. It definitely should not be used when an API execution fails due to unsupported operation.
This commit is contained in:
parent
e053561e38
commit
cb86e9d39b
@ -3141,7 +3141,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
||||
int ret = -1;
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("dump-guest-memory is not supported"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -1468,7 +1468,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
int ret = -1;
|
||||
|
||||
if (!devslot || !(olddev = *devslot)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
_("cannot find existing network device to modify"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1476,7 +1476,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
oldType = virDomainNetGetActualType(olddev);
|
||||
if (oldType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||
/* no changes are possible to a type='hostdev' interface */
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("cannot change config of '%s' network type"),
|
||||
virDomainNetTypeToString(oldType));
|
||||
goto cleanup;
|
||||
@ -1499,7 +1499,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
if (virMacAddrCmp(&olddev->mac, &newdev->mac)) {
|
||||
char oldmac[VIR_MAC_STRING_BUFLEN], newmac[VIR_MAC_STRING_BUFLEN];
|
||||
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("cannot change network interface mac address "
|
||||
"from %s to %s"),
|
||||
virMacAddrFormat(&olddev->mac, oldmac),
|
||||
@ -1508,7 +1508,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (STRNEQ_NULLABLE(olddev->model, newdev->model)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("cannot modify network device model from %s to %s"),
|
||||
olddev->model ? olddev->model : "(default)",
|
||||
newdev->model ? newdev->model : "(default)");
|
||||
@ -1520,7 +1520,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
olddev->driver.virtio.txmode != newdev->driver.virtio.txmode ||
|
||||
olddev->driver.virtio.ioeventfd != newdev->driver.virtio.ioeventfd ||
|
||||
olddev->driver.virtio.event_idx != newdev->driver.virtio.event_idx)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify virtio network device driver attributes"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1534,7 +1534,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (STRNEQ_NULLABLE(olddev->script, newdev->script)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device script attribute"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1546,7 +1546,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
if (STRNEQ_NULLABLE(olddev->ifname, newdev->ifname)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device tap name"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1564,7 +1564,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
}
|
||||
if (!virDevicePCIAddressEqual(&olddev->info.addr.pci,
|
||||
&newdev->info.addr.pci)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device guest PCI address"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1575,22 +1575,22 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
if (STRNEQ_NULLABLE(olddev->info.alias, newdev->info.alias)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device alias"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (olddev->info.rombar != newdev->info.rombar) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device rom bar setting"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (STRNEQ_NULLABLE(olddev->info.romfile, newdev->info.romfile)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network rom file"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (olddev->info.bootIndex != newdev->info.bootIndex) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device boot index setting"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1617,7 +1617,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
|
||||
if (newType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||
/* can't turn it into a type='hostdev' interface */
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("cannot change network interface type to '%s'"),
|
||||
virDomainNetTypeToString(newType));
|
||||
goto cleanup;
|
||||
@ -1675,7 +1675,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
break;
|
||||
|
||||
default:
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("unable to change config on '%s' network type"),
|
||||
virDomainNetTypeToString(newdev->type));
|
||||
break;
|
||||
@ -1746,7 +1746,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
||||
/* FINALLY - actually perform the required actions */
|
||||
|
||||
if (needReconnect) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("unable to change config on '%s' network type"),
|
||||
virDomainNetTypeToString(newdev->type));
|
||||
goto cleanup;
|
||||
|
@ -2121,7 +2121,7 @@ qemuMonitorDumpToFd(qemuMonitorPtr mon, int fd)
|
||||
/* We don't have qemuMonitorTextDump(), so we should check mon->json
|
||||
* here.
|
||||
*/
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("dump-guest-memory is not supported in text mode"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainN
|
||||
|
||||
/* check if set_link command is supported */
|
||||
if (strstr(info, "\nunknown ")) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
"%s",
|
||||
_("\'set_link\' not supported by this qemu"));
|
||||
goto error;
|
||||
|
@ -1902,7 +1902,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
|
||||
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("Setting of link state is not supported by this qemu"));
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user