Skip to contentSkip to conversation

monitor: Fix QMP ABI breakage around "id"

PATCH In review Markus Armbruster 3 participants 5 messages Jun 8, 2015

lore
Share & tools
lore
#0 lore raw

cover monitor: Fix QMP ABI breakage around "id"

First, my apologies for screwing this up, and for my slow reaction (I've been offline since Wednesday night).

A number of patches for the regression have been posted. They all change the code the same way, but either restore a comment that's no longer correct, or add a new one that isn't quite right.

This patch is again the same code change, but with a better comment.

I credited the authors of the prior patches by adding their S-o-B. Hope that's alright.

A test case protecting us from such stupid mistakes would be useful. Left for later, as we need to fix the regression right away.

Peter, can you apply this directly, or do you need me to post a pull request.

Markus Armbruster (1):
monitor: Fix QMP ABI breakage around "id"

 monitor.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 monitor: Fix QMP ABI breakage around "id"

Commit 65207c5 accidentally dropped a line of code we need along with a comment that became wrong then. This made QMP reject "id":

    {"execute": "system_reset", "id": "1"}
    {"error": {"class": "GenericError", "desc": "QMP input object member 'id' is unexpected"}}

Put the lost line right back, so QMP again accepts and returns "id", as promised by the ABI:

    {"execute": "system_reset", "id": "1"}
    {"return": {}, "id": "1"}
---
 monitor.c | 2 ++
 1 file changed, 2 insertions(+)
monitor.c +2 -0
index c7baa91..9afee7b 100644
@@ -4955,6 +4955,8 @@ static QDict *qmp_check_input_obj(QObject *input_obj, Error **errp)
                           "arguments", "object");
                 return NULL;
             }
+        } else if (!strcmp(arg_name, "id")) {
+            /* Any string is acceptable as "id", so nothing to check */
         } else {
             error_set(errp, QERR_QMP_EXTRA_MEMBER, arg_name);
             return NULL;
Signature · 1 line
1.9.3
#2 lore raw
Quoted 12 lines · Markus Armbruster

Commit 65207c5 accidentally dropped a line of code we need along with a comment that became wrong then. This made QMP reject "id":

    {"execute": "system_reset", "id": "1"}
    {"error": {"class": "GenericError", "desc": "QMP input object member 'id' is unexpected"}}

Put the lost line right back, so QMP again accepts and returns "id", as promised by the ABI:

    {"execute": "system_reset", "id": "1"}
    {"return": {}, "id": "1"}
Quoted 8 lines

That's a lot of signed-off-by lines for a two line patch :-)

Quoted 18 lines
---
 monitor.c | 2 ++
 1 file changed, 2 insertions(+)
monitor.c +2 -1
index c7baa91..9afee7b 100644
@@ -4955,6 +4955,8 @@ static QDict *qmp_check_input_obj(QObject *input_obj, Error **errp)
                           "arguments", "object");
                 return NULL;
             }
+        } else if (!strcmp(arg_name, "id")) {
+            /* Any string is acceptable as "id", so nothing to check */
         } else {
             error_set(errp, QERR_QMP_EXTRA_MEMBER, arg_name);
             return NULL;
--
Quoted 1 line

1.9.3

I'll apply this directly to master later today.

-- PMM

#3 lore raw
Quoted 5 lines · Peter Maydell
Quoted 2 lines · Markus Armbruster

Commit 65207c5 accidentally dropped a line of code we need along with a comment that became wrong then. This made QMP reject "id"

I'll apply this directly to master later today.

Now done.

-- PMM

#4 lore raw
In reply to Markus Armbruster
Quoted 12 lines · Markus Armbruster

Commit 65207c5 accidentally dropped a line of code we need along with a comment that became wrong then. This made QMP reject "id":

    {"execute": "system_reset", "id": "1"}
    {"error": {"class": "GenericError", "desc": "QMP input object member 'id' is unexpected"}}

Put the lost line right back, so QMP again accepts and returns "id", as promised by the ABI:

    {"execute": "system_reset", "id": "1"}
    {"return": {}, "id": "1"}
Quoted 8 lines

Double S-o-b by Markus is odd. But it's already landed in master, I'm too late for fixing it :)

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org