From patchwork Fri Mar 25 19:47:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 88423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E983B6F11 for ; Sat, 26 Mar 2011 07:21:10 +1100 (EST) Received: from localhost ([127.0.0.1]:56738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3DIE-0004Nk-QP for incoming@patchwork.ozlabs.org; Fri, 25 Mar 2011 16:07:34 -0400 Received: from [140.186.70.92] (port=33682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3Czs-00007i-F9 for qemu-devel@nongnu.org; Fri, 25 Mar 2011 15:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3Czp-0006NO-Sr for qemu-devel@nongnu.org; Fri, 25 Mar 2011 15:48:34 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:41514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3Czp-0006NK-QR for qemu-devel@nongnu.org; Fri, 25 Mar 2011 15:48:33 -0400 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2PJTlrW007456 for ; Fri, 25 Mar 2011 15:29:47 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9011638C8039 for ; Fri, 25 Mar 2011 15:48:27 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2PJmWFl204714 for ; Fri, 25 Mar 2011 15:48:32 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2PJmW3f025207 for ; Fri, 25 Mar 2011 16:48:32 -0300 Received: from localhost.localdomain (sig-9-65-252-65.mts.ibm.com [9.65.252.65]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p2PJm3tG022972; Fri, 25 Mar 2011 16:48:31 -0300 From: Michael Roth To: qemu-devel@nongnu.org Date: Fri, 25 Mar 2011 14:47:58 -0500 Message-Id: <1301082479-4058-12-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1301082479-4058-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1301082479-4058-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.182.142 Cc: aliguori@linux.vnet.ibm.com, agl@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, Jes.Sorensen@redhat.com Subject: [Qemu-devel] [RFC][PATCH v1 11/12] guest agent: guest-side command implementations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is where the actual commands/RPCs are defined. This patch is mostly just to serve as an example, but guest-ping actually does everything it needs to. view_file will soon be replaced with a stateful open/read/close interface, and shutdown will be ported over from virtagent soon as well. Signed-off-by: Michael Roth --- guest-agent-commands.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 guest-agent-commands.c diff --git a/guest-agent-commands.c b/guest-agent-commands.c new file mode 100644 index 0000000..ca8a894 --- /dev/null +++ b/guest-agent-commands.c @@ -0,0 +1,24 @@ +/* + * QEMU Guest Agent commands + * + * Copyright IBM Corp. 2011 + * + * Authors: + * Michael Roth + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "guest-agent.h" + +void qga_guest_ping(Error **err) +{ +} + +char *qga_guest_view_file(const char *filename, Error **err) +{ + char *test_response = qemu_mallocz(512); + strcpy(test_response, "this is some text"); + return test_response; +}