Skip to contentSkip to conversation

Finish eliminating QERR_UNSUPPORTED

PATCH In review Markus Armbruster 3 participants 7 messages Sep 11, 2024 – Oct 2, 2024

lore
Share & tools
lore
#0 lore raw

cover Finish eliminating QERR_UNSUPPORTED

Markus Armbruster (2):
qga/qapi-schema: Drop obsolete note on "unsupported" errors
qga: Improve error for guest-set-user-password parameter @crypted

 qga/qapi-schema.json      | 9 ---------
 include/qapi/qmp/qerror.h | 3 ---
 qga/commands-win32.c      | 2 +-
 3 files changed, 1 insertion(+), 13 deletions(-)
Signature · 1 line
2.46.0
#1 lore raw

PATCH 1/2 qga/qapi-schema: Drop obsolete note on "unsupported" errors

The note talks about "unsupported" errors and QERR_UNSUPPORTED. The former is vague, and the latter makes sense only in C, not in external interface documentation. Fortunately, we don't have to address this
anymore: recent merge commit 3b5efc553eb got rid of these errors. Delete the note.

---
 qga/qapi-schema.json | 9 ---------
 1 file changed, 9 deletions(-)
qga/qapi-schema.json +0 -9
index 495706cf73..0537bb7886 100644
@@ -1,15 +1,6 @@
 # *-*- Mode: Python -*-*
 # vim: filetype=python
 
-##
-# = General note concerning the use of guest agent interfaces
-#
-# "unsupported" is a higher-level error than the errors that
-# individual commands might document.  The caller should always be
-# prepared to receive QERR_UNSUPPORTED, even if the given command
-# doesn't specify it, or doesn't document any failure mode at all.
-##
-
 ##
 # = QEMU guest agent protocol commands and structs
 ##
Signature · 1 line
2.46.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] qga/qapi-schema: Drop obsolete note on "unsupported" errors

Quoted 35 lines · Markus Armbruster

The note talks about "unsupported" errors and QERR_UNSUPPORTED. The former is vague, and the latter makes sense only in C, not in external interface documentation. Fortunately, we don't have to address this
anymore: recent merge commit 3b5efc553eb got rid of these errors. Delete the note.

---
 qga/qapi-schema.json | 9 ---------
 1 file changed, 9 deletions(-)
qga/qapi-schema.json +0 -10
index 495706cf73..0537bb7886 100644
@@ -1,15 +1,6 @@
 # *-*- Mode: Python -*-*
 # vim: filetype=python
 
-##
-# = General note concerning the use of guest agent interfaces
-#
-# "unsupported" is a higher-level error than the errors that
-# individual commands might document.  The caller should always be
-# prepared to receive QERR_UNSUPPORTED, even if the given command
-# doesn't specify it, or doesn't document any failure mode at all.
-##
-
 ##
 # = QEMU guest agent protocol commands and structs
 ##
--

2.46.0

#3 lore raw

PATCH 2/2 qga: Improve error for guest-set-user-password parameter @crypted

In reply to Markus Armbruster

The Windows version of guest-set-user-password rejects argument "crypted": true with the rather useless "this feature or command is not currently supported". Improve to "'crypted' must be off on this host".

QERR_UNSUPPORTED is now unused. Drop.

---
 include/qapi/qmp/qerror.h | 3 ---
 qga/commands-win32.c      | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
include/qapi/qmp/qerror.h +0 -3
index 38e89762b3..101c1141b9 100644
@@ -26,7 +26,4 @@
 #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
     "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")"
 
-#define QERR_UNSUPPORTED \
-    "this feature or command is not currently supported"
-
 #endif /* QERROR_H */
qga/commands-win32.c +1 -1
index 61b36da469..038beb8cfa 100644
@@ -1914,7 +1914,7 @@ void qmp_guest_set_user_password(const char *username,
     GError *gerr = NULL;
 
     if (crypted) {
-        error_setg(errp, QERR_UNSUPPORTED);
+        error_setg(errp, "'crypted' must be off on this host");
         return;
     }
 
Signature · 1 line
2.46.0
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] qga: Improve error for guest-set-user-password parameter @crypted

Quoted 5 lines · Markus Armbruster

The Windows version of guest-set-user-password rejects argument "crypted": true with the rather useless "this feature or command is not currently supported". Improve to "'crypted' must be off on this host".

Quoted 7 lines

QERR_UNSUPPORTED is now unused. Drop.

---
  include/qapi/qmp/qerror.h | 3 ---
  qga/commands-win32.c      | 2 +-
  2 files changed, 1 insertion(+), 4 deletions(-)

\o/

Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] qga: Improve error for guest-set-user-password parameter @crypted

In reply to Markus Armbruster
Quoted 44 lines · Markus Armbruster

The Windows version of guest-set-user-password rejects argument "crypted": true with the rather useless "this feature or command is not currently supported". Improve to "'crypted' must be off on this host".

QERR_UNSUPPORTED is now unused. Drop.

---
 include/qapi/qmp/qerror.h | 3 ---
 qga/commands-win32.c      | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
include/qapi/qmp/qerror.h +0 -0
index 38e89762b3..101c1141b9 100644
@@ -26,7 +26,4 @@
 #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
     "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ",

maximum: %" PRId64 ")"

include/qapi/qmp/qerror.h +0 -3
-#define QERR_UNSUPPORTED \
-    "this feature or command is not currently supported"
-
 #endif /* QERROR_H */
qga/commands-win32.c +1 -2
index 61b36da469..038beb8cfa 100644
@@ -1914,7 +1914,7 @@ void qmp_guest_set_user_password(const char
 *username,
     GError *gerr = NULL;
 
     if (crypted) {
-        error_setg(errp, QERR_UNSUPPORTED);
+        error_setg(errp, "'crypted' must be off on this host");
         return;
     }
 
--

2.46.0