[Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2

2012-08-09 Thread Wenchao Xia
need to check every embbed structure's size and guess compiler's memory arrangement. This means #pragma pack(4) or struct_size, offset_next in every structure. Any better way to solve it? or make every structure a plain one? AIO is missing, need a prototype. Wenchao Xia (3): adding

[Qemu-devel] [qemu-devel] [PATCH V2 1/3] [RFC] libqblock-adding libqblock-test

2012-08-09 Thread Wenchao Xia
This patch modify Makefile and expose a API in block.c that libqblock need. Signed-off-by: Wenchao Xia --- Makefile |3 +++ block.c |2 +- block.h |1 + 3 files changed, 5 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 621cb86..a5691ee 100644 --- a

[Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design

2012-08-09 Thread Wenchao Xia
This patch is the API design. Signed-off-by: Wenchao Xia --- libqblock.c | 670 +++ libqblock.h | 447 +++ 2 files changed, 1117 insertions(+), 0 deletions(-) create mode 100644 libqblock.c create

[Qemu-devel] [qemu-devel] [PATCH V2 3/3] [RFC] libqblock-test case.

2012-08-09 Thread Wenchao Xia
This file simulate the caller to test the library. Signed-off-by: Wenchao Xia --- libqblock-test.c | 197 ++ 1 files changed, 197 insertions(+), 0 deletions(-) create mode 100644 libqblock-test.c diff --git a/libqblock-test.c b/libqblock

Re: [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2

2012-08-10 Thread Wenchao Xia
Thanks for your review, sorry I have forgot some fixing you mentioned before, will correct them this time. 于 2012-8-10 1:12, Blue Swirl 写道: On Thu, Aug 9, 2012 at 10:10 AM, Wenchao Xia wrote: This patch intrudce libqblock API, libqblock-test is used as a test case. V2: Using

Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design

2012-08-10 Thread Wenchao Xia
于 2012-8-10 1:36, Blue Swirl 写道: On Thu, Aug 9, 2012 at 10:12 AM, Wenchao Xia wrote: This patch is the API design. Signed-off-by: Wenchao Xia --- libqblock.c | 670 +++ libqblock.h | 447

Re: [Qemu-devel] [qemu-devel] [PATCH V2 3/3] [RFC] libqblock-test case.

2012-08-10 Thread Wenchao Xia
于 2012-8-10 1:49, Blue Swirl 写道: On Thu, Aug 9, 2012 at 10:12 AM, Wenchao Xia wrote: This file simulate the caller to test the library. Signed-off-by: Wenchao Xia --- libqblock-test.c | 197 ++ Please move this to test/ and build

Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design

2012-08-13 Thread Wenchao Xia
于 2012-8-10 18:48, Paolo Bonzini 写道: Il 09/08/2012 12:12, Wenchao Xia ha scritto: +/* copy information and take care the member difference in differect version. + Assuming all new member are added in the tail, struct size is the first + member, this is old to new version, src have its

Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design

2012-08-13 Thread Wenchao Xia
于 2012-8-10 19:02, Kevin Wolf 写道: Am 09.08.2012 12:12, schrieb Wenchao Xia: This patch is the API design. Signed-off-by: Wenchao Xia --- libqblock.c | 670 +++ libqblock.h | 447 +++ 2 files

Re: [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2

2012-08-13 Thread Wenchao Xia
于 2012-8-11 20:18, Blue Swirl 写道: On Fri, Aug 10, 2012 at 8:04 AM, Wenchao Xia wrote: Thanks for your review, sorry I have forgot some fixing you mentioned before, will correct them this time. 于 2012-8-10 1:12, Blue Swirl 写道: On Thu, Aug 9, 2012 at 10:10 AM, Wenchao Xia wrote

Re: [Qemu-devel] [qemu-devel] [PATCH V2 0/3] [RFC] libqblock draft code v2

2012-08-14 Thread Wenchao Xia
于 2012-8-14 4:00, Blue Swirl 写道: On Mon, Aug 13, 2012 at 11:27 AM, Wenchao Xia wrote: 于 2012-8-11 20:18, Blue Swirl 写道: On Fri, Aug 10, 2012 at 8:04 AM, Wenchao Xia wrote: Thanks for your review, sorry I have forgot some fixing you mentioned before, will correct them this time. 于

[Qemu-devel] [RFC] libqblock-API v2, re-designed

2012-08-15 Thread Wenchao Xia
internally. 3 Balanced the parameters extension and folder depth, More than one parameters were used in APIs. 4 advanced information that only some format have, will get -1 to indicate it do not exist. /* * QEMU block layer library * * Copyright IBM, Corp. 2012 * * Authors: * Wenchao Xia

Re: [Qemu-devel] [PATCH V3 2/2] qemu-img: Add json output option to the info command.

2012-08-15 Thread Wenchao Xia
BDRV_O_FLAGS | BDRV_O_NO_BACKING); +image_info->backing_filename = g_strdup(backing_filename); +image_info->backing_filename_format = +g_strdup(bdrv_get_format_name(backing_bs)); +bdrv_delete(backing_bs); +PRINTH(human, "backing file: %s", backing_filename); if (strcmp(backing_filename, backing_filename2) != 0) { -printf(" (actual path: %s)", backing_filename2); +PRINTH(human, " (actual path: %s)", backing_filename2); +} +if (human) { +putchar('\n'); } -putchar('\n'); +image_info->has_backing_filename = true; +image_info->has_backing_filename_format = true; } -dump_snapshots(bs); + +if (human) { +dump_snapshots(bs); +} else { +collect_snapshots(bs, image_info); +dump_json_image_info(image_info); +} + +qapi_free_ImageInfo(image_info); bdrv_delete(bs); return 0; } +#undef PRINTH + #define SNAPSHOT_LIST 1 #define SNAPSHOT_CREATE 2 #define SNAPSHOT_APPLY 3 -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V6 1/5] libqblock build system

2012-10-10 Thread wenchao xia
于 2012-10-9 22:25, Paolo Bonzini 写道: Il 09/10/2012 02:01, wenchao xia ha scritto: Could u give more tip about this error? what is obj-amd64? My understanding is you tried to build the library from another directory similar as: /extend_disk/xiawenc/qemu/qemu have the qemu source code, then

[Qemu-devel] [PATCH V7 2/4] libqblock type defines

2012-10-12 Thread Wenchao Xia
From: Wenchao Xia This patch contains type and macro defines used in APIs, one file for public usage, one for libqblock internal usage. Signed-off-by: Wenchao Xia --- libqblock/libqblock-internal.h | 75 libqblock/libqblock-types.h| 252

[Qemu-devel] [PATCH V7 3/4] libqblock API

2012-10-12 Thread Wenchao Xia
From: Wenchao Xia This patch contains the major APIs in the library. For ABI some reserved members were used. Important APIs: 1 QBlockContext. This structure was used to retrieve errors, every thread must create one first. 2 QBlockState. It stands for an block image object. 3

[Qemu-devel] [PATCH V7 1/4] libqblock build system

2012-10-12 Thread Wenchao Xia
From: Wenchao Xia Libqblock was placed in new directory ./libqblock, libtool will build dynamic library there, source files of block layer remains in ./block. So block related source code will generate 3 sets of binary, first is old ones used in qemu, second and third are non PIC and PIC ones

[Qemu-devel] [PATCH V7 4/4] libqblock test example

2012-10-12 Thread Wenchao Xia
From: Wenchao Xia In this example, first it will create some qcow2 images, then try get information including backing file relationship, then it will do sync IO on the image. Signed-off-by: Wenchao Xia --- tests/libqblock/libqblock-qcow2.c | 390 - 1

[Qemu-devel] [PATCH V7 0/4] libqblock qemu block layer library

2012-10-12 Thread Wenchao Xia
From: Wenchao Xia These patches introduce libqblock API, make libqblock.la and make check-libqblock could build this library. Functionalities: 1 create a new image. 2 sync access of an image. 3 basic image information retrieving such as backing file. 4 detect if a sector is allocated in an

Re: [Qemu-devel] [PATCH V7 0/4] libqblock qemu block layer library

2012-10-14 Thread wenchao xia
于 2012-10-13 18:49, Blue Swirl 写道: > On Sat, Oct 13, 2012 at 5:10 AM, Wenchao Xia wrote: >> From: Wenchao Xia >> >>These patches introduce libqblock API, make libqblock.la and make >> check-libqblock could build this library. >> Functionalities: >> 1

[Qemu-devel] [PATCH V8 0/4] libqblock qemu block layer library

2012-10-14 Thread Wenchao Xia
dependency, make check will automatically execute test anyway now. Removed "ifeq ($(LIBTOOL),)" in Makefile. v6: Remove address pointer member in image static info structure. v7: Support out of tree building. v8: Fix a bug in out of tree building. Wenchao Xia (4): libqblock buil

[Qemu-devel] [PATCH V8 1/4] libqblock build system

2012-10-14 Thread Wenchao Xia
, out of tree building is supported. Signed-off-by: Wenchao Xia --- .gitignore|2 + Makefile | 14 ++- configure |4 ++- libqblock/Makefile| 72 + libqblock

[Qemu-devel] [PATCH V8 4/4] libqblock test example

2012-10-14 Thread Wenchao Xia
In this example, first it will create some qcow2 images, then try get information including backing file relationship, then it will do sync IO on the image. Signed-off-by: Wenchao Xia --- tests/libqblock/libqblock-qcow2.c | 390 - 1 files changed, 389

[Qemu-devel] [PATCH V8 2/4] libqblock type defines

2012-10-14 Thread Wenchao Xia
This patch contains type and macro defines used in APIs, one file for public usage, one for libqblock internal usage. Signed-off-by: Wenchao Xia --- libqblock/libqblock-internal.h | 75 libqblock/libqblock-types.h| 252 2 files

[Qemu-devel] [PATCH V8 3/4] libqblock API

2012-10-14 Thread Wenchao Xia
static information such as location, backing file, size. 4 Sync I/O. It is similar to C file open, read, write and close operations. Signed-off-by: Wenchao Xia --- block.c |2 +- block.h |1 + libqblock/libqblock-error.c | 57 ++ libqblock

Re: [Qemu-devel] [PATCH V8 0/4] libqblock qemu block layer library

2012-10-25 Thread Wenchao Xia
r detail in the structure. >Test Makefile do not create diretory now, test case create it themself. >Test build system do not use libtool now, and removed qtest-obj-y in its > dependency, make check will automatically execute test anyway now. >Removed "ifeq ($(LIBTOOL)

[Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API

2012-07-09 Thread Wenchao Xia
, in which returns related info. What do you think about it? -- Best Regards Wenchao Xia mail:xiaw...@linux.vnet.ibm.com tel:86-010-82450803

Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API

2012-07-09 Thread Wenchao Xia
于 2012-7-9 17:13, Paolo Bonzini 写道: > Il 09/07/2012 10:54, Wenchao Xia ha scritto: >> Following is my implementing plan draft: >>1 introduce libqblock.so in sub directory in qemu. >>2 write a nbd client in libqblock, similar to qemu nbd client. Then >> use it

Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API

2012-07-09 Thread Wenchao Xia
于 2012-7-9 17:27, Daniel P. Berrange 写道: On Mon, Jul 09, 2012 at 04:54:08PM +0800, Wenchao Xia wrote: Hi, Paolo and folks, qemu have good capabilities to access different virtual disks, I want to expose its block layer API to let 3rd party program linked in, such as management stack or block

Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API

2012-07-09 Thread Wenchao Xia
于 2012-7-9 22:36, Christoph Hellwig 写道: On Mon, Jul 09, 2012 at 04:54:08PM +0800, Wenchao Xia wrote: Hi, Paolo and folks, qemu have good capabilities to access different virtual disks, I want to expose its block layer API to let 3rd party program linked in, such as management stack or block

[Qemu-devel] [RFC PATCH 0/2] live backup vm

2012-12-07 Thread Wenchao Xia
ake sure I am in the right direction, esp the implemention of savevm lively with vmstate, to see if there is potentional problem, such as creating snapshots takes too long? Other cases would be simpler if this case have no major problem found. Wenchao Xia (2): live backup vm, export functions l

[Qemu-devel] [RFC PATCH 2/2] live backup vm, snapshots all lively

2012-12-07 Thread Wenchao Xia
: Wenchao Xia --- buffered_file.c | 106 +++ buffered_file.h |1 + migration.c | 215 +++ migration.h | 13 4 files changed, 335 insertions(+), 0 deletions(-) diff --git a/buffered_file.c b/buffered_file.c

[Qemu-devel] [RFC PATCH 1/2] live backup vm, export functions

2012-12-07 Thread Wenchao Xia
This patch moved bdrv_snapshot_find() from savevm.c to block.c, also exports some function in savevm.c. Signed-off-by: Wenchao Xia --- block.c | 21 + block.h |2 ++ savevm.c | 37 +++-- sysemu.h |2 ++ 4 files changed, 36

Re: [Qemu-devel] [RFC PATCH 0/2] live backup vm

2012-12-08 Thread Wenchao Xia
Other cases would be simpler if this case have no major problem found. Wenchao Xia (2): live backup vm, export functions live backup vm, snapshots all lively block.c | 21 ++ block.h |2 + buffered_file.c | 106 +++ buffered_file.h |

[Qemu-devel] [PATCH] Build system clean generated source files in tests

2012-12-08 Thread Wenchao Xia
ix it. Steps to reproduce: in root source directory: 1 ./configure --target-list=x86_64-softmmu 2 make check-report-unit.xml 3 make distclean && rm -rf *-linux-user *-softmmu goto another directory: 4 configure 5 make check-report-unit.xml v2: rebased to upstream Signed-off-by: Wenchao Xi

Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-12-08 Thread Wenchao Xia
v11: Adjusting code in patch 4 to 7, details are in the child patch's commit message. v12: Split a patch to add a function in stubs, other change are in patch 4 to 7 commit messages. v13: Moved another function into stubs, added xml rule in tests/makefile, little changes in patch 4, 6,

Re: [Qemu-devel] [RFC PATCH 0/2] live backup vm

2012-12-09 Thread Wenchao Xia
de them as part of my serials. Just want to avoid conflict between your patch next year and mine by include yours as sub patches. :) -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC PATCH 0/2] live backup vm

2012-12-10 Thread Wenchao Xia
running make it not lively, am I right? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH qom-cpu 3/4] Really finally kill cpudef config section support

2012-12-11 Thread Wenchao Xia
all rules which should delete the def files, otherwise we met error: qemu-system-x86_64:/usr/local/etc/qemu/target-x86_64.conf:3: There is no option group 'cpudef' -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC PATCH 0/2] live backup vm

2012-12-11 Thread Wenchao Xia
e > > 4.) gqa unfreezefs > > 5.) qmp: savevm-end > > This restarts/resumes the VM > >> Have some questions: >> in qmp_savevm_start(), vm_stop(RUN_STATE_SAVE_VM), I think this will >> stop the VM running make it not lively, am I right? > > Yes, we need to halt the VM for a short period of time while we make > snapshots. But that time is usually short. > > - Dietmar > -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v13 0/7] libqblock qemu block layer library

2012-12-14 Thread Wenchao Xia
v13: Moved another function into stubs, added xml rule in tests/makefile, little changes in patch 4, 6, 7. Wenchao Xia (7): Hi Paolo, Do you think a rebase of the libqblock is needed? It have been quite a time without comments. -- Best Regards Wenchao Xia

[Qemu-devel] [PATCH 2/6] snapshot: add error set function

2012-12-16 Thread Wenchao Xia
Added two function which will try replace the error if it is already set, so only last error is reported. Signed-off-by: Wenchao Xia --- error.c | 23 +++ error.h |9 + 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/error.c b/error.c index

[Qemu-devel] [PATCH 5/6] snapshot: qmp interface

2012-12-16 Thread Wenchao Xia
own qmp interface or a group of BlockAction in qmp transaction interface. Signed-off-by: Wenchao Xia --- blockdev.c | 352 +++--- qapi-schema.json | 102 ++-- 2 files changed, 292 insertions(+), 162 deletions(-) diff --git a

[Qemu-devel] [PATCH 1/6] snapshot: export function in block.c

2012-12-16 Thread Wenchao Xia
This patch moves bdrv_snapshotfind from savevm.c to block.c and export it, also added bdrv_deappend in block.c. Signed-off-by: Wenchao Xia --- block.c | 30 ++ block.h |3 +++ savevm.c | 22 -- 3 files changed, 33 insertions(+), 22

[Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-16 Thread Wenchao Xia
ff-by: Wenchao Xia Signed-off-by: Dietmar Maurer --- blockdev.c | 515 1 files changed, 515 insertions(+), 0 deletions(-) diff --git a/blockdev.c b/blockdev.c index 9a05e57..1c38c67 100644 --- a/blockdev.c +++ b/blockdev.c @@ -660,6 +66

[Qemu-devel] [PATCH 3/6] snapshot: design of common API to take snapshots

2012-12-16 Thread Wenchao Xia
snapshot is splitted out from qmp layer, and now qmp can just translate the user request and fill in internal API. Internal API use params defined inside qemu, so other component inside qemu can use it without considering the qmp's parameter format. Signed-off-by: Wenchao Xia --- blockdev.h |

[Qemu-devel] [PATCH 0/6] snapshot: take snapshots in unified way

2012-12-16 Thread Wenchao Xia
three function: 1 live snapshot block device internal/external. 2 live save vmstate internal/external. 3 combination of the function unit. This patch basically provide function one in unified style with granularity of device. Wenchao Xia (6): snapshot: export function in block.c snapshot: add

[Qemu-devel] [PATCH 6/6] snapshot: human monitor interface

2012-12-16 Thread Wenchao Xia
This patch add support in human monitor to create/delete/check internal snapshot on a single blk device. To make info command get parameter, added a new info handler type which can take QDict as parameter. Signed-off-by: Wenchao Xia --- hmp-commands.hx | 50

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-16 Thread Wenchao Xia
? what command? can you tip more about the case? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-17 Thread Wenchao Xia
am not familar with those tools, Patch 5 and 6 provides hmp and qmp API, hope you can enlight more what is missing if it can't work with external tool. - Dietmar -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-18 Thread Wenchao Xia
little. I wonder why lvcreate can't be used, for block internal snapshot I think this patch have same function as your previous patch, what is missing? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-18 Thread Wenchao Xia
ssue, just wondering what this patch miss to stop you use external tool, did you called a LVM/nexenta C API in previous patch? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-18 Thread Wenchao Xia
() form. 1) will be added later, which have some issue need to solve now. qmp_transaction() or blkdev_snapshot() call the common API in this patch. "common API" in this patch is for qemu not user, it is hidden, maybe that caused misunderstanding. -- Best Regards Wenchao Xia

[Qemu-devel] [PATCH 0/3] HMP: enable info sub command taking parameter

2012-12-19 Thread Wenchao Xia
This serial of patch will enhance HMP's info command, make all command possible to take additional parameter. Please review to see if it have problem. Wenchao Xia (3): HMP: add QDict to info callback handler HMP: pass in parameter for info sub command HMP: show internal snapshots

[Qemu-devel] [PATCH 1/3] HMP: add QDict to info callback handler

2012-12-19 Thread Wenchao Xia
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Signed-off-by: Wenchao Xia --- hmp.c | 36 ++-- hmp.h | 36 ++-- hw

[Qemu-devel] [PATCH 2/3] HMP: pass in parameter for info sub command

2012-12-19 Thread Wenchao Xia
This patch enable sub info command handler getting meaningful parameter. Signed-off-by: Wenchao Xia --- hmp-commands.hx |2 +- monitor.c | 79 +++ 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/hmp-commands.hx b

[Qemu-devel] [PATCH 3/3] HMP: show internal snapshots on a single device

2012-12-19 Thread Wenchao Xia
This patch add an option to show snapshots on a single block device, so some snapshot do not exist on other block device could be shown. Signed-off-by: Wenchao Xia --- monitor.c |6 +++--- savevm.c | 55 ++- 2 files changed, 57

Re: [Qemu-devel] [PATCH v2 00/17] qapi: Convert savevm, loadvm, delvm and info snapshots

2012-12-19 Thread Wenchao Xia
> > We should also merge functionality of migrations and vm-snapshots and make > some clean-ups of this code. I could do it as another patch. With this > rewrite we could make vm-snapshots asynchronous. > > Hi, Pavel For vm-snapshots asynchronous, I have sent a RFC patch for it at: http://lists.

Re: [Qemu-devel] [PATCH 2/3] HMP: pass in parameter for info sub command

2012-12-19 Thread Wenchao Xia
> On Wed, 19 Dec 2012 18:17:09 +0800 Wenchao Xia wrote: This patch enable sub info command handler getting meaningful parameter. Signed-off-by: Wenchao Xia --- hmp-commands.hx |2 +- monitor.c | 79 +++ 2 files chan

[Qemu-devel] [RFC] lively write vmstate with predictable size

2012-12-20 Thread Wenchao Xia
er data analysis, and overwrite old data if address overlaps. So this will need qcow2 support write snapshot data at "address", and also change some savevm logic. Could u give some some comments on this to see if it is workable? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 2/6] snapshot: add error set function

2012-12-20 Thread Wenchao Xia
于 2012-12-21 5:36, Eric Blake 写道: On 12/16/2012 11:25 PM, Wenchao Xia wrote: Added two function which will try replace the error if it is already set, so only last error is reported. +#define error_setg_replace(err, fmt, ...) do { \ +if (*err != NULL

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-20 Thread Wenchao Xia
rnal tool using code, that would be great. For qemu, My understanding is just to take internal snapshot and stop vm, then let management stack do the things remain. Dietmar, do you think that is all what needed in qemu? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 1/3] HMP: add QDict to info callback handler

2012-12-24 Thread Wenchao Xia
OK, will add that in commit message. > > For now, the new argument is NULL, not an empty dictionary. Could be > mentioned in the commit message. Not worth a respin. > > [...] > -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 3/3] HMP: show internal snapshots on a single device

2012-12-24 Thread Wenchao Xia
mment. > > We usually capitalize TODO for easy grepping. > My mistake, this comments should have been removed, it is used before where qdict was not rebuilt as a new one. >> +const char *device = qdict_get_try_str(qdict, "device"); >> +if (!device) { >> +do_info_snapshots_vm(mon); >> +} else { >> +do_info_snapshots_blk(mon, device); >> +} >> +return; >> +} >> + >> void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev) >> { >> qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK, > -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 2/3] HMP: pass in parameter for info sub command

2012-12-24 Thread Wenchao Xia
于 2012-12-21 22:49, Markus Armbruster 写道: > Luiz Capitulino writes: > >> On Wed, 19 Dec 2012 18:17:09 +0800 >> Wenchao Xia wrote: >> >>>This patch enable sub info command handler getting meaningful >>> parameter. >>> >>> Sign

Re: [Qemu-devel] [PATCH 1/6] snapshot: export function in block.c

2012-12-24 Thread Wenchao Xia
于 2012-12-22 2:13, Juan Quintela 写道: > Wenchao Xia wrote: >>This patch moves bdrv_snapshotfind from savevm.c to block.c and export >> it, also added bdrv_deappend in block.c. > > I think this patch can be splitted in two: > - new bdv_deappend > - move bdrv_snaps

Re: [Qemu-devel] [RFC] lively write vmstate with predictable size

2012-12-24 Thread Wenchao Xia
Hi, Juan Thank u for reviewing on this, have some questions below. > Wenchao Xia wrote: >> resent the mail to mail-list. >> --- >> >> Hi, Paolo and Juan >> Currently savevm needs pause vm, and I am working on that make it >> livel

Re: [Qemu-devel] [PATCH 4/6] snapshot: implemention of common API to take snapshots

2012-12-24 Thread Wenchao Xia
ion was based on the code from >> diet...@proxmox.com. >> >> Signed-off-by: Wenchao Xia >> Signed-off-by: Dietmar Maurer >> --- >> blockdev.c | 515 >> >> 1 files changed, 515 insertions(+), 0 de

Re: [Qemu-devel] [PATCH 3/6] snapshot: design of common API to take snapshots

2012-12-24 Thread Wenchao Xia
于 2012-12-22 2:49, Juan Quintela 写道: > Wenchao Xia wrote: >> + >> +typedef struct SNTime { >> +uint32_t date_sec; /* UTC date of the snapshot */ >> +uint32_t date_nsec; > > This two fields are just struct timespec, does it makes sense to use it? > m

Re: [Qemu-devel] [PATCH 3/6] snapshot: design of common API to take snapshots

2012-12-24 Thread Wenchao Xia
> On 12/16/2012 11:25 PM, Wenchao Xia wrote: This patch added API to take snapshots in unified style for both internal or external type. The core structure is based on transaction, for that there is a qmp interface need to support , qmp_transaction, so all operations are packed as reque

[Qemu-devel] [PATCH] fix include file in hw/loader.h

2012-12-26 Thread Wenchao Xia
Now header files have gone into includes, so include file path needs change also to avoid build break. Signed-off-by: Wenchao Xia --- hw/loader.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/loader.h b/hw/loader.h index 26480ad..5e61c95 100644 --- a/hw

Re: [Qemu-devel] [PATCH] fix include file in hw/loader.h

2012-12-26 Thread Wenchao Xia
please ignore this mail, sorry for trouble. >Now header files have gone into includes, so include file path > needs change also to avoid build break. > > Signed-off-by: Wenchao Xia > --- > hw/loader.h |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-)

Re: [Qemu-devel] [RFC] lively write vmstate with predictable size

2012-12-26 Thread Wenchao Xia
> Hi, Juan >Thank u for reviewing on this, have some questions below. > >> Wenchao Xia wrote: >>> resent the mail to mail-list. >>> --- >>> >>> Hi, Paolo and Juan >>> Currently savevm needs pause vm, and

[Qemu-devel] [PATCH V2 0/3] HMP: allow parsing for sub command

2012-12-27 Thread Wenchao Xia
a hack. In this way extention of command folder level is easy. Moved some code and better doc according to comments. Removed the patch about info snapshots, which will goto another serial. Wenchao Xia (3): HMP: add QDict to info callback handler HMP: add infrastructure for sub command HMP

[Qemu-devel] [PATCH V2 2/3] HMP: add infrastructure for sub command

2012-12-27 Thread Wenchao Xia
This patch make parsing of hmp command aware of that it may have sub command. Also discard simple encapsulation function monitor_find_command() and qmp_find_cmd(). Signed-off-by: Wenchao Xia --- monitor.c | 44 +++- 1 files changed, 27 insertions

[Qemu-devel] [PATCH V2 1/3] HMP: add QDict to info callback handler

2012-12-27 Thread Wenchao Xia
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. v2: rebased, and better doc. Signed-off-by: Wenchao Xia --- hmp.c | 36

[Qemu-devel] [PATCH V2 3/3] HMP: add sub command table to info

2012-12-27 Thread Wenchao Xia
Now info command takes a table of sub info commands, and changed do_info() to do_info_help() to do help funtion only. Signed-off-by: Wenchao Xia --- hmp-commands.hx |3 ++- monitor.c | 34 +++--- 2 files changed, 9 insertions(+), 28 deletions(-) diff

[Qemu-devel] [PATCH V2 0/4] HMP: allow parsing for sub command

2012-12-27 Thread Wenchao Xia
a hack. In this way extention of command folder level is easy. Moved some code and better doc according to comments. Removed the patch about info snapshots, which will goto another serial. V3: Move changelog position. Split out code moving patch. Wenchao Xia (4): HMP: add QDict to info

[Qemu-devel] [PATCH V2 2/4] HMP: add infrastructure for sub command

2012-12-27 Thread Wenchao Xia
This patch make parsing of hmp command aware of that it may have sub command. Also discard simple encapsulation function monitor_find_command() and qmp_find_cmd(). Signed-off-by: Wenchao Xia --- monitor.c | 44 +++- 1 files changed, 27 insertions

[Qemu-devel] [PATCH V2 3/4] HMP: move define of mon_cmds

2012-12-27 Thread Wenchao Xia
Because mon_cmds may use info_cmds, so adjust the declare sequence of them. Signed-off-by: Wenchao Xia --- monitor.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index e4d4c59..a392df4 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH V2 1/4] HMP: add QDict to info callback handler

2012-12-27 Thread Wenchao Xia
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia --- v2: rebased, and better doc. v3: move changelog position. hmp.c | 36

Re: [Qemu-devel] [PATCH V2 1/3] HMP: add QDict to info callback handler

2012-12-27 Thread Wenchao Xia
> On Thu, Dec 27, 2012 at 04:56:27PM +0800, Wenchao Xia wrote: This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. v2: rebased, and better doc. Signed-off-by: Wenchao

Re: [Qemu-devel] [PATCH V2 1/3] HMP: add QDict to info callback handler

2012-12-27 Thread Wenchao Xia
Sorry I forgot to change the version number, pls ignore this serial. > On Thu, Dec 27, 2012 at 04:56:27PM +0800, Wenchao Xia wrote: This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL

[Qemu-devel] [PATCH V3 2/4] HMP: add infrastructure for sub command

2012-12-27 Thread Wenchao Xia
This patch make parsing of hmp command aware of that it may have sub command. Also discard simple encapsulation function monitor_find_command() and qmp_find_cmd(). Signed-off-by: Wenchao Xia --- monitor.c | 44 +++- 1 files changed, 27 insertions

[Qemu-devel] [PATCH V3 0/4] HMP: allow parsing for sub command

2012-12-27 Thread Wenchao Xia
a hack. In this way extention of command folder level is easy. Moved some code and better doc according to comments. Removed the patch about info snapshots, which will goto another serial. V3: Move changelog position. Split out code moving patch. Wenchao Xia (4): HMP: add QDict to info

[Qemu-devel] [PATCH V3 4/4] HMP: add sub command table to info

2012-12-27 Thread Wenchao Xia
Now info command takes a table of sub info commands, and changed do_info() to do_info_help() to do help funtion only. Signed-off-by: Wenchao Xia --- hmp-commands.hx |3 ++- monitor.c | 22 +- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/hmp

[Qemu-devel] [PATCH V3 1/4] HMP: add QDict to info callback handler

2012-12-27 Thread Wenchao Xia
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia --- v2: rebased, and better doc. v3: move changelog position. hmp.c | 36

[Qemu-devel] [PATCH V3 3/4] HMP: move define of mon_cmds

2012-12-27 Thread Wenchao Xia
Because mon_cmds may use info_cmds, so adjust the declare sequence of them. Signed-off-by: Wenchao Xia --- monitor.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index e4d4c59..a392df4 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH 00/11] add qmp/hmp interfaces for snapshot info

