summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Armbruster2020-11-13 09:26:18 +0100
committerMarkus Armbruster2020-12-10 17:16:44 +0100
commitf820af87433af84c13cd260807b59bbce47e2f0a (patch)
treee3e73a12d52903bd1d95e77a461f5914041bf72b
parentqerror: Drop unused QERR_ macros (diff)
downloadqemu-f820af87433af84c13cd260807b59bbce47e2f0a.tar.gz
qemu-f820af87433af84c13cd260807b59bbce47e2f0a.tar.xz
qemu-f820af87433af84c13cd260807b59bbce47e2f0a.zip
qerror: Eliminate QERR_ macros used in just one place
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201113082626.2725812-3-armbru@redhat.com>
-rw-r--r--include/qapi/qmp/qerror.h9
-rw-r--r--monitor/misc.c8
-rw-r--r--net/net.c2
3 files changed, 5 insertions, 14 deletions
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 3eabd451d8..c272e3fc29 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -25,21 +25,12 @@
#define QERR_DEVICE_HAS_NO_MEDIUM \
"Device '%s' has no medium"
-#define QERR_DEVICE_INIT_FAILED \
- "Device '%s' could not be initialized"
-
#define QERR_DEVICE_IN_USE \
"Device '%s' is in use"
#define QERR_DEVICE_NO_HOTPLUG \
"Device '%s' does not support hotplugging"
-#define QERR_FD_NOT_FOUND \
- "File descriptor named '%s' not found"
-
-#define QERR_FD_NOT_SUPPLIED \
- "No file descriptor supplied via SCM_RIGHTS"
-
#define QERR_FEATURE_DISABLED \
"The feature '%s' is not enabled"
diff --git a/monitor/misc.c b/monitor/misc.c
index 398211a034..c563e901c0 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -1232,7 +1232,7 @@ void qmp_getfd(const char *fdname, Error **errp)
fd = qemu_chr_fe_get_msgfd(&cur_mon->chr);
if (fd == -1) {
- error_setg(errp, QERR_FD_NOT_SUPPLIED);
+ error_setg(errp, "No file descriptor supplied via SCM_RIGHTS");
return;
}
@@ -1286,7 +1286,7 @@ void qmp_closefd(const char *fdname, Error **errp)
}
qemu_mutex_unlock(&cur_mon->mon_lock);
- error_setg(errp, QERR_FD_NOT_FOUND, fdname);
+ error_setg(errp, "File descriptor named '%s' not found", fdname);
}
int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp)
@@ -1357,7 +1357,7 @@ AddfdInfo *qmp_add_fd(bool has_fdset_id, int64_t fdset_id, bool has_opaque,
fd = qemu_chr_fe_get_msgfd(&mon->chr);
if (fd == -1) {
- error_setg(errp, QERR_FD_NOT_SUPPLIED);
+ error_setg(errp, "No file descriptor supplied via SCM_RIGHTS");
goto error;
}
@@ -1410,7 +1410,7 @@ error:
} else {
snprintf(fd_str, sizeof(fd_str), "fdset-id:%" PRId64, fdset_id);
}
- error_setg(errp, QERR_FD_NOT_FOUND, fd_str);
+ error_setg(errp, "File descriptor named '%s' not found", fd_str);
}
FdsetInfoList *qmp_query_fdsets(Error **errp)
diff --git a/net/net.c b/net/net.c
index 6a2c3d9567..e1035f21d1 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1013,7 +1013,7 @@ static int net_client_init1(const Netdev *netdev, bool is_netdev, Error **errp)
if (net_client_init_fun[netdev->type](netdev, netdev->id, peer, errp) < 0) {
/* FIXME drop when all init functions store an Error */
if (errp && !*errp) {
- error_setg(errp, QERR_DEVICE_INIT_FAILED,
+ error_setg(errp, "Device '%s' could not be initialized",
NetClientDriver_str(netdev->type));
}
return -1;