saddr = g_new0(SocketAddress, 1);
if (sockpath) {
saddr->type = SOCKET_ADDRESS_KIND_UNIX;
- saddr->u.q_unix = g_new0(UnixSocketAddress, 1);
- saddr->u.q_unix->path = g_strdup(sockpath);
+ saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
+ saddr->u.q_unix.data->path = g_strdup(sockpath);
} else {
+ InetSocketAddress *inet;
saddr->type = SOCKET_ADDRESS_KIND_INET;
- saddr->u.inet = g_new0(InetSocketAddress, 1);
- saddr->u.inet->host = g_strdup(bindto);
+ inet = saddr->u.inet.data = g_new0(InetSocketAddress, 1);
+ inet->host = g_strdup(bindto);
if (port) {
- saddr->u.inet->port = g_strdup(port);
+ inet->port = g_strdup(port);
} else {
- saddr->u.inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
+ inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
}
}
}
options = qemu_opts_to_qdict(opts, NULL);
qemu_opts_reset(&file_opts);
- blk = blk_new_open("hda", NULL, NULL, options, flags, &local_err);
+ blk = blk_new_open(NULL, NULL, options, flags, &local_err);
} else {
if (fmt) {
options = qdict_new();
qdict_put(options, "driver", qstring_from_str(fmt));
}
- blk = blk_new_open("hda", srcpath, NULL, options, flags, &local_err);
+ blk = blk_new_open(srcpath, NULL, options, flags, &local_err);
}
if (!blk) {