2012-12-29 Thread Wenchao Xia
dump_monitordump_stdout |--| | qmp | block Note: Last two patches need previous sent patches which extend hmp sub command, at: http://lists.nongnu.org/archive/html/qemu-devel/2012-12/msg03487.html Wenchao Xia (11): qemu-img

[Qemu-devel] [PATCH 06/11] qmp: add interface query-image

2012-12-29 Thread Wenchao Xia
This mirror function will return all image info including snapshots. Now Qemu have both query-image and query-block interfaces, and qemu-img share the code for image info retrieving with qemu emulator. Signed-off-by: Wenchao Xia --- block.c | 16 qapi-schema.json

[Qemu-devel] [PATCH 02/11] block: add bdrv_get_filename() function

2012-12-29 Thread Wenchao Xia
This function will simply return the uri or filename used to open the image. Signed-off-by: Wenchao Xia --- block.c |5 + include/block/block.h |1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 4e28c55..5f95da5 100644 --- a

[Qemu-devel] [PATCH 03/11] qemu-img: remove parameter filename in collect_image_info()

2012-12-29 Thread Wenchao Xia
Switch the filename getting from parameter to block function, now collect_image_info depends only on *bs. Signed-off-by: Wenchao Xia --- qemu-img.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 5a4df3a..d70435f 100644 --- a/qemu

