mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Kevin Wolf (12) and Peter Lieven (2) # Via Kevin Wolf * kwolf/for-anthony: nbd: Check against invalid option combinations nbd: Use default port if only host is specified block: Allow omitting the file name when using driver-specific options block: Make find_image_format safe with NULL filename block: Rename variable to avoid shadowing block: Introduce .bdrv_parse_filename callback nbd: Accept -drive options for the network connection nbd: Remove unused functions nbd: Keep hostname and port separate qemu-socket: Make socket_optslist public block: Pass bdrv_file_open() options to block drivers block: Add options QDict to bdrv_file_open() prototypes block: complete all IOs before resizing a device Revert "block: complete all IOs before .bdrv_truncate"
This commit is contained in:
commit
3f08ffb4a4
24 changed files with 310 additions and 115 deletions
|
@ -135,7 +135,8 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top);
|
|||
void bdrv_delete(BlockDriverState *bs);
|
||||
int bdrv_parse_cache_flags(const char *mode, int *flags);
|
||||
int bdrv_parse_discard_flags(const char *mode, int *flags);
|
||||
int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags);
|
||||
int bdrv_file_open(BlockDriverState **pbs, const char *filename,
|
||||
QDict *options, int flags);
|
||||
int bdrv_open_backing_file(BlockDriverState *bs);
|
||||
int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options,
|
||||
int flags, BlockDriver *drv);
|
||||
|
|
|
@ -76,6 +76,10 @@ struct BlockDriver {
|
|||
int (*bdrv_probe)(const uint8_t *buf, int buf_size, const char *filename);
|
||||
int (*bdrv_probe_device)(const char *filename);
|
||||
|
||||
/* Any driver implementing this callback is expected to be able to handle
|
||||
* NULL file names in its .bdrv_open() implementation */
|
||||
void (*bdrv_parse_filename)(const char *filename, QDict *options, Error **errp);
|
||||
|
||||
/* For handling image reopen for split or non-split files */
|
||||
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,
|
||||
BlockReopenQueue *queue, Error **errp);
|
||||
|
@ -83,7 +87,8 @@ struct BlockDriver {
|
|||
void (*bdrv_reopen_abort)(BDRVReopenState *reopen_state);
|
||||
|
||||
int (*bdrv_open)(BlockDriverState *bs, QDict *options, int flags);
|
||||
int (*bdrv_file_open)(BlockDriverState *bs, const char *filename, int flags);
|
||||
int (*bdrv_file_open)(BlockDriverState *bs, const char *filename,
|
||||
QDict *options, int flags);
|
||||
int (*bdrv_read)(BlockDriverState *bs, int64_t sector_num,
|
||||
uint8_t *buf, int nb_sectors);
|
||||
int (*bdrv_write)(BlockDriverState *bs, int64_t sector_num,
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/option.h"
|
||||
|
||||
struct nbd_request {
|
||||
uint32_t magic;
|
||||
|
@ -60,10 +61,9 @@ enum {
|
|||
#define NBD_BUFFER_SIZE (1024*1024)
|
||||
|
||||
ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read);
|
||||
int tcp_socket_outgoing(const char *address, uint16_t port);
|
||||
int tcp_socket_incoming(const char *address, uint16_t port);
|
||||
int tcp_socket_outgoing_spec(const char *address_and_port);
|
||||
int tcp_socket_incoming_spec(const char *address_and_port);
|
||||
int tcp_socket_outgoing_opts(QemuOpts *opts);
|
||||
int unix_socket_outgoing(const char *path);
|
||||
int unix_socket_incoming(const char *path);
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ int inet_aton(const char *cp, struct in_addr *ia);
|
|||
#include "qapi/error.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
|
||||
extern QemuOptsList socket_optslist;
|
||||
|
||||
/* misc helpers */
|
||||
int qemu_socket(int domain, int type, int protocol);
|
||||
int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||
|
@ -45,6 +47,7 @@ int recv_all(int fd, void *buf, int len1, bool single_read);
|
|||
*/
|
||||
typedef void NonBlockingConnectHandler(int fd, void *opaque);
|
||||
|
||||
InetSocketAddress *inet_parse(const char *str, Error **errp);
|
||||
int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp);
|
||||
int inet_listen(const char *str, char *ostr, int olen,
|
||||
int socktype, int port_offset, Error **errp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue