]> Git Repo - qemu.git/commitdiff
sheepdog: fix a core dump while do auto-reconnecting
authorLiu Yuan <[email protected]>
Thu, 28 Aug 2014 10:27:55 +0000 (18:27 +0800)
committerStefan Hajnoczi <[email protected]>
Fri, 29 Aug 2014 09:46:58 +0000 (10:46 +0100)
We should reinit local_err as NULL inside the while loop or g_free() will report
corrupption and abort the QEMU when sheepdog driver tries reconnecting.

This was broken in commit 356b4ca.

qemu-system-x86_64: failed to get the header, Resource temporarily unavailable
qemu-system-x86_64: Failed to connect to socket: Connection refused
qemu-system-x86_64: (null)
[xcb] Unknown sequence number while awaiting reply
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
qemu-system-x86_64: ../../src/xcb_io.c:298: poll_for_response: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

Cc: [email protected]
Cc: Markus Armbruster <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Liu Yuan <[email protected]>
Reviewed-by: BenoĆ®t Canet <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
block/sheepdog.c

index 49a9a9e5eb95a2b35e6fdb048b19061455dff579..f91afc3a5bcc2e98e0b9bb71e51afb9e455c7633 100644 (file)
@@ -716,7 +716,6 @@ static void coroutine_fn send_pending_req(BDRVSheepdogState *s, uint64_t oid)
 
 static coroutine_fn void reconnect_to_sdog(void *opaque)
 {
-    Error *local_err = NULL;
     BDRVSheepdogState *s = opaque;
     AIOReq *aio_req, *next;
 
@@ -731,6 +730,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque)
 
     /* Try to reconnect the sheepdog server every one second. */
     while (s->fd < 0) {
+        Error *local_err = NULL;
         s->fd = get_sheep_fd(s, &local_err);
         if (s->fd < 0) {
             DPRINTF("Wait for connection to be established\n");
This page took 0.0255 seconds and 4 git commands to generate.