qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: arun@linux.vnet.ibm.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
Date: Tue, 13 Jul 2010 18:41:18 +0530	[thread overview]
Message-ID: <4C3C65F6.4020908@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100713105630.GB11854@linux.vnet.ibm.com>

On Tuesday 13 July 2010 04:26 PM, Arun R Bharadwaj wrote:
> * Arun R Bharadwaj<arun@linux.vnet.ibm.com>  [2010-07-13 16:24:41]:
>
> This patch implements TLERROR/RLERROR in the qemu 9P server.
>
> Signed-off-by: Arun R Bharadwaj<arun@linux.vnet.ibm.com>
> ---
>   hw/virtio-9p.c |   19 +++++++++++++------
>   hw/virtio-9p.h |    2 ++
>   2 files changed, 15 insertions(+), 6 deletions(-)
>
> Index: qemu/hw/virtio-9p.h
> ===================================================================
> --- qemu.orig/hw/virtio-9p.h
> +++ qemu/hw/virtio-9p.h
> @@ -13,6 +13,8 @@
>   #define VIRTIO_9P_MOUNT_TAG 0
>
>   enum {
> +    P9_TLERROR = 6,
> +    P9_RLERROR,
>       P9_TVERSION = 100,
>       P9_RVERSION,
>       P9_TAUTH = 102,
> Index: qemu/hw/virtio-9p.c
> ===================================================================
> --- qemu.orig/hw/virtio-9p.c
> +++ qemu/hw/virtio-9p.c
> @@ -744,17 +744,24 @@ static void complete_pdu(V9fsState *s, V
>       int8_t id = pdu->id + 1; /* Response */
>
>       if (len<  0) {
> -        V9fsString str;
>           int err = -len;
> +        len = 7;
>
> -        str.data = strerror(err);
> -        str.size = strlen(str.data);
> +        if (s->proto_version != V9FS_PROTO_2000L) {
> +            V9fsString str;
> +
> +            str.data = strerror(err);
> +            str.size = strlen(str.data);
> +
> +            len += pdu_marshal(pdu, len, "s",&str);
> +            id = P9_RERROR;
> +        }
>
> -        len = 7;
> -        len += pdu_marshal(pdu, len, "s",&str);
>           len += pdu_marshal(pdu, len, "d", err);
>
> -        id = P9_RERROR;
> +        if (s->proto_version == V9FS_PROTO_2000L) {
> +            id = P9_RLERROR;
> +        }
>       }

I guess this can go in the else part of the above if loop
ie

if (s->proto_version != V9FS_PROTO_2000L) {

  id = P9_RERROR;
} else {
id = P9_RLERROR;
}


-aneesh

  parent reply	other threads:[~2010-07-13 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 10:54 [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Arun R Bharadwaj
2010-07-13 10:56 ` [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR Arun R Bharadwaj
2010-07-13 12:44   ` [Qemu-devel] " Arun R Bharadwaj
2010-07-13 13:11   ` Aneesh Kumar K.V [this message]
2010-07-13 13:27     ` [Qemu-devel] " Arun R Bharadwaj
2010-07-14 11:25 ` [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Venkateswararao Jujjuri (JV)
2010-07-15  4:31   ` Arun R Bharadwaj
2010-07-20 17:00 ` Sripathi Kodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C3C65F6.4020908@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=arun@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).