[Qemu-devel] [PATCH 2/3] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-03-01 Thread Chen Gang
'ctx-fs_root' + 'path'/'fullname.data' may be larger than PATH_MAX, so need use snprintf() instead of sprintf() just like another area have done in 9pfs. Signed-off-by: Chen Gang gang.chen.5...@gmail.com --- hw/9pfs/virtio-9p-local.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[Qemu-devel] [PATCH 3/3] hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation

2014-03-01 Thread Chen Gang
denied). - Common test: All are still OK after apply this path. mkdir -p, create/open file/dir, modify file/dir, rm file/dir. change various mount point paths under host and/or guest. Signed-off-by: Chen Gang gang.chen.5...@gmail.com --- hw/9pfs/cofs.c | 15

Re: [Qemu-devel] [PATCH] hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation

2014-02-27 Thread Chen Gang
. Next weekend should be fine. Happy hacking! OK, thank you. Thanks -- Chen Gang Open, share, and attitude like air, water, and life which God blessed

[Qemu-devel] [PATCH] hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation

2014-02-22 Thread Chen Gang
this path. mkdir -p, create/open file/dir, modify file/dir, rm file/dir. change various mount point paths under host and/or guest. Signed-off-by: Chen Gang gang.chen.5...@gmail.com --- hw/9pfs/cofs.c | 22 ++- hw/9pfs/virtio-9p-handle.c | 25 ++- hw/9pfs/virtio-9p

Re: [Qemu-devel] [PATCH] hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation

2014-02-22 Thread Chen Gang
During the test, I found that if the path is long, the performance is very very slow under 9pfs (whether apply this patch or not, the results are the same). So after this patch passes checking, I will/should analyse this performance issue, next. Thanks. On 02/23/2014 12:48 PM, Chen Gang wrote

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-15 Thread Chen Gang
On 02/05/2014 07:44 AM, Chen Gang wrote: On 02/05/2014 12:18 AM, Aneesh Kumar K.V wrote: That is a bug. The snprintf usage with PATH_MAX is to prevent buffer overflow and not to truncate. I guess we should fix path handling and propagate error correctly. -aneesh OK, thank you for your

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-04 Thread Chen Gang
On 02/03/2014 06:39 PM, Chen Gang wrote: On 02/03/2014 06:34 PM, Daniel P. Berrange wrote: On Mon, Feb 03, 2014 at 06:00:42PM +0800, Chen Gang wrote: We can not assume 'path' + 'ctx-fs_root' must be less than MAX_PATH, so need use snprintf() instead of sprintf(). And also recommend to use

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-04 Thread Chen Gang
On 02/04/2014 07:06 PM, Daniel P. Berrange wrote: On Tue, Feb 04, 2014 at 07:02:18PM +0800, Chen Gang wrote: On 02/03/2014 06:39 PM, Chen Gang wrote: On 02/03/2014 06:34 PM, Daniel P. Berrange wrote: On Mon, Feb 03, 2014 at 06:00:42PM +0800, Chen Gang wrote: We can not assume 'path' + 'ctx

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-04 Thread Chen Gang
features -- support 'unlimited' path internally. before do it, better to get original authors' response firstly. I guess, we need change quite a few areas and have a full test. Thanks. -- Chen Gang Open, share and attitude like air, water and life which God blessed

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-04 Thread Chen Gang
On 02/05/2014 12:18 AM, Aneesh Kumar K.V wrote: Chen Gang gang.chen.5...@gmail.com writes: On 02/04/2014 07:06 PM, Daniel P. Berrange wrote: On Tue, Feb 04, 2014 at 07:02:18PM +0800, Chen Gang wrote: On 02/03/2014 06:39 PM, Chen Gang wrote: On 02/03/2014 06:34 PM, Daniel P. Berrange wrote

[Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-03 Thread Chen Gang
We can not assume 'path' + 'ctx-fs_root' must be less than MAX_PATH, so need use snprintf() instead of sprintf(). And also recommend to use ARRAY_SIZE instead of hard code macro for an array size in snprintf(). Signed-off-by: Chen Gang gang.chen.5...@gmail.com --- hw/9pfs/virtio-9p-local.c | 9

Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf()

2014-02-03 Thread Chen Gang
On 02/03/2014 06:34 PM, Daniel P. Berrange wrote: On Mon, Feb 03, 2014 at 06:00:42PM +0800, Chen Gang wrote: We can not assume 'path' + 'ctx-fs_root' must be less than MAX_PATH, so need use snprintf() instead of sprintf(). And also recommend to use ARRAY_SIZE instead of hard code macro

Re: [Qemu-devel] [PATCH] vl.c: move if (fd 0) into if (fd = STDERR_FILENO)

2013-12-29 Thread Chen Gang
Firstly, thank you very much for your reply, this is my first patch for qemu. Next year (2014), as a volunteer, I will try to make a patch for qemu in each month. :-) On 12/29/2013 07:43 AM, Peter Maydell wrote: On 28 December 2013 08:52, Chen Gang gang.chen.5...@gmail.com wrote: For valid

[Qemu-devel] [PATCH] vl.c: move if (fd 0) into if (fd = STDERR_FILENO)

2013-12-28 Thread Chen Gang
For valid 'fd' (in most cases), it is enough to only check whether it is larger than STDERR_FILENO, so recommend to move if (fd 0) into failure processing block. Signed-off-by: Chen Gang gang.chen.5...@gmail.com --- vl.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git

<    2   3   4   5   6   7