[Qemu-devel] [PATCH trivial] block.c: Remove useless 'buf' variable

2014-06-21 Thread Chen Gang
'buf' is not used actually, so remove it and related snprintf() statement. Signed-off-by: Chen Gang --- block.c | 2 -- dtc | 1 - 2 files changed, 3 deletions(-) delete mode 16 dtc diff --git a/block.c b/block.c index 43abe96..74af8d7 100644 --- a/block.c +++ b/block.c

[Qemu-devel] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs

2014-06-21 Thread Chen Gang
When failure occurs, 'ret' need be set, or may return 0 to indicate success. And error_propagate() also need be called only one time within a function. Signed-off-by: Chen Gang --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c ind

Re: [Qemu-devel] [PATCH trivial] block.c: Remove useless 'buf' variable

2014-06-21 Thread Chen Gang
On 06/21/2014 11:03 PM, Michael Tokarev wrote: > 21.06.2014 17:00, Chen Gang wrote: >> 'buf' is not used actually, so remove it and related snprintf() statement. > > Applied to -trivial, after removing wrong reference to dtc submodule removal. > Please don'

Re: [Qemu-devel] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs

2014-06-23 Thread Chen Gang
local_err); > goto close_and_fail; > } > } > That's fine to me, I shall send patch v2 for it. Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed

[Qemu-devel] [PATCH trivial v2] block.c: Add return value for bdrv_append_temp_snapshot() to avoid incorrect failure processing issue

2014-06-23 Thread Chen Gang
turn value internally. So let bdrv_append_temp_snapshot() internal return value outside, and let all things normal, then fix the issue too. Signed-off-by: Chen Gang --- block.c | 7 --- include/block/block.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a

Re: [Qemu-devel] [PATCH trivial v2] block.c: Add return value for bdrv_append_temp_snapshot() to avoid incorrect failure processing issue

