rbd.c (5d289cc7243be53d409ee3b79dd4fd363806f8b6) | rbd.c (f2e5dca46b5ba4588c0756c5f272123585cbbf23) |
---|---|
1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 531 unchanged lines hidden (view full) --- 540 r = qemu_pipe(s->fds); 541 if (r < 0) { 542 error_report("error opening eventfd"); 543 goto failed; 544 } 545 fcntl(s->fds[0], F_SETFL, O_NONBLOCK); 546 fcntl(s->fds[1], F_SETFL, O_NONBLOCK); 547 qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], qemu_rbd_aio_event_reader, | 1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 531 unchanged lines hidden (view full) --- 540 r = qemu_pipe(s->fds); 541 if (r < 0) { 542 error_report("error opening eventfd"); 543 goto failed; 544 } 545 fcntl(s->fds[0], F_SETFL, O_NONBLOCK); 546 fcntl(s->fds[1], F_SETFL, O_NONBLOCK); 547 qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], qemu_rbd_aio_event_reader, |
548 NULL, NULL, s); | 548 NULL, s); |
549 550 551 qemu_opts_del(opts); 552 return 0; 553 554failed: 555 rbd_close(s->image); 556failed_open: --- 7 unchanged lines hidden (view full) --- 564} 565 566static void qemu_rbd_close(BlockDriverState *bs) 567{ 568 BDRVRBDState *s = bs->opaque; 569 570 close(s->fds[0]); 571 close(s->fds[1]); | 549 550 551 qemu_opts_del(opts); 552 return 0; 553 554failed: 555 rbd_close(s->image); 556failed_open: --- 7 unchanged lines hidden (view full) --- 564} 565 566static void qemu_rbd_close(BlockDriverState *bs) 567{ 568 BDRVRBDState *s = bs->opaque; 569 570 close(s->fds[0]); 571 close(s->fds[1]); |
572 qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], NULL, NULL, NULL, NULL); | 572 qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], NULL, NULL, NULL); |
573 574 rbd_close(s->image); 575 rados_ioctx_destroy(s->io_ctx); 576 g_free(s->snap); 577 rados_shutdown(s->cluster); 578} 579 580/* --- 438 unchanged lines hidden --- | 573 574 rbd_close(s->image); 575 rados_ioctx_destroy(s->io_ctx); 576 g_free(s->snap); 577 rados_shutdown(s->cluster); 578} 579 580/* --- 438 unchanged lines hidden --- |