diff mbox series

[03/21] qapi: Inline and remove QERR_DEVICE_IN_USE definition

Message ID 20231004173158.42591-4-philmd@linaro.org
State Handled Elsewhere
Headers show
Series qapi: Kill 'qapi/qmp/qerror.h' for good | expand

Commit Message

Philippe Mathieu-Daudé Oct. 4, 2023, 5:31 p.m. UTC
Address the comment added in commit 4629ed1e98
("qerror: Finally unused, clean up"), from 2015:

  /*
   * These macros will go away, please don't use
   * in new code, and do not add new ones!
   */

Mechanical transformation using sed, manually
removing the definition in include/qapi/qmp/qerror.h.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/qapi/qmp/qerror.h | 3 ---
 blockdev.c                | 2 +-
 chardev/char-fe.c         | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 168177bcd7..daa889809b 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -17,9 +17,6 @@ 
  * add new ones!
  */
 
-#define QERR_DEVICE_IN_USE \
-    "Device '%s' is in use"
-
 #define QERR_DEVICE_NO_HOTPLUG \
     "Device '%s' does not support hotplugging"
 
diff --git a/blockdev.c b/blockdev.c
index e5617faf0f..da39da457e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2345,7 +2345,7 @@  void coroutine_fn qmp_block_resize(const char *device, const char *node_name,
     }
 
     if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) {
-        error_setg(errp, QERR_DEVICE_IN_USE, device);
+        error_setg(errp, "Device '%s' is in use", device);
         return;
     }
 
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index 7789f7be9c..7d33b3ccd1 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -217,7 +217,7 @@  bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp)
     return true;
 
 unavailable:
-    error_setg(errp, QERR_DEVICE_IN_USE, s->label);
+    error_setg(errp, "Device '%s' is in use", s->label);
     return false;
 }