2014-06-23 Thread Chen Gang
On 06/24/2014 10:25 AM, Fam Zheng wrote: > On Mon, 06/23 23:28, Chen Gang wrote: >> When failure occurs, 'ret' need be set, or may return 0 to indicate success. > > s/need/needs/ > >> And error_propagate() also need be called only one time within a function. &g

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-11 Thread Chen Gang
If this patch need still be improvement (e.g. need let dump_cleanup function as a generic one, or other cases), please let me know, and I shall send patch v2 for it. Thanks. On 08/04/2014 09:51 PM, Chen Gang wrote: > On 08/03/2014 11:56 PM, Laszlo Ersek wrote: >> comments below >&

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-12 Thread Chen Gang
On 08/12/2014 11:43 PM, Laszlo Ersek wrote: > On 08/03/14 17:28, Chen Gang wrote: >> In dump_init(), when failure occurs, need notice about 'fd' and memory >> mapping. So call dump_cleanup() for it (need let all initializations at >> front). >> >> Als

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-14 Thread Chen Gang
On 08/15/2014 04:49 AM, Luiz Capitulino wrote: > On Sun, 03 Aug 2014 23:28:56 +0800 > Chen Gang wrote: > >> > In dump_init(), when failure occurs, need notice about 'fd' and memory >> > mapping. So call dump_cleanup() for it (need let all initializations at

Re: [Qemu-devel] [PATCH] virt/kvm/assigned-dev.c: Set 'dev->irq_source_id' to '-1' after free it

2014-08-19 Thread Chen Gang
By the way, at present, I use Qemu as user mode program, is there common test with both Qemu and KVM/Xen? And is a PC enough for the common test? Thanks. On 08/20/2014 07:58 AM, Chen Gang wrote: > On 08/19/2014 11:49 PM, Paolo Bonzini wrote: >> Il 19/08/2014 17:44, Chen Gang h

Re: [Qemu-devel] [PATCH] virt/kvm/assigned-dev.c: Set 'dev->irq_source_id' to '-1' after free it

2014-08-20 Thread Chen Gang
On 08/20/2014 08:01 AM, Chen Gang wrote: > > By the way, at present, I use Qemu as user mode program, is there common > test with both Qemu and KVM/Xen? And is a PC enough for the common test? > Oh, I find Qemu have "make check" just like gcc/binutils, so for each of my

[Qemu-devel] [PATCH] arch_init: Simplify code for load_xbzrle()

2014-05-10 Thread Chen Gang
related checking statements, and also can remove 'rc' and 'ret' local variables, Signed-off-by: Chen Gang --- arch_init.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch_init.c b/arch_init.c index 60c975d..98ee5b6 100644 --- a/arch_init

Re: [Qemu-devel] [Qemu-trivial] [PATCH] arch_init: Simplify code for load_xbzrle()

2014-05-18 Thread Chen Gang
On 05/17/2014 03:54 PM, Michael Tokarev wrote: > 10.05.2014 16:51, Chen Gang wrote: >> For xbzrle_decode_buffer(), when decoding contents will exceed writing >> buffer, it will return -1, so need not check the return value whether >> large than writing buffer. >> >&g

[Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-09 Thread Chen Gang
ructions-a64.h:119:20: error: 'vixl::kFP32DefaultNaN' defined but not used [-Werror=unused-variable] static const float kFP32DefaultNaN = rawbits_to_float(0x7fc0); ^ cc1plus: all warnings being treated as errors make: *** [disas/arm-a64.o] Error 1 Signed-

Re: [Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-09 Thread Chen Gang
On 10/9/14 22:54, Eric Blake wrote: > On 10/09/2014 08:00 AM, Chen Gang wrote: > > That's a very long subject line. Try to keep subjects around 60 > characters or so ('git shortlog -30' can give you an idea of reasonable > subjects). OK, thanks, I shall notic

Re: [Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-09 Thread Chen Gang
On 10/9/14 22:34, Peter Maydell wrote: > On 9 October 2014 15:00, Chen Gang wrote: >> The related variables are useless, need be removed, or can not pass >> microblaze building, after fix it, can build microblaze, successfully. >> >> The related configuration: >&

Re: [Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-10 Thread Chen Gang
On 10/10/14 15:37, Peter Maydell wrote: > On 10 October 2014 02:54, Chen Gang wrote: >> I use the latest upstream gcc (which pulled from master in 2014-10-0?). >> In my memory (not quite sure), the older version gcc may not notice >> about this warning. > > Hmm. I

Re: [Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-10 Thread Chen Gang
On 10/10/14 16:53, Chen Gang wrote: > On 10/10/14 15:37, Peter Maydell wrote: >>>> The reason I'm reluctant to make changes to these files is >>>> that they're pulled in from a different upstream project >>>> (libvixl) so we should only fix critica

[Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-11 Thread Chen Gang
g treated as errors make: *** [disas/arm-a64.o] Error 1 After this patch, can pass upstream gcc 5.0.0 building (print warning, but not break building), and fedora 20 gcc 4.8.1 building (not find warnings). Signed-off-by: Chen Gang --- disas/libvixl/a64/instructions-a64.h | 9 + 1 file c

Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-11 Thread Chen Gang
On 10/11/14 22:07, Chen Gang wrote: > 'instructions-a64.h' has unused variables for qemu which can be found by > gcc 5.0.0 or higher. and qemu needs "-Werror", and cause building break. > But they may be used by another projects (not qemu). > > So for gcc 5.

Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-11 Thread Chen Gang
On 10/12/14 5:25, Peter Maydell wrote: > On 11 October 2014 15:13, Chen Gang wrote: > > MJT: please don't put this in -trivial, it will clash with > the update to libvixl 1.6 currently on the list. > OK thanks (also remove -trivial from replying mailing list). > >

Re: [Qemu-devel] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-12 Thread Chen Gang
On 10/12/14 15:50, Peter Maydell wrote: > On 12 October 2014 01:32, Chen Gang wrote: >> On 10/12/14 5:25, Peter Maydell wrote: >>> Some other approaches to this that would confine the >>> fix to the makefiles rather than requiring us to modify >>> the vi

[Qemu-devel] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-13 Thread Chen Gang
strncat() will append additional '\0' to destination buffer, so need additional 1 byte for it, or may cause memory overflow, just like other area within QEMU have done. Signed-off-by: Chen Gang --- target-ppc/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

Re: [Qemu-devel] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-13 Thread Chen Gang
/%s", buf, propname); -f = fopen(buf, "rb"); +f = fopen(tmp, "rb"); +g_free(buf); if (!f) { return -1; } For me, it is really a personal taste, so if the maintainer feels the diff above is OK, I shall send patch v2 for it within 2 days. Th

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-14 Thread Chen Gang
On 10/15/2014 03:58 AM, Michael Tokarev wrote: > On 11.10.2014 23:25, Peter Maydell wrote: >> On 11 October 2014 15:13, Chen Gang wrote: >> >> MJT: please don't put this in -trivial, it will clash with >> the update to libvixl 1.6 currently on the list. > >

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] libvixl: a64: Skip "-Wunused-variable" for gcc 5.0.0 or higher

2014-10-15 Thread Chen Gang
On 10/15/14 4:47, Chen Gang wrote: > On 10/15/2014 03:58 AM, Michael Tokarev wrote: >> >> That's what I'm after too (after trying to fix it properly). >> And no, at this time I dont know how gcc5 handles this. >> > > At present, I have sent the related

[Qemu-devel] [PATCH v2] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-15 Thread Chen Gang
strncat() will append additional '\0' to destination buffer, so need additional 1 byte for it, or may cause memory overflow, just like other area within QEMU have done. And can use g_strdup_printf() instead of strncat(), which may be more easier understanding. Signed-off-by:

[Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-19 Thread Chen Gang
microblaze_complete.cpio.gz - result: Segmentation fault (core dumped) (after a simple try, I am sure, it is caused by "dtb"). And excuse me, at present, I have to only focus on fixing upstream qemu issues (I have no enough time resource for other qemu branches), please understand. Thanks.

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-19 Thread Chen Gang
On 10/19/14 21:38, Max Filippov wrote: > On Sun, Oct 19, 2014 at 5:37 PM, Chen Gang wrote: >>- running: >> >> ./arm-softmmu/qemu-system-arm -M arm-generic-fdt -nographic -smp 2 >> -machine linux=on -serial mon:stdio -dtb ../linux-xlnx/system.dtb \ >>

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-19 Thread Chen Gang
OK, thanks, I shall try it within 2 days. Send from Lenovo A788t. Guenter Roeck wrote: >On 10/19/2014 06:58 AM, Chen Gang wrote: >> >> On 10/19/14 21:38, Max Filippov wrote: >>> On Sun, Oct 19, 2014 at 5:37 PM, Chen Gang wrote: >>>> - running: >>&

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-20 Thread Chen Gang
fc20 20140613 Welcome any suggestions or completions. Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-21 Thread Chen Gang
On 10/21/14 12:37, Guenter Roeck wrote: > On 10/20/2014 08:23 AM, Chen Gang wrote: >> On 10/19/2014 10:58 PM, Guenter Roeck wrote: >>> >>> This doesn't use devicetree, but the configurations are known to be working >>> with kernel releases all the way ba

Re: [Qemu-devel] [PATCH] disas/libvixl/a64/instructions-a64.h: Remove useless varialbe to avoid building break with '-Werror'

2014-10-21 Thread Chen Gang
Good news for us! thank you for your work. :-) Thanks Send from Lenovo A788t. Peter Maydell wrote: >On 9 October 2014 15:00, Chen Gang wrote: >> The related variables are useless, need be removed, or can not pass >> microblaze building, after fix it, can build microblaz

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-21 Thread Chen Gang
21, 2014 at 06:41:14PM +0800, Chen Gang wrote: >> On 10/21/14 12:37, Guenter Roeck wrote: >> > On 10/20/2014 08:23 AM, Chen Gang wrote: >> >> On 10/19/2014 10:58 PM, Guenter Roeck wrote: >> >>> >> >>> This doesn't use devicetree, but the

Re: [Qemu-devel] [Qemu-trivial] [PATCH] target-ppc: kvm: Fix memory overflow issue about strncat()

2014-10-24 Thread Chen Gang
On 10/24/14 15:49, Michael Tokarev wrote: > On 10/13/2014 06:47 PM, Alexander Graf wrote: >> On 13.10.14 16:36, Chen Gang wrote: >>> strncat() will append additional '\0' to destination buffer, so need >>> additional 1 byte for it, or may cause memory over

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-26 Thread Chen Gang
And I still shall try qemu and kernel distribution for testing. But excuse me, maybe I can not finish within this month, I shall try to finish within next month. Thanks. 发自我的 iPad > 在 2014年10月22日,上午8:28,Chen Gang 写道: > > OK, thanks, there are multiple branches in upstream qemu. So

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-26 Thread Chen Gang
Thank your information about qemu, again. Thanks. On 10/22/2014 08:28 AM, Chen Gang wrote: > OK, thanks, there are multiple branches in upstream qemu. Sorry > for my original said, and I can only say: for upstream develop > master branch, it does not support microblaze. > > Excuse me, I

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-26 Thread Chen Gang
On 10/26/14 21:28, Chen Gang wrote: > Hello Guenter Roeck: > > I still shall try qemu and kernel distribution, next, since it can do > it successfully (whether 'sim' can be success or not). > I got confirmation from microblaze members, at present, microblaze sim can

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-27 Thread Chen Gang
rsion 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)" for x86_64 qemu. Next I shall try to use virtio file to share the local data to virtual guest (I guess, it should be OK). Thanks again! On 10/27/2014 09:47 AM, Chen Gang wrote: > On 10/26/14 21:28, Chen Gang wrote: >> Hello Guenter

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-31 Thread Chen Gang
On 10/27/14 22:47, Chen Gang wrote: > > After a little try, I succeed run microblaze under upstream qemu 2.1.2 > and upstream Linux kernel 3.17-rc7, with the xilinux own ramdisk: > "microblaze_complete.cpio.gz". :-) > > Compiler is "gcc version 4.9.1 20140717 (Re

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-31 Thread Chen Gang
-ethernetlite-3.00.a", }, { /* end of list */ }, Next, I shall send related kernel patch for upstream kernel, and continue for microbaze DejaGNU with microbaze qemu, and sorry again, I did not finish it within this month. Thanks. On 10/30/14 22:20, Chen Gang wrote: > O

[Qemu-devel] [PATCH] pc-bios: petalogix-s3adsp1800.dtb: Use 'xlnx, xps-ethernetlite-2.00.a' instead of 'xlnx, xps-ethernetlite-2.00.b'

2014-11-03 Thread Chen Gang
; edit work.dts (replace 'xlnx,xps-ethernetlite-2.00.b') "./scripts/dtc/dtc -I dts -O dtb -o ..qemu/petalogix-s3adsp1800.dtb ../work.dts" (Since I am not quite sure whether can read this patch or not, I put the related dtb file in attachment, please check, thanks). Sign

[Qemu-devel] [PATCH] xen-hvm.c: Improve the return method for xen_hvm_init()

2014-09-02 Thread Chen Gang
xen && make -j4 && make check" execute result: "echo $? == 0". Signed-off-by: Chen Gang --- xen-hvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen-hvm.c b/xen-hvm.c index 0d09940..35efec0 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -9

Re: [Qemu-devel] [PATCH] xen-hvm.c: Improve the return method for xen_hvm_init()

2014-09-02 Thread Chen Gang
Oh, sorry, forgot Cc to qemu trivial. Thanks. On 9/3/14 0:22, Chen Gang wrote: > When failure occurs, it need use "return -1" instead of exit(1), so can > let upper caller has chance to print failure information, too, then user > can know the failure result more clearly. >

Re: [Qemu-devel] [PATCH] xen-hvm.c: Improve the return method for xen_hvm_init()

2014-09-03 Thread Chen Gang
On 9/4/14 7:32, Stefano Stabellini wrote: > On Wed, 3 Sep 2014, Chen Gang wrote: >> On 9/3/14 0:22, Chen Gang wrote: [...] >>> xen_hvm_init() may also return -errno, which may let upper caller think >>> more (e.g. free some other related resources and try again), a

[Qemu-devel] [PATCH v2] xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init()

2014-09-04 Thread Chen Gang
r failure. It is not a normal function, it does not release related resources when return -1, so need give related comments for it. It passes common check: "./configure --enable-xen && make && make check" "echo $? == 0" Signed-off-by: Chen Gang --- xen

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init()

2014-09-15 Thread Chen Gang
ope I can find additonal patches for it. Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init()

2014-09-15 Thread Chen Gang
ope I can find additional patches for it. Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed

[Qemu-devel] [PATCH] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL

2014-07-18 Thread Chen Gang
ULL, so need define additional temporary variable for 'cpu' to avoid the case. Signed-off-by: Chen Gang --- kvm-all.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 3ae30ee..1402f4f 100644 --- a/kvm-all.c +++

Re: [Qemu-devel] [PATCH] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL

2014-07-20 Thread Chen Gang
On 07/20/2014 03:29 PM, Jan Kiszka wrote: > On 2014-07-19 03:21, Chen Gang wrote: >> If kvm_arch_remove_sw_breakpoint() in CPU_FOREACH() always be fail, it >> will let 'cpu' NULL. And the next kvm_arch_remove_sw_breakpoint() in >> QTAILQ_FOREACH_SAFE() will get NULL

Re: [Qemu-devel] [Qemu-trivial] [PATCH-trivial] qemu-img: Check getchar() return value in read_password() for WIN32

2014-08-02 Thread Chen Gang
On 08/02/2014 09:35 PM, Michael Tokarev wrote: > 06.07.2014 12:43, Chen Gang wrote: >> getchar() is a standard c library function which may return with failure >> (e.g. -1), so like another platforms, also need check it under WIN32. > > Applied to -trivial queue, with

[Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-03 Thread Chen Gang
In dump_init(), when failure occurs, need notice about 'fd' and memory mapping. So call dump_cleanup() for it (need let all initializations at front). Also simplify dump_cleanup(): remove redundant 'ret' and redundant 'fd' checking. Signed-off-b

Re: [Qemu-devel] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()

2014-08-04 Thread Chen Gang
On 08/03/2014 11:56 PM, Laszlo Ersek wrote: > comments below > Excuse me for replying late, firstly. > On 08/03/14 17:28, Chen Gang wrote: >> In dump_init(), when failure occurs, need notice about 'fd' and memory >> mapping. So call dump_cleanup() for it (

Re: [Qemu-devel] Cc'ing emails [was: [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()]

2014-08-04 Thread Chen Gang
tice about soon. By the way, in honest, as a gmail member, I almost do not check my email in open mailing list, but always check personal mail which for sending patches. Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed

Re: [Qemu-devel] Cc'ing emails [

2014-08-04 Thread Chen Gang
t; Ccing you for the patches with which you have absolutely nothing >> to do, and if a discussion emerges, you can't opt out of it >> anymore (especially for patches which raise hot discussions). >> So I'd rather think twice before contributing anything... > > That's sad. > -- Chen Gang Open, share, and attitude like air, water, and life which God blessed

Re: [Qemu-devel] Cc'ing emails [

2014-08-05 Thread Chen Gang
On 08/05/2014 04:07 PM, Peter Maydell wrote: > n 5 August 2014 08:08, Michael Tokarev wrote: >> 05.08.2014 08:41, Chen Gang wrote: >>> >>> Every members have their own tastes, and one working flow may be not >>> suitable for all members. I can understand, a

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

2014-03-23 Thread Chen Gang
On 03/16/2014 09:32 PM, Chen Gang wrote: > On 03/08/2014 09:58 PM, Chen Gang wrote: >> OK, thanks. >> >> Next, I will/should continue to analyse the performance issue for 9pfs >> when users drop into a long directory path under bash shell. >> > > After have

[Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-26 Thread Chen Gang
er 'break' within the matching block). After print "... not support for this target", it can avoid to print "... accelerator does not exist". Signed-off-by: Chen Gang --- vl.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-27 Thread Chen Gang
On 03/27/2014 03:55 PM, Marcel Apfelbaum wrote: > On Thu, 2014-03-27 at 09:16 +0800, Chen Gang wrote: >> At present, each 'opt_name' of 'accel_list' is uniq with each other, so >> 'buf' can only match one 'opt_name'. >> >> When dro

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-27 Thread Chen Gang
On 03/27/2014 04:59 PM, Markus Armbruster wrote: > Chen Gang writes: > >> At present, each 'opt_name' of 'accel_list' is uniq with each other, so >> 'buf' can only match one 'opt_name'. >> >> When drop into the matching

[Qemu-devel] [PATCH trival] vl.c: clean up code

2014-03-30 Thread Chen Gang
'args' (which is defined in the middle of code block). Signed-off-by: Chen Gang --- vl.c | 36 +--- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/vl.c b/vl.c index 9975e5a..9c733cb 100644 --- a/vl.c +++ b/vl.c @@ -1188,1

Re: [Qemu-devel] [PATCH trival] vl.c: clean up code

2014-03-30 Thread Chen Gang
which style is the best to Qemu. Thanks. On 03/30/2014 10:34 PM, Chen Gang wrote: > in get_boot_device() > > - remove 'res' to simplify code > > in main(): > > - remove useless 'continue'. > > - in main switch(): > >- re

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-30 Thread Chen Gang
Hello Maintainers: If it is necessary to send patch v2 by me, please let me know, I will/should send. Thanks. On 03/27/2014 06:01 PM, Chen Gang wrote: > > > On 03/27/2014 04:59 PM, Markus Armbruster wrote: >> Chen Gang writes: >> >>> At present, each 'opt

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-31 Thread Chen Gang
On 03/31/2014 08:38 PM, Markus Armbruster wrote: > Chen Gang writes: > >> Hello Maintainers: >> >> If it is necessary to send patch v2 by me, please let me know, I >> will/should send. > > Not a maintainer, but if you send a v2 with an improved commit mes

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-31 Thread Chen Gang
On 03/31/2014 09:01 PM, Peter Maydell wrote: > On 31 March 2014 13:53, Chen Gang wrote: >> On 03/31/2014 08:38 PM, Markus Armbruster wrote: >>> Chen Gang writes: >>> >>>> Hello Maintainers: >>>> >>>> If it is necessary to s

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-31 Thread Chen Gang
On 03/31/2014 09:16 PM, Peter Maydell wrote: > On 31 March 2014 14:12, Chen Gang wrote: >> Next, when I send trivial patches, I will/should cc to qemu-trivial. I >> guess, most of my future patches will be trivial patches (and for me, >> trivial != minor). > > We d

Re: [Qemu-devel] [PATCH] vl.c: use 'break' instead of 'continue' in configure_accelerator()

2014-03-31 Thread Chen Gang
On 03/31/2014 09:33 PM, Peter Maydell wrote: > On 31 March 2014 14:26, Chen Gang wrote: >> Next, when I send trivial patches, I will only send to qemu-trivial (not >> send/cc to qemu-devel again), that will be more efficient. :-) > > No, please always send to qemu-dev

Re: [Qemu-devel] [PATCH trival] vl.c: clean up code

2014-03-31 Thread Chen Gang
On 03/31/2014 11:49 PM, Markus Armbruster wrote: > Chen Gang writes: > >> in get_boot_device() >> >> - remove 'res' to simplify code >> >> in main(): >> >> - remove useless 'continue'. >> >> - in main switch(): &g

Re: [Qemu-devel] [PATCH trival] vl.c: clean up code

2014-04-01 Thread Chen Gang
On 04/01/2014 04:13 PM, Markus Armbruster wrote: > Chen Gang writes: > >> On 03/31/2014 11:49 PM, Markus Armbruster wrote: >>> Chen Gang writes: >>> >>>> in get_boot_device() >>>> >>>> - remove 'res' to simplify code

Re: [Qemu-devel] [PATCH trival] vl.c: clean up code

2014-04-01 Thread Chen Gang
On 04/01/2014 08:36 PM, Alex Bennée wrote: > > Chen Gang writes: > >> Hello Maintainers: >> >> In main switch of main(), it contents several styles for "{...}" code block. >> >> If it is necessary to use unique style within a function, please le

Re: [Qemu-devel] [PATCH trival] vl.c: clean up code

2014-04-01 Thread Chen Gang
On 04/01/2014 09:33 PM, Markus Armbruster wrote: > Chen Gang writes: > >> On 04/01/2014 04:13 PM, Markus Armbruster wrote: >>> Chen Gang writes: >>> >>>> On 03/31/2014 11:49 PM, Markus Armbruster wrote: >>>>> Chen Gang writes: >>&

[Qemu-devel] [PATCH-trivial v2] vl: Report accelerator not supported for target more nicely

2014-04-04 Thread Chen Gang
When you ask for an accelerator not supported for your target, you get a bogus "accelerator does not exist" message: $ qemu-system-arm -machine none,accel=kvm KVM not supported for this target "kvm" accelerator does not exist. No accelerator found! Suppress it. Sign

Re: [Qemu-devel] [PATCH-trivial v2] vl: Report accelerator not supported for target more nicely

2014-04-06 Thread Chen Gang
On 04/04/2014 06:57 PM, Markus Armbruster wrote: > Chen Gang writes: > >> When you ask for an accelerator not supported for your target, you get >> a bogus "accelerator does not exist" message: >> >> $ qemu-system-arm -machine none,accel=kvm >>

Re: [Qemu-devel] [Qemu-trivial] [PATCH-trivial v2] vl: Report accelerator not supported for target more nicely

2014-04-06 Thread Chen Gang
On 04/06/2014 02:32 PM, Michael Tokarev wrote: > 04.04.2014 13:39, Chen Gang wrote: >> When you ask for an accelerator not supported for your target, you get >> a bogus "accelerator does not exist" message: >> >> $ qemu-system-arm -machine none,accel=kvm &

Re: [Qemu-devel] [PULL 01/11] vl: Report accelerator not supported for target more nicely

2014-04-08 Thread Chen Gang
Thanks, and I will/should finish the left trivial patches within this week (2014-04-13) On 04/08/2014 03:04 PM, Michael Tokarev wrote: > From: Chen Gang > > When you ask for an accelerator not supported for your target, you get > a bogus "accelerator does not exist"

[Qemu-devel] [PATCH trivial 0/3] vl: simplify code for main() and get_boot_device()

2014-04-08 Thread Chen Gang
ther code style issue: multiple "{...}" styles within "swith(...)"). Signed-off-by: Chen Gang --- vl.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-)

[Qemu-devel] [PATCH trivial 1/3] vl: remove useless 'continue'

2014-04-08 Thread Chen Gang
Normal "if (...) {...} else {...}" is enough in "while(...) {...}", not need additional useless 'continue'. Signed-off-by: Chen Gang --- vl.c |1 - 1 file changed, 1 deletion(-) diff --git a/vl.c b/vl.c index 9975e5a..7505002 100644 --- a/vl.c +++ b/vl.c @@ -

[Qemu-devel] [PATCH trivial 2/3] vl: remove redundant local variable 'res'

2014-04-08 Thread Chen Gang
In function, if no additional resources to free before quit, commonly, need not use additional local variable 'res' to notice about it. So remove it to simplify code. Signed-off-by: Chen Gang --- vl.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vl.c b/

[Qemu-devel] [PATCH trivial 3/3] vl: remove local variable 'args' in the middle of code block

2014-04-08 Thread Chen Gang
n the middle of code block. And at present, we can assume that all related gcc versions will be latest enough to notice about this grammar. Signed-off-by: Chen Gang --- vl.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vl.c b/vl.c index 377f962..d3814

Re: [Qemu-devel] [PATCH trivial 0/3] vl: simplify code for main() and get_boot_device()

2014-04-14 Thread Chen Gang
May any member help to check them? And next, I shall try to find bug issues (not code style or document issues), and fix them. Hope I can succeed. Thanks. On 04/08/2014 08:00 PM, Chen Gang wrote: > In "vl.c", at least, we can simplify the code below, so can let readers > rea

Re: [Qemu-devel] [PATCH trivial 1/3] vl: remove useless 'continue'

2014-04-14 Thread Chen Gang
On 04/15/2014 10:11 AM, Peter Crosthwaite wrote: > On Tue, Apr 8, 2014 at 10:01 PM, Chen Gang wrote: >> > Normal "if (...) {...} else {...}" is enough in "while(...) {...}", not >> > need additional useless 'continue'. >> > > Only i

Re: [Qemu-devel] [PATCH trivial 2/3] vl: remove redundant local variable 'res'

2014-04-14 Thread Chen Gang
On 04/15/2014 10:13 AM, Peter Crosthwaite wrote: > On Tue, Apr 8, 2014 at 10:02 PM, Chen Gang wrote: >> In function, if no additional resources to free before quit, commonly, >> need not use additional local variable 'res' to notice about it. So >> remove it to simp

Re: [Qemu-devel] [PATCH trivial 2/3] vl: remove redundant local variable 'res'

2014-04-15 Thread Chen Gang
On 04/15/2014 04:43 PM, Markus Armbruster wrote: > Peter Crosthwaite writes: > >> On Tue, Apr 8, 2014 at 10:02 PM, Chen Gang wrote: >>> In function, if no additional resources to free before quit, commonly, >>> need not use additional local variable 'res'

Re: [Qemu-devel] [PATCH trivial 1/3] vl: remove useless 'continue'

2014-04-15 Thread Chen Gang
On 04/15/2014 04:50 PM, Markus Armbruster wrote: > Chen Gang writes: > >> Normal "if (...) {...} else {...}" is enough in "while(...) {...}", not >> need additional useless 'continue'. >> >> Signed-off-by: Chen Gang >> --- >

Re: [Qemu-devel] [PATCH trivial 3/3] vl: remove local variable 'args' in the middle of code block

2014-04-15 Thread Chen Gang
On 04/15/2014 04:56 PM, Markus Armbruster wrote: > Chen Gang writes: > >> For C code, it does not recommend to define a local variable in the >> middle of code block without "{...}". The original author may want to >> zero members not mentioned in structure ass

Re: [Qemu-devel] [PATCH trivial 3/3] vl: remove local variable 'args' in the middle of code block

2014-04-15 Thread Chen Gang
On 04/15/2014 08:29 PM, Peter Crosthwaite wrote: > On Tue, Apr 8, 2014 at 10:05 PM, Chen Gang wrote: >> For C code, it does not recommend to define a local variable in the >> middle of code block without "{...}". The original author may want to >> zero mem

[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 --- vl.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --

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 wrote: >> For valid 'fd&#

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 correctl

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

2014-02-22 Thread Chen Gang
r guest (permission 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 Ga

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: use g_strdup_printf() instead of PATH_MAX limitation

2014-02-27 Thread Chen Gang
me. > > 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 0/3] hw/9pfs: fix 3 issues which related with path string

2014-03-01 Thread Chen Gang
Patch 1/3: move v9fs_string_free() to below "err_out:" Patch 2/3: use snprintf() instead of sprintf() (which will be replaced of by Path 3/3) Patch 3/3: use g_strdup_printf() instead of PATH_MAX limitation Signed-off-by: Chen Gang --- hw/9pfs/cofs.c |

[Qemu-devel] [PATCH 1/3] hw/9pfs/virtio-9p-local.c: move v9fs_string_free() to below "err_out:"

2014-03-01 Thread Chen Gang
When "goto err_out", 'v9fs_string' already was allocated, so still need free 'v9fs_string' before return. Signed-off-by: Chen Gang --- hw/9pfs/virtio-9p-local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/virtio-9p-local.c b/h

[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 --- hw/9pfs/virtio-9p-local.c | 7 --- 1 file changed, 4 insertions(+), 3 d

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

2014-03-01 Thread Chen Gang
test1234567890file.log" under guest (permission 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 gues

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

2014-03-03 Thread Chen Gang
On 03/03/2014 04:34 PM, Markus Armbruster wrote: > Chen Gang writes: > >> When path is truncated by PATH_MAX limitation, it causes QEMU to access >> incorrect file. So use original full path instead of PATH_MAX within >> 9pfs (need check/process ENOMEM for related memor

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

2014-03-03 Thread Chen Gang
On 03/03/2014 04:34 PM, Markus Armbruster wrote: > Chen Gang writes: > >> '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. >

Re: [Qemu-devel] [PATCH 1/3] hw/9pfs/virtio-9p-local.c: move v9fs_string_free() to below "err_out:"

2014-03-03 Thread Chen Gang
On 03/03/2014 11:29 PM, Aneesh Kumar K.V wrote: > Chen Gang writes: > >> When "goto err_out", 'v9fs_string' already was allocated, so still need >> free 'v9fs_string' before return. >> >> Signed-off-by: Chen Gang > > Reviewed-b

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

2014-03-03 Thread Chen Gang
On 03/04/2014 03:29 AM, Aneesh Kumar K.V wrote: > "Aneesh Kumar K.V" writes: > >> Chen Gang writes: >> Can we keep this as >> v9fs_co_run_in_worker( >> { >> >>buf->data = __readlink(&am

  1   2   3   4   5   6   7   >