qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 02/10] qerror: Eliminate QERR_ macros used in just one place
Date: Fri, 13 Nov 2020 09:26:18 +0100	[thread overview]
Message-ID: <20201113082626.2725812-3-armbru@redhat.com> (raw)
In-Reply-To: <20201113082626.2725812-1-armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qapi/qmp/qerror.h | 9 ---------
 monitor/misc.c            | 8 ++++----
 net/net.c                 | 2 +-
 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 32e6a8c13d..9aa2505cfa 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 794c652282..5e1b57a608 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1008,7 +1008,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;
-- 
2.26.2



  parent reply	other threads:[~2020-11-13  8:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  8:26 [PATCH 00/10] Chipping away at qerror.h Markus Armbruster
2020-11-13  8:26 ` [PATCH 01/10] qerror: Drop unused QERR_ macros Markus Armbruster
2020-11-16 12:41   ` Philippe Mathieu-Daudé
2020-11-13  8:26 ` Markus Armbruster [this message]
2020-11-13  8:26 ` [PATCH 03/10] block: Improve some block-commit, block-stream error messages Markus Armbruster
2020-11-13 13:30   ` Max Reitz
2020-11-13  8:26 ` [PATCH 04/10] ui: Improve some set_passwd, expire_password " Markus Armbruster
2020-11-13  8:26 ` [PATCH 05/10] ui: Improve a client_migrate_info error message Markus Armbruster
2020-11-13  8:26 ` [PATCH 06/10] ui: Tweak " Markus Armbruster
2020-11-13  8:26 ` [PATCH 07/10] qga: Replace an unreachable error by abort() Markus Armbruster
2020-11-13  8:26 ` [PATCH 08/10] qga: Tweak a guest-shutdown error message Markus Armbruster
2020-11-13  8:26 ` [PATCH 09/10] qom: Improve {qom, device}-list-properties error messages Markus Armbruster
2020-11-13  9:09   ` [PATCH 09/10] qom: Improve {qom,device}-list-properties " Paolo Bonzini
2020-11-13 13:39     ` Markus Armbruster
2020-11-13  8:26 ` [PATCH 10/10] Tweak a few "Parameter 'NAME' expects THING" error message Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113082626.2725812-3-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).