Workaround against commit f500a6d3c2b9ef0bb06d0080d91d8ed3c1d68f58 --- a/block/rbd.c 2013-03-27 02:16:53.000000000 +0300 +++ b/block/rbd.c 2013-03-27 02:17:31.000000000 +0300 @@ -544,6 +544,9 @@ static void qemu_rbd_close(BlockDriverSt { BDRVRBDState *s = bs->opaque; + if (!s->image) + return; + close(s->fds[0]); close(s->fds[1]); qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], NULL, NULL, NULL, NULL); @@ -766,7 +769,7 @@ static int qemu_rbd_co_flush(BlockDriver #if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1) /* rbd_flush added in 0.1.1 */ BDRVRBDState *s = bs->opaque; - return rbd_flush(s->image); + return s->image ? rbd_flush(s->image) : 0; #else return 0; #endif