]> xenbits.xensource.com Git - xen.git/commitdiff
tools/livepatch: Show the correct expected state before action
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 14 Dec 2016 07:51:53 +0000 (07:51 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 14 Dec 2016 20:27:19 +0000 (15:27 -0500)
Somewhat confusingly, before the action has been executed the patch is
expected to be in the "allow" state, not the "expected" state.  The
check for this was correct but the subsequent error message was not.
Fix the error message to show this state correctly.

Before:
    $ xen-livepatch unload test
    test: in wrong state (APPLIED), expected (unknown)
After:
    $ xen-livepatch unload test
    test: in wrong state (APPLIED), expected (CHECKED)

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
tools/misc/xen-livepatch.c

index 2de04c0a16bc3c78f98c53015d83ede7be0bdb4b..f6c7c8a629f4bbcf43990fcabf9f134e51ebed86 100644 (file)
@@ -308,7 +308,7 @@ int action_func(int argc, char *argv[], unsigned int idx)
     {
         printf("%s: in wrong state (%s), expected (%s)\n",
                name, state2str(status.state),
-               state2str(action_options[idx].expected));
+               state2str(action_options[idx].allow));
         return -1;
     }