nbd: Drop BDS backpointer
authorMax Reitz <mreitz@redhat.com>
Fri, 6 Feb 2015 21:06:16 +0000 (16:06 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Feb 2015 14:36:03 +0000 (14:36 +0000)
commitf53a829bb9ef14be800556cbc02d8b20fc1050a7
tree6b18946eed64c59e72baebabaabe59b98faef0a2
parentcd2d5541271f1934345d8ca42f5fafff1744eee7
nbd: Drop BDS backpointer

Before this patch, the "opaque" pointer in an NBD BDS points to a
BDRVNBDState, which contains an NbdClientSession object, which in turn
contains a pointer to the BDS. This pointer may become invalid due to
bdrv_swap(), so drop it, and instead pass the BDS directly to the
nbd-client.c functions which then retrieve the NbdClientSession object
from there.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1423256778-3340-2-git-send-email-mreitz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/nbd-client.c
block/nbd-client.h
block/nbd.c
include/block/nbd.h
nbd.c