From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlHr-0008RY-Cn for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:45:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIlHn-0002LO-85 for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:45:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlHm-0002L5-Kq for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:45:30 -0500 Message-ID: <54D14176.5020005@redhat.com> Date: Tue, 03 Feb 2015 14:45:26 -0700 From: Eric Blake MIME-Version: 1.0 References: <1420031214-6053-1-git-send-email-den@openvz.org> <1420031214-6053-6-git-send-email-den@openvz.org> In-Reply-To: <1420031214-6053-6-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U3rRUA2vJ2mVkxVCqrjj0xeLRho5H4wRG" Subject: Re: [Qemu-devel] [PATCH 5/8] guest agent: add guest-exec and guest-exec-status interfaces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: qemu-devel@nongnu.org, Simon Zolin , Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --U3rRUA2vJ2mVkxVCqrjj0xeLRho5H4wRG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/31/2014 06:06 AM, Denis V. Lunev wrote: > From: Simon Zolin >=20 > Interfaces to execute/manage processes in the guest. Child process' > stdin/stdout/stderr can be associated with handles for communication > via read/write interfaces. >=20 > Signed-off-by: Simon Zolin > Acked-by: Roman Kagan > Signed-off-by: Denis V. Lunev > CC: Michael Roth > --- > +++ b/qga/qapi-schema.json > @@ -759,3 +759,50 @@ > ## > { 'command': 'guest-get-fsinfo', > 'returns': ['GuestFilesystemInfo'] } > + > +## > +# @guest-exec-status > +# > +# Check status of process associated with PID retrieved via guest-exec= =2E > +# Reap the process and associated metadata if it has exited. > +# > +# @pid: pid returned from guest-exec > +# > +# Returns: GuestExecStatus on success. If a child process exited, "ex= it" is set > +# to the exit code. If a child process was killed by a signa= l, > +# "signal" is set to the signal number. If a child process i= s still > +# running, both "exit" and "signal" are set to -1. On Window= s, > +# "signal" is always set to -1. That last sentence feels a bit too specific, and might even be wrong (it IS possible to tell in Windows if something died due to Ctrl-C, which is effectively SIGINT); so it might be better worded as 'If a guest cannot reliably detect exit signals, "signal" will be -1'. > +# > +# Since: 2.3 > +## > +{ 'type': 'GuestExecStatus', > + 'data': { 'exit': 'int', 'signal': 'int', > + 'handle_stdin': 'int', 'handle_stdout': 'int', > + 'handle_stderr': 'int' } } s/_/-/ throughout (that is, prefer dash, not underscore, for handle-stdin and friends) > + > +{ 'command': 'guest-exec-status', > + 'data': { 'pid': 'int' }, > + 'returns': 'GuestExecStatus' } Is there any way to query which pids are currently being tracked? Suppose that the host's connection to qga is interrupted; on reconnect, how can the host learn which pids are in use, to know how to grab status of those pids? > + > +## > +# @guest-exec: > +# > +# Execute a command in the guest > +# > +# @path: path or executable name to execute > +# @params: #optional parameter list to pass to executable > +# @env: #optional environment variables to pass to executable > +# @handle_stdin: #optional handle to associate with process' stdin. > +# @handle_stdout: #optional handle to associate with process' stdout > +# @handle_stderr: #optional handle to associate with process' stderr Inconsistent trailing '.'. If any handle is omitted, what is used in its place, effectively /dev/null? > +# > +# Returns: PID on success. > +# > +# Since: 2.3 > +## > +{ 'command': 'guest-exec', > + 'data': { 'path': 'str', '*params': ['str'], '*env': ['str'], I guess 'env' matches the usual exec*() interface, where the user is responsible for passing 'name=3Dvalue' pairs and behavior is not necessarily defined if any of those strings aren't a name=3Dvalue? > + '*handle_stdin': 'int', '*handle_stdout': 'int', > + '*handle_stderr': 'int' }, again, s/_/-/ > + 'returns': 'int' } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --U3rRUA2vJ2mVkxVCqrjj0xeLRho5H4wRG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU0UF2AAoJEKeha0olJ0NqMi8H/R7k3imvgLa2j+v9IZFZpX8j DR300HHdthroeyFLSzdxBWvqjLRwtGzxuMeEBjYvPK3EFFV/n2AxSaSU3wUNP8LK 8ilRCL54cWOkqMKk7OpFMMRU1rP06EKJpS+uuqA1rHFb4CJ/CDmlXoqVZE/qg5vb 5iv+fe/msYvpXwW30pR6vprPEzBJKMjmfw9nPEP9kE+8n8XOyMv6ersRta0R69Tq k8sisMTl6vp/UQWyN4PhmfpNvMsTI2MF/PxjxY6Z9VOQ+silb5G+MNMlFZn9psnk 0m/nW1Z4pm0QQZoAKbMDDvk5bN42DmqEEnCHL0vlGavGePSNLG3de2X3a80eCOo= =Cg+R -----END PGP SIGNATURE----- --U3rRUA2vJ2mVkxVCqrjj0xeLRho5H4wRG--