diff mbox

qed: replace vm_clock with rt_clock for qemu-tool compatibility

Message ID 4F4B4D5E.4070609@redhat.com
State New
Headers show

Commit Message

Kevin Wolf Feb. 27, 2012, 9:31 a.m. UTC
Am 27.02.2012 09:42, schrieb Paolo Bonzini:
> On 02/27/2012 08:35 AM, Zhi Yong Wu wrote:
>> Since vm_clock is created via qemu_init_main_loop(), when QED read
>> vm_clock, why will this call abort()?
>> Can you elaborate this? what is its call path?
>>
> 
> It will crash in cpu_get_clock() (in qemu-tool.c).

The fix isn't very nice if it makes migration impossible. I'd like to
introduce a similar timer in qcow2 which does support migration and
breaking it is not an option. So what about (completely untested)...

 int64_t cpu_get_icount(void)

Kevin

Comments

Stefan Hajnoczi Feb. 27, 2012, 11:14 a.m. UTC | #1
On Mon, Feb 27, 2012 at 9:31 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 27.02.2012 09:42, schrieb Paolo Bonzini:
>> On 02/27/2012 08:35 AM, Zhi Yong Wu wrote:
>>> Since vm_clock is created via qemu_init_main_loop(), when QED read
>>> vm_clock, why will this call abort()?
>>> Can you elaborate this? what is its call path?
>>>
>>
>> It will crash in cpu_get_clock() (in qemu-tool.c).
>
> The fix isn't very nice if it makes migration impossible. I'd like to
> introduce a similar timer in qcow2 which does support migration and
> breaking it is not an option. So what about (completely untested)...
>
> diff --git a/qemu-tool.c b/qemu-tool.c
> index 183a583..edb84f5 100644
> --- a/qemu-tool.c
> +++ b/qemu-tool.c
> @@ -61,7 +61,7 @@ void monitor_protocol_event(MonitorEvent event,
> QObject *data)
>
>  int64_t cpu_get_clock(void)
>  {
> -    abort();
> +    return 0;
>  }

This is what we used to do, I'm okay with it.

Stefan
diff mbox

Patch

diff --git a/qemu-tool.c b/qemu-tool.c
index 183a583..edb84f5 100644
--- a/qemu-tool.c
+++ b/qemu-tool.c
@@ -61,7 +61,7 @@  void monitor_protocol_event(MonitorEvent event,
QObject *data)

 int64_t cpu_get_clock(void)
 {
-    abort();
+    return 0;
 }