mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Block patches
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJTB8hAAAoJEH8JsnLIjy/WQdgP/jEu5baA1/qKanDsS9l+81u1 /sIYSWpHDEJ0uavqTMBeyMOwkzel7SZRusIwA/d5pMqxbY6/86YJumTTozFWvtqc IABqHtRKCxjcLdZRPbkuNAOiw6p76vSZa543o2t8OAhK2DIFy530wWXeoQEYvuJX 4pOh0lTradOrF1z6uW4ozgQ1efPppwh/iqwfWWNJVTgfnWxJk6qQaATEgkuSdsUN Wp78UzOxLGO6JKJB6kP3LfNL0ANTYHpfH2/wkE6cW6TkSUduOm6hIBY+tb9khqYt INOKxqFADK6EOgjvJBsZuZUtOnHK5oM921LepN/mOPAs6gKcn2j+FfqJrl3I1/5M AXM3M0FPuijEKPGWw7pCLt7j84KJkD9a/rsKO37yRzw17fOma2Rpr4TrX43BF+5t CGqQ7PzDJ6Fng4EXjyNDzviwXIK8xmG1tfn92tq/BUd6OuM9MCyzEGvEiGOMBoXv w4iOV7UC+1P3TjnTBhMlBVGywSfdOJoHr9k4lXGNp0h8fPhM9rfruI3BFysxaas6 GmKbd7yvKwXOTptd3I9SB8BzVUL3CcD3FK24+cWKAl8GgyiDIWRlvBYyMp3p8Z8f NDzcxYP6aRGsoddvpIWr3Tz89hw5wTW5u3RmNgxJUguz6HYKFbl30dpGT+96q2BN YIAANTdPxn7BP6r3glQH =ZaDG -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging Block patches # gpg: Signature made Fri 21 Feb 2014 21:42:24 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (54 commits) iotests: Mixed quorum child device specifications quorum: Simplify quorum_open() quorum: Add unit test. quorum: Add quorum_open() and quorum_close(). quorum: Implement recursive .bdrv_recurse_is_first_non_filter in quorum. quorum: Add quorum_co_flush(). quorum: Add quorum_invalidate_cache(). quorum: Add quorum_getlength(). quorum: Add quorum mechanism. quorum: Add quorum_aio_readv. blkverify: Extract qemu_iovec_clone() and qemu_iovec_compare() from blkverify. quorum: Add quorum_aio_writev and its dependencies. quorum: Create BDRVQuorumState and BlkDriver and do init. quorum: Create quorum.c, add QuorumChildRequest and QuorumAIOCB. check-qdict: Test termination of qdict_array_split() check-qdict: Adjust test for qdict_array_split() qdict: Extract non-QDicts in qdict_array_split() qemu-config: Sections must consist of keys qemu-iotests: Check qemu-img command line parsing qemu-img: Allow -o help with incomplete argument list ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
e7a1d6c52a
50 changed files with 2821 additions and 636 deletions
54
qemu-nbd.c
54
qemu-nbd.c
|
@ -20,6 +20,8 @@
|
|||
#include "block/block.h"
|
||||
#include "block/nbd.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "block/snapshot.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
@ -201,6 +203,56 @@ static void termsig_handler(int signum)
|
|||
qemu_notify_event();
|
||||
}
|
||||
|
||||
static void combine_addr(char *buf, size_t len, const char* address,
|
||||
uint16_t port)
|
||||
{
|
||||
/* If the address-part contains a colon, it's an IPv6 IP so needs [] */
|
||||
if (strstr(address, ":")) {
|
||||
snprintf(buf, len, "[%s]:%u", address, port);
|
||||
} else {
|
||||
snprintf(buf, len, "%s:%u", address, port);
|
||||
}
|
||||
}
|
||||
|
||||
static int tcp_socket_incoming(const char *address, uint16_t port)
|
||||
{
|
||||
char address_and_port[128];
|
||||
Error *local_err = NULL;
|
||||
|
||||
combine_addr(address_and_port, 128, address, port);
|
||||
int fd = inet_listen(address_and_port, NULL, 0, SOCK_STREAM, 0, &local_err);
|
||||
|
||||
if (local_err != NULL) {
|
||||
qerror_report_err(local_err);
|
||||
error_free(local_err);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
static int unix_socket_incoming(const char *path)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
int fd = unix_listen(path, NULL, 0, &local_err);
|
||||
|
||||
if (local_err != NULL) {
|
||||
qerror_report_err(local_err);
|
||||
error_free(local_err);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
static int unix_socket_outgoing(const char *path)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
int fd = unix_connect(path, &local_err);
|
||||
|
||||
if (local_err != NULL) {
|
||||
qerror_report_err(local_err);
|
||||
error_free(local_err);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void *show_parts(void *arg)
|
||||
{
|
||||
char *device = arg;
|
||||
|
@ -598,7 +650,7 @@ int main(int argc, char **argv)
|
|||
|
||||
bs = bdrv_new("hda");
|
||||
srcpath = argv[optind];
|
||||
ret = bdrv_open(bs, srcpath, NULL, flags, drv, &local_err);
|
||||
ret = bdrv_open(&bs, srcpath, NULL, NULL, flags, drv, &local_err);
|
||||
if (ret < 0) {
|
||||
errno = -ret;
|
||||
err(EXIT_FAILURE, "Failed to bdrv_open '%s': %s", argv[optind],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue