[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3] libxl: add "xl qemu-monitor-command"



On Tue, 2016-09-06 at 12:51 +0200, Juergen Gross wrote:
> Add a new xl command "qemu-monitor-command" to issue arbitrary
> commands
> to a domain's device model. Syntax is:
> 
> xl qemu-monitor-command <domain> <command>
> 
> The command is issued via qmp human-monitor-command command. Any
> information returned by the command is printed to stdout.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
> V3: - add GC_FREE as requested by Dario Faggioli
>     - return with EXIT_FAILURE/SUCCESS as requested by Dario Faggioli
>
I think you missed one...

> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 7540fb1..d1a2a14 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -9536,6 +9536,35 @@ int main_psr_hwinfo(int argc, char **argv)
>  
>  #endif
>  
> +int main_qemu_monitor_command(int argc, char **argv)
> +{
> +    int opt;
> +    uint32_t domid;
> +    char *cmd;
> +    char *output;
> +    int ret;
> +
> +    SWITCH_FOREACH_OPT(opt, "", NULL, "qemu-monitor-command", 2) {
> +        /* No options */
> +    }
> +
> +    domid = find_domain(argv[optind]);
> +    cmd = argv[optind + 1];
> +
> +    if (argc - optind > 2) {
> +        fprintf(stderr, "Invalid arguments.\n");
> +        return 1;
>
...here.

Anyway, this is

Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

if possible, with the above 'return 1' converted to 'return
EXIT_FAILURE' (either by resending or done upon commit).

If a maintainer wants to ack and commit this as is, my R-b still
stands. In fact, as I said, xl is still not yet 100% consistent wrt
this, and although I think new code should comply with the rule, I
won't stand in the way of a patch for something like this.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.