mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
nbd: Create struct for tracking export info
The NBD Protocol is introducing some additional information about exports, such as minimum request size and alignment, as well as an advertised maximum request size. It will be easier to feed this information back to the block layer if we gather all the information into a struct, rather than adding yet more pointer parameters during negotiation. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20170707203049.534-2-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1221a47467
commit
004a89fce9
6 changed files with 47 additions and 45 deletions
|
@ -123,13 +123,20 @@ enum {
|
|||
* aren't overflowing some other buffer. */
|
||||
#define NBD_MAX_NAME_SIZE 256
|
||||
|
||||
/* Details collected by NBD_OPT_EXPORT_NAME and NBD_OPT_GO */
|
||||
struct NBDExportInfo {
|
||||
uint64_t size;
|
||||
uint16_t flags;
|
||||
};
|
||||
typedef struct NBDExportInfo NBDExportInfo;
|
||||
|
||||
ssize_t nbd_rwv(QIOChannel *ioc, struct iovec *iov, size_t niov, size_t length,
|
||||
bool do_read, Error **errp);
|
||||
int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags,
|
||||
int nbd_receive_negotiate(QIOChannel *ioc, const char *name,
|
||||
QCryptoTLSCreds *tlscreds, const char *hostname,
|
||||
QIOChannel **outioc,
|
||||
off_t *size, Error **errp);
|
||||
int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size,
|
||||
QIOChannel **outioc, NBDExportInfo *info,
|
||||
Error **errp);
|
||||
int nbd_init(int fd, QIOChannelSocket *sioc, NBDExportInfo *info,
|
||||
Error **errp);
|
||||
ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request);
|
||||
ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue