[Qemu-devel] [PATCH 2/2][RFC] cpu: link each new cpu to QOM tree /machine/node/socket/core/thread/cpu respectively.

2014-02-25 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/i386/pc.c | 40 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 348b15f..4e07ef9 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -57,6 +57,7 @@ #include "hw/boa

[Qemu-devel] [PATCH 0/2][RFC] prebuild cpu QOM tree /machine/node/socket/core/thread/..

2014-02-25 Thread Chen Fan
2. add -device cpu-foo.path supported. 3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Thanks, Chen Chen Fan (2): qom: introduce cpu QOM hierarchy tree /machine/node/socket/core/thread/cpu. cpu: link each new

Re: [Qemu-devel] [PATCH 1/2][RFC] qom: introduce cpu QOM hierarchy tree /machine/node/socket/core/thread/cpu.

2014-02-25 Thread Chen Fan
On Tue, 2014-02-25 at 06:35 -0700, Eric Blake wrote: > On 02/25/2014 02:07 AM, Chen Fan wrote: > > Signed-off-by: Chen Fan > > --- > > include/qom/node.h | 66 +++ > > qom/Makefile.objs | 2 +- &g

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

2014-02-27 Thread Chen Gang
On 02/24/2014 08:52 PM, Markus Armbruster wrote: > Gang Chen writes: >> Excuse me, I have no enough time resources during work day, so I >> will/should send the patches within week end (2014-03-02). If we can not >> bear the time point, please help send the patches for

Re: [Qemu-devel] [PATCH 1/2][RFC] qom: introduce cpu QOM hierarchy tree /machine/node/socket/core/thread/cpu.

2014-02-27 Thread Chen Fan
On Wed, 2014-02-26 at 15:52 -0300, Eduardo Habkost wrote: > On Tue, Feb 25, 2014 at 05:07:31PM +0800, Chen Fan wrote: > [...] > > +Object *object_get_thread_from_index(int64_t cpu_index) > > Probably the code that is going to call this function already knows what > will be

[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

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 10:42 PM, Markus Armbruster wrote: > Chen Gang writes: > >> On 03/03/2014 04:34 PM, Markus Armbruster wrote: >>> Turns a buffer overrun bug into a truncation bug. The next commit fixes >>> truncation bugs including this one. Would be nice to sp

Re: [Qemu-devel] [PATCH 0/3] hw/9pfs: fix 3 issues which related with path string

2014-03-03 Thread Chen Gang
On 03/04/2014 01:43 AM, Eric Blake wrote: > On 03/01/2014 10:33 AM, Chen Gang wrote: >> 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) >>

[Qemu-devel] [RFC v2 0/2] prebuild cpu QOM tree /machine/node/socket/core/thread/..

2014-03-04 Thread Chen Fan
3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Chen Fan (2): i386: introduce "struct X86TopoInfo" for saving cpu topology information i386: introduce cpu QOM hierarchy tree hw/i386/pc.c

[Qemu-devel] [RFC v2 1/2] i386: introduce "struct X86TopoInfo" for saving cpu topology information

2014-03-04 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/i386/pc.c | 13 + target-i386/cpu.c | 16 target-i386/cpu.h | 4 target-i386/topology.h | 7 +++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 348b15f

[Qemu-devel] [RFC v2 2/2] i386: introduce cpu QOM hierarchy tree

2014-03-04 Thread Chen Fan
add cpu-topology.h cpu-topology.c files for prebuild cpu qom tree "/machine/node[X]/socket[Y]/core[Z]/thread[N]/cpu" Signed-off-by: Chen Fan --- hw/i386/pc.c | 6 +- target-i386/Makefile.objs | 2 +- target-i386/cpu-qom.h | 1 + target-i386/cpu-topolo

