mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches: - Add qemu-storage-daemon (still experimental) - rbd: Add support for ceph namespaces - Fix bdrv_reopen() with backing file in different AioContext - qcow2: Fix read-write reopen with persistent dirty bitmaps - qcow2: Fix alloc_cluster_abort() for pre-existing clusters # gpg: Signature made Fri 06 Mar 2020 17:12:31 GMT # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (29 commits) block: bdrv_reopen() with backing file in different AioContext iotests: Refactor blockdev-reopen test for iothreads block/rbd: Add support for ceph namespaces qemu-storage-daemon: Add --monitor option monitor: Add allow_hmp parameter to monitor_init() hmp: Fail gracefully if chardev is already in use qmp: Fail gracefully if chardev is already in use monitor: Create QAPIfied monitor_init() qapi: Create 'pragma' module stubs: Update monitor stubs for qemu-storage-daemon qemu-storage-daemon: Add --chardev option qemu-storage-daemon: Add main loop qemu-storage-daemon: Add --export option blockdev-nbd: Boxed argument type for nbd-server-add qemu-storage-daemon: Add --nbd-server option qemu-storage-daemon: Add --object option qapi: Flatten object-add qemu-storage-daemon: Add --blockdev option block: Move sysemu QMP commands to QAPI block module block: Move common QMP commands to block-core QAPI module ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -128,7 +128,28 @@ GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.c)
|
||||
GENERATED_QAPI_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h
|
||||
GENERATED_QAPI_FILES += qapi/qapi-doc.texi
|
||||
|
||||
# The following list considers only the storage daemon main module. All other
|
||||
# modules are currently shared with the main schema, so we don't actually
|
||||
# generate additional files.
|
||||
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES = storage-daemon/qapi/qapi-commands.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-commands.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.h
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.c
|
||||
GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-doc.texi
|
||||
|
||||
generated-files-y += $(GENERATED_QAPI_FILES)
|
||||
generated-files-y += $(GENERATED_STORAGE_DAEMON_QAPI_FILES)
|
||||
|
||||
generated-files-y += trace/generated-tcg-tracers.h
|
||||
|
||||
@@ -450,6 +471,8 @@ dummy := $(call unnest-vars,, \
|
||||
qga-vss-dll-obj-y \
|
||||
block-obj-y \
|
||||
block-obj-m \
|
||||
storage-daemon-obj-y \
|
||||
storage-daemon-obj-m \
|
||||
crypto-obj-y \
|
||||
qom-obj-y \
|
||||
io-obj-y \
|
||||
@@ -482,6 +505,7 @@ TARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(T
|
||||
SOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES))
|
||||
$(SOFTMMU_ALL_RULES): $(authz-obj-y)
|
||||
$(SOFTMMU_ALL_RULES): $(block-obj-y)
|
||||
$(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y)
|
||||
$(SOFTMMU_ALL_RULES): $(chardev-obj-y)
|
||||
$(SOFTMMU_ALL_RULES): $(crypto-obj-y)
|
||||
$(SOFTMMU_ALL_RULES): $(io-obj-y)
|
||||
@@ -586,6 +610,7 @@ qemu-img.o: qemu-img-cmds.h
|
||||
qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
|
||||
qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
|
||||
qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
|
||||
qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
|
||||
|
||||
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
|
||||
|
||||
@@ -647,6 +672,17 @@ qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
|
||||
"GEN","$(@:%-timestamp=%)")
|
||||
@>$@
|
||||
|
||||
qapi-modules-storage-daemon = \
|
||||
$(SRC_PATH)/storage-daemon/qapi/qapi-schema.json \
|
||||
$(QAPI_MODULES_STORAGE_DAEMON:%=$(SRC_PATH)/qapi/%.json)
|
||||
|
||||
$(GENERATED_STORAGE_DAEMON_QAPI_FILES): storage-daemon/qapi/qapi-gen-timestamp ;
|
||||
storage-daemon/qapi/qapi-gen-timestamp: $(qapi-modules-storage-daemon) $(qapi-py)
|
||||
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
|
||||
-o "storage-daemon/qapi" $<, \
|
||||
"GEN","$(@:%-timestamp=%)")
|
||||
@>$@
|
||||
|
||||
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qapi-commands.h qga-qapi-init-commands.h)
|
||||
$(qga-obj-y): $(QGALIB_GEN)
|
||||
|
||||
@@ -745,6 +781,7 @@ clean: recurse-clean
|
||||
rm -f trace/generated-tracers-dtrace.h*
|
||||
rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
|
||||
rm -f qapi-gen-timestamp
|
||||
rm -f storage-daemon/qapi/qapi-gen-timestamp
|
||||
rm -rf qga/qapi-generated
|
||||
rm -f config-all-devices.mak
|
||||
|
||||
|
||||
@@ -27,6 +27,15 @@ io-obj-y = io/
|
||||
|
||||
endif # CONFIG_SOFTMMU or CONFIG_TOOLS
|
||||
|
||||
#######################################################################
|
||||
# storage-daemon-obj-y is code used by qemu-storage-daemon (these objects are
|
||||
# used for system emulation, too, but specified separately there)
|
||||
|
||||
storage-daemon-obj-y = block/ monitor/ qapi/ qom/ storage-daemon/
|
||||
storage-daemon-obj-y += blockdev.o blockdev-nbd.o iothread.o job-qmp.o
|
||||
storage-daemon-obj-$(CONFIG_WIN32) += os-win32.o
|
||||
storage-daemon-obj-$(CONFIG_POSIX) += os-posix.o
|
||||
|
||||
######################################################################
|
||||
# Target independent part of system emulation. The long term path is to
|
||||
# suppress *all* target specific code in case of system emulation, i.e. a
|
||||
|
||||
@@ -600,7 +600,7 @@ static int bdrv_create_file_fallback(const char *filename, BlockDriver *drv,
|
||||
QemuOpts *opts, Error **errp)
|
||||
{
|
||||
BlockBackend *blk;
|
||||
QDict *options = qdict_new();
|
||||
QDict *options;
|
||||
int64_t size = 0;
|
||||
char *buf = NULL;
|
||||
PreallocMode prealloc;
|
||||
@@ -623,6 +623,7 @@ static int bdrv_create_file_fallback(const char *filename, BlockDriver *drv,
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
options = qdict_new();
|
||||
qdict_put_str(options, "driver", drv->format_name);
|
||||
|
||||
blk = blk_new_open(filename, NULL, options,
|
||||
@@ -3694,6 +3695,15 @@ cleanup_perm:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
QTAILQ_FOREACH_REVERSE(bs_entry, bs_queue, entry) {
|
||||
BlockDriverState *bs = bs_entry->state.bs;
|
||||
|
||||
if (bs->drv->bdrv_reopen_commit_post)
|
||||
bs->drv->bdrv_reopen_commit_post(&bs_entry->state);
|
||||
}
|
||||
}
|
||||
cleanup:
|
||||
QTAILQ_FOREACH_SAFE(bs_entry, bs_queue, entry, next) {
|
||||
if (ret) {
|
||||
@@ -3777,6 +3787,29 @@ static void bdrv_reopen_perm(BlockReopenQueue *q, BlockDriverState *bs,
|
||||
*shared = cumulative_shared_perms;
|
||||
}
|
||||
|
||||
static bool bdrv_reopen_can_attach(BlockDriverState *parent,
|
||||
BdrvChild *child,
|
||||
BlockDriverState *new_child,
|
||||
Error **errp)
|
||||
{
|
||||
AioContext *parent_ctx = bdrv_get_aio_context(parent);
|
||||
AioContext *child_ctx = bdrv_get_aio_context(new_child);
|
||||
GSList *ignore;
|
||||
bool ret;
|
||||
|
||||
ignore = g_slist_prepend(NULL, child);
|
||||
ret = bdrv_can_set_aio_context(new_child, parent_ctx, &ignore, NULL);
|
||||
g_slist_free(ignore);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ignore = g_slist_prepend(NULL, child);
|
||||
ret = bdrv_can_set_aio_context(parent, child_ctx, &ignore, errp);
|
||||
g_slist_free(ignore);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Take a BDRVReopenState and check if the value of 'backing' in the
|
||||
* reopen_state->options QDict is valid or not.
|
||||
@@ -3828,14 +3861,11 @@ static int bdrv_reopen_parse_backing(BDRVReopenState *reopen_state,
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: before removing the x- prefix from x-blockdev-reopen we
|
||||
* should move the new backing file into the right AioContext
|
||||
* instead of returning an error.
|
||||
* Check AioContext compatibility so that the bdrv_set_backing_hd() call in
|
||||
* bdrv_reopen_commit() won't fail.
|
||||
*/
|
||||
if (new_backing_bs) {
|
||||
if (bdrv_get_aio_context(new_backing_bs) != bdrv_get_aio_context(bs)) {
|
||||
error_setg(errp, "Cannot use a new backing file "
|
||||
"with a different AioContext");
|
||||
if (!bdrv_reopen_can_attach(bs, bs->backing, new_backing_bs, errp)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -46,7 +46,9 @@ block-obj-y += aio_task.o
|
||||
block-obj-y += backup-top.o
|
||||
block-obj-y += filter-compress.o
|
||||
|
||||
common-obj-y += stream.o
|
||||
block-obj-y += stream.o
|
||||
|
||||
common-obj-y += qapi-sysemu.o
|
||||
|
||||
nfs.o-libs := $(LIBNFS_LIBS)
|
||||
iscsi.o-cflags := $(LIBISCSI_CFLAGS)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1026,7 +1026,7 @@ err:
|
||||
void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m)
|
||||
{
|
||||
BDRVQcow2State *s = bs->opaque;
|
||||
if (!has_data_file(bs)) {
|
||||
if (!has_data_file(bs) && !m->keep_old_clusters) {
|
||||
qcow2_free_clusters(bs, m->alloc_offset,
|
||||
m->nb_clusters << s->cluster_bits,
|
||||
QCOW2_DISCARD_NEVER);
|
||||
|
||||
+6
-1
@@ -1884,6 +1884,11 @@ fail:
|
||||
static void qcow2_reopen_commit(BDRVReopenState *state)
|
||||
{
|
||||
qcow2_update_options_commit(state->bs, state->opaque);
|
||||
g_free(state->opaque);
|
||||
}
|
||||
|
||||
static void qcow2_reopen_commit_post(BDRVReopenState *state)
|
||||
{
|
||||
if (state->flags & BDRV_O_RDWR) {
|
||||
Error *local_err = NULL;
|
||||
|
||||
@@ -1898,7 +1903,6 @@ static void qcow2_reopen_commit(BDRVReopenState *state)
|
||||
bdrv_get_node_name(state->bs));
|
||||
}
|
||||
}
|
||||
g_free(state->opaque);
|
||||
}
|
||||
|
||||
static void qcow2_reopen_abort(BDRVReopenState *state)
|
||||
@@ -5534,6 +5538,7 @@ BlockDriver bdrv_qcow2 = {
|
||||
.bdrv_close = qcow2_close,
|
||||
.bdrv_reopen_prepare = qcow2_reopen_prepare,
|
||||
.bdrv_reopen_commit = qcow2_reopen_commit,
|
||||
.bdrv_reopen_commit_post = qcow2_reopen_commit_post,
|
||||
.bdrv_reopen_abort = qcow2_reopen_abort,
|
||||
.bdrv_join_options = qcow2_join_options,
|
||||
.bdrv_child_perm = bdrv_format_default_perms,
|
||||
|
||||
+32
-14
@@ -104,6 +104,7 @@ typedef struct BDRVRBDState {
|
||||
rbd_image_t image;
|
||||
char *image_name;
|
||||
char *snap;
|
||||
char *namespace;
|
||||
uint64_t image_size;
|
||||
} BDRVRBDState;
|
||||
|
||||
@@ -152,7 +153,7 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
|
||||
const char *start;
|
||||
char *p, *buf;
|
||||
QList *keypairs = NULL;
|
||||
char *found_str;
|
||||
char *found_str, *image_name;
|
||||
|
||||
if (!strstart(filename, "rbd:", &start)) {
|
||||
error_setg(errp, "File name must start with 'rbd:'");
|
||||
@@ -171,18 +172,24 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
|
||||
qdict_put_str(options, "pool", found_str);
|
||||
|
||||
if (strchr(p, '@')) {
|
||||
found_str = qemu_rbd_next_tok(p, '@', &p);
|
||||
qemu_rbd_unescape(found_str);
|
||||
qdict_put_str(options, "image", found_str);
|
||||
image_name = qemu_rbd_next_tok(p, '@', &p);
|
||||
|
||||
found_str = qemu_rbd_next_tok(p, ':', &p);
|
||||
qemu_rbd_unescape(found_str);
|
||||
qdict_put_str(options, "snapshot", found_str);
|
||||
} else {
|
||||
found_str = qemu_rbd_next_tok(p, ':', &p);
|
||||
qemu_rbd_unescape(found_str);
|
||||
qdict_put_str(options, "image", found_str);
|
||||
image_name = qemu_rbd_next_tok(p, ':', &p);
|
||||
}
|
||||
/* Check for namespace in the image_name */
|
||||
if (strchr(image_name, '/')) {
|
||||
found_str = qemu_rbd_next_tok(image_name, '/', &image_name);
|
||||
qemu_rbd_unescape(found_str);
|
||||
qdict_put_str(options, "namespace", found_str);
|
||||
} else {
|
||||
qdict_put_str(options, "namespace", "");
|
||||
}
|
||||
qemu_rbd_unescape(image_name);
|
||||
qdict_put_str(options, "image", image_name);
|
||||
if (!p) {
|
||||
goto done;
|
||||
}
|
||||
@@ -343,6 +350,11 @@ static QemuOptsList runtime_opts = {
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Rados pool name",
|
||||
},
|
||||
{
|
||||
.name = "namespace",
|
||||
.type = QEMU_OPT_STRING,
|
||||
.help = "Rados namespace name in the pool",
|
||||
},
|
||||
{
|
||||
.name = "image",
|
||||
.type = QEMU_OPT_STRING,
|
||||
@@ -467,13 +479,14 @@ static int coroutine_fn qemu_rbd_co_create_opts(const char *filename,
|
||||
* schema, but when they come from -drive, they're all QString.
|
||||
*/
|
||||
loc = rbd_opts->location;
|
||||
loc->pool = g_strdup(qdict_get_try_str(options, "pool"));
|
||||
loc->conf = g_strdup(qdict_get_try_str(options, "conf"));
|
||||
loc->has_conf = !!loc->conf;
|
||||
loc->user = g_strdup(qdict_get_try_str(options, "user"));
|
||||
loc->has_user = !!loc->user;
|
||||
loc->image = g_strdup(qdict_get_try_str(options, "image"));
|
||||
keypairs = qdict_get_try_str(options, "=keyvalue-pairs");
|
||||
loc->pool = g_strdup(qdict_get_try_str(options, "pool"));
|
||||
loc->conf = g_strdup(qdict_get_try_str(options, "conf"));
|
||||
loc->has_conf = !!loc->conf;
|
||||
loc->user = g_strdup(qdict_get_try_str(options, "user"));
|
||||
loc->has_user = !!loc->user;
|
||||
loc->q_namespace = g_strdup(qdict_get_try_str(options, "namespace"));
|
||||
loc->image = g_strdup(qdict_get_try_str(options, "image"));
|
||||
keypairs = qdict_get_try_str(options, "=keyvalue-pairs");
|
||||
|
||||
ret = qemu_rbd_do_create(create_options, keypairs, password_secret, errp);
|
||||
if (ret < 0) {
|
||||
@@ -648,6 +661,11 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
|
||||
error_setg_errno(errp, -r, "error opening pool %s", opts->pool);
|
||||
goto failed_shutdown;
|
||||
}
|
||||
/*
|
||||
* Set the namespace after opening the io context on the pool,
|
||||
* if nspace == NULL or if nspace == "", it is just as we did nothing
|
||||
*/
|
||||
rados_ioctx_set_namespace(*io_ctx, opts->q_namespace);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
+21
-19
@@ -132,6 +132,11 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds,
|
||||
nbd_server = NULL;
|
||||
}
|
||||
|
||||
void nbd_server_start_options(NbdServerOptions *arg, Error **errp)
|
||||
{
|
||||
nbd_server_start(arg->addr, arg->tls_creds, arg->tls_authz, errp);
|
||||
}
|
||||
|
||||
void qmp_nbd_server_start(SocketAddressLegacy *addr,
|
||||
bool has_tls_creds, const char *tls_creds,
|
||||
bool has_tls_authz, const char *tls_authz,
|
||||
@@ -143,10 +148,7 @@ void qmp_nbd_server_start(SocketAddressLegacy *addr,
|
||||
qapi_free_SocketAddress(addr_flat);
|
||||
}
|
||||
|
||||
void qmp_nbd_server_add(const char *device, bool has_name, const char *name,
|
||||
bool has_description, const char *description,
|
||||
bool has_writable, bool writable,
|
||||
bool has_bitmap, const char *bitmap, Error **errp)
|
||||
void qmp_nbd_server_add(BlockExportNbd *arg, Error **errp)
|
||||
{
|
||||
BlockDriverState *bs = NULL;
|
||||
BlockBackend *on_eject_blk;
|
||||
@@ -159,28 +161,28 @@ void qmp_nbd_server_add(const char *device, bool has_name, const char *name,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!has_name) {
|
||||
name = device;
|
||||
if (!arg->has_name) {
|
||||
arg->name = arg->device;
|
||||
}
|
||||
|
||||
if (strlen(name) > NBD_MAX_STRING_SIZE) {
|
||||
error_setg(errp, "export name '%s' too long", name);
|
||||
if (strlen(arg->name) > NBD_MAX_STRING_SIZE) {
|
||||
error_setg(errp, "export name '%s' too long", arg->name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (has_description && strlen(description) > NBD_MAX_STRING_SIZE) {
|
||||
error_setg(errp, "description '%s' too long", description);
|
||||
if (arg->description && strlen(arg->description) > NBD_MAX_STRING_SIZE) {
|
||||
error_setg(errp, "description '%s' too long", arg->description);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nbd_export_find(name)) {
|
||||
error_setg(errp, "NBD server already has export named '%s'", name);
|
||||
if (nbd_export_find(arg->name)) {
|
||||
error_setg(errp, "NBD server already has export named '%s'", arg->name);
|
||||
return;
|
||||
}
|
||||
|
||||
on_eject_blk = blk_by_name(device);
|
||||
on_eject_blk = blk_by_name(arg->device);
|
||||
|
||||
bs = bdrv_lookup_bs(device, device, errp);
|
||||
bs = bdrv_lookup_bs(arg->device, arg->device, errp);
|
||||
if (!bs) {
|
||||
return;
|
||||
}
|
||||
@@ -194,15 +196,15 @@ void qmp_nbd_server_add(const char *device, bool has_name, const char *name,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!has_writable) {
|
||||
writable = false;
|
||||
if (!arg->has_writable) {
|
||||
arg->writable = false;
|
||||
}
|
||||
if (bdrv_is_read_only(bs)) {
|
||||
writable = false;
|
||||
arg->writable = false;
|
||||
}
|
||||
|
||||
exp = nbd_export_new(bs, 0, len, name, description, bitmap,
|
||||
!writable, !writable,
|
||||
exp = nbd_export_new(bs, 0, len, arg->name, arg->description, arg->bitmap,
|
||||
!arg->writable, !arg->writable,
|
||||
NULL, false, on_eject_blk, errp);
|
||||
if (!exp) {
|
||||
goto out;
|
||||
|
||||
-559
File diff suppressed because it is too large
Load Diff
+7
-1
@@ -737,7 +737,13 @@ Chardev *qemu_chr_new_noreplay(const char *label, const char *filename,
|
||||
|
||||
if (qemu_opt_get_bool(opts, "mux", 0)) {
|
||||
assert(permit_mux_mon);
|
||||
monitor_init_hmp(chr, true);
|
||||
monitor_init_hmp(chr, true, &err);
|
||||
if (err) {
|
||||
error_report_err(err);
|
||||
object_unparent(OBJECT(chr));
|
||||
chr = NULL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -6316,7 +6316,7 @@ tools=""
|
||||
if test "$want_tools" = "yes" ; then
|
||||
tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) qemu-edid\$(EXESUF) $tools"
|
||||
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
|
||||
tools="qemu-nbd\$(EXESUF) $tools"
|
||||
tools="qemu-nbd\$(EXESUF) qemu-storage-daemon\$(EXESUF) $tools"
|
||||
fi
|
||||
if [ "$ivshmem" = "yes" ]; then
|
||||
tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
|
||||
|
||||
@@ -190,6 +190,11 @@ Use ``migrate-set-parameters`` instead.
|
||||
|
||||
Use ``migrate-set-parameters`` and ``query-migrate-parameters`` instead.
|
||||
|
||||
``object-add`` option ``props`` (since 5.0)
|
||||
'''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Specify the properties for the object as top-level arguments instead.
|
||||
|
||||
``query-block`` result field ``dirty-bitmaps[i].status`` (since 4.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
|
||||
@@ -3367,7 +3367,7 @@ int gdbserver_start(const char *device)
|
||||
/* Initialize a monitor terminal for gdb */
|
||||
mon_chr = qemu_chardev_new(NULL, TYPE_CHARDEV_GDB,
|
||||
NULL, NULL, &error_abort);
|
||||
monitor_init_hmp(mon_chr, false);
|
||||
monitor_init_hmp(mon_chr, false, &error_abort);
|
||||
} else {
|
||||
qemu_chr_fe_deinit(&s->chr, true);
|
||||
mon_chr = s->mon_chr;
|
||||
|
||||
+10
-1
@@ -18,6 +18,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qmp/qdict.h"
|
||||
#include "qapi/qmp/qstring.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "hw/xen/xen_common.h"
|
||||
#include "hw/block/xen_blkif.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
@@ -858,10 +859,18 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
|
||||
{
|
||||
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
|
||||
Error *local_err = NULL;
|
||||
QDict *opts;
|
||||
QObject *ret_data;
|
||||
|
||||
iothread->id = g_strdup(id);
|
||||
|
||||
qmp_object_add(TYPE_IOTHREAD, id, false, NULL, &local_err);
|
||||
opts = qdict_new();
|
||||
qdict_put_str(opts, "qom-type", TYPE_IOTHREAD);
|
||||
qdict_put_str(opts, "id", id);
|
||||
qmp_object_add(opts, &ret_data, &local_err);
|
||||
qobject_unref(opts);
|
||||
qobject_unref(ret_data);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ struct BlockDriver {
|
||||
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,
|
||||
BlockReopenQueue *queue, Error **errp);
|
||||
void (*bdrv_reopen_commit)(BDRVReopenState *reopen_state);
|
||||
void (*bdrv_reopen_commit_post)(BDRVReopenState *reopen_state);
|
||||
void (*bdrv_reopen_abort)(BDRVReopenState *reopen_state);
|
||||
void (*bdrv_join_options)(QDict *options, QDict *old_options);
|
||||
|
||||
|
||||
@@ -353,6 +353,7 @@ void nbd_client_put(NBDClient *client);
|
||||
|
||||
void nbd_server_start(SocketAddress *addr, const char *tls_creds,
|
||||
const char *tls_authz, Error **errp);
|
||||
void nbd_server_start_options(NbdServerOptions *arg, Error **errp);
|
||||
|
||||
/* nbd_read
|
||||
* Reads @size bytes from @ioc. Returns 0 on success.
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
extern __thread Monitor *cur_mon;
|
||||
typedef struct MonitorHMP MonitorHMP;
|
||||
typedef struct MonitorOptions MonitorOptions;
|
||||
|
||||
#define QMP_REQ_QUEUE_LEN_MAX 8
|
||||
|
||||
@@ -16,8 +17,9 @@ bool monitor_cur_is_qmp(void);
|
||||
|
||||
void monitor_init_globals(void);
|
||||
void monitor_init_globals_core(void);
|
||||
void monitor_init_qmp(Chardev *chr, bool pretty);
|
||||
void monitor_init_hmp(Chardev *chr, bool use_readline);
|
||||
void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp);
|
||||
void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp);
|
||||
int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp);
|
||||
int monitor_init_opts(QemuOpts *opts, Error **errp);
|
||||
void monitor_cleanup(void);
|
||||
|
||||
|
||||
@@ -162,4 +162,11 @@ void user_creatable_del(const char *id, Error **errp);
|
||||
*/
|
||||
void user_creatable_cleanup(void);
|
||||
|
||||
/**
|
||||
* qmp_object_add:
|
||||
*
|
||||
* QMP command handler for object-add. See the QAPI schema for documentation.
|
||||
*/
|
||||
void qmp_object_add(QDict *qdict, QObject **ret_data, Error **errp);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,8 @@ enum {
|
||||
QEMU_ARCH_NIOS2 = (1 << 17),
|
||||
QEMU_ARCH_HPPA = (1 << 18),
|
||||
QEMU_ARCH_RISCV = (1 << 19),
|
||||
|
||||
QEMU_ARCH_NONE = (1 << 31),
|
||||
};
|
||||
|
||||
extern const uint32_t arch_type;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user