aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-09-18 13:26:25 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-09-19 15:26:28 +0200
commit2c8d9f065538a5a0ef2421e90b6076d05148accf (patch)
treee302eabc6302f61e5a2f1c41f7afe7b06f7cbdab /qemu-nbd.c
parentff2b68aa70d10b7eae813b04e9a23723dbd89ebd (diff)
downloadqemu-arm-2c8d9f065538a5a0ef2421e90b6076d05148accf.tar.gz
nbd: add reference counting to NBDExport
We will use a similar two-phase destruction for NBDExport, so we need each NBDClient to add a reference to NBDExport. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 23392e0d3c..2a2cba3f73 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -586,7 +586,9 @@ int main(int argc, char **argv)
} while (!sigterm_reported && (persistent || !nbd_started || nb_fds > 0));
nbd_export_close(exp);
+ nbd_export_put(exp);
bdrv_close(bs);
+
if (sockpath) {
unlink(sockpath);
}