[Qemu-devel] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-26 Thread Alex Bligh
parameters which are not possible to specify through the qemu-img convert command line. Signed-off-by: Alexandre Derumier Signed-off-by: Alex Bligh --- qemu-img-cmds.hx |4 +- qemu-img.c | 49 ++--- qemu-img.texi | 15 ++- tests/qemu

[Qemu-devel] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-26 Thread Alex Bligh
Add a qemu-img convert -n option to skip target volume creation Changes since v5: * Fail conversion if the existing output image is smaller than the input image and the -n option is specified * Use -n not -C * Add a test routine Alexandre Derumier (1): add qemu-img convert -n option (skip tar

Re: [Qemu-devel] [PATCHv4] add qemu-img convert -C option (skip target volume creation)

2013-08-26 Thread Alex Bligh
using -n not -C (obviously I'm fighting a losing battle there). -- Alex Bligh

Re: [Qemu-devel] [PATCH v2 1/2] qemu-timer: drop outdated signal safety comments

2013-08-27 Thread Alex Bligh
t_alarm_handler() just marks the alarm timer as expired/pending > and notifies the main loop using qemu_notify_event(). > > Therefore these outdated comments about signal safety can be dropped. > > Signed-off-by: Stefan Hajnoczi Signed-off-by: Alex Bligh Ooops - meant to delete these

Re: [Qemu-devel] [PATCH v2 2/2] qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe

2013-08-27 Thread Alex Bligh
imers; t != NULL; t = t->next) { > if (t == ts) { > -return true; > + found = true; > +break; > } > } > -return false; > +qemu_mutex_unlock(&timer_list->active_timers_lock); > +return found; > } > > bool timer_expired(QEMUTimer *timer_head, int64_t current_time) > @@ -376,13 +411,16 @@ bool timerlist_run_timers(QEMUTimerList *timer_list) > > current_time = qemu_clock_get_ns(timer_list->clock->type); > for(;;) { > +qemu_mutex_lock(&timer_list->active_timers_lock); > ts = timer_list->active_timers; > if (!timer_expired_ns(ts, current_time)) { > +qemu_mutex_unlock(&timer_list->active_timers_lock); > break; > } > /* remove timer from the list before calling the callback */ > timer_list->active_timers = ts->next; > ts->next = NULL; > +qemu_mutex_unlock(&timer_list->active_timers_lock); > > /* run the callback (the timer list can be modified) */ > ts->cb(ts->opaque); > -- > 1.8.3.1 > > > -- Alex Bligh

Re: [Qemu-devel] [PATCH v3 2/4] timer: protect timers_state's clock with seqlock

2013-08-27 Thread Alex Bligh
fixing before QEMU_CLOCK_VIRTUAL is used at all in other other threads. -- Alex Bligh

Re: [Qemu-devel] [PATCH v3 3/4] qemu-thread: add QemuEvent

2013-08-27 Thread Alex Bligh
On 27 Aug 2013, at 04:21, Liu Ping Fan wrote: > +void qemu_event_set(QemuEvent *ev) > +{ It would be useful if these functions had inline documentation. -- Alex Bligh

Re: [Qemu-devel] [PATCH v3 4/4] timer: make qemu_clock_enable sync between disable and timer's cb

2013-08-27 Thread Alex Bligh
> +} > } > } > > @@ -373,8 +388,10 @@ bool timerlist_run_timers(QEMUTimerList *timer_list) > QEMUTimer *ts; > int64_t current_time; > bool progress = false; > - > + > +qemu_event_reset(&timer_list->ev); > if (!timer_list-

Re: [Qemu-devel] [RFC] aio: add aio_context_acquire() and aio_context_release()

2013-08-27 Thread Alex Bligh
the eventual deletion under the BQL on the main thread. -- Alex Bligh

Re: [Qemu-devel] Buildbot Failures

2013-08-29 Thread Alex Bligh
t; > Commit b53edf971 broke this, pipe2 is a Linux-specific function. Its > availability can be tested for with CONFIG_PIPE2. Guessing that's mine. I'll take a look. A simple fix might be to only run the test on Linux for the time being. -- Alex Bligh

[Qemu-devel] [PATCH] aio / timers: fix build of test/test-aio.c on non-linux platforms

2013-08-29 Thread Alex Bligh
tests/test-aio.c used pipe2 which is Linux only. Use qemu_pipe and qemu_set_nonblock for portabillity. Addition of O_CLOEXEC is a harmless bonus. Signed-off-by: Alex Bligh --- tests/test-aio.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test-aio.c b

[Qemu-devel] [PATCH] aio / timers: use g_usleep() not sleep()

2013-08-29 Thread Alex Bligh
sleep() apparently doesn't exist under mingw. Use g_usleep for portability. Signed-off-by: Alex Bligh --- tests/test-aio.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-aio.c b/tests/test-aio.c index 4215701..110fa4a 100644 --- a/tests/test-aio.c

[Qemu-devel] [PATCHv2] aio / timers: use g_usleep() not sleep()

2013-08-29 Thread Alex Bligh
sleep() apparently doesn't exist under mingw. Use g_usleep for portability. Signed-off-by: Alex Bligh --- tests/test-aio.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-aio.c b/tests/test-aio.c index 4215701..c4fe0fc 100644 --- a/tests/test-aio.c

Re: [Qemu-devel] [PATCH] aio / timers: use g_usleep() not sleep()

2013-08-29 Thread Alex Bligh
C) would be even better. Prefer 1 as it's then obvious its a conversion and 1 second. But I've fixed the blank and sent that as v2. I suspect checkpatch is confused about * meaning a pointer dereference. -- Alex Bligh

