* [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable.
@ 2010-07-13 10:54 Arun R Bharadwaj
2010-07-13 10:56 ` [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR Arun R Bharadwaj
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Arun R Bharadwaj @ 2010-07-13 10:54 UTC (permalink / raw)
To: qemu-devel; +Cc: arun
Hi,
This patch cleans up the legacy 'dotu' variable which is always set to
1 by default, since qemu doesnt support legacy 9p clients.
Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
---
hw/virtio-9p-debug.c | 26 +++--------
hw/virtio-9p-debug.h | 1
hw/virtio-9p.c | 119 +++++++++++++++++++++++----------------------------
3 files changed, 63 insertions(+), 83 deletions(-)
Index: qemu/hw/virtio-9p-debug.h
===================================================================
--- qemu.orig/hw/virtio-9p-debug.h
+++ qemu/hw/virtio-9p-debug.h
@@ -1,7 +1,6 @@
#ifndef _QEMU_VIRTIO_9P_DEBUG_H
#define _QEMU_VIRTIO_9P_DEBUG_H
-extern int dotu;
void pprint_pdu(V9fsPDU *pdu);
#endif
Index: qemu/hw/virtio-9p-debug.c
===================================================================
--- qemu.orig/hw/virtio-9p-debug.c
+++ qemu/hw/virtio-9p-debug.c
@@ -169,12 +169,10 @@ static void pprint_stat(V9fsPDU *pdu, in
pprint_str(pdu, rx, offsetp, ", uid");
pprint_str(pdu, rx, offsetp, ", gid");
pprint_str(pdu, rx, offsetp, ", muid");
- if (dotu) {
- pprint_str(pdu, rx, offsetp, ", extension");
- pprint_int32(pdu, rx, offsetp, ", uid");
- pprint_int32(pdu, rx, offsetp, ", gid");
- pprint_int32(pdu, rx, offsetp, ", muid");
- }
+ pprint_str(pdu, rx, offsetp, ", extension");
+ pprint_int32(pdu, rx, offsetp, ", uid");
+ pprint_int32(pdu, rx, offsetp, ", gid");
+ pprint_int32(pdu, rx, offsetp, ", muid");
fprintf(llogfile, "}");
}
@@ -343,9 +341,7 @@ void pprint_pdu(V9fsPDU *pdu)
pprint_int32(pdu, 0, &offset, "afid");
pprint_str(pdu, 0, &offset, ", uname");
pprint_str(pdu, 0, &offset, ", aname");
- if (dotu) {
- pprint_int32(pdu, 0, &offset, ", n_uname");
- }
+ pprint_int32(pdu, 0, &offset, ", n_uname");
break;
case P9_RAUTH:
fprintf(llogfile, "RAUTH: (");
@@ -357,9 +353,7 @@ void pprint_pdu(V9fsPDU *pdu)
pprint_int32(pdu, 0, &offset, ", afid");
pprint_str(pdu, 0, &offset, ", uname");
pprint_str(pdu, 0, &offset, ", aname");
- if (dotu) {
- pprint_int32(pdu, 0, &offset, ", n_uname");
- }
+ pprint_int32(pdu, 0, &offset, ", n_uname");
break;
case P9_RATTACH:
fprintf(llogfile, "RATTACH: (");
@@ -371,9 +365,7 @@ void pprint_pdu(V9fsPDU *pdu)
case P9_RERROR:
fprintf(llogfile, "RERROR: (");
pprint_str(pdu, 1, &offset, "ename");
- if (dotu) {
- pprint_int32(pdu, 1, &offset, ", ecode");
- }
+ pprint_int32(pdu, 1, &offset, ", ecode");
break;
case P9_TFLUSH:
fprintf(llogfile, "TFLUSH: (");
@@ -408,9 +400,7 @@ void pprint_pdu(V9fsPDU *pdu)
pprint_str(pdu, 0, &offset, ", name");
pprint_int32(pdu, 0, &offset, ", perm");
pprint_int8(pdu, 0, &offset, ", mode");
- if (dotu) {
- pprint_str(pdu, 0, &offset, ", extension");
- }
+ pprint_str(pdu, 0, &offset, ", extension");
break;
case P9_RCREATE:
fprintf(llogfile, "RCREATE: (");
Index: qemu/hw/virtio-9p.c
===================================================================
--- qemu.orig/hw/virtio-9p.c
+++ qemu/hw/virtio-9p.c
@@ -18,7 +18,6 @@
#include "fsdev/qemu-fsdev.h"
#include "virtio-9p-debug.h"
-int dotu = 1;
int debug_9p_pdu;
enum {
@@ -753,9 +752,7 @@ static void complete_pdu(V9fsState *s, V
len = 7;
len += pdu_marshal(pdu, len, "s", &str);
- if (dotu) {
- len += pdu_marshal(pdu, len, "d", err);
- }
+ len += pdu_marshal(pdu, len, "d", err);
id = P9_RERROR;
}
@@ -785,22 +782,20 @@ static mode_t v9mode_to_mode(uint32_t mo
ret |= S_IFDIR;
}
- if (dotu) {
- if (mode & P9_STAT_MODE_SYMLINK) {
- ret |= S_IFLNK;
- }
- if (mode & P9_STAT_MODE_SOCKET) {
- ret |= S_IFSOCK;
- }
- if (mode & P9_STAT_MODE_NAMED_PIPE) {
- ret |= S_IFIFO;
- }
- if (mode & P9_STAT_MODE_DEVICE) {
- if (extension && extension->data[0] == 'c') {
- ret |= S_IFCHR;
- } else {
- ret |= S_IFBLK;
- }
+ if (mode & P9_STAT_MODE_SYMLINK) {
+ ret |= S_IFLNK;
+ }
+ if (mode & P9_STAT_MODE_SOCKET) {
+ ret |= S_IFSOCK;
+ }
+ if (mode & P9_STAT_MODE_NAMED_PIPE) {
+ ret |= S_IFIFO;
+ }
+ if (mode & P9_STAT_MODE_DEVICE) {
+ if (extension && extension->data[0] == 'c') {
+ ret |= S_IFCHR;
+ } else {
+ ret |= S_IFBLK;
}
}
@@ -863,34 +858,32 @@ static uint32_t stat_to_v9mode(const str
mode |= P9_STAT_MODE_DIR;
}
- if (dotu) {
- if (S_ISLNK(stbuf->st_mode)) {
- mode |= P9_STAT_MODE_SYMLINK;
- }
+ if (S_ISLNK(stbuf->st_mode)) {
+ mode |= P9_STAT_MODE_SYMLINK;
+ }
- if (S_ISSOCK(stbuf->st_mode)) {
- mode |= P9_STAT_MODE_SOCKET;
- }
+ if (S_ISSOCK(stbuf->st_mode)) {
+ mode |= P9_STAT_MODE_SOCKET;
+ }
- if (S_ISFIFO(stbuf->st_mode)) {
- mode |= P9_STAT_MODE_NAMED_PIPE;
- }
+ if (S_ISFIFO(stbuf->st_mode)) {
+ mode |= P9_STAT_MODE_NAMED_PIPE;
+ }
- if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
- mode |= P9_STAT_MODE_DEVICE;
- }
+ if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
+ mode |= P9_STAT_MODE_DEVICE;
+ }
- if (stbuf->st_mode & S_ISUID) {
- mode |= P9_STAT_MODE_SETUID;
- }
+ if (stbuf->st_mode & S_ISUID) {
+ mode |= P9_STAT_MODE_SETUID;
+ }
- if (stbuf->st_mode & S_ISGID) {
- mode |= P9_STAT_MODE_SETGID;
- }
+ if (stbuf->st_mode & S_ISGID) {
+ mode |= P9_STAT_MODE_SETGID;
+ }
- if (stbuf->st_mode & S_ISVTX) {
- mode |= P9_STAT_MODE_SETVTX;
- }
+ if (stbuf->st_mode & S_ISVTX) {
+ mode |= P9_STAT_MODE_SETVTX;
}
return mode;
@@ -915,29 +908,27 @@ static int stat_to_v9stat(V9fsState *s,
v9fs_string_null(&v9stat->gid);
v9fs_string_null(&v9stat->muid);
- if (dotu) {
- v9stat->n_uid = stbuf->st_uid;
- v9stat->n_gid = stbuf->st_gid;
- v9stat->n_muid = 0;
-
- v9fs_string_null(&v9stat->extension);
-
- if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
- err = v9fs_do_readlink(s, name, &v9stat->extension);
- if (err == -1) {
- err = -errno;
- return err;
- }
- v9stat->extension.data[err] = 0;
- v9stat->extension.size = err;
- } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
- v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
- S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
- major(stbuf->st_rdev), minor(stbuf->st_rdev));
- } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
- v9fs_string_sprintf(&v9stat->extension, "%s %u",
- "HARDLINKCOUNT", stbuf->st_nlink);
+ v9stat->n_uid = stbuf->st_uid;
+ v9stat->n_gid = stbuf->st_gid;
+ v9stat->n_muid = 0;
+
+ v9fs_string_null(&v9stat->extension);
+
+ if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
+ err = v9fs_do_readlink(s, name, &v9stat->extension);
+ if (err == -1) {
+ err = -errno;
+ return err;
}
+ v9stat->extension.data[err] = 0;
+ v9stat->extension.size = err;
+ } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
+ v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
+ S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
+ major(stbuf->st_rdev), minor(stbuf->st_rdev));
+ } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
+ v9fs_string_sprintf(&v9stat->extension, "%s %u",
+ "HARDLINKCOUNT", stbuf->st_nlink);
}
str = strrchr(name->data, '/');
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
2010-07-13 10:54 [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Arun R Bharadwaj
@ 2010-07-13 10:56 ` Arun R Bharadwaj
2010-07-13 12:44 ` [Qemu-devel] " Arun R Bharadwaj
2010-07-13 13:11 ` [Qemu-devel] " Aneesh Kumar K.V
2010-07-14 11:25 ` [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Venkateswararao Jujjuri (JV)
2010-07-20 17:00 ` Sripathi Kodi
2 siblings, 2 replies; 8+ messages in thread
From: Arun R Bharadwaj @ 2010-07-13 10:56 UTC (permalink / raw)
To: qemu-devel; +Cc: arun
* 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;
+ }
}
/* fill out the header */
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] Re: [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
2010-07-13 10:56 ` [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR Arun R Bharadwaj
@ 2010-07-13 12:44 ` Arun R Bharadwaj
2010-07-13 13:11 ` [Qemu-devel] " Aneesh Kumar K.V
1 sibling, 0 replies; 8+ messages in thread
From: Arun R Bharadwaj @ 2010-07-13 12:44 UTC (permalink / raw)
To: qemu-devel; +Cc: arun
* Arun R Bharadwaj <arun@linux.vnet.ibm.com> [2010-07-13 16:26:30]:
> * Arun R Bharadwaj <arun@linux.vnet.ibm.com> [2010-07-13 16:24:41]:
>
> This patch implements TLERROR/RLERROR in the qemu 9P server.
>
Here is the link to client implementation of the same
http://sourceforge.net/mailarchive/message.php?msg_name=20100713110049.GC11854%40linux.vnet.ibm.com
-arun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
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
2010-07-13 13:27 ` Arun R Bharadwaj
1 sibling, 1 reply; 8+ messages in thread
From: Aneesh Kumar K.V @ 2010-07-13 13:11 UTC (permalink / raw)
To: arun; +Cc: qemu-devel
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] [virtio-9p] Implement TLERROR/RLERROR.
2010-07-13 13:11 ` [Qemu-devel] " Aneesh Kumar K.V
@ 2010-07-13 13:27 ` Arun R Bharadwaj
0 siblings, 0 replies; 8+ messages in thread
From: Arun R Bharadwaj @ 2010-07-13 13:27 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: arun, qemu-devel
* Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> [2010-07-13 18:41:18]:
> 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;
> }
>
Sure. That works fine.
>
> -aneesh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable.
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-14 11:25 ` Venkateswararao Jujjuri (JV)
2010-07-15 4:31 ` Arun R Bharadwaj
2010-07-20 17:00 ` Sripathi Kodi
2 siblings, 1 reply; 8+ messages in thread
From: Venkateswararao Jujjuri (JV) @ 2010-07-14 11:25 UTC (permalink / raw)
To: arun; +Cc: qemu-devel
Arun R Bharadwaj wrote:
> Hi,
>
> This patch cleans up the legacy 'dotu' variable which is always set to
> 1 by default, since qemu doesnt support legacy 9p clients.
Do we have 2/2 in this series? Also please check the thread-id.
It is showing part of your other patch, TLERROR/RLERROR.
- JV
>
> Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
> ---
> hw/virtio-9p-debug.c | 26 +++--------
> hw/virtio-9p-debug.h | 1
> hw/virtio-9p.c | 119 +++++++++++++++++++++++----------------------------
> 3 files changed, 63 insertions(+), 83 deletions(-)
>
> Index: qemu/hw/virtio-9p-debug.h
> ===================================================================
> --- qemu.orig/hw/virtio-9p-debug.h
> +++ qemu/hw/virtio-9p-debug.h
> @@ -1,7 +1,6 @@
> #ifndef _QEMU_VIRTIO_9P_DEBUG_H
> #define _QEMU_VIRTIO_9P_DEBUG_H
>
> -extern int dotu;
> void pprint_pdu(V9fsPDU *pdu);
>
> #endif
> Index: qemu/hw/virtio-9p-debug.c
> ===================================================================
> --- qemu.orig/hw/virtio-9p-debug.c
> +++ qemu/hw/virtio-9p-debug.c
> @@ -169,12 +169,10 @@ static void pprint_stat(V9fsPDU *pdu, in
> pprint_str(pdu, rx, offsetp, ", uid");
> pprint_str(pdu, rx, offsetp, ", gid");
> pprint_str(pdu, rx, offsetp, ", muid");
> - if (dotu) {
> - pprint_str(pdu, rx, offsetp, ", extension");
> - pprint_int32(pdu, rx, offsetp, ", uid");
> - pprint_int32(pdu, rx, offsetp, ", gid");
> - pprint_int32(pdu, rx, offsetp, ", muid");
> - }
> + pprint_str(pdu, rx, offsetp, ", extension");
> + pprint_int32(pdu, rx, offsetp, ", uid");
> + pprint_int32(pdu, rx, offsetp, ", gid");
> + pprint_int32(pdu, rx, offsetp, ", muid");
> fprintf(llogfile, "}");
> }
>
> @@ -343,9 +341,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_int32(pdu, 0, &offset, "afid");
> pprint_str(pdu, 0, &offset, ", uname");
> pprint_str(pdu, 0, &offset, ", aname");
> - if (dotu) {
> - pprint_int32(pdu, 0, &offset, ", n_uname");
> - }
> + pprint_int32(pdu, 0, &offset, ", n_uname");
> break;
> case P9_RAUTH:
> fprintf(llogfile, "RAUTH: (");
> @@ -357,9 +353,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_int32(pdu, 0, &offset, ", afid");
> pprint_str(pdu, 0, &offset, ", uname");
> pprint_str(pdu, 0, &offset, ", aname");
> - if (dotu) {
> - pprint_int32(pdu, 0, &offset, ", n_uname");
> - }
> + pprint_int32(pdu, 0, &offset, ", n_uname");
> break;
> case P9_RATTACH:
> fprintf(llogfile, "RATTACH: (");
> @@ -371,9 +365,7 @@ void pprint_pdu(V9fsPDU *pdu)
> case P9_RERROR:
> fprintf(llogfile, "RERROR: (");
> pprint_str(pdu, 1, &offset, "ename");
> - if (dotu) {
> - pprint_int32(pdu, 1, &offset, ", ecode");
> - }
> + pprint_int32(pdu, 1, &offset, ", ecode");
> break;
> case P9_TFLUSH:
> fprintf(llogfile, "TFLUSH: (");
> @@ -408,9 +400,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_str(pdu, 0, &offset, ", name");
> pprint_int32(pdu, 0, &offset, ", perm");
> pprint_int8(pdu, 0, &offset, ", mode");
> - if (dotu) {
> - pprint_str(pdu, 0, &offset, ", extension");
> - }
> + pprint_str(pdu, 0, &offset, ", extension");
> break;
> case P9_RCREATE:
> fprintf(llogfile, "RCREATE: (");
> Index: qemu/hw/virtio-9p.c
> ===================================================================
> --- qemu.orig/hw/virtio-9p.c
> +++ qemu/hw/virtio-9p.c
> @@ -18,7 +18,6 @@
> #include "fsdev/qemu-fsdev.h"
> #include "virtio-9p-debug.h"
>
> -int dotu = 1;
> int debug_9p_pdu;
>
> enum {
> @@ -753,9 +752,7 @@ static void complete_pdu(V9fsState *s, V
>
> len = 7;
> len += pdu_marshal(pdu, len, "s", &str);
> - if (dotu) {
> - len += pdu_marshal(pdu, len, "d", err);
> - }
> + len += pdu_marshal(pdu, len, "d", err);
>
> id = P9_RERROR;
> }
> @@ -785,22 +782,20 @@ static mode_t v9mode_to_mode(uint32_t mo
> ret |= S_IFDIR;
> }
>
> - if (dotu) {
> - if (mode & P9_STAT_MODE_SYMLINK) {
> - ret |= S_IFLNK;
> - }
> - if (mode & P9_STAT_MODE_SOCKET) {
> - ret |= S_IFSOCK;
> - }
> - if (mode & P9_STAT_MODE_NAMED_PIPE) {
> - ret |= S_IFIFO;
> - }
> - if (mode & P9_STAT_MODE_DEVICE) {
> - if (extension && extension->data[0] == 'c') {
> - ret |= S_IFCHR;
> - } else {
> - ret |= S_IFBLK;
> - }
> + if (mode & P9_STAT_MODE_SYMLINK) {
> + ret |= S_IFLNK;
> + }
> + if (mode & P9_STAT_MODE_SOCKET) {
> + ret |= S_IFSOCK;
> + }
> + if (mode & P9_STAT_MODE_NAMED_PIPE) {
> + ret |= S_IFIFO;
> + }
> + if (mode & P9_STAT_MODE_DEVICE) {
> + if (extension && extension->data[0] == 'c') {
> + ret |= S_IFCHR;
> + } else {
> + ret |= S_IFBLK;
> }
> }
>
> @@ -863,34 +858,32 @@ static uint32_t stat_to_v9mode(const str
> mode |= P9_STAT_MODE_DIR;
> }
>
> - if (dotu) {
> - if (S_ISLNK(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_SYMLINK;
> - }
> + if (S_ISLNK(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_SYMLINK;
> + }
>
> - if (S_ISSOCK(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_SOCKET;
> - }
> + if (S_ISSOCK(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_SOCKET;
> + }
>
> - if (S_ISFIFO(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_NAMED_PIPE;
> - }
> + if (S_ISFIFO(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_NAMED_PIPE;
> + }
>
> - if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_DEVICE;
> - }
> + if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_DEVICE;
> + }
>
> - if (stbuf->st_mode & S_ISUID) {
> - mode |= P9_STAT_MODE_SETUID;
> - }
> + if (stbuf->st_mode & S_ISUID) {
> + mode |= P9_STAT_MODE_SETUID;
> + }
>
> - if (stbuf->st_mode & S_ISGID) {
> - mode |= P9_STAT_MODE_SETGID;
> - }
> + if (stbuf->st_mode & S_ISGID) {
> + mode |= P9_STAT_MODE_SETGID;
> + }
>
> - if (stbuf->st_mode & S_ISVTX) {
> - mode |= P9_STAT_MODE_SETVTX;
> - }
> + if (stbuf->st_mode & S_ISVTX) {
> + mode |= P9_STAT_MODE_SETVTX;
> }
>
> return mode;
> @@ -915,29 +908,27 @@ static int stat_to_v9stat(V9fsState *s,
> v9fs_string_null(&v9stat->gid);
> v9fs_string_null(&v9stat->muid);
>
> - if (dotu) {
> - v9stat->n_uid = stbuf->st_uid;
> - v9stat->n_gid = stbuf->st_gid;
> - v9stat->n_muid = 0;
> -
> - v9fs_string_null(&v9stat->extension);
> -
> - if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
> - err = v9fs_do_readlink(s, name, &v9stat->extension);
> - if (err == -1) {
> - err = -errno;
> - return err;
> - }
> - v9stat->extension.data[err] = 0;
> - v9stat->extension.size = err;
> - } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
> - v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
> - S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
> - major(stbuf->st_rdev), minor(stbuf->st_rdev));
> - } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
> - v9fs_string_sprintf(&v9stat->extension, "%s %u",
> - "HARDLINKCOUNT", stbuf->st_nlink);
> + v9stat->n_uid = stbuf->st_uid;
> + v9stat->n_gid = stbuf->st_gid;
> + v9stat->n_muid = 0;
> +
> + v9fs_string_null(&v9stat->extension);
> +
> + if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
> + err = v9fs_do_readlink(s, name, &v9stat->extension);
> + if (err == -1) {
> + err = -errno;
> + return err;
> }
> + v9stat->extension.data[err] = 0;
> + v9stat->extension.size = err;
> + } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
> + v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
> + S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
> + major(stbuf->st_rdev), minor(stbuf->st_rdev));
> + } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
> + v9fs_string_sprintf(&v9stat->extension, "%s %u",
> + "HARDLINKCOUNT", stbuf->st_nlink);
> }
>
> str = strrchr(name->data, '/');
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable.
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
0 siblings, 0 replies; 8+ messages in thread
From: Arun R Bharadwaj @ 2010-07-15 4:31 UTC (permalink / raw)
To: Venkateswararao Jujjuri (JV); +Cc: qemu-devel
* Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> [2010-07-14 04:25:21]:
> Arun R Bharadwaj wrote:
> > Hi,
> >
> > This patch cleans up the legacy 'dotu' variable which is always set to
> > 1 by default, since qemu doesnt support legacy 9p clients.
>
> Do we have 2/2 in this series? Also please check the thread-id.
> It is showing part of your other patch, TLERROR/RLERROR.
>
> - JV
>
Hi JV,
The cleanup patch is the 1/2 and the TLERROR/RLERROR patch is the 2/2.
I have put them this way because the TLERROR patch needs to be applied
after the cleanup patch is applied. Hence the same thread-id.
-arun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable.
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-14 11:25 ` [Qemu-devel] [PATCH 1/2] [virtio-9p] Cleanup legacy 'dotu' variable Venkateswararao Jujjuri (JV)
@ 2010-07-20 17:00 ` Sripathi Kodi
2 siblings, 0 replies; 8+ messages in thread
From: Sripathi Kodi @ 2010-07-20 17:00 UTC (permalink / raw)
To: arun; +Cc: qemu-devel
On Tue, 13 Jul 2010 16:24:41 +0530
Arun R Bharadwaj <arun@linux.vnet.ibm.com> wrote:
> Hi,
>
> This patch cleans up the legacy 'dotu' variable which is always set to
> 1 by default, since qemu doesnt support legacy 9p clients.
>
> Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Acked-by: Sripathi Kodi <sripathik@in.ibm.com>
> ---
> hw/virtio-9p-debug.c | 26 +++--------
> hw/virtio-9p-debug.h | 1
> hw/virtio-9p.c | 119 +++++++++++++++++++++++----------------------------
> 3 files changed, 63 insertions(+), 83 deletions(-)
>
> Index: qemu/hw/virtio-9p-debug.h
> ===================================================================
> --- qemu.orig/hw/virtio-9p-debug.h
> +++ qemu/hw/virtio-9p-debug.h
> @@ -1,7 +1,6 @@
> #ifndef _QEMU_VIRTIO_9P_DEBUG_H
> #define _QEMU_VIRTIO_9P_DEBUG_H
>
> -extern int dotu;
> void pprint_pdu(V9fsPDU *pdu);
>
> #endif
> Index: qemu/hw/virtio-9p-debug.c
> ===================================================================
> --- qemu.orig/hw/virtio-9p-debug.c
> +++ qemu/hw/virtio-9p-debug.c
> @@ -169,12 +169,10 @@ static void pprint_stat(V9fsPDU *pdu, in
> pprint_str(pdu, rx, offsetp, ", uid");
> pprint_str(pdu, rx, offsetp, ", gid");
> pprint_str(pdu, rx, offsetp, ", muid");
> - if (dotu) {
> - pprint_str(pdu, rx, offsetp, ", extension");
> - pprint_int32(pdu, rx, offsetp, ", uid");
> - pprint_int32(pdu, rx, offsetp, ", gid");
> - pprint_int32(pdu, rx, offsetp, ", muid");
> - }
> + pprint_str(pdu, rx, offsetp, ", extension");
> + pprint_int32(pdu, rx, offsetp, ", uid");
> + pprint_int32(pdu, rx, offsetp, ", gid");
> + pprint_int32(pdu, rx, offsetp, ", muid");
> fprintf(llogfile, "}");
> }
>
> @@ -343,9 +341,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_int32(pdu, 0, &offset, "afid");
> pprint_str(pdu, 0, &offset, ", uname");
> pprint_str(pdu, 0, &offset, ", aname");
> - if (dotu) {
> - pprint_int32(pdu, 0, &offset, ", n_uname");
> - }
> + pprint_int32(pdu, 0, &offset, ", n_uname");
> break;
> case P9_RAUTH:
> fprintf(llogfile, "RAUTH: (");
> @@ -357,9 +353,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_int32(pdu, 0, &offset, ", afid");
> pprint_str(pdu, 0, &offset, ", uname");
> pprint_str(pdu, 0, &offset, ", aname");
> - if (dotu) {
> - pprint_int32(pdu, 0, &offset, ", n_uname");
> - }
> + pprint_int32(pdu, 0, &offset, ", n_uname");
> break;
> case P9_RATTACH:
> fprintf(llogfile, "RATTACH: (");
> @@ -371,9 +365,7 @@ void pprint_pdu(V9fsPDU *pdu)
> case P9_RERROR:
> fprintf(llogfile, "RERROR: (");
> pprint_str(pdu, 1, &offset, "ename");
> - if (dotu) {
> - pprint_int32(pdu, 1, &offset, ", ecode");
> - }
> + pprint_int32(pdu, 1, &offset, ", ecode");
> break;
> case P9_TFLUSH:
> fprintf(llogfile, "TFLUSH: (");
> @@ -408,9 +400,7 @@ void pprint_pdu(V9fsPDU *pdu)
> pprint_str(pdu, 0, &offset, ", name");
> pprint_int32(pdu, 0, &offset, ", perm");
> pprint_int8(pdu, 0, &offset, ", mode");
> - if (dotu) {
> - pprint_str(pdu, 0, &offset, ", extension");
> - }
> + pprint_str(pdu, 0, &offset, ", extension");
> break;
> case P9_RCREATE:
> fprintf(llogfile, "RCREATE: (");
> Index: qemu/hw/virtio-9p.c
> ===================================================================
> --- qemu.orig/hw/virtio-9p.c
> +++ qemu/hw/virtio-9p.c
> @@ -18,7 +18,6 @@
> #include "fsdev/qemu-fsdev.h"
> #include "virtio-9p-debug.h"
>
> -int dotu = 1;
> int debug_9p_pdu;
>
> enum {
> @@ -753,9 +752,7 @@ static void complete_pdu(V9fsState *s, V
>
> len = 7;
> len += pdu_marshal(pdu, len, "s", &str);
> - if (dotu) {
> - len += pdu_marshal(pdu, len, "d", err);
> - }
> + len += pdu_marshal(pdu, len, "d", err);
>
> id = P9_RERROR;
> }
> @@ -785,22 +782,20 @@ static mode_t v9mode_to_mode(uint32_t mo
> ret |= S_IFDIR;
> }
>
> - if (dotu) {
> - if (mode & P9_STAT_MODE_SYMLINK) {
> - ret |= S_IFLNK;
> - }
> - if (mode & P9_STAT_MODE_SOCKET) {
> - ret |= S_IFSOCK;
> - }
> - if (mode & P9_STAT_MODE_NAMED_PIPE) {
> - ret |= S_IFIFO;
> - }
> - if (mode & P9_STAT_MODE_DEVICE) {
> - if (extension && extension->data[0] == 'c') {
> - ret |= S_IFCHR;
> - } else {
> - ret |= S_IFBLK;
> - }
> + if (mode & P9_STAT_MODE_SYMLINK) {
> + ret |= S_IFLNK;
> + }
> + if (mode & P9_STAT_MODE_SOCKET) {
> + ret |= S_IFSOCK;
> + }
> + if (mode & P9_STAT_MODE_NAMED_PIPE) {
> + ret |= S_IFIFO;
> + }
> + if (mode & P9_STAT_MODE_DEVICE) {
> + if (extension && extension->data[0] == 'c') {
> + ret |= S_IFCHR;
> + } else {
> + ret |= S_IFBLK;
> }
> }
>
> @@ -863,34 +858,32 @@ static uint32_t stat_to_v9mode(const str
> mode |= P9_STAT_MODE_DIR;
> }
>
> - if (dotu) {
> - if (S_ISLNK(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_SYMLINK;
> - }
> + if (S_ISLNK(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_SYMLINK;
> + }
>
> - if (S_ISSOCK(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_SOCKET;
> - }
> + if (S_ISSOCK(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_SOCKET;
> + }
>
> - if (S_ISFIFO(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_NAMED_PIPE;
> - }
> + if (S_ISFIFO(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_NAMED_PIPE;
> + }
>
> - if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
> - mode |= P9_STAT_MODE_DEVICE;
> - }
> + if (S_ISBLK(stbuf->st_mode) || S_ISCHR(stbuf->st_mode)) {
> + mode |= P9_STAT_MODE_DEVICE;
> + }
>
> - if (stbuf->st_mode & S_ISUID) {
> - mode |= P9_STAT_MODE_SETUID;
> - }
> + if (stbuf->st_mode & S_ISUID) {
> + mode |= P9_STAT_MODE_SETUID;
> + }
>
> - if (stbuf->st_mode & S_ISGID) {
> - mode |= P9_STAT_MODE_SETGID;
> - }
> + if (stbuf->st_mode & S_ISGID) {
> + mode |= P9_STAT_MODE_SETGID;
> + }
>
> - if (stbuf->st_mode & S_ISVTX) {
> - mode |= P9_STAT_MODE_SETVTX;
> - }
> + if (stbuf->st_mode & S_ISVTX) {
> + mode |= P9_STAT_MODE_SETVTX;
> }
>
> return mode;
> @@ -915,29 +908,27 @@ static int stat_to_v9stat(V9fsState *s,
> v9fs_string_null(&v9stat->gid);
> v9fs_string_null(&v9stat->muid);
>
> - if (dotu) {
> - v9stat->n_uid = stbuf->st_uid;
> - v9stat->n_gid = stbuf->st_gid;
> - v9stat->n_muid = 0;
> -
> - v9fs_string_null(&v9stat->extension);
> -
> - if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
> - err = v9fs_do_readlink(s, name, &v9stat->extension);
> - if (err == -1) {
> - err = -errno;
> - return err;
> - }
> - v9stat->extension.data[err] = 0;
> - v9stat->extension.size = err;
> - } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
> - v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
> - S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
> - major(stbuf->st_rdev), minor(stbuf->st_rdev));
> - } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
> - v9fs_string_sprintf(&v9stat->extension, "%s %u",
> - "HARDLINKCOUNT", stbuf->st_nlink);
> + v9stat->n_uid = stbuf->st_uid;
> + v9stat->n_gid = stbuf->st_gid;
> + v9stat->n_muid = 0;
> +
> + v9fs_string_null(&v9stat->extension);
> +
> + if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
> + err = v9fs_do_readlink(s, name, &v9stat->extension);
> + if (err == -1) {
> + err = -errno;
> + return err;
> }
> + v9stat->extension.data[err] = 0;
> + v9stat->extension.size = err;
> + } else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
> + v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
> + S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
> + major(stbuf->st_rdev), minor(stbuf->st_rdev));
> + } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
> + v9fs_string_sprintf(&v9stat->extension, "%s %u",
> + "HARDLINKCOUNT", stbuf->st_nlink);
> }
>
> str = strrchr(name->data, '/');
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-07-20 17:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] " Aneesh Kumar K.V
2010-07-13 13:27 ` 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
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).