[Qemu-devel] [PATCH 07/11] block: move bdrv_find_snapshot to block.c

2012-12-29 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- block.c | 23 +++ include/block/block.h |2 ++ savevm.c | 22 -- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/block.c b/block.c index 0e9f414..d7eb213 100644 --- a

[Qemu-devel] [PATCH 11/11] hmp: show snapshot on single block device

2012-12-29 Thread Wenchao Xia
This patch use block layer API to qmp snapshot info on a block device, then use the same code dumping vm snapshot info, to print in monitor. Note: This patch need previous hmp extention patch which enable info sub command take qdict * as paramter. Signed-off-by: Wenchao Xia --- monitor.c

[Qemu-devel] [PATCH 08/11] qmp: add interface query-snapshot

2012-12-29 Thread Wenchao Xia
This interface now return valid internal snapshots. Signed-off-by: Wenchao Xia --- block.c | 32 qapi-schema.json | 12 2 files changed, 44 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index d7eb213..ad058f9 100644

[Qemu-devel] [PATCH 01/11] qemu-img: remove unused parameter in collect_image_info()

2012-12-29 Thread Wenchao Xia
Parameter *fmt was not used, so remove it. Signed-off-by: Wenchao Xia --- qemu-img.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 69cc028..5a4df3a 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1182,8 +1182,7 @@ static void

