aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-03-12 15:13:36 +0100
committerMarkus Armbruster <armbru@redhat.com>2024-04-24 09:50:58 +0200
commita95921f1712b5f3bb9f905a08984b478b89e0fa5 (patch)
treef2c6bdd0fbf2ede5f325e6c03414cb33ce1c3dce /block
parent7f65e789abf496480be6a54ba454dd6641b45784 (diff)
downloadqemu-a95921f1712b5f3bb9f905a08984b478b89e0fa5.zip
qemu-a95921f1712b5f3bb9f905a08984b478b89e0fa5.tar.gz
qemu-a95921f1712b5f3bb9f905a08984b478b89e0fa5.tar.bz2
qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition
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, and manual cleanup. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240312141343.3168265-4-armbru@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/snapshot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/snapshot.c b/block/snapshot.c
index 8242b4a..8fd1756 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -28,7 +28,6 @@
#include "block/qdict.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qstring.h"
#include "qemu/option.h"
#include "sysemu/block-backend.h"
@@ -359,7 +358,8 @@ int bdrv_snapshot_delete(BlockDriverState *bs,
GLOBAL_STATE_CODE();
if (!drv) {
- error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
+ error_setg(errp, "Device '%s' has no medium",
+ bdrv_get_device_name(bs));
return -ENOMEDIUM;
}
if (!snapshot_id && !name) {
@@ -437,7 +437,8 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs,
GRAPH_RDLOCK_GUARD_MAINLOOP();
if (!drv) {
- error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
+ error_setg(errp, "Device '%s' has no medium",
+ bdrv_get_device_name(bs));
return -ENOMEDIUM;
}
if (!snapshot_id && !name) {