Skip to content

Commit f95b25c

Browse files
philmdMarkus Armbruster
authored andcommitted
qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG 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 a95921f commit f95b25c

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

hw/core/qdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "qapi/error.h"
3030
#include "qapi/qapi-events-qdev.h"
3131
#include "qapi/qmp/qdict.h"
32-
#include "qapi/qmp/qerror.h"
3332
#include "qapi/visitor.h"
3433
#include "qemu/error-report.h"
3534
#include "qemu/option.h"
@@ -479,7 +478,8 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
479478
static int unattached_count;
480479

481480
if (dev->hotplugged && !dc->hotpluggable) {
482-
error_setg(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj));
481+
error_setg(errp, "Device '%s' does not support hotplugging",
482+
object_get_typename(obj));
483483
return;
484484
}
485485

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_NO_HOTPLUG \
21-
"Device '%s' does not support hotplugging"
22-
2320
#define QERR_INVALID_PARAMETER \
2421
"Invalid parameter '%s'"
2522

system/qdev-monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ void qdev_unplug(DeviceState *dev, Error **errp)
917917
}
918918

919919
if (!dc->hotpluggable) {
920-
error_setg(errp, QERR_DEVICE_NO_HOTPLUG,
920+
error_setg(errp, "Device '%s' does not support hotplugging",
921921
object_get_typename(OBJECT(dev)));
922922
return;
923923
}

0 commit comments

Comments
 (0)