Home
last modified time | relevance | path

Searched hist:"63 f0f45f2e89b60ff8245fec81328ddfde42a303" (Results 1 – 1 of 1) sorted by relevance

/openbmc/qemu/block/
H A Dcurl.cdiff a2f468e48f8b6559ec9123e94948bc373b788941 Thu Aug 28 03:04:21 CDT 2014 Richard W.M. Jones <rjones@redhat.com> curl: Don't deref NULL pointer in call to aio_poll.

In commit 63f0f45f2e89b60ff8245fec81328ddfde42a303 the following
mechanical change was made:

if (!state) {
- qemu_aio_wait();
+ aio_poll(state->s->aio_context, true);
}

The new code now checks if state is NULL and then dereferences it
('state->s') which is obviously incorrect.

This commit replaces state->s->aio_context with
bdrv_get_aio_context(bs), fixing this problem. The two other hunks
are concerned with getting the BlockDriverState pointer bs to where it
is needed.

The original bug causes a segfault when using libguestfs to access a
VMware vCenter Server and doing any kind of complex read-heavy
operations. With this commit the segfault goes away.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
diff 63f0f45f2e89b60ff8245fec81328ddfde42a303 Thu May 08 09:34:40 CDT 2014 Stefan Hajnoczi <stefanha@redhat.com> curl: implement .bdrv_detach/attach_aio_context()

The curl block driver uses fd handlers, timers, and BHs. The fd
handlers and timers are managed on behalf of libcurl, which controls
them using callback functions that the block driver implements.

The simplest way to implement .bdrv_detach/attach_aio_context() is to
clean up libcurl in the old event loop and initialize it again in the
new event loop. We do not need to keep track of anything since there
are no pending requests when the AioContext is changed.

Also make sure to use aio_set_fd_handler() instead of
qemu_aio_set_fd_handler() and aio_bh_new() instead of qemu_bh_new() so
the current AioContext is passed in.

Cc: Alexander Graf <agraf@suse.de>
Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>