Skip to contentSkip to conversation

qerror: Improve QERR_DEVICE_NOT_ACTIVE message

PATCH In review Hani Benhabiles 3 participants 4 messages Feb 25, 2014 – Feb 28, 2014

lore
Share & tools
lore
#0 lore raw

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
index 73c67b7..25193c9 100644
@@ -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
index d0d98e7..ffddd26 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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 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
index 73c67b7..25193c9 100644
@@ -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
index d0d98e7..ffddd26 100644
@@ -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.

#2 lore raw
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 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
index 73c67b7..25193c9 100644
@@ -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
index d0d98e7..ffddd26 100644
@@ -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

Sure, no problem with dropping them. Thanks for the review, Markus!

#3 lore raw
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 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
index 73c67b7..25193c9 100644
@@ -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
index d0d98e7..ffddd26 100644
@@ -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

Sure, no problem with dropping them. Thanks for the review, Markus!

Done.