- 23 8月, 2013 7 次提交
-
-
由 Alex Bligh 提交于
On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called to end the appropriate poll(), irrespective of use_icount value. On qemu_clock_enable, ensure qemu_notify or aio_notify is called for all QEMUTimerLists attached to the QEMUClock. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Add a notify pointer to QEMUTimerList so it knows what to notify on a timer change. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 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: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Split QEMUClock into QEMUClock and QEMUTimerList so that we can have more than one QEMUTimerList associated with the same clock. Introduce a main_loop_timerlist concept and make existing qemu_clock_* calls that actually should operate on a QEMUTimerList call the relevant QEMUTimerList implementations, using the clock's default timerlist. This vastly reduces the invasiveness of this change and means the API stays constant for existing users. Introduce a list of QEMUTimerLists associated with each clock so that reenabling the clock can cause all the notifiers to be called. Note the code to do the notifications is added in a later patch. Switch QEMUClockType to an enum. Remove global variables vm_clock, host_clock and rt_clock and add compatibility defines. Do not fix qemu_next_alarm_deadline as it's going to be deleted. Add qemu_clock_use_for_deadline to indicate whether a particular clock should be used for deadline calculations. When use_icount is true, vm_clock should not be used for deadline calculations as it does not contain a nanosecond count. Instead, icount timeouts come from the execution thread doing aio_notify or qemu_notify as appropriate. This function is used in the next patch. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 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: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 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: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Add qemu_poll_ns which works like g_poll but takes a nanosecond timeout. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 22 8月, 2013 4 次提交
-
-
由 Alex Bligh 提交于
Make treatment of disabled clocks consistent in deadline calculation Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Add utility functions to qemu-timer.c for nanosecond timing. Add qemu_clock_deadline_ns to calculate deadlines to nanosecond accuracy. Add utility function qemu_soonest_timeout to calculate soonest deadline. Add qemu_timeout_ns_to_ms to convert a timeout in nanoseconds back to milliseconds for when ppoll is not used. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Rename qemu_new_clock to qemu_clock_new. Expose clock types. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Alex Bligh 提交于
Rename four functions in preparation for new API. Rename qemu_timer_expired to timer_expired Rename qemu_timer_expire_time_ns to timer_expire_time_ns Rename qemu_timer_pending to timer_pending Rename qemu_timer_expired_ns to timer_expired_ns Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 13 4月, 2013 1 次提交
-
-
由 Paolo Bonzini 提交于
These are needed for any of the Win32 alarm timer implementations. They are not tied to mmtimer exclusively. Jacob tested this patch with both mmtimer and Win32 timers. Cc: qemu-stable@nongnu.org Tested-by: NJacob Kroon <jacob.kroon@gmail.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
- 19 12月, 2012 5 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 10 11月, 2012 1 次提交
-
-
由 Stefan Weil 提交于
A compiler warning is caused by the unused local function reinit_timers on non-POSIX hosts. Include that function only for POSIX hosts. Signed-off-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 05 11月, 2012 1 次提交
-
-
由 Anthony Liguori 提交于
Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 03 11月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
Timers are not inherited by the child of a fork(2), so just use pthread_atfork to reinstate them after daemonize. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 30 10月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 28 10月, 2012 1 次提交
-
-
由 Richard Henderson 提交于
Older glibc (RHEL 5.x, Debian 5.x) does not have the _sigev_un._tid member in its structure definition, while the accompanying kernel headers do define SIGEV_THREAD_ID. We need configure to check for both before using it. Signed-off-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
- 23 9月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
ptimer_head is an invariant pointer to clock->active_timers. Remove it, and just reference clock->active_timers directly. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
-
- 04 9月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
QEMU will hang when fed the following command-line qemu-system-mips -kernel vmlinux-2.6.32-5-4kc-malta -append "console=ttyS0" -nographic -net none The -net none is important otherwise it seems some events are generated causing the things to work. When it doesn't work, the guest hangs when measuring the CPU frequency, after the following line: [ 0.000000] NR_IRQS:256 Pressing a key on the serial port unblocks it, hinting that the problem is due to the recent elimination of the 1 second timeout in the main loop. The problem is that because init_timer_alarm sets the timer's pending flag to true, the alarm timer is never armed until after the first time through the main loop. Thus the bug started when QEMU started testing the pending flag in qemu_mod_timer (commit 1828be31, more alarm timer cleanup, 2010-03-10). But actually, it isn't true at all that a timer is pending when the alarm timer is created, and the real bug has been latent forever: the fix is to remove the bogus setting of pending flag. Reported-by: NAurelien Jarno <aurelien@aurel32.net> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NJan Kiszka <jan.kiszka@siemens.com> Tested-by: NAurelien Jarno <aurelien@aurel32.net> Tested-by: NMichael Tokarev <mjt@tls.msk.ru> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
- 10 8月, 2012 1 次提交
-
-
由 Stefano Stabellini 提交于
qemu_rearm_alarm_timer partially duplicates the code in qemu_next_alarm_deadline to figure out if it needs to rearm the timer. If it calls qemu_next_alarm_deadline, it always rearms the timer even if the next deadline is INT64_MAX. This patch simplifies the behavior of qemu_rearm_alarm_timer and removes the duplicated code, always calling qemu_next_alarm_deadline and only rearming the timer if the deadline is less than INT64_MAX. Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: NStefan Weil <sw@weilnetz.de> Tested-by: NAndreas Färber <andreas.faerber@web.de> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 03 8月, 2012 1 次提交
-
-
由 Peter Maydell 提交于
For command line options which permit '?' meaning 'please list the permitted values', add support for 'help' as a synonym, by abstracting the check out into a helper function. This change means that in some cases where we were being lazy in our string parsing, "?junk" will now be rejected as an invalid option rather than being (undocumentedly) treated the same way as "?". Update the documentation to use 'help' rather than '?', since '?' is a shell metacharacter and thus prone to fail confusingly if there is a single character filename in the current working directory and the '?' has not been escaped. It's therefore better to steer users towards 'help', though '?' is retained for backwards compatibility. We do not, however, update the output of the system emulator's -help (or any documentation autogenerated from the qemu-options.hx which is the source of the -help text) because libvirt parses our -help output and will break. At a later date when QEMU provides a better interface so libvirt can avoid having to do this, we can update the -help text too. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 14 5月, 2012 1 次提交
-
-
由 Stefan Weil 提交于
Function timeSetEvent returns 0 when it fails, but it does not set an error code which can be retrieved by GetLastError. Therefore calling GetLastError is useless. Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
- 09 5月, 2012 1 次提交
-
-
由 Andreas Faerber 提交于
sys/param.h is needed for __FreeBSD_version. Pointed out by Juergen, thanks. Signed-off-by: NAndreas Faerber <andreas.faerber@web.de> Cc: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 03 5月, 2012 1 次提交
-
-
由 Stefan Weil 提交于
timeSetEvent only accepts delays in the range which is returned by timeGetDevCaps. The lower limit is typically 1 (= 1 ms), so the constant value of 1 in the old code usually worked. The upper limit can be as low as 10000 ms, so the latest changes in QEMU's timer handling which introduced timeout values above that limit could result in failures of timeSetEvent when the timer was re-armed. Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
- 27 4月, 2012 8 次提交
-
-
由 Stefan Weil 提交于
Remove all holes which were found by pahole on Linux x86_64 (and replace "struct QEMUTimer" by "QEMUTimer"). Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
由 Stefan Weil 提交于
Some time ago, the last time which did not have dynticks was removed, so now all timers have dynticks. I also removed a misleading error message for the dynticks timer. If timer_create fails, there is already an error message, and QEMU will use the unix timer which also provides dynamic ticks, therefore dynamic ticks are not disabled. v2: Remove two if statements because they were always true (thanks to Paolo Bonzini for this correction). Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
由 Stefan Weil 提交于
This avoids conversions between int and bool / char. It also makes the code more readable. Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
由 Stefan Weil 提交于
The last user of this function was removed by commit 12d4536f. Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
由 Stefan Weil 提交于
qemu-timer.h includes qemu-common.h which already includes time.h, sys/time.h, windows.h, unistd.h, fcntl.h, errno.h and signal.h. Therefore those include statements are redundant and can be removed. Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Weil <sw@weilnetz.de>
-
由 Stefano Stabellini 提交于
- remove qemu_calculate_timeout; - explicitly size timeout to uint32_t; - introduce slirp_update_timeout; - pass NULL as timeout argument to select in case timeout is the maximum value; Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: NPaul Brook <paul@codesourcery.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Stefano Stabellini 提交于
Also delta in qemu_next_alarm_deadline is a 64 bit value so set the default to INT64_MAX instead of INT32_MAX. Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Stefano Stabellini 提交于
Fix win32_rearm_timer and mm_rearm_timer: they should be able to handle INT64_MAX as a delta parameter without overflowing. Also, the next deadline in ms should be calculated rounding down rather than up (see unix_rearm_timer and dynticks_rearm_timer). Finally ChangeTimerQueueTimer takes an unsigned long and timeSetEvent takes an unsigned int as delta, so cast the ms delta to the appropriate unsigned integer. Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 17 4月, 2012 1 次提交
-
-
由 Peter Portante 提交于
Basically, the main wait loop calls qemu_run_all_timers() unconditionally. The first thing this routine used to do is to see if a timer had been serviced, and then reset the loop timeout to the next deadline. However, the new deadlines had not been calculated at that point, as qemu_run_timers() had not been called yet for each of the clocks. So qemu_rearm_alarm_timer() would end up with a negative or zero deadline, and default to setting a 250us timeout for the loop. As qemu_run_timers() is called for each clock, the real deadlines would be put in place, but because a loop timeout was already set, the loop timeout would not be changed. Once that 250us timeout fired, the real deadline would be used for the subsequent timeout. For idle VMs, this effectively doubles the number of times through the loop, doubling the number of select() system calls, timer calls, etc. putting added scheduling pressure on the kernel. And under cgroups, this really causes a big problem because the cgroup code does not scale well. By simply running the timers before trying to rearm the timer, we always rearm with a non-zero deadline, effectively halving the number of system calls. Signed-off-by: NPeter Portante <pportant@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 30 3月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
This patch combines qtest and -icount together to turn the vm_clock into a source that can be fully managed by the client. To this end new commands clock_step and clock_set are added. Hooking them with libqtest is left as an exercise to the reader. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 17 2月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
Notifiers do not need to access both ends of the list, and using a QLIST also simplifies the API. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-