[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/22] qapi: Inline and remove QERR_DEVICE_IN_USE definition
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 03/22] qapi: Inline and remove QERR_DEVICE_IN_USE definition |
Date: |
Thu, 5 Oct 2023 06:50:20 +0200 |
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 --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;
}
--
2.41.0
- [PATCH v2 00/22] qapi: Kill 'qapi/qmp/qerror.h' for good, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 01/22] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 03/22] qapi: Inline and remove QERR_DEVICE_IN_USE definition,
Philippe Mathieu-Daudé <=
- [PATCH v2 02/22] qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 04/22] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 05/22] qapi: Inline QERR_INVALID_PARAMETER definition (constant parameter), Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 07/22] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant param), Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 06/22] qapi: Inline and remove QERR_INVALID_PARAMETER definition, Philippe Mathieu-Daudé, 2023/10/05