From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3] libxl: add "xl qemu-monitor-command" Date: Tue, 6 Sep 2016 14:16:30 +0200 Message-ID: <1473164190.19612.108.camel@citrix.com> References: <1473159066-26227-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8577674164698181992==" Return-path: In-Reply-To: <1473159066-26227-1-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Juergen Gross , xen-devel@lists.xen.org Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org --===============8577674164698181992== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-dfAX4krLVuBhslbxcOTh" --=-dfAX4krLVuBhslbxcOTh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: >=20 > xl qemu-monitor-command >=20 > The command is issued via qmp human-monitor-command command. Any > information returned by the command is printed to stdout. >=20 > Signed-off-by: Juergen Gross > --- > V3: - add GC_FREE as requested by Dario Faggioli > =C2=A0=C2=A0=C2=A0=C2=A0- return with EXIT_FAILURE/SUCCESS as requested b= y 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) > =C2=A0 > =C2=A0#endif > =C2=A0 > +int main_qemu_monitor_command(int argc, char **argv) > +{ > +=C2=A0=C2=A0=C2=A0=C2=A0int opt; > +=C2=A0=C2=A0=C2=A0=C2=A0uint32_t domid; > +=C2=A0=C2=A0=C2=A0=C2=A0char *cmd; > +=C2=A0=C2=A0=C2=A0=C2=A0char *output; > +=C2=A0=C2=A0=C2=A0=C2=A0int ret; > + > +=C2=A0=C2=A0=C2=A0=C2=A0SWITCH_FOREACH_OPT(opt, "", NULL, "qemu-monitor-= command", 2) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* No options */ > +=C2=A0=C2=A0=C2=A0=C2=A0} > + > +=C2=A0=C2=A0=C2=A0=C2=A0domid =3D find_domain(argv[optind]); > +=C2=A0=C2=A0=C2=A0=C2=A0cmd =3D argv[optind + 1]; > + > +=C2=A0=C2=A0=C2=A0=C2=A0if (argc - optind > 2) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0fprintf(stderr, "Invalid= arguments.\n"); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 1; > ...here. Anyway, this is Reviewed-by: Dario Faggioli 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 --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-dfAX4krLVuBhslbxcOTh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXzrOfAAoJEBZCeImluHPuZEwQALa1U3RTitmI5wIFvc0Xo2H9 qNb6Gbah+YTYvA0fdGZJ9Be8WeyzMSeIurDpHXIGQpld4U/Qv6mc1+9TI8Urj7O1 EeMfaM2+qkvLdtRJHqsP8okAS0Rg40Cx/t5ytXxC4sblVUVG1Cdv4P2X1k4tN9eu oOxoxd3tyOBuZo57bnQEs5ke6DaB9r7z1c7KQUp7EtR4N/NQ3RTXWDJ9sBR42FoJ kRnk11oUoLKcNxU5+28G8tgVKIExxwEIqMXHUBrs7fGsexzW6KpR20z/cZ/mh2D6 ZKpFf2hLP0VbzbLCFKKWIg2ixHcTVAtsr8C9fIjsepHTWFIKX07RKYbG59hhm5LM sNCP/Zk/gAZaCo4MaKgnvAwEHpKZ6byygJhBBRSqPbWI1x05jJcQX3KmADn1JB1o rU1Y/x+HxB36fajeNNEZlZVHO9GDHgY9pEPpuHhymwzqu+BoGJyMFEBrd4NhC5mf EzSt3xSdb5k9cgtqLW6OMcp0olr2A3wi4YgZgHQL1+xtiRVyrSyzF7hrYdlHM6l3 jnMr02jp+QgvhgpqCEHF09GWYu7O278kA7As2yYlfLUxQB7MO1drs792cXJ7mwkD 59SEAlLW109ZCDY3SOuW799xttfO7+wdssrlaFUyNx0kYQeQ8UBT/E7AL5UYIXQ8 dhXlk0Q+J/ztw+jcu5ST =K8RV -----END PGP SIGNATURE----- --=-dfAX4krLVuBhslbxcOTh-- --===============8577674164698181992== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============8577674164698181992==--