Re: [Qemu-devel] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Alex Bligh
;t require contributor assignment). My copyright would be 2013. But removing Redhat's (c) or altering it did not seem right. I'm really not bothered about having my own string in there particularly for such a meagre bit of code, but I suppose most accurate would be: (c) 2009 Red Hat,

Re: [Qemu-devel] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Alex Bligh
--On 30 August 2013 12:55:29 -0600 Eric Blake wrote: Yes, that looks like the best approach. Thanks - done in v6 and added your reviewed-by line -- Alex Bligh

[Qemu-devel] [PATCHv6] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Alex Bligh
parameters which are not possible to specify through the qemu-img convert command line. Reviewed-by: Eric Blake Signed-off-by: Alexandre Derumier Signed-off-by: Alex Bligh --- Changes since v5: * Change order of case statement for -n to be after -q * Add my own copyright string (per Eric Blake) qemu

Re: [Qemu-devel] [PATCHv6] add qemu-img convert -n option (skip target volume creation)

2013-09-02 Thread Alex Bligh
>goto out; > } Fixed in v7 (just sent) subject to fixing the deliberate mistake in the above :-) Other two fixed too. -- Alex Bligh

[Qemu-devel] [PATCHv7] add qemu-img convert -n option (skip target volume creation)

2013-09-02 Thread Alex Bligh
parameters which are not possible to specify through the qemu-img convert command line. Reviewed-by: Eric Blake Signed-off-by: Alexandre Derumier Signed-off-by: Alex Bligh --- Changes since v6: * Check for outut file too short using bdrv_getlength (Stefan H) * Remove spurious comment re compression from

[Qemu-devel] When does live migration give up?

2013-09-04 Thread Alex Bligh
"do not attempt to migrate 50 busy VMs through a single 1GB/s NIC". -- Alex Bligh

Re: [Qemu-devel] When does live migration give up?

2013-09-04 Thread Alex Bligh
Paolo, --On 4 September 2013 19:07:53 +0200 Paolo Bonzini wrote: Il 04/09/2013 17:24, Alex Bligh ha scritto: We have seen a situation when migrating about 50 VMs at once where some of them fail. I think this is because they are dirtying pages faster than they can be transmitted. No

Re: [Qemu-devel] When does live migration give up?

2013-09-04 Thread Alex Bligh
--On 4 September 2013 19:05:50 +0100 Alex Bligh wrote: We appear to be getting something other than 'ms' returned through the monitoring system. Unhelpfully what that is is not logged. By which I mean 'we seem to be getting "status: failed" on the send side' -- Alex Bligh

Re: [Qemu-devel] When does live migration give up?

2013-09-04 Thread Alex Bligh
ing prematurely) which can >> cause a failed migration after many minutes? We've seen problems where >> the destination is not set up the same as the source (e.g. different >> numbers of NICs) but IIRC that fails much earlier. >> >> To make things easier (cough), this is qemu 1.0 (as shipped with Ubuntu >> Precise). >> > > > -- Alex Bligh

