[Qemu-devel] [PATCH 0/2] Add basic "detach" support for dump-guest-memory

2015-11-23 Thread Peter Xu
seful when the backend storage for the dump file is very slow. Peter Xu (2): dump-guest-memory: add "detach" flag for QMP/HMP interfaces dump-guest-memory: add basic "detach" support. dump.c| 62 ++

[Qemu-devel] [PATCH 2/2] dump-guest-memory: add basic "detach" support.

2015-11-23 Thread Peter Xu
This will allow the user specify "-d" (just like command "migrate") when using "dump-guest-memory" command. When specified, one background thread is created to do the dump work. One flag is added to show whether there is a background dump work in progress. Signed

[Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory

2015-11-23 Thread Peter Xu
seful when the backend storage for the dump file is very slow. Peter Xu (2): dump-guest-memory: add "detach" flag for QMP/HMP interfaces dump-guest-memory: add basic "detach" support. dump.c| 62 ++

[Qemu-devel] [PATCH 1/2] dump-guest-memory: add "detach" flag for QMP/HMP interfaces

2015-11-23 Thread Peter Xu
This patch only add the interfaces, but not implementing them. Signed-off-by: Peter Xu --- dump.c | 3 ++- hmp-commands.hx | 5 +++-- hmp.c| 3 ++- qapi-schema.json | 3 ++- qmp-commands.hx | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dump.c

[Qemu-devel] [PATCH REPOST 2/2] dump-guest-memory: add basic "detach" support.

2015-11-23 Thread Peter Xu
This will allow the user specify "-d" (just like command "migrate") when using "dump-guest-memory" command. When specified, one background thread is created to do the dump work. One flag is added to show whether there is a background dump work in progress. Signed

[Qemu-devel] [PATCH REPOST 1/2] dump-guest-memory: add "detach" flag for QMP/HMP interfaces

2015-11-23 Thread Peter Xu
This patch only add the interfaces, but not implementing them. Signed-off-by: Peter Xu --- dump.c | 3 ++- hmp-commands.hx | 5 +++-- hmp.c| 3 ++- qapi-schema.json | 3 ++- qmp-commands.hx | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dump.c

Re: [Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory

2015-11-23 Thread Peter Xu
, Nov 23, 2015 at 05:22:29PM +0100, Laszlo Ersek wrote: >> On 11/23/15 11:07, Peter Xu wrote: >>> Currently, dump-guest-memory supports synchronous operation only. This patch >>> sets are adding "detach" support for it (just like "migrate -d" for >>>

Re: [Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory

2015-11-24 Thread Peter Xu
On 11/25/2015 10:46 AM, Fam Zheng wrote: > On Tue, 11/24 06:49, Eric Blake wrote: >> On 11/24/2015 04:37 AM, Fam Zheng wrote: >> I think the patch should be dropped, and periodic progress reports should be emitted from within the dump loops that do the heavy lifting. For the E

Re: [Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory

2015-11-24 Thread Peter Xu
On 11/24/2015 08:05 PM, Paolo Bonzini wrote: > > > On 24/11/2015 04:10, Fam Zheng wrote: >> What about all the hot-plug commands that changes the memory layout? > > If the guest is stopped, they shouldn't. device_add does not enable new > BARs for example, the guest does that after it receive

[Qemu-devel] [RFC PATCH 2/2] arm: gic: add "query-gic-capability" interface

2016-02-13 Thread Peter Xu
Signed-off-by: Peter Xu --- qapi-schema.json | 11 +++ qmp-commands.hx | 25 + qmp.c| 5 + scripts/qapi.py | 1 + 4 files changed, 42 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 81654bd..7e3b8cd 100644 --- a/qapi

[Qemu-devel] [RFC PATCH 1/2] arm: gic: add GICType

2016-02-13 Thread Peter Xu
A new enum type is added to define ARM GIC types. Signed-off-by: Peter Xu --- qapi-schema.json | 17 + 1 file changed, 17 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 8d04897..81654bd 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4083,3

[Qemu-devel] [RFC PATCH 0/2] ARM: add QMP command to query GIC version

2016-02-13 Thread Peter Xu
if defined TARGET_ARM" to block out ARM specified commands, however how should I do the similiar thing in qapi-schema.json? Thanks! Peter Peter Xu (2): arm: gic: add GICType arm: gic: add "query-gic-capability" interface qapi-schema.json | 28 qmp-commands.hx | 25 + qmp.c| 5 + scripts/qapi.py | 1 + 4 files changed, 59 insertions(+) -- 2.4.3

Re: [Qemu-devel] [RFC PATCH 0/2] ARM: add QMP command to query GIC version

2016-02-14 Thread Peter Xu
On Mon, Feb 15, 2016 at 12:54:57AM -0600, Wei Huang wrote: > On 2/13/16 23:41, Peter Xu wrote: > > Please help review whether the interface suits our need, also please > > point out any error I have made. > > I tested QEMU with these patches and they were able to work on a n

Re: [Qemu-devel] [libvirt] [RFC PATCH 0/2] ARM: add QMP command to query GIC version

2016-02-15 Thread Peter Xu
On Mon, Feb 15, 2016 at 10:35:39AM +0100, Martin Kletzander wrote: > On Sun, Feb 14, 2016 at 01:41:41PM +0800, Peter Xu wrote: > > > >["gicv2", "gicv2-kvm", "gicv3-kvm"] > > > >Please help review whether the interface suits our need, also

Re: [Qemu-devel] [RFC PATCH 0/2] ARM: add QMP command to query GIC version

2016-02-15 Thread Peter Xu
On Mon, Feb 15, 2016 at 10:52:01AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > For ARM platform, we still do not have any interface to query > > whether current QEMU/host support specific GIC version. This > > patchset is trying to add one QMP interface for t

Re: [Qemu-devel] [PATCH v6 00/11] Add basic "detach" support for dump-guest-memory

2016-02-15 Thread Peter Xu
Still think this might help in some cases, so ping again... Peter On Wed, Dec 09, 2015 at 10:42:12AM +0800, Peter Xu wrote: > v6 changes: > - patch 10 > - English error fix [Fam] > - patch 11 > - remove useless var: "not_used" [me] > - all > - move patch

Re: [Qemu-devel] [PATCH v6 09/11] Dump: add qmp command "query-dump"

2016-02-15 Thread Peter Xu
On Tue, Feb 16, 2016 at 02:40:59PM +0800, Fam Zheng wrote: > On Wed, 12/09 10:42, Peter Xu wrote: > > -s->status = (local_err ? DUMP_STATUS_FAILED : DUMP_STATUS_COMPLETED); > > -error_propagate(errp, local_err); > > This means the error is released by caller, ...

Re: [Qemu-devel] [PATCH v6 10/11] Dump: add hmp command "info dump"

2016-02-15 Thread Peter Xu
On Tue, Feb 16, 2016 at 02:46:15PM +0800, Fam Zheng wrote: > On Wed, 12/09 10:42, Peter Xu wrote: > > + > > +void hmp_info_dump(Monitor *mon, const QDict *qdict) > > +{ > > +DumpQueryResult *result = qmp_query_dump(NULL); > > If something goes wrong, it is pro

[Qemu-devel] [PATCH v7 01/11] dump-guest-memory: cleanup: removing dump_{error|cleanup}().

2016-02-15 Thread Peter Xu
It might be a little bit confusing and error prone to do dump_cleanup() in these two functions. A better way is to do dump_cleanup() before dump finish, no matter whether dump has succeeded or not. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 78

[Qemu-devel] [PATCH v7 00/11] Add basic "detach" support for dump-guest-memory

2016-02-15 Thread Peter Xu
Changes from v6: - patch 9: fix leak of local_err due to patch switch.. [Fam] - patch 10: assert "result" before use [Fam] - patch 11: add Fam's reviewed-by. For older patch, please refers to v6 series: https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg01299.html Peter

[Qemu-devel] [PATCH v7 04/11] dump-guest-memory: add dump_in_progress() helper function

2016-02-15 Thread Peter Xu
For now, it has no effect. It will be used in dump detach support. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 13 + include/qemu-common.h | 4 qmp.c | 14 ++ 3 files changed, 31 insertions(+) diff --git a/dump.c b

[Qemu-devel] [PATCH v7 03/11] dump-guest-memory: using static DumpState, add DumpStatus

2016-02-15 Thread Peter Xu
Instead of malloc/free each time for DumpState, make it static. Added DumpStatus to show status for dump. This is to be used for detached dump. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 21 - include/sysemu/dump.h | 2 ++ qapi-schema.json

[Qemu-devel] [PATCH v7 02/11] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2016-02-15 Thread Peter Xu
This patch only adds the interfaces, but does not implement them. "detach" parameter is made optional, to make sure that all the old dump-guest-memory requests will still be able to work. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 5 +++-- hmp-comman

[Qemu-devel] [PATCH v7 05/11] dump-guest-memory: introduce dump_process() helper function.

2016-02-15 Thread Peter Xu
No functional change. Cleanup only. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 31 +-- include/sysemu/dump.h | 3 +++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/dump.c b/dump.c index 158d6ea..fed84a6 100644

[Qemu-devel] [PATCH v7 06/11] dump-guest-memory: disable dump when in INMIGRATE state

2016-02-15 Thread Peter Xu
Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 5 + 1 file changed, 5 insertions(+) diff --git a/dump.c b/dump.c index fed84a6..923e3a5 100644 --- a/dump.c +++ b/dump.c @@ -1654,6 +1654,11 @@ void qmp_dump_guest_memory(bool paging, const char *file, DumpState *s

[Qemu-devel] [PATCH v7 10/11] Dump: add hmp command "info dump"

2016-02-15 Thread Peter Xu
It will calculate percentage of finished work from completed and total. Signed-off-by: Peter Xu --- hmp-commands-info.hx | 14 ++ hmp.c| 17 + hmp.h| 1 + 3 files changed, 32 insertions(+) diff --git a/hmp-commands-info.hx b/hmp

[Qemu-devel] [PATCH v7 07/11] dump-guest-memory: add "detach" support

2016-02-15 Thread Peter Xu
If "detach" is provided, one thread is created to do the dump work, while main thread will return immediately. For each GuestPhysBlock, adding one more field "mr" to points to MemoryRegion that it belongs, also ref the mr before use. Signed-off-by: Peter Xu Reviewed-by: Fa

[Qemu-devel] [PATCH v7 11/11] dump-guest-memory: add qmp event DUMP_COMPLETED

2016-02-15 Thread Peter Xu
One new QMP event DUMP_COMPLETED is added. When a dump finishes, one DUMP_COMPLETED event will occur to notify the user. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- docs/qmp-events.txt | 18 ++ dump.c | 18 -- qapi/event.json | 16

[Qemu-devel] [PATCH v7 08/11] DumpState: adding total_size and written_size fields

2016-02-15 Thread Peter Xu
Here, total_size is the size in bytes to be dumped (raw data, which means before compression), while written_size are bytes handled (raw size too). Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 32 include/sysemu/dump.h | 9

[Qemu-devel] [PATCH v7 09/11] Dump: add qmp command "query-dump"

2016-02-15 Thread Peter Xu
ump >From completed and total, we could know how much work finished by calculating: 100.0 * completed / total (%) Signed-off-by: Peter Xu --- dump.c | 23 +++ qapi-schema.json | 32 +++- qmp-commands.hx | 27 +++

Re: [Qemu-devel] [PATCH v7 03/11] dump-guest-memory: using static DumpState, add DumpStatus

2016-02-16 Thread Peter Xu
On Tue, Feb 16, 2016 at 01:32:00PM +0100, Andrew Jones wrote: > On Tue, Feb 16, 2016 at 03:50:53PM +0800, Peter Xu wrote: > > Instead of malloc/free each time for DumpState, make it > > static. Added DumpStatus to show status for dump. > > I see that the motivation for makin

[Qemu-devel] [RFC PATCH 0/2] Add one more PCI IOMMU ops

2016-02-17 Thread Peter Xu
Peter Xu (2): pci: renaming PCIIOMMUFunc to PCIIOMMUASLookupFunc pci: add PCIIOMMUOps and PCIIOMMUIntRemapFunc hw/pci/pci.c | 21 - include/hw/pci/pci.h | 14 -- include/hw/pci/pci_bus.h | 2 +- 3 files changed, 29 insertions(+), 8 deletions

[Qemu-devel] [RFC PATCH 1/2] pci: renaming PCIIOMMUFunc to PCIIOMMUASLookupFunc

2016-02-17 Thread Peter Xu
There could be more than one ops for IOMMU in the future. Renaming PCIIOMMUFunc to a more specific name better describes what it does, which is to do address space lookup. Signed-off-by: Peter Xu --- hw/pci/pci.c | 2 +- include/hw/pci/pci.h | 4 ++-- include/hw/pci/pci_bus.h

[Qemu-devel] [RFC PATCH 2/2] pci: add PCIIOMMUOps and PCIIOMMUIntRemapFunc

2016-02-17 Thread Peter Xu
pci_setup_iommu_ops() is introduced. We can use this instead of the origin pci_setup_iommu() one to extend interrupt remapping on specific platform. Signed-off-by: Peter Xu --- hw/pci/pci.c | 21 - include/hw/pci/pci.h | 10 ++ include/hw/pci/pci_bus.h | 2

Re: [Qemu-devel] [PATCH v7 08/11] DumpState: adding total_size and written_size fields

2016-02-17 Thread Peter Xu
On Tue, Feb 16, 2016 at 01:39:36PM +0100, Andrew Jones wrote: > On Tue, Feb 16, 2016 at 03:50:58PM +0800, Peter Xu wrote: > > Here, total_size is the size in bytes to be dumped (raw data, which > > means before compression), while written_size are bytes handled (raw > > size

Re: [Qemu-devel] [RFC PATCH 0/2] ARM: add QMP command to query GIC version

2016-02-17 Thread Peter Xu
On Mon, Feb 15, 2016 at 03:22:05PM +, Daniel P. Berrange wrote: > On Mon, Feb 15, 2016 at 04:08:33PM +0100, Markus Armbruster wrote: > > Peter Xu writes: > > > > > On Mon, Feb 15, 2016 at 10:52:01AM +0100, Markus Armbruster wrote: > > >> Peter Xu write

Re: [Qemu-devel] [RFC PATCH 2/2] pci: add PCIIOMMUOps and PCIIOMMUIntRemapFunc

2016-02-17 Thread Peter Xu
On Wed, Feb 17, 2016 at 08:46:18PM +0100, Paolo Bonzini wrote: > > > On 17/02/2016 11:25, Peter Xu wrote: > > This patch extended the current PCI IOMMU functions into operation list, > > one new op is added to do interrupt remapping. > > > > Currently it is not

[Qemu-devel] [PATCH v7 00/11] Add basic "detach" support for dump-guest-memory

2016-02-17 Thread Peter Xu
AX" for enum types...) Changes from v6: - patch 9: fix leak of local_err due to patch switch.. [Fam] - patch 10: assert "result" before use [Fam] - patch 11: add Fam's reviewed-by. For older patch, please refers to v6 series: https://lists.gnu.org/archive/html/qemu-devel/2015-1

[Qemu-devel] [PATCH v8 01/11] dump-guest-memory: cleanup: removing dump_{error|cleanup}().

2016-02-17 Thread Peter Xu
It might be a little bit confusing and error prone to do dump_cleanup() in these two functions. A better way is to do dump_cleanup() before dump finish, no matter whether dump has succeeded or not. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 78

[Qemu-devel] [PATCH v8 03/11] dump-guest-memory: using static DumpState, add DumpStatus

2016-02-17 Thread Peter Xu
Instead of malloc/free each time for DumpState, make it static. Added DumpStatus to show status for dump. This is to be used for detached dump. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 21 - include/sysemu/dump.h | 2 ++ qapi-schema.json

[Qemu-devel] [PATCH v8 04/11] dump-guest-memory: add dump_in_progress() helper function

2016-02-17 Thread Peter Xu
For now, it has no effect. It will be used in dump detach support. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 13 + include/qemu-common.h | 4 qmp.c | 14 ++ 3 files changed, 31 insertions(+) diff --git a/dump.c b

[Qemu-devel] [PATCH v8 02/11] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2016-02-17 Thread Peter Xu
This patch only adds the interfaces, but does not implement them. "detach" parameter is made optional, to make sure that all the old dump-guest-memory requests will still be able to work. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 5 +++-- hmp-comman

[Qemu-devel] [PATCH v8 08/11] DumpState: adding total_size and written_size fields

2016-02-17 Thread Peter Xu
Here, total_size is the size in bytes to be dumped (raw data, which means before compression), while written_size are bytes handled (raw size too). Signed-off-by: Peter Xu --- dump.c| 32 include/sysemu/dump.h | 9 + 2 files changed, 41

[Qemu-devel] [PATCH v8 05/11] dump-guest-memory: introduce dump_process() helper function.

2016-02-17 Thread Peter Xu
No functional change. Cleanup only. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c| 31 +-- include/sysemu/dump.h | 3 +++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/dump.c b/dump.c index 158d6ea..fed84a6 100644

[Qemu-devel] [PATCH v8 06/11] dump-guest-memory: disable dump when in INMIGRATE state

2016-02-17 Thread Peter Xu
Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- dump.c | 5 + 1 file changed, 5 insertions(+) diff --git a/dump.c b/dump.c index fed84a6..923e3a5 100644 --- a/dump.c +++ b/dump.c @@ -1654,6 +1654,11 @@ void qmp_dump_guest_memory(bool paging, const char *file, DumpState *s

[Qemu-devel] [PATCH v8 11/11] dump-guest-memory: add qmp event DUMP_COMPLETED

2016-02-17 Thread Peter Xu
One new QMP event DUMP_COMPLETED is added. When a dump finishes, one DUMP_COMPLETED event will occur to notify the user. Signed-off-by: Peter Xu Reviewed-by: Fam Zheng --- docs/qmp-events.txt | 18 ++ dump.c | 18 -- qapi/event.json | 16

[Qemu-devel] [PATCH v8 07/11] dump-guest-memory: add "detach" support

2016-02-17 Thread Peter Xu
If "detach" is provided, one thread is created to do the dump work, while main thread will return immediately. For each GuestPhysBlock, adding one more field "mr" to points to MemoryRegion that it belongs, also ref the mr before use. Signed-off-by: Peter Xu Reviewed-by: Fa

[Qemu-devel] [PATCH v8 09/11] Dump: add qmp command "query-dump"

2016-02-17 Thread Peter Xu
ump >From completed and total, we could know how much work finished by calculating: 100.0 * completed / total (%) Reviewed-by: Fam Zheng Signed-off-by: Peter Xu --- dump.c | 23 +++ qapi-schema.json | 32 +++- qmp-comm

[Qemu-devel] [PATCH v8 10/11] Dump: add hmp command "info dump"

2016-02-17 Thread Peter Xu
It will calculate percentage of finished work from completed and total. Signed-off-by: Peter Xu --- hmp-commands-info.hx | 14 ++ hmp.c| 17 + hmp.h| 1 + 3 files changed, 32 insertions(+) diff --git a/hmp-commands-info.hx b/hmp

Re: [Qemu-devel] [PATCH v7 00/11] Add basic "detach" support for dump-guest-memory

2016-02-17 Thread Peter Xu
mistake. Peter On Thu, Feb 18, 2016 at 01:16:45PM +0800, Peter Xu wrote: > Changes from v7: > - patch 8: use s->dump_info.page_size not TARGET_PAGE_SIZE > - patch 10: change DUMP_STATUS_MAX to DUMP_STATUS__MAX (this is to > fix compile error for rebasing to latest master branch

Re: [Qemu-devel] [PATCH v7 00/11] Add basic "detach" support for dump-guest-memory

2016-02-17 Thread Peter Xu
On Thu, Feb 18, 2016 at 08:26:44AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > Changes from v7: > > - patch 8: use s->dump_info.page_size not TARGET_PAGE_SIZE > > - patch 10: change DUMP_STATUS_MAX to DUMP_STATUS__MAX (this is to > > fix compile er

[Qemu-devel] [PATCH v2 0/8] Add basic "detach" support for dump-guest-memory

2015-11-26 Thread Peter Xu
- test detached dump, command return immediately. When dump finished, will receive event DUMP_COMPLETED with a message. - test dump-query before/during/after dump - test kdump with zlib compression, w/ and w/o detach - libvirt - test "virsh dump --memory-only" with default

[Qemu-devel] [PATCH v2 1/8] dump-guest-memory: cleanup: removing dump_{error|cleanup}().

2015-11-26 Thread Peter Xu
might happen when dump got errors within the process (e.g., when write_dump_header() fails, it will skip calling dump_cleanup(), which will leads to memory leak for list elements in DumpState). Signed-off-by: Peter Xu --- dump.c | 78

[Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status

2015-11-26 Thread Peter Xu
This patch is only adding the QMP/HMP interface for "dump-query" command, but not implementing them. This command could be used to query background dump status. Please refer to the next patch to see how dump status are defined. Currently, only fake results are returned. Signed-off-by

[Qemu-devel] [PATCH v2 6/8] dump-query: implement "status" of "dump-query" command.

2015-11-26 Thread Peter Xu
t;IN_PROGRESS", "percentage": "{0..100}%" } 3. no dump is running, and the last dump has finished: { "status": "SUCCEEDED|FAILED", "percentage": "N/A" } It's mostly done. Except that we might need m

[Qemu-devel] [PATCH v2 2/8] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2015-11-26 Thread Peter Xu
This patch only adds the interfaces, but not implements them. "detach" parameter is made optional, to make sure that all the old dump-guest-memory requests will still be able to work. Signed-off-by: Peter Xu --- dump.c | 5 +++-- hmp-commands.hx | 5 +++-- hmp.c

[Qemu-devel] [PATCH v2 4/8] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-26 Thread Peter Xu
To get aligned with QMP interface, one new QMP event DUMP_COMPLETED is added. It is used when user specified "detach" in dump, and triggered when the dump finishes. Error message will be appended to this event if the dump has failed. Signed-off-by: Peter Xu --- docs/qmp-event

[Qemu-devel] [PATCH v2 8/8] dump-query: make the percentage accurate.

2015-11-26 Thread Peter Xu
By calculating the total_size and written_size of memory, we could get relatively accurate percentage of finished dump. Signed-off-by: Peter Xu --- dump.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 65bd5fb..0fcad28 100644 --- a/dump.c +++ b

[Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support.

2015-11-26 Thread Peter Xu
should make sure each MemoryRegion would only be referenced for once. One global struct "GlobalDumpState" is added to store some global informations for dump procedures. One mutex is used to protect the global dump info. Signed-off-by: Peter Xu --- dump.c

[Qemu-devel] [PATCH v2 7/8] DumpState: adding total_size and written_size fields

2015-11-26 Thread Peter Xu
ned-off-by: Peter Xu --- dump.c| 36 +--- include/sysemu/dump.h | 9 + 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/dump.c b/dump.c index 25298b7..65bd5fb 100644 --- a/dump.c +++ b/dump.c @@ -334,6 +334,8 @@ static void

Re: [Qemu-devel] [PATCH v2 0/8] Add basic "detach" support for dump-guest-memory

2015-11-26 Thread Peter Xu
Hi, all, Sorry that I forgot to CC reviewers and maintainers when posting the patch set. :( Please review! Thanks. Peter On 11/27/2015 10:48 AM, Peter Xu wrote: > Sorry that this v2 series cannot be aligned with the v1 series. One > patch is added at the begining of the series to do som

Re: [Qemu-devel] [PATCH v2 2/8] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2015-11-26 Thread Peter Xu
On 11/27/2015 12:31 PM, Fam Zheng wrote: > On Fri, 11/27 10:48, Peter Xu wrote: >> This patch only adds the interfaces, but not implements them. >> "detach" parameter is made optional, to make sure that all the old >> dump-guest-memory requests will still be ab

Re: [Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support.

2015-11-26 Thread Peter Xu
On 11/27/2015 01:14 PM, Fam Zheng wrote: > On Fri, 11/27 10:48, Peter Xu wrote: >> This patch implements "detach" for "dump-guest-memory" command. When >> specified, one background thread is created to do the dump work. >> >> When there is a

Re: [Qemu-devel] [PATCH v2 4/8] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-26 Thread Peter Xu
On 11/27/2015 01:19 PM, Fam Zheng wrote: > On Fri, 11/27 10:48, Peter Xu wrote: >> @@ -1659,8 +1660,17 @@ static void dump_process(DumpState *s, Error **errp) >> static void *dump_thread(void *data) >> { >> GlobalDumpState *global = (GlobalDumpState *)data;

Re: [Qemu-devel] [PATCH v2 1/8] dump-guest-memory: cleanup: removing dump_{error|cleanup}().

2015-11-26 Thread Peter Xu
On 11/27/2015 12:28 PM, Fam Zheng wrote: > I think when write_dump_header() returns a failure, it does call > dump_cleanup(), in create_header{32,64}. > > But the changes of code in this patch look sane to me, and the new error > handling is definitely looking better. Yes, you are right. I will

Re: [Qemu-devel] [PATCH v2 0/8] Add basic "detach" support for dump-guest-memory

2015-11-26 Thread Peter Xu
On 11/27/2015 01:28 PM, Fam Zheng wrote: > Looks good overall! I've replied patches with a few questions. Thanks! > > Fam Thanks! Will wait for more comments and post v3 later. Peter

Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status

2015-11-26 Thread Peter Xu
On 11/27/2015 01:25 PM, Fam Zheng wrote: > On Fri, 11/27 10:48, Peter Xu wrote: >> This patch is only adding the QMP/HMP interface for "dump-query" >> command, but not implementing them. This command could be used to >> query background dump status. Please refer

Re: [Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support.

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 11:14:17AM +0100, Paolo Bonzini wrote: > > > On 27/11/2015 07:27, Peter Xu wrote: > > If embed the mr pointer into GuestPhyBlock, then we might need to > > ref/unref one MemoryRegion for multiple times (and I am not sure how > > many, maybe it

Re: [Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support.

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 11:31:00AM +0100, Paolo Bonzini wrote: > [snip] > > + > > +static GlobalDumpState *dump_state_get_global(void) > > +{ > > +static bool init = false; > > +static GlobalDumpState global_dump_state; > > +if (unlikely(!init)) { > > +qemu_mutex_init(&global

Re: [Qemu-devel] [PATCH v2 4/8] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 11:15:35AM +0100, Paolo Bonzini wrote: > > > On 27/11/2015 03:48, Peter Xu wrote: > > +## > > +# @DUMP_COMPLETED > > +# > > +# Emitted when background dump has completed > > +# > > +# Since: 2.6 > > +## > > +{

Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 11:17:52AM +0100, Paolo Bonzini wrote: > > > On 27/11/2015 08:03, Peter Xu wrote: > > > > +{ 'struct': 'DumpStatus', > > > > + 'data': { 'status': 'str', 'percentage': &

Re: [Qemu-devel] [PATCH v2 6/8] dump-query: implement "status" of "dump-query" command.

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 11:22:48AM +0100, Paolo Bonzini wrote: > > > On 27/11/2015 03:48, Peter Xu wrote: > > This patch implements the status changes inside dump process. When > > query dump status, three possible results could be: > > > > 1. never started d

Re: [Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support.

2015-11-27 Thread Peter Xu
On Fri, Nov 27, 2015 at 01:14:25PM +0800, Fam Zheng wrote: > On Fri, 11/27 10:48, Peter Xu wrote: [snip] > > This patch doesn't handle the incoming migration case, i.e. when QEMU is > started with "-incoming", or "-incoming defer". Dump can go wrong when

[Qemu-devel] question: about exec/poison.h

2015-11-29 Thread Peter Xu
Hi, all, I met one problem when trying to add a new public function in dump.h named "dump_state_get_global" and using it in hmp.c. What I got is something like: In file included from /root/git/qemu/hmp.c:35:0: /root/git/qemu/include/sysemu/dump.h:26:34: error: attempt to use poisoned "TARGET_PAG

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 09:06:45AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > Hi, all, > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. What I got is >

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 10:12:10AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 04:47, Peter Xu wrote: > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. > > Don&#

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 10:28:08AM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 30/11/2015 04:47, Peter Xu wrote: > >> > >> I met one problem when trying to add a new public function in dump.h > >> named "dump_state_get_global&q

Re: [Qemu-devel] question: about exec/poison.h

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 11:36:41AM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 10:47, Peter Xu wrote: > > So from what I understand from your reply, I could include the > > percentage value into "query-dump", right? :) > > If you have the written and

[Qemu-devel] [PATCH v3 00/12] Add basic "detach" support for dump-guest-memory

2015-11-30 Thread Peter Xu
mp, command return immediately. When dump finished, will receive event DUMP_COMPLETED with a message. - test query-dump before/during/after dump - test kdump with zlib compression, w/ and w/o detach - libvirt - test "virsh dump --memory-only" with default format and kdump-zlib

[Qemu-devel] [PATCH v3 01/12] dump-guest-memory: cleanup: removing dump_{error|cleanup}().

2015-11-30 Thread Peter Xu
It might be a little bit confusing to do dump_cleanup() in these two functions and error prone. A better way is to do dump_cleanup() before dump finish, no matter whether dump has succeeded or not. Signed-off-by: Peter Xu --- dump.c | 78

[Qemu-devel] [PATCH v3 06/12] dump-guest-memory: disable dump when in INMIGRATE state

2015-11-30 Thread Peter Xu
Signed-off-by: Peter Xu --- dump.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dump.c b/dump.c index c8ae5c3..5b9def3 100644 --- a/dump.c +++ b/dump.c @@ -1628,13 +1628,17 @@ void qmp_dump_guest_memory(bool paging, const char *file, DumpState *s; Error

[Qemu-devel] [PATCH v3 02/12] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2015-11-30 Thread Peter Xu
This patch only adds the interfaces, but not implements them. "detach" parameter is made optional, to make sure that all the old dump-guest-memory requests will still be able to work. Signed-off-by: Peter Xu --- dump.c | 5 +++-- hmp-commands.hx | 5 +++-- hmp.c

[Qemu-devel] [PATCH v3 12/12] Dump: enhance the documentations.

2015-11-30 Thread Peter Xu
Add more documents to mention about "query-dump" and DUMP_COMPLETED events. Signed-off-by: Peter Xu --- qapi-schema.json | 7 +-- qmp-commands.hx | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 577c381..ce4acb2 10

[Qemu-devel] [PATCH v3 03/12] dump-guest-memory: using static DumpState, add DumpStatus

2015-11-30 Thread Peter Xu
Instead of malloc/free each time for DumpState, make it static. Added DumpStatus to show status for dump. This is to be used for detach dump. Signed-off-by: Peter Xu --- dump.c| 30 +++--- include/sysemu/dump.h | 2 ++ qapi-schema.json | 18

[Qemu-devel] [PATCH v3 07/12] dump-guest-memory: add "detach" support

2015-11-30 Thread Peter Xu
If "detach" is provided, one thread is created to do the dump work, while main thread will return immediately. For each GuestPhysBlock, adding one more field "mr" to points to MemoryRegion that it belongs, also ref the mr before use. Signed-off-by: P

[Qemu-devel] [PATCH v3 04/12] dump-guest-memory: add dump_in_progress() helper function

2015-11-30 Thread Peter Xu
For now, it has no effect. It will be used in dump detach support. Signed-off-by: Peter Xu --- dump.c| 13 + include/qemu-common.h | 4 qmp.c | 14 ++ 3 files changed, 31 insertions(+) diff --git a/dump.c b/dump.c index c9ea878

[Qemu-devel] [PATCH v3 05/12] dump-guest-memory: introduce dump_process() helper function.

2015-11-30 Thread Peter Xu
No functional change. Cleanup only. Signed-off-by: Peter Xu --- dump.c| 19 ++- include/sysemu/dump.h | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dump.c b/dump.c index 110dbf9..c8ae5c3 100644 --- a/dump.c +++ b/dump.c @@ -1451,6

[Qemu-devel] [PATCH v3 08/12] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-30 Thread Peter Xu
One new QMP event DUMP_COMPLETED is added. It is used when user specified "detach" in dump, and triggered when the dump finishes (either succeeded or failed). If failed, one "err" data will be passed with specific error message. Signed-off-by: Peter Xu --- docs

[Qemu-devel] [PATCH v3 09/12] DumpState: adding total_size and written_size fields

2015-11-30 Thread Peter Xu
Here, total_size is the size in bytes to be dumped (raw data, which means before compression), while written_size are bytes handled (raw size too). Signed-off-by: Peter Xu --- dump.c| 32 include/sysemu/dump.h | 9 + 2 files changed, 41

[Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump"

2015-11-30 Thread Peter Xu
atest dump >From written_bytes and total_bytes, we could see how much work finished by calculating: 100.0 * written_bytes / total_bytes (%) Signed-off-by: Peter Xu --- dump.c | 10 ++ qapi-schema.json | 29 + qmp-comm

[Qemu-devel] [PATCH v3 11/12] Dump: add hmp command "info dump"

2015-11-30 Thread Peter Xu
It will calculate percentage of finished work from written_bytes and total_bytes. Signed-off-by: Peter Xu --- hmp-commands-info.hx | 14 ++ hmp.c| 18 ++ hmp.h| 1 + 3 files changed, 33 insertions(+) diff --git a/hmp-commands-info.hx

Re: [Qemu-devel] [PATCH v2 2/8] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 11:21:23AM -0700, Eric Blake wrote: > On 11/26/2015 07:48 PM, Peter Xu wrote: > > This patch only adds the interfaces, but not implements them. > > s/not implements/does not implement/ > > > "detach" parameter is made optional, to make su

Re: [Qemu-devel] [PATCH v2 4/8] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 11:18:48AM -0700, Eric Blake wrote: > On 11/26/2015 07:48 PM, Peter Xu wrote: > > To get aligned with QMP interface, one new QMP event DUMP_COMPLETED > > is added. It is used when user specified "detach" in dump, and > > triggered when the du

Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 11:27:35AM -0700, Eric Blake wrote: > On 11/26/2015 07:48 PM, Peter Xu wrote: > > This patch is only adding the QMP/HMP interface for "dump-query" > > command, but not implementing them. This command could be used to > > query background d

Re: [Qemu-devel] [PATCH v3 02/12] dump-guest-memory: add "detach" flag for QMP/HMP interfaces.

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 03:05:10PM -0700, Eric Blake wrote: > On 11/30/2015 04:32 AM, Peter Xu wrote: > > This patch only adds the interfaces, but not implements them. > > "detach" parameter is made optional, to make sure that all the old > > dump-guest-memory requ

Re: [Qemu-devel] [PATCH v3 03/12] dump-guest-memory: using static DumpState, add DumpStatus

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 02:00:28PM +0100, Paolo Bonzini wrote: > > +/* init dump state with specific status */ > > +static void dump_state_prepare(DumpState *s, DumpStatus status) > > +{ > > +bzero(s, sizeof(*s)); > > +s->status = status; > > Either use memcpy, or > > s = (DumpState)

Re: [Qemu-devel] [PATCH v3 03/12] dump-guest-memory: using static DumpState, add DumpStatus

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 03:08:24PM -0700, Eric Blake wrote: > On 11/30/2015 04:32 AM, Peter Xu wrote: > > Instead of malloc/free each time for DumpState, make it > > static. Added DumpStatus to show status for dump. > > > > This is to be used for detach d

Re: [Qemu-devel] [PATCH v3 05/12] dump-guest-memory: introduce dump_process() helper function.

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 01:55:01PM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 12:32, Peter Xu wrote: > > if (*errp) { > > s->status = DUMP_STATUS_FAILED; > > Why not move this "if" to dump_process as well? Yes. I did that in another pa

Re: [Qemu-devel] [PATCH v3 08/12] dump-guest-memory: add qmp event DUMP_COMPLETED

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 03:12:31PM -0700, Eric Blake wrote: > On 11/30/2015 04:32 AM, Peter Xu wrote: > > +Example: > > + > > +{ "event": "DUMP_COMPLETED", > > + "data": {} } > > Please keep this file sorted. The insertion should be

Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump"

2015-11-30 Thread Peter Xu
On Mon, Nov 30, 2015 at 01:56:42PM +0100, Paolo Bonzini wrote: > > > On 30/11/2015 12:32, Peter Xu wrote: > > +{ > > +DumpQueryResult *result = g_malloc0(sizeof(*result)); > > +DumpState *state = dump_state_get_global(); > > +result->sta

  1   2   3   4   5   6   7   8   9   10   >