From 0ddf08db22a9ef6b122d8c4cfe5b25d2c2c51962 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 18 Sep 2012 13:59:03 +0200 Subject: nbd: add notification for closing an NBDExport In order to exit cleanly from qemu-nbd, add a callback that triggers when an NBDExport is closed. In the case of qemu-nbd it will exit the main loop. Signed-off-by: Paolo Bonzini --- nbd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nbd.h') diff --git a/nbd.h b/nbd.h index 86921cd..895820b 100644 --- a/nbd.h +++ b/nbd.h @@ -79,7 +79,8 @@ typedef struct NBDExport NBDExport; typedef struct NBDClient NBDClient; NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, - off_t size, uint32_t nbdflags); + off_t size, uint32_t nbdflags, + void (*close)(NBDExport *)); void nbd_export_close(NBDExport *exp); void nbd_export_get(NBDExport *exp); void nbd_export_put(NBDExport *exp); -- cgit v1.1