qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print
@ 2015-03-06  9:09 Markus Armbruster
  2015-03-06  9:09 ` [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit Markus Armbruster
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-03-06  9:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, lcapitulino

A more thorough cleanup of the area is in the works, but I want to get
this out quickly, so it makes 2.3.

I think it can go via -trivial, if Luiz doesn't mind.

Markus Armbruster (2):
  hmp: Fix definition of command quit
  qmp: Drop unused .user_print from command definitions

 hmp-commands.hx | 1 -
 qmp-commands.hx | 4 ----
 2 files changed, 5 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit
  2015-03-06  9:09 [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Markus Armbruster
@ 2015-03-06  9:09 ` Markus Armbruster
  2015-03-06  9:09 ` [Qemu-devel] [PATCH 2/2] qmp: Drop unused .user_print from command definitions Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-03-06  9:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, lcapitulino

The command handler is a union of two function types.  If
cmd->user_print is set, handle_user_command() calls
cmd->mhandler.cmd_new(), else cmd->mhandler.cmd().

Command definitions must therefore either set both user_print() and
mhandler.cmd_new(), or only mhandler.cmd().

quit's sets user_print and mhandler.cmd().  handle_user_command()
calls hmp_quit() through mhandler.cmd_new() rather than
mhandler.cmd(), i.e. through a function pointer with a different type.
Broken in commit 7a7f325, v1.0.

Works in practice because hmp_quit() doesn't use its arguments, and
handle_user_command() ignores its function value.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hmp-commands.hx | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 81f276b..fa5679f 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -47,7 +47,6 @@ ETEXI
         .args_type  = "",
         .params     = "",
         .help       = "quit the emulator",
-        .user_print = monitor_user_noop,
         .mhandler.cmd = hmp_quit,
     },
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/2] qmp: Drop unused .user_print from command definitions
  2015-03-06  9:09 [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Markus Armbruster
  2015-03-06  9:09 ` [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit Markus Armbruster
@ 2015-03-06  9:09 ` Markus Armbruster
  2015-03-06 15:57 ` [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Eric Blake
  2015-03-10  6:09 ` Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-03-06  9:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, lcapitulino

.user_print isn't used with QMP commands, only with HMP commands.
Copied over when QMP got its own command table in commit 82a56f0.
Most of them have been dropped since, but a few stragglers remain.
Drop them.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qmp-commands.hx | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/qmp-commands.hx b/qmp-commands.hx
index a85d847..2c05e87 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -276,7 +276,6 @@ EQMP
         .args_type  = "device:O",
         .params     = "driver[,prop=value][,...]",
         .help       = "add device, like -device on the command line",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_device_add,
     },
 
@@ -757,7 +756,6 @@ EQMP
         .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
         .params     = "protocol hostname port tls-port cert-subject",
         .help       = "send migration info to spice/vnc client",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_async = client_migrate_info,
         .flags      = MONITOR_CMD_ASYNC,
     },
@@ -793,7 +791,6 @@ EQMP
         .args_type  = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
         .params     = "-p protocol [begin] [length] [format]",
         .help       = "dump guest memory to file",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
     },
 
@@ -1833,7 +1830,6 @@ EQMP
         .args_type  = "",
         .params     = "",
         .help       = "enable QMP capabilities",
-        .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_qmp_capabilities,
     },
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print
  2015-03-06  9:09 [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Markus Armbruster
  2015-03-06  9:09 ` [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit Markus Armbruster
  2015-03-06  9:09 ` [Qemu-devel] [PATCH 2/2] qmp: Drop unused .user_print from command definitions Markus Armbruster
@ 2015-03-06 15:57 ` Eric Blake
  2015-03-10  6:09 ` Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2015-03-06 15:57 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: qemu-trivial, lcapitulino

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

On 03/06/2015 02:09 AM, Markus Armbruster wrote:
> A more thorough cleanup of the area is in the works, but I want to get
> this out quickly, so it makes 2.3.
> 
> I think it can go via -trivial, if Luiz doesn't mind.
> 
> Markus Armbruster (2):
>   hmp: Fix definition of command quit
>   qmp: Drop unused .user_print from command definitions

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
>  hmp-commands.hx | 1 -
>  qmp-commands.hx | 4 ----
>  2 files changed, 5 deletions(-)
> 

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print
  2015-03-06  9:09 [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Markus Armbruster
                   ` (2 preceding siblings ...)
  2015-03-06 15:57 ` [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Eric Blake
@ 2015-03-10  6:09 ` Michael Tokarev
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2015-03-10  6:09 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: qemu-trivial, lcapitulino

06.03.2015 12:09, Markus Armbruster wrote:
> A more thorough cleanup of the area is in the works, but I want to get
> this out quickly, so it makes 2.3.
> 
> I think it can go via -trivial, if Luiz doesn't mind.

Applied to -trivial for now, thank you!

/mjt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-10  6:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06  9:09 [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Markus Armbruster
2015-03-06  9:09 ` [Qemu-devel] [PATCH 1/2] hmp: Fix definition of command quit Markus Armbruster
2015-03-06  9:09 ` [Qemu-devel] [PATCH 2/2] qmp: Drop unused .user_print from command definitions Markus Armbruster
2015-03-06 15:57 ` [Qemu-devel] [PATCH 0/2] monitor: Fix and clean up around .user_print Eric Blake
2015-03-10  6:09 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).