[PATCH v5 2/3] job: introduce dump guest memory job

2022-08-01 Thread Hogan Wang via
ake use of jobs framework. Signed-off-by: Hogan Wang --- dump/dump-hmp-cmds.c | 7 --- dump/dump.c | 1 + qapi/dump.json | 11 +-- qapi/job.json| 5 - 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c i

[PATCH v5 1/3] dump: support cancel dump process

2022-08-01 Thread Hogan Wang via
Break saving pages or dump iterate when dump job in cancel state, make sure dump process exits as soon as possible. Signed-off-by: Hogan Wang --- dump/dump.c | 23 +++ include/sysemu/dump.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/dump/dump.c b/dump

[PATCH v5 3/3] dump: use jobs framework for dump guest memory

2022-08-01 Thread Hogan Wang via
}} Cancel dump job: {"execute": "job-cancel", "arguments": { "id": "dump-guest-memory" }} Dismiss dump job: {"execute": "job-dismiss", "arguments": { "id": "dump-guest-memo

[PATCH v4 2/3] job: introduce dump guest memory job

2022-08-01 Thread Hogan Wang via
ake use of jobs framework. Signed-off-by: Hogan Wang --- dump/dump-hmp-cmds.c | 12 ++-- dump/dump.c | 1 + qapi/dump.json | 6 +- qapi/job.json| 5 - 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c i

[PATCH v4 1/3] dump: support cancel dump process

2022-08-01 Thread Hogan Wang via
Break saving pages or dump iterate when dump job in cancel state, make sure dump process exits as soon as possible. Signed-off-by: Hogan Wang --- dump/dump.c | 23 +++ include/sysemu/dump.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/dump/dump.c b/dump

[PATCH v4 3/3] dump: use jobs framework for dump guest memory

2022-08-01 Thread Hogan Wang via
}} Cancel dump job: {"execute": "job-cancel", "arguments": { "id": "dump-guest-memory" }} Dismiss dump job: {"execute": "job-dismiss", "arguments": { "id": "dump-guest-memo

[PATCH v3 3/3] dump: use jobs framework for dump guest memory

2022-07-29 Thread Hogan Wang via
}} Cancel dump job: {"execute": "job-cancel", "arguments": { "id": "dump-guest-memory" }} Dismiss dump job: {"execute": "job-dismiss", "arguments": { "id": "dump-guest-memo

[PATCH v3 2/3] job: introduce dump guest memory job

2022-07-29 Thread Hogan Wang via
ake use of jobs framework. Signed-off-by: Hogan Wang --- dump/dump-hmp-cmds.c | 12 ++-- dump/dump.c | 1 + qapi/dump.json | 6 +- qapi/job.json| 5 - 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c i

[PATCH v3 1/3] dump: support cancel dump process

2022-07-29 Thread Hogan Wang via
Break saving pages or dump iterate when dump job in cancel state, make sure dump process exits as soon as possible. Signed-off-by: Hogan Wang --- dump/dump.c | 23 +++ include/sysemu/dump.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/dump/dump.c b/dump

[PATCH 1/3] job: introduce dump guest memory job

2022-07-27 Thread Hogan Wang via
ake use of jobs framework. Signed-off-by: Hogan Wang --- dump/dump-hmp-cmds.c | 12 ++-- dump/dump.c | 1 + qapi/dump.json | 6 +- qapi/job.json| 5 - 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c i

[PATCH 2/3] dump: use jobs framework for dump guest memory

2022-07-27 Thread Hogan Wang via
There's no way to cancel the current executing dump process, lead to the virtual machine manager daemon((e.g. libvirtd) cannot restore the dump job after daemon restart. Use default job id 'dump-guest-memory' to create a job object for dump process. Signed-off-by: Hogan Wang -

[PATCH 3/3] dump: support cancel dump process

2022-07-27 Thread Hogan Wang via
Break saving pages or dump iterate when dump job in cancel state, make sure dump process exits as soon as possible. Signed-off-by: Hogan Wang --- dump/dump.c | 24 include/sysemu/dump.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/dump/dump.c b

[PATCH] dump: introduce dump-cancel QMP command

2022-07-20 Thread Hogan Wang via
There's no way to cancel the current executing dump process, lead to the virtual machine manager daemon((e.g. libvirtd) cannot restore the dump job after daemon restart. Add the 'cancelling' and 'cancelled' dump states. Use 'dump-cancel' qmp command Set the dump state as 'cancelling'. The dump pr

[PATCH v2] chardev: avoid use-after-free when client disconnect

2022-07-20 Thread Hogan Wang via
40F", ctx = 0x0, read_coroutine = 0x0, write_coroutine = 0x0} Solution: IOWatchPoll object hold the @ioc and @src objects reference and release the reference in GSource finalize callback function. Signed-off-by: Hogan Wang --- chardev/char-io.c | 12 ++-- 1 file changed, 10

Re: [PATCH] chardev: avoid use-after-free when client disconnect

2022-04-18 Thread Hogan Wang via
> Hi > > On Mon, Mar 28, 2022 at 12:22 PM Hogan Wang via wrote: > > IOWatchPoll object did not hold the @ioc and @src objects reference, > > then io_watch_poll_prepare execute in IO thread, if IOWatchPoll > > removed by mian thread, io_watch_poll_prepare may execute at

[PATCH] chardev: avoid use-after-free when client disconnect

2022-03-28 Thread Hogan Wang via
40F", ctx = 0x0, read_coroutine = 0x0, write_coroutine = 0x0} Solution: IOWatchPoll object hold the @ioc and @src objects reference and release the reference in GSource finalize callback function. Signed-off-by: Hogan Wang --- chardev/char-io.c | 17 - 1 f

[PATCH] hw/pci-host: save/restore pci host config register for old ones

2020-08-10 Thread Hogan Wang
x402,chardev=seabios\ -monitor stdio \ -incoming tcp:127.0.0.1:8000 step 4. execute the following qmp command in vm1 to migrate. (qemu) migrate tcp:127.0.0.1:8000 step 5. execute the following qmp command in vm2 to resume vcpu. (qemu) cont Before this patch, we get KVM "emulation failur

[PATCH 2/6] hw/pci-host: save/restore pci host config register for old ones

2020-07-29 Thread Hogan Wang
x402,chardev=seabios\ -monitor stdio \ -incoming tcp:127.0.0.1:8000 step 4. execute the following qmp command in vm1 to migrate. (qemu) migrate tcp:127.0.0.1:8000 step 5. execute the following qmp command in vm2 to resume vcpu. (qemu) cont Before this patch, we get KVM "emulation failur

[PATCH 2/3] qemu-options: introduce parse_net_client

2020-07-28 Thread Hogan Wang
From: w00506750 introduce parse_net_client to parse netdev/nic/net clients. Signed-off-by: Hogan Wang --- include/net/net.h | 1 - net/net.c | 9 - qemu-options.hx | 8 +--- softmmu/vl.c | 30 -- 4 files changed, 17 insertions(+), 31

[PATCH 3/3] qemu-options: introduce parse_virtfs

2020-07-28 Thread Hogan Wang
From: w00506750 introduce parse_virtfs to parse virtfs options. Signed-off-by: Hogan Wang --- qemu-options.hx | 2 +- softmmu/vl.c| 158 +--- 2 files changed, 82 insertions(+), 78 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx

[PATCH 1/3] qemu-options: introduce functions to parse options

2020-07-28 Thread Hogan Wang
From: w00506750 All of the qemu options are parsed in qemu_init function, and make qemu_init function too long and nasty. Introduce 'parser' function pointer in QEMUOption struct to parse one option or a set of options. Signed-off-by: Hogan Wang --- qemu-options-wrap

[PATCH v5] hw/pci-host: save/restore pci host config register for old ones

2020-07-27 Thread Hogan Wang
x402,chardev=seabios\ -monitor stdio \ -incoming tcp:127.0.0.1:8000 step 4. execute the following qmp command in vm1 to migrate. (qemu) migrate tcp:127.0.0.1:8000 step 5. execute the following qmp command in vm2 to resume vcpu. (qemu) cont Before this patch, we get KVM "emulation failur

[PATCH v4 1/2] hw/pci-host: save/restore pci host config register

2020-07-27 Thread Hogan Wang
From: Hogan Wang The pci host config register is used to save PCI address for read/write config data. If guest write a value to config register, and then pause the vcpu to migrate, After the migration, the guest continue to write pci config data, and the write data will be ignored because of new

[PATCH v4 2/2] hw/pci-host: save/restore pci host config register for old ones

2020-07-27 Thread Hogan Wang
x402,chardev=seabios\ -monitor stdio \ -incoming tcp:127.0.0.1:8000 step 4. execute the following qmp command in vm1 to migrate. (qemu) migrate tcp:127.0.0.1:8000 step 5. execute the following qmp command in vm2 to resume vcpu. (qemu) cont Before this patch, we can get KVM "emulation

[PATCH v3 2/2] hw/pci-host: save/restore pci host config register for old ones

2020-07-25 Thread Hogan Wang
The i440fx and q35 machines integrate i440FX or MCH PCI device by default. Refer to i440FX and ICH9-LPC spcifications, there are some reserved configuration registers can used to save/restore PCIHostState.config_reg. It's nasty but friendly to old ones. Signed-off-by: Hogan Wang --- hw/pci

[PATCH v3 1/2] hw/pci-host: save/restore pci host config register

2020-07-25 Thread Hogan Wang
. guest write config data(0x0A) fail to disable the SMRAM becasue of config register state lost. 5. guest continue to boot and crash in ipxe option ROM due to SMRAM in enabled state. Signed-off-by: Hogan Wang --- hw/i386/pc.c | 5 - hw/pci-host/i440fx.c | 20