diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-09-19 14:33:23 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-12-22 11:53:59 +0100 |
commit | 1743b515860ef645b285908ee367c5e343e0020c (patch) | |
tree | e3e4b075df3892869bce293affd2d6dbb5dca40b /nbd.h | |
parent | a61c67828dea7c64edaf226cadb45b4ffcc1d411 (diff) | |
download | qemu-1743b515860ef645b285908ee367c5e343e0020c.tar.gz qemu-1743b515860ef645b285908ee367c5e343e0020c.tar.bz2 qemu-1743b515860ef645b285908ee367c5e343e0020c.zip |
qemu-nbd: move client handling to nbd.c
This patch sets up the fd handler in nbd.c instead of qemu-nbd.c. It
introduces NBDClient, which wraps the arguments to nbd_trip in a single
structure, so that we can add a notifier to it. This way, qemu-nbd can
know about disconnections.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd.h')
-rw-r--r-- | nbd.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -76,11 +76,12 @@ int nbd_client(int fd); int nbd_disconnect(int fd); typedef struct NBDExport NBDExport; +typedef struct NBDClient NBDClient; NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, off_t size, uint32_t nbdflags); void nbd_export_close(NBDExport *exp); -int nbd_negotiate(NBDExport *exp, int csock); -int nbd_trip(NBDExport *exp, int csock); +NBDClient *nbd_client_new(NBDExport *exp, int csock, + void (*close)(NBDClient *)); #endif |