From patchwork Tue Mar 16 09:15:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [-v2,08/22] virtio-9p: Implement P9_TCLUNK From: "Aneesh Kumar K.V" X-Patchwork-Id: 47819 Message-Id: <1268730920-14584-9-git-send-email-aneesh.kumar@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: ericvh@gmail.com, aliguori@us.ibm.com, "Aneesh Kumar K.V" Date: Tue, 16 Mar 2010 14:45:06 +0530 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)