mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
Remove inappropriate use of VIR_ERR_NO_SUPPORT
The VIR_ERR_NO_SUPPORT refers to an API which is not implemented. There is a separate VIR_ERR_CONFIG_UNSUPPORTED for XML config options that are not available with the current hypervisor. * src/qemu/qemu_conf.c, src/qemu/qemu_driver.c: Remove many VIR_ERR_NO_SUPPORT replace with VIR_ERR_CONFIG_UNSUPPORTED
This commit is contained in:
parent
cd35e8927f
commit
021251bd7d
@ -1843,7 +1843,7 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
|
||||
ret = virAsprintf(&devname, "xenblk%d", devid);
|
||||
break;
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported disk name mapping for bus '%s'"),
|
||||
virDomainDiskBusTypeToString(disk->bus));
|
||||
return -1;
|
||||
@ -3394,7 +3394,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
|
||||
goto cleanup;
|
||||
|
||||
if (!ncpus || !host) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("CPU specification not supported by hypervisor"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -3568,7 +3568,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
if (migrateFrom) {
|
||||
if (STRPREFIX(migrateFrom, "tcp")) {
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("TCP migration is not supported with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
@ -3576,13 +3576,13 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
if (qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC) {
|
||||
migrateFrom = "exec:cat";
|
||||
} else if (!(qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_KVM_STDIO)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("STDIO migration is not supported with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
} else if (STRPREFIX(migrateFrom, "exec")) {
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("STDIO migration is not supported with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
@ -4034,7 +4034,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
|
||||
/* QEMU doesn't implement a SATA driver */
|
||||
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("SATA is not supported with this QEMU binary"));
|
||||
goto error;
|
||||
}
|
||||
@ -4390,7 +4390,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
case VIR_DOMAIN_CHR_TARGET_TYPE_GUESTFWD:
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_CHARDEV) ||
|
||||
!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("guestfwd requires QEMU to support -chardev & -device"));
|
||||
goto error;
|
||||
}
|
||||
@ -4415,7 +4415,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
|
||||
case VIR_DOMAIN_CHR_TARGET_TYPE_VIRTIO:
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio channel requires QEMU to support -device"));
|
||||
goto error;
|
||||
}
|
||||
@ -4747,7 +4747,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
goto error;
|
||||
ADD_ARG(devstr);
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("PCI device assignment is not supported by this version of qemu"));
|
||||
goto error;
|
||||
}
|
||||
|
@ -824,7 +824,7 @@ getVolumeQcowPassphrase(virConnectPtr conn,
|
||||
enc = disk->encryption;
|
||||
|
||||
if (!conn) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot find secrets without a connection"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -7566,7 +7566,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
|
||||
int vlan;
|
||||
|
||||
if (!(qemuCmdFlags & QEMUD_CMD_FLAG_HOST_NET_ADD)) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("installed qemu version does not support host_net_add"));
|
||||
return -1;
|
||||
}
|
||||
@ -7574,7 +7574,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
|
||||
if (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
|
||||
net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
||||
if (priv->monConfig->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("network device type '%s' cannot be attached: "
|
||||
"qemu is not using a unix socket monitor"),
|
||||
virDomainNetTypeToString(net->type));
|
||||
@ -7585,7 +7585,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
|
||||
return -1;
|
||||
} else if (net->type == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
||||
if (priv->monConfig->type != VIR_DOMAIN_CHR_TYPE_UNIX) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("network device type '%s' cannot be attached: "
|
||||
"qemu is not using a unix socket monitor"),
|
||||
virDomainNetTypeToString(net->type));
|
||||
@ -7618,7 +7618,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
|
||||
vlan = qemuDomainNetVLAN(net);
|
||||
|
||||
if (vlan < 0) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Unable to attach network devices without vlan"));
|
||||
goto cleanup;
|
||||
}
|
||||
@ -7954,7 +7954,7 @@ static int qemudDomainAttachHostDevice(struct qemud_driver *driver,
|
||||
unsigned long long qemuCmdFlags)
|
||||
{
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev mode '%s' not supported"),
|
||||
virDomainHostdevModeTypeToString(hostdev->mode));
|
||||
return -1;
|
||||
@ -7997,7 +7997,7 @@ static int qemudDomainAttachHostDevice(struct qemud_driver *driver,
|
||||
break;
|
||||
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev subsys type '%s' not supported"),
|
||||
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
|
||||
goto error;
|
||||
@ -8094,7 +8094,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
|
||||
if (ret == 0)
|
||||
dev->data.disk = NULL;
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk bus '%s' cannot be hotplugged."),
|
||||
virDomainDiskBusTypeToString(dev->data.disk->bus));
|
||||
/* fallthrough */
|
||||
@ -8102,7 +8102,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
|
||||
break;
|
||||
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk device type '%s' cannot be hotplugged"),
|
||||
virDomainDiskDeviceTypeToString(dev->data.disk->device));
|
||||
/* Fallthrough */
|
||||
@ -8119,7 +8119,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
|
||||
if (ret == 0)
|
||||
dev->data.controller = NULL;
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk controller bus '%s' cannot be hotplugged."),
|
||||
virDomainControllerTypeToString(dev->data.controller->type));
|
||||
/* fallthrough */
|
||||
@ -8135,7 +8135,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
|
||||
if (ret == 0)
|
||||
dev->data.hostdev = NULL;
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("device type '%s' cannot be attached"),
|
||||
virDomainDeviceTypeToString(dev->type));
|
||||
goto endjob;
|
||||
@ -8324,7 +8324,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
|
||||
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk bus '%s' cannot be updated."),
|
||||
virDomainDiskBusTypeToString(dev->data.disk->bus));
|
||||
break;
|
||||
@ -8342,7 +8342,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
break;
|
||||
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk device type '%s' cannot be updated"),
|
||||
virDomainDiskDeviceTypeToString(dev->data.disk->device));
|
||||
break;
|
||||
@ -8922,7 +8922,7 @@ static int qemudDomainDetachHostDevice(struct qemud_driver *driver,
|
||||
int ret;
|
||||
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev mode '%s' not supported"),
|
||||
virDomainHostdevModeTypeToString(hostdev->mode));
|
||||
return -1;
|
||||
@ -8936,7 +8936,7 @@ static int qemudDomainDetachHostDevice(struct qemud_driver *driver,
|
||||
ret = qemudDomainDetachHostUsbDevice(driver, vm, dev, qemuCmdFlags);
|
||||
break;
|
||||
default:
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev subsys type '%s' not supported"),
|
||||
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
|
||||
return -1;
|
||||
@ -8998,7 +8998,7 @@ static int qemudDomainDetachDevice(virDomainPtr dom,
|
||||
qemuCmdFlags);
|
||||
}
|
||||
else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("This type of disk cannot be hot unplugged"));
|
||||
}
|
||||
} else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
|
||||
@ -9008,7 +9008,7 @@ static int qemudDomainDetachDevice(virDomainPtr dom,
|
||||
ret = qemudDomainDetachPciControllerDevice(driver, vm, dev,
|
||||
qemuCmdFlags);
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk controller bus '%s' cannot be hotunplugged."),
|
||||
virDomainControllerTypeToString(dev->data.controller->type));
|
||||
/* fallthrough */
|
||||
@ -9016,7 +9016,7 @@ static int qemudDomainDetachDevice(virDomainPtr dom,
|
||||
} else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
|
||||
ret = qemudDomainDetachHostDevice(driver, vm, dev, qemuCmdFlags);
|
||||
} else {
|
||||
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("This type of device cannot be hot unplugged"));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user