[Qemu-devel] [PATCH v3 0/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm

2014-09-21 Thread Alex Bligh
grate properly due to a fundamental difference in their internal state between versions. Also note that (as expected) migration from qemu-2.x to qemu-1.0 will not work, even if the machine types are the same. Alex Bligh (2): Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qem

[Qemu-devel] [PATCH v3 1/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm

2014-09-21 Thread Alex Bligh
Add a machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm version 1.0. Signed-off-by: Alex Bligh --- hw/acpi/piix4.c | 47 +-- hw/i386/pc_piix.c | 30 ++ hw/timer/i8254_common.c

[Qemu-devel] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-21 Thread Alex Bligh
. Signed-off-by: Alex Bligh --- configure | 12 hw/i386/pc_piix.c |8 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f7685b5..b143302 100755 --- a/configure +++ b/configure @@ -335,6 +335,7 @@ libssh2="" vhdx=

Re: [Qemu-devel] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-22 Thread Alex Bligh
On 22 Sep 2014, at 12:36, Michael S. Tsirkin wrote: > On Sun, Sep 21, 2014 at 03:38:59PM +0100, Alex Bligh wrote: >> Add a configure option --enable-pc-1-0-qemu-kvm and the >> corresponding --disable-pc-1-0-qemu-kvm, defaulting >> to disabled. >> >> Rename m

Re: [Qemu-devel] [PATCH v3 1/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm

2014-09-22 Thread Alex Bligh
can see 'opaque' points to PIIX4PMState or PITCommonState. Do you mean to put them in there? Could you point to an example to copy. -- Alex Bligh

Re: [Qemu-devel] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-22 Thread Alex Bligh
you prefer using -M pc-1.0, add a new property > and teach management to set it. > > But no silent compile-time behind the scenes changes please. OK, how about we keep the aliases, and make pc-1.0 default to the pc-1.0-qemu-git. We then add a command line option to make pc-1.0 mean pc-1.0-q

Re: [Qemu-devel] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-22 Thread Alex Bligh
in the way they want (if we don't like the configure option). However, that's not compatible with using PC_COMPAT as far as I know (unless there is some cunning way you can make a machine parameter change compat_props things). -- Alex Bligh

Re: [Qemu-devel] [libvirt] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-22 Thread Alex Bligh
ty to import pc-1.0 machines from qemu-kvm. That's useful even if you build qemu from source every time. Or were you just arguing against the ./configure option? -- Alex Bligh

Re: [Qemu-devel] [libvirt] [PATCH v3 2/2] Add configure option --enable-pc-1-0-qemu-kvm

2014-09-22 Thread Alex Bligh
ve just sent through a version that works as a machine parameter instead. If upstream doesn't like this, I'd prefer downstream took v2 of the patch (which makes -M pc-1.0 work) instead. That's also what Serge tested. -- Alex Bligh

[Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-09-22 Thread Alex Bligh
ation from qemu-2.x to qemu-1.0 will not work, even if the machine types are the same. Changes since v1: * Do not use a machine type, use a machine parameter. Alex Bligh (1): Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm hw/acpi/piix4.c

[Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-09-22 Thread Alex Bligh
i8254 PIT common state is interpreted as being type 3 Signed-off-by: Alex Bligh --- hw/acpi/piix4.c | 47 +-- hw/core/machine.c | 16 hw/i386/pc.c|1 + hw/i386/pc_piix.c | 25

Re: [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-09-24 Thread Alex Bligh
Markus, On 24 Sep 2014, at 09:05, Markus Armbruster wrote: > Alex Bligh writes: > >> This patch series adds inbound migrate capability from qemu-kvm version >> 1.0. The main ideas are those set out in Cole Robinson's patch here: >> http://pkgs.fedoraproject.or

Re: [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-09-28 Thread Alex Bligh
's far easier with a new machine type, and I'd far prefer a new machine type. If you were just objecting to the fact that pc-1.0 was made to be an alias of either one or the other at compile time, simply drop the second patch of the v2 patchset. If we have a new machine type, I don't /think/ I need the early_init thing at all (I may be wrong about that). -- Alex Bligh

Re: [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-09-29 Thread Alex Bligh
On 29 Sep 2014, at 11:08, Michael S. Tsirkin wrote: > On Sun, Sep 28, 2014 at 09:33:08PM +0100, Alex Bligh wrote: >> Hang on a second! v2 of this patch DID use a new virtual machine, >> called exactly that. I thought you were objecting to that and >> wanting a machine pa

Re: [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-10-04 Thread Alex Bligh
; Actually it's version 3 that breaks migration right? > Pls say this explicitly: s/which/version 3 breaks migration from qemu 1.2/ It's changing the minimum version ID to 2 (from 3) which would break migration from qemu (git) 1.2, because that uses a version ID of 2, and we want the old loader to run in that case. I've made this clearer. -- Alex Bligh

[Qemu-devel] [PATCH] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm

2014-10-04 Thread Alex Bligh
om v4 * Revert to using a machine type, but do not add alias machine types, configure options, or (potentially) change the meaning of pc-1.0 - leave this for distributions to ponder * Add compat_props for qemu-kvm-migration to the PIIX4_PM driver and the i8259 pit-common driver. Signed-off-by:

Re: [Qemu-devel] [PATCH] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm

2014-10-04 Thread Alex Bligh
Sorry that was v5 - git send-email fumble fingers as git-publish doesn't seem to work well with single patches. Alex On 4 Oct 2014, at 17:37, Alex Bligh wrote: > Add a machine type pc-1.0-qemu-kvm for live migrate compatibility > with qemu-kvm version 1.0. > > This patch add

Re: [Qemu-devel] [PATCH v4] Add machine parameter qemu-kvm-migration for live migrate compatibility with qemu-kvm

2014-10-05 Thread Alex Bligh
mply that Ubuntu makes its pc-1.0 > machine type the qemu-kvm one. No new machine types, no aliases, no > anything. That would not allow Ubuntu (or Suse - similarly affected I think) to import pc-1.0 VMs from things actually running pc-1.0, and would mean that newly created pc-1.0 VMs would be 'wrong', perpetuating the problem. -- Alex Bligh

Re: [Qemu-devel] [PATCH] aio / timers: De-document -clock

2014-10-06 Thread Alex Bligh
gt; longer works, and needs to be redone. Can't do that right now, so I > just stick in a FIXME. > > Signed-off-by: Markus Armbruster Reviewed-by: Alex Bligh > --- > docs/writing-qmp-commands.txt | 2 ++ > qemu-options.hx | 12 ++-- > 2 files changed,

Re: [Qemu-devel] [PATCH] qtest: fix qtest_clock_warp() for no deadline case

2014-06-09 Thread Alex Bligh
line function and will generate the same code. > seqlock_write_lock(&timers_state.vm_clock_seqlock); > qemu_icount_bias += warp; > seqlock_write_unlock(&timers_state.vm_clock_seqlock); > -- > 1.9.1 > > > -- Alex Bligh

Re: [Qemu-devel] [PATCHv2] [RFC 1/7] aio / timers: Remove alarm timers

2013-07-25 Thread Alex Bligh
that yet. In general QEMUClock should have an AioContext pointer so that it can call aio_notify. OK, if we do that, disregard my comment about always using qemu_notify_event. -- Alex Bligh

Re: [Qemu-devel] [PATCHv2] [RFC 2/7] aio / timers: qemu-timer.c utility functions and add list of clocks

2013-07-25 Thread Alex Bligh
Stefan, --On 25 July 2013 11:19:29 +0200 Stefan Hajnoczi wrote: On Sat, Jul 20, 2013 at 07:06:38PM +0100, Alex Bligh wrote: Add utility functions to qemu-timer.c for nanosecond timing. Ensure we keep track of all QEMUClocks on a list. Add qemu_clock_deadline_ns and

Re: [Qemu-devel] [PATCHv2] [RFC 2/7] aio / timers: qemu-timer.c utility functions and add list of clocks

2013-07-25 Thread Alex Bligh
--On 25 July 2013 11:21:33 +0200 Stefan Hajnoczi wrote: On Sat, Jul 20, 2013 at 07:06:38PM +0100, Alex Bligh wrote: +gint qemu_g_poll_ns(GPollFD *fds, guint nfds, int64_t timeout); You didn't define the function in this patch. Will fix -- Alex Bligh

Re: [Qemu-devel] [PATCHv2] [RFC 1/7] aio / timers: Remove alarm timers

2013-07-25 Thread Alex Bligh
break; This could be made clearer to say outright that the options don't exist anymore: /* Clock options no longer exist. Keep this option for backward * compatibility. */ OK -- Alex Bligh

Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff

2013-07-25 Thread Alex Bligh
email that vm_clock stops when the guest is paused. I think we can find a solution for I/O throttling and QED, which use vm_clock in the block layer. Note that block jobs already use rt_clock. I would happily at a QEMUClock of each type to AioContext. They are after all pretty lightweight. --

Re: [Qemu-devel] [PATCHv2] [RFC 6/7] aio / timers: Switch to ppoll, run AioContext timers in aio_poll/aio_dispatch

2013-07-25 Thread Alex Bligh
viously it would have exited at the bottom of aio_poll and returned true is if g_poll returns such that aio_dispatch does nothing. That requires there to be no aio_dispatch to the normal FD handlers (which would generally mean a timeout) AND no timers running. This might happen if there was zero timeout

Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff

2013-07-25 Thread Alex Bligh
xt, because the timer list is fundamentally per clock-source. I am currently just using QEMU_CLOCK_REALTIME as that's what the block drivers normally want. Will block drivers ever want timers from a different clock source? -- Alex Bligh

Re: [Qemu-devel] [PATCHv2] [RFC 6/7] aio / timers: Switch to ppoll, run AioContext timers in aio_poll/aio_dispatch

2013-07-25 Thread Alex Bligh
ns = -1; +} else { + timeout_ns = (int64_t)timeout * (int64_t)SCALE_MS; Indentation. Will fix -- Alex Bligh

[Qemu-devel] [RFC] [PATCHv3 01/12] aio / timers: add qemu-timer.c utility functions

2013-07-25 Thread Alex Bligh
qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to milliseconds for when ppoll is not used. Signed-off-by: Alex Bligh --- include/qemu/timer.h | 17 ++ qemu-timer.c | 63 +- 2 files changed, 74 insertions(+), 6 deletions(-) diff

[Qemu-devel] [RFC] [PATCHv3 05/12] aio / timers: Add a clock to AioContext

2013-07-25 Thread Alex Bligh
Add a clock to each AioContext and delete it when freed. Signed-off-by: Alex Bligh --- async.c |2 ++ include/block/aio.h |5 + 2 files changed, 7 insertions(+) diff --git a/async.c b/async.c index 90fe906..0d41431 100644 --- a/async.c +++ b/async.c @@ -177,6 +177,7

[Qemu-devel] [RFC] [PATCHv3 02/12] aio / timers: add ppoll support with qemu_poll_ns

2013-07-25 Thread Alex Bligh
Add qemu_poll_ns which works like g_poll but takes a nanosecond timeout. Signed-off-by: Alex Bligh --- configure| 19 +++ include/qemu/timer.h |1 + qemu-timer.c | 24 3 files changed, 44 insertions(+) diff --git a/configure

[Qemu-devel] [RFC] [PATCHv3 06/12] aio / timers: Add an AioContext pointer to QEMUClock

2013-07-25 Thread Alex Bligh
Add an AioContext pointer to QEMUClock so it knows what to notify on a timer change. Signed-off-by: Alex Bligh --- async.c |1 + include/qemu/timer.h |3 +++ qemu-timer.c | 12 3 files changed, 16 insertions(+) diff --git a/async.c b/async.c index

[Qemu-devel] [RFC] [PATCHv3 12/12] aio / timers: Add test harness for AioContext timers

2013-07-25 Thread Alex Bligh
Add a test harness for AioContext timers. The g_source equivalent is unsatisfactory as it suffers from false wakeups. Signed-off-by: Alex Bligh --- tests/test-aio.c | 122 ++ 1 file changed, 122 insertions(+) diff --git a/tests/test-aio.c b

[Qemu-devel] [RFC] [PATCHv3 07/12] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-07-25 Thread Alex Bligh
Calculate the timeout in aio_ctx_prepare taking into account the timers attached to the AioContext. Alter aio_ctx_check similarly. Signed-off-by: Alex Bligh --- async.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/async.c b/async.c index 2968c68..a62c463

[Qemu-devel] [RFC] [PATCHv3 11/12] aio / timers: Remove alarm timers

2013-07-25 Thread Alex Bligh
Remove alarm timers from qemu-timers.c now we use g_poll / ppoll instead. Signed-off-by: Alex Bligh --- include/qemu/timer.h |2 - main-loop.c |4 - qemu-timer.c | 501 +- vl.c |5 +- 4 files changed

[Qemu-devel] [RFC] [PATCHv3 04/12] aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress

2013-07-25 Thread Alex Bligh
Make qemu_run_timers and qemu_run_all_timers return progress so that aio_poll etc. can determine whether a timer has been run. Signed-off-by: Alex Bligh --- include/qemu/timer.h |4 ++-- qemu-timer.c | 18 -- 2 files changed, 14 insertions(+), 8 deletions(-) diff

[Qemu-devel] [RFC] [PATCHv3 03/12] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

2013-07-25 Thread Alex Bligh
Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to set one nanosecond timer slack to increase precision of timer calls. Signed-off-by: Alex Bligh --- configure| 18 ++ qemu-timer.c |7 +++ 2 files changed, 25 insertions(+) diff --git a/configure b

[Qemu-devel] [RFC] [PATCHv3 08/12] aio / timers: Convert aio_poll to use AioContext timers' deadline

2013-07-25 Thread Alex Bligh
Convert aio_poll to use deadline based on AioContext's timers. Signed-off-by: Alex Bligh --- aio-posix.c | 20 +--- aio-win32.c | 22 +++--- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index b68eccd..fe

[Qemu-devel] [RFC] [PATCHv3 00/12] aio / timers: Add AioContext timers and use ppoll

2013-07-25 Thread Alex Bligh
atch set to do this. Alex Bligh (12): aio / timers: add qemu-timer.c utility functions aio / timers: add ppoll support with qemu_poll_ns aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack aio / timers: Make qemu_run_timers and qemu_run_all_timers return

Re: [Qemu-devel] [RFC] [PATCHv3 00/12] aio / timers: Add AioContext timers and use ppoll

2013-07-25 Thread Alex Bligh
--On 25 July 2013 23:16:36 +0100 Alex Bligh wrote: * change comment in deprecation of clock options This got missed due to my own inadequacy. Delta is below. It will be in the next series. -- Alex Bligh commit 699c55b421822ad2d14b5520b04db8fa9f77c4e0 Author: Alex Bligh Date: Thu Jul

[Qemu-devel] [RFC] [PATCHv3 09/12] aio / timers: convert mainloop to use timeout

2013-07-25 Thread Alex Bligh
Convert mainloop to use timeout from 3 static timers. Signed-off-by: Alex Bligh --- main-loop.c | 48 +--- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/main-loop.c b/main-loop.c index a44fff6..c30978b 100644 --- a/main-loop.c

[Qemu-devel] [RFC] [PATCHv3 10/12] aio / timers: on timer modification, qemu_notify or aio_notify

2013-07-25 Thread Alex Bligh
On qemu_clock_enable or qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll(). Signed-off-by: Alex Bligh --- qemu-timer.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c index 6efd1b4

Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff

2013-07-26 Thread Alex Bligh
block driver that uses a timer, as I don't think the vm timer is running when qemu-img is running. -- Alex Bligh

[Qemu-devel] [RFC] [PATCHv4 04/13] aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress

2013-07-26 Thread Alex Bligh
Make qemu_run_timers and qemu_run_all_timers return progress so that aio_poll etc. can determine whether a timer has been run. Signed-off-by: Alex Bligh --- include/qemu/timer.h |4 ++-- qemu-timer.c | 18 -- 2 files changed, 14 insertions(+), 8 deletions(-) diff

[Qemu-devel] [RFC] [PATCHv4 06/13] aio / timers: Add a QEMUTimerList to AioContext

2013-07-26 Thread Alex Bligh
Add a QEMUTimerList to each AioContext and delete it when the AioContext is freed. Signed-off-by: Alex Bligh --- async.c |7 +++ include/block/aio.h |5 + tests/test-aio.c |3 +++ tests/test-thread-pool.c |3 +++ 4 files changed, 18

[Qemu-devel] [RFC] [PATCHv4 05/13] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList

2013-07-26 Thread Alex Bligh
to do the notifications is added in a later patch. Signed-off-by: Alex Bligh --- include/qemu/timer.h | 26 + qemu-timer.c | 150 +++--- 2 files changed, 143 insertions(+), 33 deletions(-) diff --git a/include/qemu/timer.h b/include

[Qemu-devel] [RFC] [PATCHv4 08/13] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-07-26 Thread Alex Bligh
Calculate the timeout in aio_ctx_prepare taking into account the timers attached to the AioContext. Alter aio_ctx_check similarly. Signed-off-by: Alex Bligh --- async.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/async.c b/async.c index d3ed868..2a907e1

[Qemu-devel] [RFC] [PATCHv4 13/13] aio / timers: Add test harness for AioContext timers

2013-07-26 Thread Alex Bligh
Add a test harness for AioContext timers. The g_source equivalent is unsatisfactory as it suffers from false wakeups. Signed-off-by: Alex Bligh --- tests/test-aio.c | 136 ++ 1 file changed, 136 insertions(+) diff --git a/tests/test-aio.c b

[Qemu-devel] [RFC] [PATCHv4 12/13] aio / timers: Remove alarm timers

2013-07-26 Thread Alex Bligh
Remove alarm timers from qemu-timers.c now we use g_poll / ppoll instead. Signed-off-by: Alex Bligh --- include/qemu/timer.h |2 - main-loop.c |4 - qemu-timer.c | 501 +- vl.c |4 +- 4 files changed

[Qemu-devel] [RFC] [PATCHv4 02/13] aio / timers: add ppoll support with qemu_poll_ns

2013-07-26 Thread Alex Bligh
Add qemu_poll_ns which works like g_poll but takes a nanosecond timeout. Signed-off-by: Alex Bligh --- configure| 19 +++ include/qemu/timer.h |1 + qemu-timer.c | 24 3 files changed, 44 insertions(+) diff --git a/configure

[Qemu-devel] [RFC] [PATCHv4 00/13] aio / timers: Add AioContext timers and use ppoll

2013-07-26 Thread Alex Bligh
ation of clock options Alex Bligh (13): aio / timers: add qemu-timer.c utility functions aio / timers: add ppoll support with qemu_poll_ns aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack aio / timers: Make qemu_run_timers and qemu_run_all_timers return

[Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout

2013-07-26 Thread Alex Bligh
Convert mainloop to use timeout from 3 static timers. Signed-off-by: Alex Bligh --- main-loop.c | 48 +--- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/main-loop.c b/main-loop.c index a44fff6..c30978b 100644 --- a/main-loop.c

[Qemu-devel] [RFC] [PATCHv4 03/13] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

2013-07-26 Thread Alex Bligh
Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to set one nanosecond timer slack to increase precision of timer calls. Signed-off-by: Alex Bligh --- configure| 18 ++ qemu-timer.c |7 +++ 2 files changed, 25 insertions(+) diff --git a/configure b

[Qemu-devel] [RFC] [PATCHv4 11/13] aio / timers: on timer modification, qemu_notify or aio_notify

2013-07-26 Thread Alex Bligh
On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll(). On qemu_clock_enable, ensure qemu_notify or aio_notify is called for all QEMUTimerLists attached to the QEMUClock. Signed-off-by: Alex Bligh --- qemu-timer.c | 22 +++--- 1 file

[Qemu-devel] [RFC] [PATCHv4 09/13] aio / timers: Convert aio_poll to use AioContext timers' deadline

2013-07-26 Thread Alex Bligh
aio.c where an assert was backwards. Signed-off-by: Alex Bligh --- aio-posix.c | 20 +--- aio-win32.c | 22 +++--- tests/test-aio.c |4 ++-- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index b6

Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff

2013-07-26 Thread Alex Bligh
u-devel/2013-07/msg04887.html Unfortunately I've needed to keep qemu_new_timer AND qemu_new_timer_timerlist about to avoid horrendous git stats due to the consequent API changes (I did it, but you don't want to see it), and these have several variants. Apart from that it wasn't too bad. -- Alex Bligh

Re: [Qemu-devel] [PATCH V3 for-1.6 1/5] block: Repair the throttling code.

2013-07-26 Thread Alex Bligh
}; in my opinion, particularly when used multiple times in succession. I think this is probably a bug in checkpatch.pl. -- Alex Bligh

[Qemu-devel] [RFC] [PATCHv4 07/13] aio / timers: Add an AioContext pointer to QEMUTimerList

2013-07-26 Thread Alex Bligh
Add an AioContext pointer to QEMUTimerList so it knows what to notify on a timer change. Signed-off-by: Alex Bligh --- async.c |1 + include/qemu/timer.h |3 +++ qemu-timer.c | 12 3 files changed, 16 insertions(+) diff --git a/async.c b/async.c

[Qemu-devel] [RFC] [PATCHv4 01/13] aio / timers: add qemu-timer.c utility functions

2013-07-26 Thread Alex Bligh
qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to milliseconds for when ppoll is not used. Signed-off-by: Alex Bligh --- include/qemu/timer.h | 17 ++ qemu-timer.c | 63 +- 2 files changed, 74 insertions(+), 6 deletions(-) diff

Re: [Qemu-devel] [RFC v2 0/5] arm AioContext with its own timer stuff

2013-07-29 Thread Alex Bligh
QEMUTimerList to each AioContext. -- Alex Bligh

Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff

2013-07-29 Thread Alex Bligh
does the bdrv_open, and that's right at the end of migration. It seems to me it should be safe to do block jobs right up to the bdrv_close. -- Alex Bligh

Re: [Qemu-devel] [RFC v2 0/5] arm AioContext with its own timer stuff

2013-07-29 Thread Alex Bligh
ronization necessary). I should say PingFan has probably paid more attention to thread safety than me, as my work was intended to be applied before AioContexts were used by multiple threads. -- Alex Bligh

Re: [Qemu-devel] [RFC v2 0/5] arm AioContext with its own timer stuff

2013-07-29 Thread Alex Bligh
lways set from the same thread they are run (i.e. there is only one thread walking the QEMUTimerList). -- Alex Bligh

Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb

2013-07-30 Thread Alex Bligh
ng the QEMUTimerList itself is concerned, this is something which is 99.999% done by the thread owning the AioContext. qemu_clock_enable should not even be walking this list. So I don't see why the protection here is needed. -- Alex Bligh

Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb

2013-08-01 Thread Alex Bligh
, if rebasing on top of my patches, qemu_run_timers *can* be executed concurrently by mulitple threads, but in respect of any given QEMUTimerList, it will only be executed by one thread. -- Alex Bligh

Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb

2013-08-01 Thread Alex Bligh
;m not sure that's true. If two AioContexts run in different threads, would their BH's and timers not also run in those two different threads? -- Alex Bligh

Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout

2013-08-01 Thread Alex Bligh
was trying hard to avoid anything having to iterate over all timerlists, and leave the timerlist to be per-thread where possible. This may well fail for the clock warp stuff. I probably need to exactly the same as on qemu_clock_enable() here if use_icount is true. WDYT? -- Alex Bligh

Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb

2013-08-01 Thread Alex Bligh
qemu_clock_enable(foo, false), and the code after qemu_clock_enable assumes that no timers are running. Then you should move that code to a bottom half in foo's AioContext. foo is a QEMUClock here. A QEMUClock may not have just one AioContext. It could have several each operated by a different thread. -- Alex Bligh

Re: [Qemu-devel] [RFC] [PATCHv4 10/13] aio / timers: Convert mainloop to use timeout

2013-08-02 Thread Alex Bligh
liest deadline of all vm_clock timerlists. And this: if (qemu_clock_expired(vm_clock)) { qemu_notify_event(); } would also have to walk all timerlists for vm_clock, and notify those that have expired. But you would not need one warp timer per timerlist. OK looks like I need to review the patch looking for use_icount. -- Alex Bligh

Re: [Qemu-devel] [sheepdog] [PATCH v4 06/10] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-08-02 Thread Alex Bligh
). That won't affect anything current. I suggest you go with v4 for the time being. If I end up doing a v5 and your code doesn't sit well on top of it, I can rebase to yours or something. I'd expect changes in v5 to be really small. -- Alex Bligh

[Qemu-devel] CHECKPATH issue

2013-08-04 Thread Alex Bligh
if it were multiplication). -- Alex Bligh $ scripts/checkpatch.pl aio-timer-patches-5/* 2>&1 | fgrep -B6 0007-aio-timers ERROR: "foo * bar" should be "foo *bar" #27: FILE: include/qemu/timer.h:22: +typedef QEMUTimerList * QEMUTimerListGroup[QEMU_CLOCK_MAX]; total: 1 erro

[Qemu-devel] [RFC] [PATCHv5 07/16] aio / timers: Add QEMUTimerListGroup and helper functions

2013-08-04 Thread Alex Bligh
Add QEMUTimerListGroup and helper functions, to represent a QEMUTimerList associated with each clock. Add a default QEMUTimerListGroup representing the default timer lists which are not associated with any other object (e.g. an AioContext as added by future patches). Signed-off-by: Alex Bligh

[Qemu-devel] [RFC] [PATCHv5 04/16] aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress

2013-08-04 Thread Alex Bligh
Make qemu_run_timers and qemu_run_all_timers return progress so that aio_poll etc. can determine whether a timer has been run. Signed-off-by: Alex Bligh --- include/qemu/timer.h |4 ++-- qemu-timer.c | 18 -- 2 files changed, 14 insertions(+), 8 deletions(-) diff

[Qemu-devel] [RFC] [PATCHv5 00/16] aio / timers: Add AioContext timers and use ppoll

2013-08-04 Thread Alex Bligh
s * Indentation fix * Fix aio_win32.c aio_poll to return progress * aio_notify / qemu_notify when timers are modified * change comment in deprecation of clock options Alex Bligh (16): aio / timers: add qemu-timer.c utility functions aio / timers: add ppoll support with qemu_poll_ns aio

[Qemu-devel] [RFC] [PATCHv5 01/16] aio / timers: add qemu-timer.c utility functions

2013-08-04 Thread Alex Bligh
qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to milliseconds for when ppoll is not used. Signed-off-by: Alex Bligh --- include/qemu/timer.h | 17 ++ qemu-timer.c | 63 +- 2 files changed, 74 insertions(+), 6 deletions(-) diff

[Qemu-devel] [RFC] [PATCHv5 03/16] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack

2013-08-04 Thread Alex Bligh
Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to set one nanosecond timer slack to increase precision of timer calls. Signed-off-by: Alex Bligh --- configure| 18 ++ qemu-timer.c |7 +++ 2 files changed, 25 insertions(+) diff --git a/configure b

[Qemu-devel] [RFC] [PATCHv5 08/16] aio / timers: Add QEMUTimerListGroup to AioContext

2013-08-04 Thread Alex Bligh
Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerList associated with each clock is added) and delete it when the AioContext is freed. Signed-off-by: Alex Bligh --- async.c |2 ++ include/block/aio.h |4 tests/test-aio.c |3 +++ tests

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