mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
qemu-nbd: Pass max connections to blockdev layer
The next patch wants to adjust whether the NBD server code advertises MULTI_CONN based on whether it is known if the server limits to exactly one client. For a server started by QMP, this information is obtained through nbd_server_start (which can support more than one export); but for qemu-nbd (which supports exactly one export), it is controlled only by the command-line option -e/--shared. Since we already have a hook function used by qemu-nbd, it's easiest to just alter its signature to fit our needs. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20220512004924.417153-2-eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
46609b90d9
commit
a5fced4021
3 changed files with 6 additions and 6 deletions
|
@ -30,18 +30,18 @@ typedef struct NBDServerData {
|
|||
} NBDServerData;
|
||||
|
||||
static NBDServerData *nbd_server;
|
||||
static bool is_qemu_nbd;
|
||||
static int qemu_nbd_connections = -1; /* Non-negative if this is qemu-nbd */
|
||||
|
||||
static void nbd_update_server_watch(NBDServerData *s);
|
||||
|
||||
void nbd_server_is_qemu_nbd(bool value)
|
||||
void nbd_server_is_qemu_nbd(int max_connections)
|
||||
{
|
||||
is_qemu_nbd = value;
|
||||
qemu_nbd_connections = max_connections;
|
||||
}
|
||||
|
||||
bool nbd_server_is_running(void)
|
||||
{
|
||||
return nbd_server || is_qemu_nbd;
|
||||
return nbd_server || qemu_nbd_connections >= 0;
|
||||
}
|
||||
|
||||
static void nbd_blockdev_client_closed(NBDClient *client, bool ignored)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue