aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-04-26 09:36:41 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:14:40 +0200
commitbd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 (patch)
tree82ef0cd9da0812afc7021d5690c14f72e8e13177 /hmp.c
parent62cf396b5d397948c5ac4d04d09596ca14f6c173 (diff)
downloadqemu-bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884.zip
qemu-bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884.tar.gz
qemu-bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884.tar.bz2
sockets: Limit SocketAddressLegacy to external interfaces
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hmp.c b/hmp.c
index c7f161d..524e589 100644
--- a/hmp.c
+++ b/hmp.c
@@ -34,6 +34,7 @@
#include "qapi-visit.h"
#include "qom/object_interfaces.h"
#include "ui/console.h"
+#include "block/nbd.h"
#include "block/qapi.h"
#include "qemu-io.h"
#include "qemu/cutils.h"
@@ -2108,7 +2109,7 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
bool all = qdict_get_try_bool(qdict, "all", false);
Error *local_err = NULL;
BlockInfoList *block_list, *info;
- SocketAddressLegacy *addr;
+ SocketAddress *addr;
if (writable && !all) {
error_setg(&local_err, "-w only valid together with -a");
@@ -2121,8 +2122,8 @@ void hmp_nbd_server_start(Monitor *mon, const QDict *qdict)
goto exit;
}
- qmp_nbd_server_start(addr, false, NULL, &local_err);
- qapi_free_SocketAddressLegacy(addr);
+ nbd_server_start(addr, NULL, &local_err);
+ qapi_free_SocketAddress(addr);
if (local_err != NULL) {
goto exit;
}