From patchwork Tue Mar 16 09:15:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 47819 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 B1A59B7D61 for ; Tue, 16 Mar 2010 20:32:58 +1100 (EST) Received: from localhost ([127.0.0.1]:55555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrT8x-00081N-PD for incoming@patchwork.ozlabs.org; Tue, 16 Mar 2010 05:32:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrSsR-0001rE-Nd for qemu-devel@nongnu.org; Tue, 16 Mar 2010 05:15:51 -0400 Received: from [199.232.76.173] (port=39542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrSsR-0001r5-8m for qemu-devel@nongnu.org; Tue, 16 Mar 2010 05:15:51 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrSsQ-0000Oc-2d for qemu-devel@nongnu.org; Tue, 16 Mar 2010 05:15:50 -0400 Received: from mx20.gnu.org ([199.232.41.8]:47215) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NrSsP-0000Hv-IX for qemu-devel@nongnu.org; Tue, 16 Mar 2010 05:15:49 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NrSsN-0001XC-HH for qemu-devel@nongnu.org; Tue, 16 Mar 2010 05:15:48 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp08.au.ibm.com (8.14.3/8.13.1) with ESMTP id o2G9Fj5T001988 for ; Tue, 16 Mar 2010 20:15:45 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2G9Fj4O1478670 for ; Tue, 16 Mar 2010 20:15:45 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2G9FilZ005982 for ; Tue, 16 Mar 2010 20:15:45 +1100 Received: from localhost.localdomain ([9.124.214.164]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o2G9FRvF005290; Tue, 16 Mar 2010 20:15:43 +1100 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Tue, 16 Mar 2010 14:45:06 +0530 Message-Id: <1268730920-14584-9-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.2.273.gc2413 In-Reply-To: <1268730920-14584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1268730920-14584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: ericvh@gmail.com, aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH -v2 08/22] virtio-9p: Implement P9_TCLUNK 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 From: Anthony Liguori This patch gets ls -al to work Signed-off-by: Anthony Liguori Signed-off-by: Aneesh Kumar K.V --- hw/virtio-9p.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 9bc0a57..3ac6255 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -1303,8 +1303,20 @@ out: static void v9fs_clunk(V9fsState *s, V9fsPDU *pdu) { - if (debug_9p_pdu) - pprint_pdu(pdu); + int32_t fid; + size_t offset = 7; + int err; + + pdu_unmarshal(pdu, offset, "d", &fid); + + err = free_fid(s, fid); + if (err < 0) + goto out; + + offset = 7; + err = offset; +out: + complete_pdu(s, pdu, err); } static void v9fs_write(V9fsState *s, V9fsPDU *pdu)