Re: [Qemu-devel] Re: Strategic decision: COW format

2011-03-12 Thread Chunqiang Tang
> It seems that there is great interest in QCOW2's > internal snapshot feature. If we really want to do that, the right solution is > to follow VMDK's approach of storing each snapshot as a separate COW file (see > http://www.vmware.com/app/vmdk/?src=vmdk ), rather than using the reference > c

[Qemu-devel] Message de Corentin Chary

2011-03-12 Thread Corentin Chary
viadeoBonjour, Je vous invite à rejoindre mon réseau de contacts sur Viadeo. Cordialement,Corentin Chary Confirmer que vous connaissez Corentin http://www.viadeo.com/action/index.jsp?actionId=0021xn1x7dm9pjk8&urlId=0021v1e4bjtkdcp0&utm_source=Viade

Re: [Qemu-devel] [RFC PATCH 0/5] allow arbitrary scaling of timers

2011-03-12 Thread Anthony Liguori
On 03/12/2011 11:04 AM, Paolo Bonzini wrote: Right now, rt_clock timers are limited to millisecond resolutions; other clocks are limited to nanoseconds. This patch series removes the limitation. In order to ease transition, new functions are provided with explicit resolution (milli/nanosecond).

Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command

2011-03-12 Thread Anthony Liguori
On 03/12/2011 02:42 PM, Avi Kivity wrote: On 03/10/2011 06:04 PM, Anthony Liguori wrote: On 03/10/2011 09:45 AM, Avi Kivity wrote: btw2, I now nominate subscribe and unsubscribe as replacements for get and put. Subscribe implies sub/pub in my mind and we're not publishing events so I don't

Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command

2011-03-12 Thread Avi Kivity
On 03/10/2011 06:04 PM, Anthony Liguori wrote: On 03/10/2011 09:45 AM, Avi Kivity wrote: btw2, I now nominate subscribe and unsubscribe as replacements for get and put. Subscribe implies sub/pub in my mind and we're not publishing events so I don't think it fits the model. A pub/sub event

Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command

2011-03-12 Thread Avi Kivity
On 03/10/2011 06:42 PM, Anthony Liguori wrote: Maybe for QMPv2, but for QMPv1, this is going to introduce an extremely incompatible change. Why? It's 100% backwards compatible. It's a very significant change for clients. While technical compatible, it would require a change to the client

[Qemu-devel] [PATCH v4 upstream 20/21] protect qemu_cpu_kick_self for Win32

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index e0bcb5c..7559a02 100644 --- a/cpus.c +++ b/cpus.c @@ -867,12 +867,16 @@ void qemu_cpu_kick(void *_env) void qemu_cpu_kick_self(void) { +#ifndef _WIN32

[Qemu-devel] [PATCH v4 upstream 18/21] merge all signal initialization with qemu_signalfd_init, rename

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c | 87 ++- 1 files changed, 36 insertions(+), 51 deletions(-) diff --git a/cpus.c b/cpus.c index 32e9352..2b491a9 100644 --- a/cpus.c +++ b/cpus.c @@ -346,11 +346,37 @@ static void sigfd_handler(

[Qemu-devel] [PATCH v4 upstream 16/21] do not use timedwait on qemu_cpu_cond

2011-03-12 Thread Paolo Bonzini
Whenever env->created becomes true, qemu_cpu_cond is signaled by {kvm,tcg}_cpu_thread_fn. Signed-off-by: Paolo Bonzini --- cpus.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 8f169ad..4305184 100644 --- a/cpus.c +++ b/cpus.c @@ -970,7 +970,7 @

[Qemu-devel] [RFC PATCH 4/5] add a generic scaling mechanism for timers

2011-03-12 Thread Paolo Bonzini
This enables rt_clock timers to use nanosecond resolution, just by using the _ns functions; there is really no reason to forbid that. Migrated timers are all using vm_clock (of course; but I checked that anyway) so the timers in the savevm files are already in nanosecond resolution. So this patch

[Qemu-devel] [PATCH v4 upstream 13/21] do not use timedwait on qemu_halt_cond

2011-03-12 Thread Paolo Bonzini
The following conditions can cause cpu_has_work(env) to become true: - env->queued_work_first: run_on_cpu is already kicking the VCPU - env->stop = 1: pause_all_vcpus is already kicking the VCPU - env->stopped = 0: resume_all_vcpus is already kicking the VCPU - vm_running = 1: vm_start is calli

[Qemu-devel] [RFC PATCH 2/5] change all rt_clock references to use millisecond resolution accessors

2011-03-12 Thread Paolo Bonzini
This was done with: sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \ $(git grep -l 'new_timer\>.*rt_clock' ) after checking that get_clock and new_timer never

[Qemu-devel] [PATCH v4 upstream 09/21] inline cpu_halted into sole caller

2011-03-12 Thread Paolo Bonzini
All implementations are now the same, and there is only one caller, so inline the function there. Signed-off-by: Paolo Bonzini --- cpu-exec.c |9 +++-- target-alpha/exec.h | 11 --- target-arm/exec.h| 13 - target-cris/exec.h | 1

[Qemu-devel] [RFC PATCH 5/5] remove qemu_get_clock

2011-03-12 Thread Paolo Bonzini
These patches are already not doing a great service to out-of-tree modifications to QEMU. However, at least we can warn them by getting rid of the old confusing functions, or otherwise causing compilation errors. This patch removes qemu_get_clock; the previous one changed qemu_new_timer's signatu

[Qemu-devel] [RFC PATCH 0/5] allow arbitrary scaling of timers

2011-03-12 Thread Paolo Bonzini
Right now, rt_clock timers are limited to millisecond resolutions; other clocks are limited to nanoseconds. This patch series removes the limitation. In order to ease transition, new functions are provided with explicit resolution (milli/nanosecond). The old qemu_get_clock is removed. The old q

[Qemu-devel] [PATCH RESEND] hw/fmopl: Fix buffer access out-of-bounds errors

2011-03-12 Thread Stefan Weil
Index 75 is one too large for AR_TABLE[75], DR_TABLE[75]. This error was reported by cppcheck. hw/fmopl.c:600: error: Buffer access out-of-bounds: OPL.AR_TABLE hw/fmopl.c:601: error: Buffer access out-of-bounds: OPL.DR_TABLE Fix this by limiting the access to the allowed range. MultiArcadeMachine

[Qemu-devel] [RFC PATCH 1/5] add more helper functions with explicit milli/nanosecond resolution

2011-03-12 Thread Paolo Bonzini
The code doesn't make much sense right now, but it will as soon as timers will be able to scale their resolution arbitrarily. Signed-off-by: Paolo Bonzini --- qemu-timer.h | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/qemu-timer.h b/qemu-timer.h

[Qemu-devel] [PATCH v4 upstream 08/21] remove CONFIG_THREAD

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5513d3e..a166de0 100755 --- a/configure +++ b/configure @@ -2667,7 +2667,6 @@ if test "$vnc_png" != "no" ; then fi if test "$vnc_thread" != "no" ; the

[Qemu-devel] [PATCH v4 upstream 11/21] exit round-robin vcpu loop if cpu->stopped is true

2011-03-12 Thread Paolo Bonzini
Sometimes vcpus are stopped directly without going through ->stop = 1. Exit the VCPU execution loop in this case as well. Signed-off-by: Paolo Bonzini --- cpus.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index c5743c4..785a104 100644 --- a/cpus.c +

[Qemu-devel] [PATCH v4 upstream 14/21] do not use timedwait on qemu_system_cond

2011-03-12 Thread Paolo Bonzini
qemu_main_loop_start is the only place where qemu_system_ready is set to 1. Signed-off-by: Paolo Bonzini --- cpus.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 4c3837f..e367b3b 100644 --- a/cpus.c +++ b/cpus.c @@ -823,7 +823,7 @@ static void

[Qemu-devel] [PATCH v4 upstream 07/21] add assertions on the owner of a QemuMutex

2011-03-12 Thread Paolo Bonzini
These are already present in the Win32 implementation, add them to the pthread wrappers as well. Use PTHREAD_MUTEX_ERRORCHECK for mutex operations. Later we'll add tracking of the owner for cond_signal/broadcast. Signed-off-by: Paolo Bonzini --- qemu-thread-posix.c |6 +- 1 files change

[Qemu-devel] [PATCH v4 upstream 21/21] add Win32 IPI service

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c | 25 ++--- qemu-thread-posix.c |9 - qemu-thread-posix.h |1 - 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cpus.c b/cpus.c index 7559a02..077729c 100644 --- a/cpus.c +++ b/cpus.c @@ -8

[Qemu-devel] [PATCH v4 upstream 12/21] always signal pause_cond after stopping a VCPU

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index 785a104..6cfb45b 100644 --- a/cpus.c +++ b/cpus.c @@ -1012,8 +1012,10 @@ void qemu_notify_event(void) void cpu_stop_current(void) { if (cpu_single_env) {

[Qemu-devel] [PATCH v4 upstream 05/21] add win32 qemu-thread implementation

2011-03-12 Thread Paolo Bonzini
For now, qemu_cond_timedwait and qemu_mutex_timedlock are left as POSIX-only functions. They can be removed later, once the patches that remove their uses are in. Signed-off-by: Paolo Bonzini --- Makefile.objs|4 +- qemu-thread.c => qemu-thread-posix.c |0 qemu-t

[Qemu-devel] [PATCH v4 upstream 19/21] provide dummy signal init functions for win32

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c | 143 --- 1 files changed, 73 insertions(+), 70 deletions(-) diff --git a/cpus.c b/cpus.c index 2b491a9..e0bcb5c 100644 --- a/cpus.c +++ b/cpus.c @@ -196,6 +196,16 @@ static void cpu_handle_debu

[Qemu-devel] [PATCH v4 upstream 15/21] do not use timedwait on qemu_pause_cond

2011-03-12 Thread Paolo Bonzini
all_vcpus_paused can start returning true after penv->stopped changes from 0 to 1. When this is done, qemu_pause_cond is always signaled. Signed-off-by: Paolo Bonzini --- cpus.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index e367b3b..8f169ad 1006

[Qemu-devel] [PATCH v4 upstream 17/21] iothread stops the vcpu thread via IPI

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index 4305184..32e9352 100644 --- a/cpus.c +++ b/cpus.c @@ -1086,9 +1086,11 @@ bool cpu_exec_all(void) qemu_clock_enable(vm_clock,

[Qemu-devel] [PATCH v4 upstream 06/21] include qemu-thread.h early

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- cpus.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 09ce6fe..c5743c4 100644 --- a/cpus.c +++ b/cpus.c @@ -32,6 +32,7 @@ #include "kvm.h" #include "exec-all.h" +#include "qemu-thread.h" #include "cpus.h" #in

[Qemu-devel] [PATCH v4 upstream 03/21] use win32 timer queues

2011-03-12 Thread Paolo Bonzini
Multimedia timers are only useful for compatibility with Windows NT 4.0 and earlier. Plus, the implementation in Wine is extremely heavyweight. Signed-off-by: Paolo Bonzini --- qemu-timer.c | 86 +++-- 1 files changed, 35 insertions(+), 51 d

[Qemu-devel] [PATCH v4 upstream 10/21] always qemu_cpu_kick after unhalting a cpu

2011-03-12 Thread Paolo Bonzini
This ensures env->halt_cond is broadcast, and the loop in qemu_tcg_wait_io_event and qemu_kvm_wait_io_event is exited naturally rather than through a timeout. Signed-off-by: Paolo Bonzini --- hw/ppc.c |2 ++ hw/sun4m.c | 10 -- hw/sun4u.c |4 ++-- targ

[Qemu-devel] [PATCH v4 upstream 04/21] Refactor thread retrieval and check

2011-03-12 Thread Paolo Bonzini
From: Jan Kiszka We have qemu_cpu_self and qemu_thread_self. The latter is retrieving the current thread, the former is checking for equality (using CPUState). We also have qemu_thread_equal which is only used like qemu_cpu_self. This refactors the interfaces, creating qemu_cpu_is_self and qemu_

[Qemu-devel] [PATCH v4 upstream 02/21] implement win32 dynticks timer

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- qemu-timer.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c index 88c7b28..122e7ed 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -1004,6 +1004,7 @@ static void win32_stop_timer(struct qemu_alarm_timer *

[Qemu-devel] [PATCH v4 upstream 01/21] unlock iothread during WaitForMultipleObjects

2011-03-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- os-win32.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/os-win32.c b/os-win32.c index b214e6a..c971d92 100644 --- a/os-win32.c +++ b/os-win32.c @@ -140,7 +140,9 @@ void os_host_main_loop_wait(int *timeout) int err; Wa

[Qemu-devel] [PATCH v4 upstream 00/21] Win32 iothread support

2011-03-12 Thread Paolo Bonzini
Here is again the full series for Win32 iothread support. It should be ready now. Patches 1 to 5 are generic Win32 improvements, including the qemu-thread implementation. To simplify the dependencies, I think it's better if this part is also routed through uq/master. Patches 6 to 8 are generic

Re: [Qemu-devel] [PATCH 07/15] qapi: add query-version QMP command

2011-03-12 Thread Anthony Liguori
On 03/12/2011 05:19 AM, Blue Swirl wrote: On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: This is used internally by QMP. It's also a pretty good example of a typical command conversion. Signed-off-by: Anthony Liguori diff --git a/Makefile.objs b/Makefile.objs index 5dae800..e1a2756

Re: [Qemu-devel] [PATCH 10/11] json-streamer: limit the maximum recursion depth and maximum token count

2011-03-12 Thread Anthony Liguori
On 03/11/2011 05:16 PM, Michael Roth wrote: parser->emit(parser, parser->tokens); QDECREF(parser->tokens); parser->tokens = qlist_new(); +parser->token_size = 0; +} else if (parser->token_size> MAX_TOKEN_SIZE || + parser->bracket_count> MA

Re: [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2)

2011-03-12 Thread Anthony Liguori
On 03/12/2011 05:29 AM, Blue Swirl wrote: On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: Only generate qmp-types.[ch]. These files contain the type definitions for QMP along with the alloc/free functions for these types. Functions to convert enum values to integers and vice versa are

Re: [Qemu-devel] [PATCH 14/15] qapi: add test-libqmp

2011-03-12 Thread Anthony Liguori
On 03/12/2011 05:23 AM, Blue Swirl wrote: On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: This provides a glib-test based testing framework for QMP Signed-off-by: Anthony Liguori diff --git a/Makefile b/Makefile index 5170675..1d363d7 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,

Re: [Qemu-devel] [PATCH 13/15] qapi: add code generator for libqmp (v2)

2011-03-12 Thread Anthony Liguori
On 03/12/2011 05:10 AM, Blue Swirl wrote: On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: Signed-off-by: Anthony Liguori --- v1 -> v2 - update code generator to use multiline - proxy command support - async command support diff --git a/Makefile b/Makefile index 47a755d..5170675

Re: [Qemu-devel] Re: [PATCH 01/11] Add hard build dependency on glib

2011-03-12 Thread Anthony Liguori
On 03/12/2011 02:09 AM, Paolo Bonzini wrote: On 03/11/2011 10:00 PM, Anthony Liguori wrote: GLib is an extremely common library that has a portable thread implementation along with tons of other goodies. GLib and GObject have a fantastic amount of infrastructure we can leverage in QEMU inclu

Re: [Qemu-devel] [PATCH 03/11] add a generic Error object

2011-03-12 Thread Anthony Liguori
On 03/12/2011 05:05 AM, Blue Swirl wrote: On Fri, Mar 11, 2011 at 11:00 PM, Anthony Liguori wrote: The Error class is similar to QError (now deprecated) except that it supports propagation. This allows for higher quality error handling. It's losely modeled after glib style GErrors. Signed-of

[Qemu-devel] Can Qemu emulation Simultaneous Multi-Thread processor ?

2011-03-12 Thread wang sheng
Did  Qemu emulate the SMT processor ?   I have develop some method to emulate an multi-thread ,  I  define single CPUState  variable,  the CPUState contain  four  thread contexts.    every 1ms interval   , switching thread-context to emulate the threads. How do you think  the way by which I used t

[Qemu-devel] Re: fdc: refactor device creation causes guest kernel panic

2011-03-12 Thread Blue Swirl
On Sat, Mar 12, 2011 at 2:58 PM, Stefan Hajnoczi wrote: > On Sat, Mar 12, 2011 at 10:53 AM, Blue Swirl wrote: >> The logic for calculating the drive state in pc.c does not match fdc.c >> logic. Please try this patch. >> >> diff --git a/hw/pc.c b/hw/pc.c >> index 5966bf1..4d67d9f 100644 >> --- a/h

[Qemu-devel] Re: fdc: refactor device creation causes guest kernel panic

2011-03-12 Thread Stefan Hajnoczi
On Sat, Mar 12, 2011 at 10:53 AM, Blue Swirl wrote: > The logic for calculating the drive state in pc.c does not match fdc.c > logic. Please try this patch. > > diff --git a/hw/pc.c b/hw/pc.c > index 5966bf1..4d67d9f 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -382,7 +382,7 @@ void pc_cmos_init(ra

Re: [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2)

2011-03-12 Thread Blue Swirl
On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: > Only generate qmp-types.[ch].  These files contain the type definitions for > QMP along with the alloc/free functions for these types.  Functions to convert > enum values to integers and vice versa are also included. > > qmp-types is used b

Re: [Qemu-devel] [PATCH 14/15] qapi: add test-libqmp

2011-03-12 Thread Blue Swirl
On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: > This provides a glib-test based testing framework for QMP > > Signed-off-by: Anthony Liguori > > diff --git a/Makefile b/Makefile > index 5170675..1d363d7 100644 > --- a/Makefile > +++ b/Makefile > @@ -72,6 +72,8 @@ defconfig: > >  -includ

Re: [Qemu-devel] [PATCH 07/15] qapi: add query-version QMP command

2011-03-12 Thread Blue Swirl
On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: > This is used internally by QMP.  It's also a pretty good example of a typical > command conversion. > > Signed-off-by: Anthony Liguori > > diff --git a/Makefile.objs b/Makefile.objs > index 5dae800..e1a2756 100644 > --- a/Makefile.objs > +

Re: [Qemu-devel] [PATCH 13/15] qapi: add code generator for libqmp (v2)

2011-03-12 Thread Blue Swirl
On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori wrote: > Signed-off-by: Anthony Liguori > --- > v1 -> v2 >  - update code generator to use multiline >  - proxy command support >  - async command support > > diff --git a/Makefile b/Makefile > index 47a755d..5170675 100644 > --- a/Makefile > +++ b

Re: [Qemu-devel] [PATCH 03/11] add a generic Error object

2011-03-12 Thread Blue Swirl
On Fri, Mar 11, 2011 at 11:00 PM, Anthony Liguori wrote: > The Error class is similar to QError (now deprecated) except that it supports > propagation.  This allows for higher quality error handling.  It's losely > modeled after glib style GErrors. > > Signed-off-by: Anthony Liguori > > diff --gi

[Qemu-devel] Re: fdc: refactor device creation causes guest kernel panic

2011-03-12 Thread Blue Swirl
On Wed, Mar 9, 2011 at 4:34 PM, Stefan Hajnoczi wrote: > The following kernel panic occurs when the RHEL6 installer starts on > qemu.git/master: > > BUG: unable to handle kernel NULL pointer dereference at (null) > IP: [] floppy_ready+0xfb/0x730 [floppy] > > For full details see http://pastebin.co

Re: [Qemu-devel] Re: RFC: emulation of system flash

2011-03-12 Thread Jan Kiszka
On 2011-03-11 20:09, Jordan Justen wrote: > On Thu, Mar 10, 2011 at 16:27, Carl-Daniel Hailfinger > wrote: >> Auf 11.03.2011 01:19, Jan Kiszka schrieb: >>> At least it's an in-band interface, which is the better choice as we >>> currently only have a PIIX3 southbridge for x86, predating even FWHs.

[Qemu-devel] Re: [PATCH 11/15] kvm: Rework inner loop of kvm_cpu_exec

2011-03-12 Thread Jan Kiszka
On 2011-03-11 22:34, Marcelo Tosatti wrote: > On Sat, Mar 05, 2011 at 07:12:50PM +0100, Jan Kiszka wrote: @@ -956,7 +956,6 @@ int kvm_cpu_exec(CPUState *env) abort(); } -ret = 0; /* exit loop */ switch (run->exit_reason) { >>> >

[Qemu-devel] Re: [PATCH 01/11] Add hard build dependency on glib

2011-03-12 Thread Paolo Bonzini
On 03/11/2011 10:00 PM, Anthony Liguori wrote: GLib is an extremely common library that has a portable thread implementation along with tons of other goodies. GLib and GObject have a fantastic amount of infrastructure we can leverage in QEMU including an object oriented programming infrastructur