Skip to content

Commit a95921f

Browse files
philmdMarkus Armbruster
authored andcommitted
qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition
Address the comment added in commit 4629ed1 ("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é <[email protected]> Signed-off-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]>
1 parent 7f65e78 commit a95921f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

block/snapshot.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "block/qdict.h"
2929
#include "qapi/error.h"
3030
#include "qapi/qmp/qdict.h"
31-
#include "qapi/qmp/qerror.h"
3231
#include "qapi/qmp/qstring.h"
3332
#include "qemu/option.h"
3433
#include "sysemu/block-backend.h"
@@ -359,7 +358,8 @@ int bdrv_snapshot_delete(BlockDriverState *bs,
359358
GLOBAL_STATE_CODE();
360359

361360
if (!drv) {
362-
error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
361+
error_setg(errp, "Device '%s' has no medium",
362+
bdrv_get_device_name(bs));
363363
return -ENOMEDIUM;
364364
}
365365
if (!snapshot_id && !name) {
@@ -437,7 +437,8 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs,
437437
GRAPH_RDLOCK_GUARD_MAINLOOP();
438438

439439
if (!drv) {
440-
error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
440+
error_setg(errp, "Device '%s' has no medium",
441+
bdrv_get_device_name(bs));
441442
return -ENOMEDIUM;
442443
}
443444
if (!snapshot_id && !name) {

blockdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static void external_snapshot_action(TransactionAction *action,
13951395
bdrv_drained_begin(state->old_bs);
13961396

13971397
if (!bdrv_is_inserted(state->old_bs)) {
1398-
error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM,
1398+
error_setg(errp, "Device '%s' has no medium",
13991399
bdrv_get_device_or_node_name(state->old_bs));
14001400
return;
14011401
}

include/qapi/qmp/qerror.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
* add new ones!
1818
*/
1919

20-
#define QERR_DEVICE_HAS_NO_MEDIUM \
21-
"Device '%s' has no medium"
22-
2320
#define QERR_DEVICE_NO_HOTPLUG \
2421
"Device '%s' does not support hotplugging"
2522

0 commit comments

Comments
 (0)