fda7fbcd8d
- kvm-i386-Resolve-CPU-models-to-v1-by-default.patch [bz#1779078 bz#1787291 bz#1779078 bz#1779078] - kvm-iotests-Support-job-complete-in-run_job.patch [bz#1781637] - kvm-iotests-Create-VM.blockdev_create.patch [bz#1781637] - kvm-block-Activate-recursively-even-for-already-active-n.patch [bz#1781637] - kvm-hmp-Allow-using-qdev-ID-for-qemu-io-command.patch [bz#1781637] - kvm-iotests-Test-external-snapshot-with-VM-state.patch [bz#1781637] - kvm-iotests.py-Let-wait_migration-wait-even-more.patch [bz#1781637] - kvm-blockdev-fix-coding-style-issues-in-drive_backup_pre.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-blockdev-unify-qmp_drive_backup-and-drive-backup-tra.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-blockdev-unify-qmp_blockdev_backup-and-blockdev-back.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-blockdev-honor-bdrv_try_set_aio_context-context-requ.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-backup-top-Begin-drain-earlier.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-block-backup-top-Don-t-acquire-context-while-droppin.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-blockdev-Acquire-AioContext-on-dirty-bitmap-function.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-blockdev-Return-bs-to-the-proper-context-on-snapshot.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-iotests-Test-handling-of-AioContexts-with-some-block.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] - kvm-target-arm-monitor-query-cpu-model-expansion-crashed.patch [bz#1801320] - kvm-docs-arm-cpu-features-Make-kvm-no-adjvtime-comment-c.patch [bz#1801320] - Resolves: bz#1745606 (Qemu hang when do incremental live backup in transaction mode without bitmap) - Resolves: bz#1746217 (Src qemu hang when do storage vm migration during guest installation) - Resolves: bz#1773517 (Src qemu hang when do storage vm migration with dataplane enable) - Resolves: bz#1779036 (Qemu coredump when do snapshot in transaction mode with one snapshot path not exist) - Resolves: bz#1779078 (RHVH 4.4: Failed to run VM on 4.3/4.4 engine (Exit message: the CPU is incompatible with host CPU: Host CPU does not provide required features: hle, rtm)) - Resolves: bz#1781637 (qemu crashed when do mem and disk snapshot) - Resolves: bz#1782111 (Qemu hang when do full backup on multi-disks with one job's 'job-id' missed in transaction mode(data plane enable)) - Resolves: bz#1782175 (Qemu core dump when add persistent bitmap(data plane enable)) - Resolves: bz#1783965 (Qemu core dump when do backup with sync: bitmap and no bitmap provided) - Resolves: bz#1787291 (RHVH 4.4: Failed to run VM on 4.3/4.4 engine (Exit message: the CPU is incompatible with host CPU: Host CPU does not provide required features: hle, rtm) [rhel-8.1.0.z]) - Resolves: bz#1801320 (aarch64: backport query-cpu-model-expansion and adjvtime document fixes)
101 lines
3.5 KiB
Diff
101 lines
3.5 KiB
Diff
From cebc614e5ddd1f770c4d6dc26c066791f36e56df Mon Sep 17 00:00:00 2001
|
|
From: Kevin Wolf <kwolf@redhat.com>
|
|
Date: Fri, 7 Feb 2020 11:24:02 +0000
|
|
Subject: [PATCH 05/18] hmp: Allow using qdev ID for qemu-io command
|
|
|
|
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
Message-id: <20200207112404.25198-5-kwolf@redhat.com>
|
|
Patchwork-id: 93750
|
|
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 4/6] hmp: Allow using qdev ID for qemu-io command
|
|
Bugzilla: 1781637
|
|
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
|
|
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
|
In order to issue requests on an existing BlockBackend with the
|
|
'qemu-io' HMP command, allow specifying the BlockBackend not only with a
|
|
BlockBackend name, but also with a qdev ID/QOM path for a device that
|
|
owns the (possibly anonymous) BlockBackend.
|
|
|
|
Because qdev names could be conflicting with BlockBackend and node
|
|
names, introduce a -d option to explicitly address a device. If the
|
|
option is not given, a BlockBackend or a node is addressed.
|
|
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
(cherry picked from commit 89b6fc45614bb45dcd58f1590415afe5c2791abd)
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
---
|
|
hmp-commands.hx | 8 +++++---
|
|
monitor/hmp-cmds.c | 28 ++++++++++++++++++----------
|
|
2 files changed, 23 insertions(+), 13 deletions(-)
|
|
|
|
diff --git a/hmp-commands.hx b/hmp-commands.hx
|
|
index cfcc044..dc23185 100644
|
|
--- a/hmp-commands.hx
|
|
+++ b/hmp-commands.hx
|
|
@@ -1875,9 +1875,11 @@ ETEXI
|
|
|
|
{
|
|
.name = "qemu-io",
|
|
- .args_type = "device:B,command:s",
|
|
- .params = "[device] \"[command]\"",
|
|
- .help = "run a qemu-io command on a block device",
|
|
+ .args_type = "qdev:-d,device:B,command:s",
|
|
+ .params = "[-d] [device] \"[command]\"",
|
|
+ .help = "run a qemu-io command on a block device\n\t\t\t"
|
|
+ "-d: [device] is a device ID rather than a "
|
|
+ "drive ID or node name",
|
|
.cmd = hmp_qemu_io,
|
|
},
|
|
|
|
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
|
index b2551c1..5f8941d 100644
|
|
--- a/monitor/hmp-cmds.c
|
|
+++ b/monitor/hmp-cmds.c
|
|
@@ -2468,23 +2468,31 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
|
|
{
|
|
BlockBackend *blk;
|
|
BlockBackend *local_blk = NULL;
|
|
+ bool qdev = qdict_get_try_bool(qdict, "qdev", false);
|
|
const char* device = qdict_get_str(qdict, "device");
|
|
const char* command = qdict_get_str(qdict, "command");
|
|
Error *err = NULL;
|
|
int ret;
|
|
|
|
- blk = blk_by_name(device);
|
|
- if (!blk) {
|
|
- BlockDriverState *bs = bdrv_lookup_bs(NULL, device, &err);
|
|
- if (bs) {
|
|
- blk = local_blk = blk_new(bdrv_get_aio_context(bs),
|
|
- 0, BLK_PERM_ALL);
|
|
- ret = blk_insert_bs(blk, bs, &err);
|
|
- if (ret < 0) {
|
|
+ if (qdev) {
|
|
+ blk = blk_by_qdev_id(device, &err);
|
|
+ if (!blk) {
|
|
+ goto fail;
|
|
+ }
|
|
+ } else {
|
|
+ blk = blk_by_name(device);
|
|
+ if (!blk) {
|
|
+ BlockDriverState *bs = bdrv_lookup_bs(NULL, device, &err);
|
|
+ if (bs) {
|
|
+ blk = local_blk = blk_new(bdrv_get_aio_context(bs),
|
|
+ 0, BLK_PERM_ALL);
|
|
+ ret = blk_insert_bs(blk, bs, &err);
|
|
+ if (ret < 0) {
|
|
+ goto fail;
|
|
+ }
|
|
+ } else {
|
|
goto fail;
|
|
}
|
|
- } else {
|
|
- goto fail;
|
|
}
|
|
}
|
|
|
|
--
|
|
1.8.3.1
|
|
|