[Qemu-devel] [PATCH 10/11] hmp: retrieve info from qmp for snapshot info

2012-12-29 Thread Wenchao Xia
stdout or monitor. Note: This patch need previous hmp extention patch which enable info sub command take qdict * as paramter. Signed-off-by: Wenchao Xia --- savevm.c | 83 - 1 files changed, 33 insertions(+), 50 deletions(-) diff

[Qemu-devel] [PATCH 05/11] block: rename bdrv_query_info to bdrv_query_block_info

2012-12-29 Thread Wenchao Xia
Now this function have a mirror name with bdrv_query_image_info to tip well what it is doing. Signed-off-by: Wenchao Xia --- block.c |4 ++-- include/block/block.h |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index d39da3d

[Qemu-devel] [PATCH 09/11] hmp: export function hmp_handle_error()

2012-12-29 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- hmp.c |2 +- hmp.h |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hmp.c b/hmp.c index 2465d9b..89a1a8c 100644 --- a/hmp.c +++ b/hmp.c @@ -23,7 +23,7 @@ #include "monitor/monitor.h" #include "ui/console.h&

[Qemu-devel] [PATCH 04/11] qemu-img: move image retrieving function to block layer

2012-12-29 Thread Wenchao Xia
filter out snapshot info not needed, a call back function is added in bdrv_query_snapshot_infolist(). Signed-off-by: Wenchao Xia --- block.c | 118 + include/block/block.h |9 qemu-img.c| 88

  1   2   3   4   5   6   7   8   9   10   >