diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-12-01 22:23:43 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-12-16 10:12:20 +0100 |
commit | e2bc625f9bbb3a5d3ef2cb0f14dd52b517b92ffd (patch) | |
tree | 724caddcd255f32333e988d2b95e25e27a43d211 /block/nbd-client.c | |
parent | e53a18e488c657bbc6f218ae60de8e813a912667 (diff) | |
download | qemu-e2bc625f9bbb3a5d3ef2cb0f14dd52b517b92ffd.zip qemu-e2bc625f9bbb3a5d3ef2cb0f14dd52b517b92ffd.tar.gz qemu-e2bc625f9bbb3a5d3ef2cb0f14dd52b517b92ffd.tar.bz2 |
nbd: pass export name as init argument
There is no need to keep the export name around, and it seems a better
fit as an argument in the init() call.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'block/nbd-client.c')
-rw-r--r-- | block/nbd-client.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/block/nbd-client.c b/block/nbd-client.c index 693110d..3dfae1d 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -338,18 +338,17 @@ static void nbd_teardown_connection(NbdClientSession *client) void nbd_client_session_close(NbdClientSession *client) { nbd_teardown_connection(client); - g_free(client->export_name); - client->export_name = NULL; } -int nbd_client_session_init(NbdClientSession *client, - BlockDriverState *bs, int sock) +int nbd_client_session_init(NbdClientSession *client, BlockDriverState *bs, + int sock, const char *export) { int ret; /* NBD handshake */ + logout("session init %s\n", export); qemu_set_block(sock); - ret = nbd_receive_negotiate(sock, client->export_name, + ret = nbd_receive_negotiate(sock, export, &client->nbdflags, &client->size, &client->blocksize); if (ret < 0) { |