[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 --- hw/9pfs/virtio

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(). >> >&g

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, >>> s

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

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

2014-02-04 Thread Chen Gang
- fix sprintf() bug, can use snprintf() to fix it just like other places have done -- apply this patch (comments need be improved). - improve 9pfs 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 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: >>>>>

Re: [Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support

2013-12-03 Thread Chen Fan
On Thu, 2013-11-28 at 15:41 +0100, Igor Mammedov wrote: > On Wed, 9 Oct 2013 17:43:08 +0800 > Chen Fan wrote: > > > Via implementing ACPI standard methods _EJ0 in bios, after Guest OS hot > > remove > > one vCPU, it is able to send a signal to QEMU, then QEMU could n

Re: [Qemu-devel] [RFC qom-cpu v4 10/10] cpus: reclaim allocated vCPU objects

2013-12-03 Thread Chen Fan
On Thu, 2013-11-28 at 15:48 +0100, Igor Mammedov wrote: > On Wed, 9 Oct 2013 17:43:18 +0800 > Chen Fan wrote: > > > After ACPI get a signal to eject a vCPU, then it will notify > > the vCPU thread to exit in KVM, and the vCPU must be removed from CPU list, > > bef

Re: [Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support

2013-12-04 Thread Chen Fan
On Wed, 2013-12-04 at 16:42 +0100, Igor Mammedov wrote: > On Wed, 04 Dec 2013 10:15:16 +0800 > Chen Fan wrote: > > > On Thu, 2013-11-28 at 15:41 +0100, Igor Mammedov wrote: > > > On Wed, 9 Oct 2013 17:43:08 +0800 > > > Chen Fan wrote: > > > > >

Re: [Qemu-devel] [PATCH v3 4/4] ioapic: QOM'ify ioapic

2013-12-18 Thread Chen Fan
_NATIVE_ENDIAN, > > }; > > > > -static void ioapic_init(IOAPICCommonState *s, int instance_no) > > +static void ioapic_realize(DeviceState *dev, Error **errp) > > { > > -DeviceState *dev = DEVICE(s); > > +IOAPICCommonState *s = IOAPIC_COMMON(de

Re: [Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support

2013-12-19 Thread Chen Fan
On Thu, 2013-11-28 at 15:41 +0100, Igor Mammedov wrote: > On Wed, 9 Oct 2013 17:43:08 +0800 > Chen Fan wrote: > > > Via implementing ACPI standard methods _EJ0 in bios, after Guest OS hot > > remove > > one vCPU, it is able to send a signal to QEMU, then QEMU could n

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-05 Thread Chen Fan
> > static const TypeInfo apic_common_type = { > diff --git a/include/hw/cpu/icc_bus.h b/include/hw/cpu/icc_bus.h > index b550070..b32a549 100644 > --- a/include/hw/cpu/icc_bus.h > +++ b/include/hw/cpu/icc_bus.h > @@ -66,7 +66,8 @@ typedef struct ICCDeviceClass { >

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-11 Thread Chen Fan
On Mon, 2013-11-11 at 11:58 +0800, 赵小强 wrote: > 于 11/05/2013 04:51 PM, 赵小强 写道: > > 于 2013年11月05日 16:25, Chen Fan 写道: > >> On Tue, 2013-11-05 at 15:55 +0800, xiaoqiang zhao wrote: > >>> changes includes: > >>> 1. use type constant for apic and kvm_apic

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-11 Thread Chen Fan
On Tue, 2013-11-12 at 09:54 +0800, 赵小强 wrote: > 于 11/12/2013 09:28 AM, Chen Fan 写道: > > > On Mon, 2013-11-11 at 11:58 +0800, 赵小强 wrote: > > > 于 11/05/2013 04:51 PM, 赵小强 写道: > > > > 于 2013年11月05日 16:25, Chen Fan 写道: > > > > > On Tue,

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-13 Thread Chen Fan
On Tue, 2013-11-12 at 17:41 +0100, Andreas Färber wrote: > Am 12.11.2013 04:02, schrieb Chen Fan: > > On Tue, 2013-11-12 at 09:54 +0800, 赵小强 wrote: > >> He asked me to drop the parent_realize. so in v2, I just replace the > >> 'init' with 'realize'. &

Re: [Qemu-devel] [RFC qom-cpu v4 09/10] piix4: implement function cpu_status_write() for vcpu ejection

2013-11-27 Thread Chen Fan
On Mon, 2013-11-25 at 19:38 +0100, Vasilis Liaskovitis wrote: > On Fri, Nov 22, 2013 at 09:02:27AM +0100, Vasilis Liaskovitis wrote: > > Hi, > > > > On Wed, Oct 09, 2013 at 05:43:17PM +0800, Chen Fan wrote: > > > When OS eject a vcpu (like: echo 1 > > >

Re: [Qemu-devel] [RFC qom-cpu v4 05/10] qmp: add 'cpu-del' command support

2013-11-27 Thread Chen Fan
On Wed, 2013-11-27 at 07:00 -0700, Eric Blake wrote: > On 10/09/2013 03:43 AM, Chen Fan wrote: > > Signed-off-by: Chen Fan > > --- > > hw/i386/pc.c | 6 ++ > > hw/i386/pc_piix.c| 3 ++- > > include/hw/boards.h | 2 ++ > > include/hw

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

2014-04-15 Thread Chen Gang
On 04/15/2014 04:49 PM, Markus Armbruster wrote: > Chen Gang writes: > >> In "vl.c", at least, we can simplify the code below, so can let readers >> read professional C code (especially for new readers, which often start >> reading code at main function). >

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

2014-04-15 Thread Chen Gang
On 04/15/2014 10:51 PM, Markus Armbruster wrote: > Chen Gang writes: > >> On 04/15/2014 04:49 PM, Markus Armbruster wrote: >>> In future submissions, please send the patches in-reply-to the cover >>> letter, not chained together in-reply-to the previous part. Che

[Qemu-devel] [PATCH trivial v2 0/2] vl: simplify code for main()

2014-04-15 Thread Chen Gang
In "vl.c", at least, we can simplify the code below, so can let readers read professional C code (especially for new readers, which often start reading code at main function). - Remove useless 'continue' in main(). - Eliminate a superfluous local variable in main(). Sign

[Qemu-devel] [PATCH trivial v2 1/2] vl: Remove useless 'continue'

2014-04-15 Thread Chen Gang
"This if else has no code between it and the end of the enclosing while loop. This makes this continue redundant." 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 @@ -3034,7 +303

[Qemu-devel] [PATCH trivial v2 2/2] vl: Eliminate a superfluous local variable

2014-04-15 Thread Chen Gang
CODING_STYLE frowns upon mixing declarations and statements. main() has such a declaration. Clean up by eliminating the variable. 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..d381443

[Qemu-devel] [PATCH trivial] vl: Avoid to close stdout after finish 'writeconfig' option

2014-04-20 Thread Chen Gang
After finish 'writeconfig' to stdout (with '-'), we want to copy/past the related information mannually, not for redirection ('readconfig' does not support '-'). So we can not close the stdout, or next options which may use stdout will not be displayed.

Re: [Qemu-devel] [PATCH trivial] vl: Avoid to close stdout after finish 'writeconfig' option

2014-04-21 Thread Chen Gang
On 04/21/2014 11:09 PM, Eric Blake wrote: > On 04/20/2014 06:05 AM, Chen Gang wrote: >> After finish 'writeconfig' to stdout (with '-'), we want to copy/past >> the related information mannually, not for redirection ('readconfig' >> does not sup

[Qemu-devel] [PATCH trivial v2] vl: avoid closing stdout with 'writeconfig'

2014-04-21 Thread Chen Gang
blem because it does not support reading from '-') Signed-off-by: Chen Gang Reviewed-by: Eric Blake --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 9975e5a..215467f 100644 --- a/vl.c +++ b/vl.c @@ -3855,7 +385

[Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()

2014-05-01 Thread Chen Gang
When DPRINTF() has effect, the original author wants to print all ram_load() calling results. So need use 'goto' instead of 'return' within ram_load(), just like other areas have done. Signed-off-by: Chen Gang --- arch_init.c | 12 1 file changed, 8 insert

Re: [Qemu-devel] [PATCH 17/35] dimm: add busy address check and address auto-allocation

2014-05-07 Thread Tang Chen
provided with -device/device_add command, attempt to use it or fail command if it's already occupied or falls inside of an existing DimmDevice memory region. Signed-off-by: Igor Mammedov Signed-off-by: Tang Chen --- hw/i386/pc.c | 16 +++- hw/mem/dimm.c | 70 +

[Qemu-devel] [RFC qom-cpu v4 03/10] apic: remove local_apics array and using CPU_FOREACH instead

2013-10-09 Thread Chen Fan
Using CPU_FOREACH() marco instead of scaning the entire local_apics array for fast searching apic. Signed-off-by: Chen Fan --- hw/intc/apic.c | 73 ++--- include/hw/i386/apic_internal.h | 2 -- 2 files changed, 32 insertions(+), 43 deletions

[Qemu-devel] [RFC qom-cpu v4 06/10] qom cpu: rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier'

2013-10-09 Thread Chen Fan
Rename variable 'cpu_added_notifier' to 'cpu_hotplug_notifier', for adding vcpu-remove notifier support. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 10 +- hw/i386/pc.c| 2 +- include/sysemu/sysemu.h | 2 +- qom/cpu.c | 10

[Qemu-devel] [RFC qom-cpu v4 02/10] apic: remove redundant variable 'apic_no' from apic_init_common()

2013-10-09 Thread Chen Fan
In struct APICCommonState, there is an id field yet, which was set earlier, qdev_prop_set_uint8(env->apic_state, "id", env->cpuid_apic_id); so we use the id field instead of the variable 'apic_no' to represent the unique apic index. Signed-off-by: Chen Fan ---

[Qemu-devel] [RFC qom-cpu v4 04/10] x86: add x86_cpu_unrealizefn() for cpu apic remove

2013-10-09 Thread Chen Fan
Implement x86_cpu_unrealizefn() for corresponding x86_cpu_realizefn(), which is mostly used to clear the apic related information at here. and refactor apic initialization, use QOM realizefn. Signed-off-by: Chen Fan --- hw/i386/kvm/apic.c | 18 -- hw/intc/apic.c

[Qemu-devel] [RFC qom-cpu v4 01/10] x86: move apic_state field from CPUX86State to X86CPU

2013-10-09 Thread Chen Fan
This motion is preparing for refactoring vCPU apic subsequently. Signed-off-by: Chen Fan --- cpu-exec.c| 2 +- cpus.c| 5 ++--- hw/i386/kvmvapic.c| 8 +++- hw/i386/pc.c | 17 - target-i386/cpu-qom.h | 4

[Qemu-devel] [RFC qom-cpu v4 08/10] i386: implement pc interface pc_hot_del_cpu()

2013-10-09 Thread Chen Fan
Implement cpu interface pc_hot_del_cpu() for unrealizing device vCPU. emiting vcpu-remove notifier to ACPI, then ACPI could send sci interrupt to OS for hot-remove vcpu. Signed-off-by: Chen Fan --- hw/i386/pc.c | 30 -- qom/cpu.c| 12 2 files changed

[Qemu-devel] [RFC qom-cpu v4 00/10] i386: add cpu hot remove support

2013-10-09 Thread Chen Fan
ments.gmane.org/gmane.comp.emulators.qemu/230460 Chen Fan (10): x86: move apic_state field from CPUX86State to X86CPU apic: remove redundant variable 'apic_no' from apic_init_common() apic: remove local_apics array and using CPU_FOREACH instead x86: add x86_cpu_unrealizefn() for cpu apic r

[Qemu-devel] [RFC qom-cpu v4 09/10] piix4: implement function cpu_status_write() for vcpu ejection

2013-10-09 Thread Chen Fan
When OS eject a vcpu (like: echo 1 > /sys/bus/acpi/devices/LNXCPUXX/eject), it will call acpi EJ0 method, the firmware will write the new cpumap, QEMU will know which vcpu need to be ejected. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 37 - 1 file chan

[Qemu-devel] [RFC qom-cpu v4 05/10] qmp: add 'cpu-del' command support

2013-10-09 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/i386/pc.c | 6 ++ hw/i386/pc_piix.c| 3 ++- include/hw/boards.h | 2 ++ include/hw/i386/pc.h | 1 + qapi-schema.json | 12 qmp-commands.hx | 23 +++ qmp.c| 9 + 7 files changed

[Qemu-devel] [RFC qom-cpu v4 10/10] cpus: reclaim allocated vCPU objects

2013-10-09 Thread Chen Fan
After ACPI get a signal to eject a vCPU, then it will notify the vCPU thread to exit in KVM, and the vCPU must be removed from CPU list, before the vCPU really removed, there will release the all related vCPU objects. Signed-off-by: Chen Fan --- cpus.c | 46

[Qemu-devel] [RFC qom-cpu v4 07/10] qom cpu: add UNPLUG cpu notifier support

2013-10-09 Thread Chen Fan
Move struct HotplugEventType from file piix4.c to file qom/cpu.c, and add struct CPUNotifier for supporting UNPLUG cpu notifier. Signed-off-by: Chen Fan --- hw/acpi/piix4.c | 8 ++-- include/qom/cpu.h | 10 ++ qom/cpu.c | 6 +- 3 files changed, 17 insertions(+), 7

[Qemu-devel] [PATCH v1 3/3] x86: move apic_state field from CPUX86State to X86CPU

2013-10-22 Thread Chen Fan
Signed-off-by: Chen Fan --- cpu-exec.c| 2 +- cpus.c| 5 ++--- hw/i386/kvmvapic.c| 8 +++- hw/i386/pc.c | 17 - hw/intc/apic.c| 8 target-i386/cpu-qom.h | 4 target-i386/cpu.c

[Qemu-devel] [PATCH v1 1/3] Change apic/kvm/xen to use QOM typing

2013-10-22 Thread Chen Fan
Get rid of unused icc_device_realize() Signed-off-by: Chen Fan --- hw/cpu/icc_bus.c| 17 - hw/i386/kvm/apic.c | 10 -- hw/intc/apic.c | 18 -- hw/intc/apic_common.c | 17 +++-- hw/xen

[Qemu-devel] [PATCH v1 2/3] Using CPU_FOREACH() instead of scanning local_apics

2013-10-22 Thread Chen Fan
And dropping MAX_APICS cast macro altogether. Signed-off-by: Chen Fan --- hw/intc/apic.c | 82 + include/hw/i386/apic_internal.h | 2 - 2 files changed, 33 insertions(+), 51 deletions(-) diff --git a/hw/intc/apic.c b/hw/intc/apic.c

[Qemu-devel] [PATCH v1 0/3] refactor x86 apic to QOM typing

2013-10-22 Thread Chen Fan
In order to implement 'cpu-del' in the furture. at first, needing to refactor x86 apic codes. this converts apic/kvm/xen 's init() callbacks to realize() and dropping local_apics[] from file hw/intc/apic.c. moving apic_state field from CPUX86State to X86CPU. Chen Fan (3): Chan

Re: [Qemu-devel] [RFC v2 1/2] i386: introduce "struct X86TopoInfo" for saving cpu topology information

2014-03-04 Thread Chen Fan
On Tue, 2014-03-04 at 16:35 -0300, Eduardo Habkost wrote: > On Tue, Mar 04, 2014 at 06:50:24PM +0800, Chen Fan wrote: > > Signed-off-by: Chen Fan > > --- > > hw/i386/pc.c | 13 + > > target-i386/cpu.c | 16 >

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

2014-03-08 Thread Chen Gang
it. Thanks. On 03/07/2014 11:16 PM, Aneesh Kumar K.V wrote: > From: Chen Gang > > 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 me

Re: [Qemu-devel] [RFC v3 2/3] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu()

2014-03-11 Thread Chen Fan
On Tue, 2014-03-11 at 15:00 -0300, Eduardo Habkost wrote: > On Tue, Mar 11, 2014 at 06:58:53PM +0800, chen.fan.fnst wrote: > > From: "chen.fan.fnst" > > > > Signed-off-by: Chen Fan > > --- > > hw/i386/pc.c | 12 > > targ

[Qemu-devel] [RFC v4 1/3] cpu: introduce CpuTopoInfo structure for argument simplification

2014-03-12 Thread Chen Fan
Signed-off-by: Chen Fan --- target-i386/topology.h | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/target-i386/topology.h b/target-i386/topology.h index 07a6c5f..9b811c1 100644 --- a/target-i386/topology.h +++ b/target-i386/topology.h

[Qemu-devel] [RFC v4 0/3] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu

2014-03-12 Thread Chen Fan
h used for specifying the QOM path. 2. add -device cpu-foo.path supported. 3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Chen Fan (3): i386: introduce cpu QOM hierarchy tree cpu: introduce X86CPUTopoInfo structu

[Qemu-devel] [RFC v4 2/3] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu()

2014-03-12 Thread Chen Fan
Signed-off-by: Chen Fan --- hw/i386/pc.c | 25 ++--- target-i386/cpu.c | 28 +++- target-i386/cpu.h | 5 + target-i386/topology.h | 18 ++ 4 files changed, 60 insertions(+), 16 deletions(-) diff --git a/hw/i386

[Qemu-devel] [RFC v4 3/3] i386: introduce cpu QOM hierarchy tree

2014-03-12 Thread Chen Fan
add cpu-topology.h cpu-topology.c files for prebuilding cpu qom tree "/machine/node[X]/socket[Y]/core[Z]->link cpu" Signed-off-by: Chen Fan --- hw/i386/pc.c | 3 + target-i386/Makefile.objs | 2 +- target-i386/cpu-top

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

2014-03-16 Thread Chen Gang
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 a test, I am sure it is not 9pfs issue, either not Qemu's issue, it&#

[Qemu-devel] [PATCH trivial] target-arm/gdbstub64.c: remove useless 'break' statement.

2014-03-17 Thread Chen Gang
Clean up useless 'break' statement after 'return' statement. Signed-off-by: Chen Gang --- target-arm/gdbstub64.c |2 -- 1 file changed, 2 deletions(-) diff --git a/target-arm/gdbstub64.c b/target-arm/gdbstub64.c index e8a8295..8f3b8d1 100644 --- a/target-arm/gdbstub6

Re: [Qemu-devel] [PATCH trivial] target-arm/gdbstub64.c: remove useless 'break' statement.

2014-03-17 Thread Chen Gang
On 03/18/2014 08:39 AM, Peter Maydell wrote: > On 18 March 2014 00:31, Chen Gang wrote: >> Clean up useless 'break' statement after 'return' statement. >> >> Signed-off-by: Chen Gang > > Reviewed-by: Peter Maydell > > thanks > --

Re: [Qemu-devel] [PATCH trivial] target-arm/gdbstub64.c: remove useless 'break' statement.

2014-03-18 Thread Chen Gang
On 03/18/2014 01:14 PM, Peter Crosthwaite wrote: > On Tue, Mar 18, 2014 at 10:31 AM, Chen Gang wrote: >> > Clean up useless 'break' statement after 'return' statement. >> > >> > Signed-off-by: Chen Gang > Reviewed-by: Peter Crosthwaite >

[Qemu-devel] [PATCH v1 2/4] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu()

2014-03-19 Thread Chen Fan
introduce x86_cpu_topo_ids_from_index() to calculate the cpu topology information, and the compat old mode mechanism moved into there. remove unused funciton x86_apicid_from_cpu_idx(). Signed-off-by: Chen Fan --- hw/i386/pc.c | 22 -- target-i386/cpu.c | 33

[Qemu-devel] [PATCH v1 4/4] i386: introduce cpu QOM hierarchy tree

2014-03-19 Thread Chen Fan
add cpu-topology.h cpu-topology.c files for prebuilding cpu qom tree "/machine/node[X]/socket[Y]/core[Z]->link cpu" Signed-off-by: Chen Fan --- hw/i386/pc.c | 3 + target-i386/Makefile.objs | 2 +- target-i386/cpu-top

[Qemu-devel] [PATCH v1 3/4] topo unit-test: update Unit tests to test-x86-cpuid.c

2014-03-19 Thread Chen Fan
remove redundant x86_apicid_from_cpu_idx() tests. add tests to check x86_topo_ids_from_apic_id() and x86_topo_ids_from_apic_id() output. Signed-off-by: Chen Fan --- tests/test-x86-cpuid.c | 165 ++--- 1 file changed, 129 insertions(+), 36 deletions

[Qemu-devel] [PATCH v1 0/4] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu

2014-03-19 Thread Chen Fan
erty which used for specifying the QOM path. 2. add -device cpu-foo.path supported. 3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Chen Fan (4): cpu: introduce CpuTopoInfo structure for argument simplification i386:

[Qemu-devel] [PATCH v1 1/4] cpu: introduce CpuTopoInfo structure for argument simplification

2014-03-19 Thread Chen Fan
Signed-off-by: Chen Fan Reviewed-by: Eduardo Habkost --- target-i386/topology.h | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/target-i386/topology.h b/target-i386/topology.h index 07a6c5f..e9ff89c 100644 --- a/target-i386/topology.h

Re: [Qemu-devel] [PATCH v1 0/4] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu

2014-03-19 Thread Chen Fan
On Wed, 2014-03-19 at 06:00 -0600, Eric Blake wrote: > On 03/19/2014 02:53 AM, Chen Fan wrote: > > at present, after hotplug a discontinuous cpu id on source, then done > > migration, > > on target, it will fail to add the unoccupied cpu id which was skipped at > > s

Re: [Qemu-devel] [PATCH v1 2/4] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu()

2014-03-19 Thread Chen Fan
On Wed, 2014-03-19 at 16:27 -0300, Eduardo Habkost wrote: > On Wed, Mar 19, 2014 at 04:53:41PM +0800, Chen Fan wrote: > > introduce x86_cpu_topo_ids_from_index() to calculate the cpu topology > > information, and the compat old mode mechanism moved into there. > > r

[Qemu-devel] [PATCH v2 1/3] cpu: introduce CpuTopoInfo structure for argument simplification

2014-03-19 Thread Chen Fan
Signed-off-by: Chen Fan Reviewed-by: Eduardo Habkost --- target-i386/topology.h | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/target-i386/topology.h b/target-i386/topology.h index 07a6c5f..e9ff89c 100644 --- a/target-i386/topology.h

[Qemu-devel] [PATCH v2 3/3] i386: introduce cpu QOM hierarchy tree

2014-03-19 Thread Chen Fan
add cpu-topology.h cpu-topology.c files for prebuilding cpu qom tree "/machine/node[X]/socket[Y]/core[Z]->link cpu" Signed-off-by: Chen Fan --- hw/i386/pc.c | 3 + target-i386/Makefile.objs | 2 +- target-i386/cpu-top

[Qemu-devel] [PATCH v2 0/3] prebuild cpu QOM tree /machine/node/socket/core ->link-cpu

2014-03-19 Thread Chen Fan
. TODO: 1. add cpu "path" property which used for specifying the QOM path. 2. add -device cpu-foo.path supported. 3. then we could introduce hot-remove cpu probably. I don't know wether this way is right or not. pls tell me. :) Chen Fan (3): cpu: introduce CpuTopoInf

[Qemu-devel] [PATCH v2 2/3] i386: use CpuTopoInfo instead apic_id as argument for pc_new_cpu()

2014-03-19 Thread Chen Fan
introduce x86_cpu_topo_ids_from_index() to calculate the cpu topology information, and the compat old mode mechanism moved into there. remove unused funciton x86_apicid_from_cpu_idx(). Unit tests included. Signed-off-by: Chen Fan --- hw/i386/pc.c | 22 --- target-i386/cpu.c

Re: [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs

2015-02-10 Thread Chen, Tiejun
On 2015/2/10 3:56, Michael S. Tsirkin wrote: It doesn't make sense to copy values manually: the only issue with getting headers from linux seems to be dealing with linux/types, we can easily fix that automatically while importing. Signed-off-by: Michael S. Tsirkin --- FYI this is what I propos

Re: [Qemu-devel] [Xen-devel] [v2][PATCH] libxl: add one machine property to support IGD GFX passthrough

2015-02-10 Thread Chen, Tiejun
On 2015/2/9 19:05, Ian Campbell wrote: On Mon, 2015-02-09 at 14:28 +0800, Chen, Tiejun wrote: What about this? I've not read the code in detail,since I'm travelling but from a quick glance it looks to be implementing the sort of thing I meant, thanks. Thanks for your time. A

Re: [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs

2015-02-10 Thread Chen, Tiejun
On 2015/2/11 10:03, Peter Maydell wrote: On 11 February 2015 at 01:36, Chen, Tiejun wrote: On 2015/2/10 3:56, Michael S. Tsirkin wrote: It doesn't make sense to copy values manually: the only issue with getting headers from linux seems to be dealing with linux/types, we can easily fix

Re: [Qemu-devel] [PATCH RFC] scripts/update-linux-headers.sh: pull virtio hdrs

2015-02-11 Thread Chen, Tiejun
On 2015/2/11 11:46, Peter Maydell wrote: On 11 February 2015 at 02:50, Chen, Tiejun wrote: On 2015/2/11 10:03, Peter Maydell wrote: The linux-headers/ directory contains header files which can only validly be included if the host we're compiling on is Linux. Some of them will cause co

Re: [Qemu-devel] [Xen-devel] [v2][PATCH] libxl: add one machine property to support IGD GFX passthrough

2015-02-12 Thread Chen, Tiejun
Ian, Just ping this, or do you think I should send this as a patch? Thanks Tiejun On 2015/2/11 10:45, Chen, Tiejun wrote: On 2015/2/9 19:05, Ian Campbell wrote: On Mon, 2015-02-09 at 14:28 +0800, Chen, Tiejun wrote: What about this? I've not read the code in detail,since I'm

[Qemu-devel] [RFC 0/2] qemu-ga: add guest-network-set-interface command

2015-02-24 Thread Chen Fan
to shield themselves from the intricacies of networking setup. on different environment, creating bonding device is distinct. On Fedora/Redhat, that requires modifying the files ifcfg-eth0, ifcfg-eth1 and ifcfg-bond0 in /etc/sysconfig/network-scripts; on Debian, it requires changing several entries in /e

[Qemu-devel] [RFC 2/2] qemu-agent: add guest-network-delete-interface command

2015-02-24 Thread Chen Fan
Add a corresponding command to guest-network-set-interface. Signed-off-by: Chen Fan --- qga/commands-posix.c | 51 +++ qga/commands-win32.c | 6 ++ qga/qapi-schema.json | 11 +++ 3 files changed, 68 insertions(+) diff --git a/qga

[Qemu-devel] [RFC 1/2] qemu-agent: add guest-network-set-interface command

2015-02-24 Thread Chen Fan
"bond" interface. the active-backup mode can be used for an automatic switch. so this patch is adding a guest-network-set-interface command for creating bond device. so the management can easy to create a bond device dynamically when guest running. Signed-off-by: Chen Fan --- configure

Re: [Qemu-devel] [PATCH v4 00/10] cpu: add device_add foo-x86_64-cpu support

2015-02-25 Thread Chen Fan
t is the status of "device_add x86_64-cpu-socket" ? after that, I think we can do somethings to help you to achieve your ideas. Thanks, Chen Could you please help to review it? Will get to it Friday earliest. Regards, Andreas

Re: [Qemu-devel] [RFC v3 08/10] vfio-pci: add VFIO_FEATURE_ENABLE_AER_CAP feature

2015-02-25 Thread Chen Fan
On 02/11/2015 12:39 AM, Alex Williamson wrote: On Tue, 2015-02-10 at 15:03 +0800, Chen Fan wrote: add a new "aercap" feature in vfio device, for controlling whether expose aer capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 10 -- 1 file changed, 8 insert

Re: [Qemu-devel] [PATCH v4 00/10] cpu: add device_add foo-x86_64-cpu support

2015-02-26 Thread Chen Fan
On 02/26/2015 05:35 PM, Andreas Färber wrote: Hi, Am 25.02.2015 um 10:58 schrieb Chen Fan: On 02/25/2015 12:56 AM, Andreas Färber wrote: Am 24.02.2015 um 02:25 schrieb Gu Zheng: The issues you commented in the previous version have been fixed in this one. What I have repeatedly rejected is

Re: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough

2015-01-22 Thread Chen, Tiejun
On 2015/1/22 8:51, Chen, Tiejun wrote: On 2015/1/21 21:48, Gerd Hoffmann wrote: On Mi, 2015-01-21 at 11:37 +, Ian Jackson wrote: Tiejun Chen writes ("[RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough"): When we're working to support IGD GFX p

Re: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough

2015-01-25 Thread Chen, Tiejun
On 2015/1/23 8:43, Chen, Tiejun wrote: On 2015/1/22 8:51, Chen, Tiejun wrote: On 2015/1/21 21:48, Gerd Hoffmann wrote: On Mi, 2015-01-21 at 11:37 +, Ian Jackson wrote: Tiejun Chen writes ("[RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough"):

Re: [Qemu-devel] [PATCH] vfio: fix wrong initialize vfio_group_list

2015-01-25 Thread Chen Fan
CC: qemu-triv...@nongnu.org On 01/22/2015 04:14 PM, Eric Auger wrote: Hi Chen, thanks for correcting this mistake I introduced when moving code from pci to common. so, can you check in this patch? Thanks, Chen Best Regards Eric On 01/22/2015 04:50 AM, Chen Fan wrote: Signed-off-by

Re: [Qemu-devel] [PATCH] vfio: fix wrong initialize vfio_group_list

2015-01-25 Thread Chen Fan
On 01/26/2015 10:06 AM, Alex Williamson wrote: - Original Message - CC: qemu-triv...@nongnu.org On 01/22/2015 04:14 PM, Eric Auger wrote: Hi Chen, thanks for correcting this mistake I introduced when moving code from pci to common. so, can you check in this patch? I've g

Re: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough

2015-01-27 Thread Chen, Tiejun
On 2015/1/27 22:40, Ian Jackson wrote: Chen, Tiejun writes ("Re: [Qemu-devel] [RFC][PATCH 1/1] libxl: add one machine property to support IGD GFX passthrough"): On 2015/1/23 8:43, Chen, Tiejun wrote: On 2015/1/22 8:51, Chen, Tiejun wrote: At this point I just concern here if we

[Qemu-devel] [RFC v2 6/8] vfio_pci: fix a wrong check in vfio_pci_reset

2015-01-28 Thread Chen Fan
= pci_af_flr(dev, probe); 3335 if (rc != -ENOTTY) 3336 goto done; 3337 3338 rc = pci_pm_reset(dev, probe); 3339 if (rc != -ENOTTY) 3340 goto done; so when vfio has FLR, reset it directly. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 +- 1 file

[Qemu-devel] [RFC v2 3/8] pcie_aer: expose pcie_aer_msg() interface

2015-01-28 Thread Chen Fan
For vfio device, we need to propagate the aer error to Guest OS. we use the pcie_aer_msg() to send aer error to guest. Signed-off-by: Chen Fan --- hw/pci/pcie_aer.c | 2 +- include/hw/pci/pcie_aer.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/pcie_aer.c b

<    1   2   3   4   5   6   7   8   9   10   >