diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-02-10 18:41:04 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-02-16 17:13:57 +0100 |
commit | 1c778ef729dd50d4b06780af1f44b69c63c532f8 (patch) | |
tree | 72727b34634cbed27f46f2dc32d5eb7c0444a6fd /blockdev-nbd.c | |
parent | ae39827802bc2aa781137d2f41bab0b60acd4e63 (diff) |
nbd: convert to using I/O channels for actual socket I/O
Now that all callers are converted to use I/O channels for
initial connection setup, it is possible to switch the core
NBD protocol handling core over to use QIOChannel APIs for
actual sockets I/O.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1455129674-17255-7-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'blockdev-nbd.c')
-rw-r--r-- | blockdev-nbd.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/blockdev-nbd.c b/blockdev-nbd.c index 9baf88316c..2148753fff 100644 --- a/blockdev-nbd.c +++ b/blockdev-nbd.c @@ -27,7 +27,6 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, gpointer opaque) { QIOChannelSocket *cioc; - int fd; cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc), NULL); @@ -35,10 +34,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, return TRUE; } - fd = dup(cioc->fd); - if (fd >= 0) { - nbd_client_new(NULL, fd, nbd_client_put); - } + nbd_client_new(NULL, cioc, nbd_client_put); object_unref(OBJECT(cioc)); return TRUE; } |