mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
nbd: Always call "close_fn" in nbd_client_new
Rename the parameter "close" to "close_fn" to disambiguous with close(2). This unifies error handling paths of NBDClient allocation: nbd_client_new will shutdown the socket and call the "close_fn" callback if negotiation failed, so the caller don't need a different path than the normal close. The returned pointer is never used, make it void in preparation for the next patch. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1452760863-25350-2-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e1dc68155c
commit
ee7d7aabda
4 changed files with 11 additions and 18 deletions
|
@ -98,8 +98,7 @@ NBDExport *nbd_export_find(const char *name);
|
|||
void nbd_export_set_name(NBDExport *exp, const char *name);
|
||||
void nbd_export_close_all(void);
|
||||
|
||||
NBDClient *nbd_client_new(NBDExport *exp, int csock,
|
||||
void (*close)(NBDClient *));
|
||||
void nbd_client_new(NBDExport *exp, int csock, void (*close_fn)(NBDClient *));
|
||||
void nbd_client_get(NBDClient *client);
|
||||
void nbd_client_put(NBDClient *client);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue