qerror: Improve QERR_DEVICE_NOT_ACTIVE message
PATCH 1/1 qerror: Improve QERR_DEVICE_NOT_ACTIVE message
The error message as currently used is confusing as there are no "balloon" or "spice" devices.
(qemu) balloon 1024
balloon: Device 'balloon' has not been activated
With this patch:
(qemu) balloon 1024
balloon: No balloon device has been activated
--- include/qapi/qmp/qerror.h | 2 +- qmp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
include/qapi/qmp/qerror.h +1 -1
@@ -105,7 +105,7 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"#define QERR_DEVICE_NOT_ACTIVE \ - ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated" + ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"#define QERR_DEVICE_NOT_ENCRYPTED \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"
qmp.c +0 -2
@@ -289,7 +289,6 @@ void qmp_set_password(const char *protocol, const char *password,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }
@@ -337,7 +336,6 @@ void qmp_expire_password(const char *protocol, const char *whenstr,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }
Signature · 1 line
1.8.3.2
Quoted 44 lines · Hani Benhabiles
The error message as currently used is confusing as there are no "balloon" or "spice" devices.
(qemu) balloon 1024
balloon: Device 'balloon' has not been activatedWith this patch:
(qemu) balloon 1024
balloon: No balloon device has been activatedSigned-off-by Hani Benhabiles <[email protected]>Suggested-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 2 +- qmp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)include/qapi/qmp/qerror.h +1
-1@@ -105,7 +105,7 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"#define QERR_DEVICE_NOT_ACTIVE \ - ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated" + ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"#define QERR_DEVICE_NOT_ENCRYPTED \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"qmp.c +0
-1@@ -289,7 +289,6 @@ void qmp_set_password(const char *protocol, const char *password,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }
qmp.c void qmp_expire_password(const char *protocol, const char *whenstr, · line 341
Quoted 7 lines
qmp.c +0
-1@@ -337,7 +336,6 @@ void qmp_expire_password(const char *protocol, const char *whenstr,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }
The wording of the error message is still suboptimal for the !using_spice case, but it's an improvement. I'd leave the two comments alone, though. Hani, if you agree, then Luiz could perhaps merge your patch with these two hunks dropped.
Quoted 59 lines · Markus Armbruster
Quoted 44 lines · Hani Benhabiles
The error message as currently used is confusing as there are no "balloon" or "spice" devices.
(qemu) balloon 1024
balloon: Device 'balloon' has not been activatedWith this patch:
(qemu) balloon 1024
balloon: No balloon device has been activatedSigned-off-by Hani Benhabiles <[email protected]>Suggested-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 2 +- qmp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)include/qapi/qmp/qerror.h +1
-1@@ -105,7 +105,7 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"#define QERR_DEVICE_NOT_ACTIVE \ - ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated" + ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"#define QERR_DEVICE_NOT_ENCRYPTED \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"qmp.c +0
-1@@ -289,7 +289,6 @@ void qmp_set_password(const char *protocol, const char *password,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }qmp.c void qmp_expire_password(const char *protocol, const char *whenstr, · line 341
Quoted 7 lines
qmp.c +0
-1@@ -337,7 +336,6 @@ void qmp_expire_password(const char *protocol, const char *whenstr,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }The wording of the error message is still suboptimal for the !using_spice case, but it's an improvement. I'd leave the two comments alone, though. Hani, if you agree, then Luiz could perhaps merge your patch with these two hunks dropped.
Quoted 1 line
Reviewed-by Markus Armbruster <[email protected]>
Sure, no problem with dropping them. Thanks for the review, Markus!
Quoted 60 lines · On Tue, 25 Feb 2014 09:42:43 +0100 Hani Benhabiles <[email protected]> wrote:
Quoted 59 lines · Markus Armbruster
Quoted 44 lines · Hani Benhabiles
The error message as currently used is confusing as there are no "balloon" or "spice" devices.
(qemu) balloon 1024
balloon: Device 'balloon' has not been activatedWith this patch:
(qemu) balloon 1024
balloon: No balloon device has been activatedSigned-off-by Hani Benhabiles <[email protected]>Suggested-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 2 +- qmp.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)include/qapi/qmp/qerror.h +1
-1@@ -105,7 +105,7 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"#define QERR_DEVICE_NOT_ACTIVE \ - ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated" + ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"#define QERR_DEVICE_NOT_ENCRYPTED \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"qmp.c +0
-1@@ -289,7 +289,6 @@ void qmp_set_password(const char *protocol, const char *password,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }qmp.c void qmp_expire_password(const char *protocol, const char *whenstr, · line 341
Quoted 7 lines
qmp.c +0
-1@@ -337,7 +336,6 @@ void qmp_expire_password(const char *protocol, const char *whenstr,if (strcmp (protocol,"spice" ) ==0 ) {if (!using_spice) { -/* correct one? spice isn't a device ,,, */ error_set (errp,QERR_DEVICE_NOT_ACTIVE ,"spice" );return ; }The wording of the error message is still suboptimal for the !using_spice case, but it's an improvement. I'd leave the two comments alone, though. Hani, if you agree, then Luiz could perhaps merge your patch with these two hunks dropped.
Quoted 3 lines
Quoted 1 line
Reviewed-by Markus Armbruster <[email protected]>Sure, no problem with dropping them. Thanks for the review, Markus!
Done.