[Qemu-devel] Re: [PATCH] cutils: Use int64_t instead of ssize_t for strtosz()

2011-01-10 Thread Jes Sorensen
On 01/10/11 11:29, Stefan Hajnoczi wrote: The strtosz() function parses byte count strings and converts K, M, G units. The ssize_t type is not appropriate because block devices need 64-bit range even on 32-bit hosts. Switch from ssize_t to int64_t. Hmmm I think this is identical to the patch

Re: [Qemu-devel] Re: KVM call agenda for Jan 11

2011-01-10 Thread Jes Sorensen
On 01/10/11 12:59, Juan Quintela wrote: Juan Quintela quint...@redhat.com wrote: Now sent it to the right kvm list. Sorry for the second sent. Please send any agenda items you are interested in covering. - KVM Forum 2011 (Jes). Just to add a bit more background. Last year we discussed

[Qemu-devel] [PATCH] do_snapshot_blkdev() error on missing snapshot_file argument

2011-01-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Current code does not support snapshot internally to the running image. Error in case no snapshot_file is specified. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- blockdev.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions

Re: [Qemu-devel] Re: Usefulness of the bug tracker

2011-01-06 Thread Jes Sorensen
On 01/06/11 16:11, Michael S. Tsirkin wrote: On Thu, Jan 06, 2011 at 10:28:46AM +, Stefan Hajnoczi wrote: The real problem is that we're collecting bugs but not effectively investigating and fixing them. Can Launchpad send out automatic bug summary emails once every week/two weeks/month?

[Qemu-devel] [PATCH] Make strtosz() return int64_t instead of ssize_t

2011-01-05 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com strtosz() needs to return a 64 bit type even on 32 bit architectures. Otherwise qemu-img will fail to create disk images = 2GB Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- cutils.c |8 monitor.c |2 +- qemu-common.h

[Qemu-devel] Re: [PATCH] Make strtosz() return int64_t instead of ssize_t

2011-01-05 Thread Jes Sorensen
On 01/05/11 13:34, Michael S. Tsirkin wrote: On Wed, Jan 05, 2011 at 11:41:02AM +0100, jes.soren...@redhat.com wrote: From: Jes Sorensen jes.soren...@redhat.com strtosz() needs to return a 64 bit type even on 32 bit architectures. Otherwise qemu-img will fail to create disk images = 2GB

[Qemu-devel] Re: [PATCH] Make strtosz() return int64_t instead of ssize_t

2011-01-05 Thread Jes Sorensen
On 01/05/11 14:46, Anthony Liguori wrote: On 01/05/2011 04:41 AM, jes.soren...@redhat.com wrote: From: Jes Sorensenjes.soren...@redhat.com strtosz() needs to return a 64 bit type even on 32 bit architectures. Otherwise qemu-img will fail to create disk images= 2GB Signed-off-by: Jes

[Qemu-devel] Re: [PATCH] Make strtosz() return int64_t instead of ssize_t

2011-01-05 Thread Jes Sorensen
On 01/05/11 19:29, Anthony Liguori wrote: I wouldn't make such bold claims but I'll concede that one is not significantly better than the other and won't object to int64_t if you feel strongly. The more I think of it, the more I come to the conclusion that int64_t is the best solution. Since

Re: [Qemu-devel] KVM call agenda for Jan 4

2011-01-04 Thread Jes Sorensen
On 01/03/11 11:57, Juan Quintela wrote: Please send any agenda items you are interested in covering. thanks, Juan. Do we have anything for the agenda yet? Jes

Re: [Qemu-devel] KVM call agenda for Jan 4

2011-01-04 Thread Jes Sorensen
On 01/04/11 15:33, Anthony Liguori wrote: On 01/04/2011 08:31 AM, Jes Sorensen wrote: On 01/03/11 11:57, Juan Quintela wrote: Please send any agenda items you are interested in covering. thanks, Juan. Do we have anything for the agenda yet? I could use the extra hour

[Qemu-devel] Re: [PATCH 1/2] block/qcow2.c: rename qcow_ functions to qcow2_

2010-12-17 Thread Jes Sorensen
On 12/17/10 15:20, Kevin Wolf wrote: offset = start_offset; while (offset end_offset) { @@ -88,13 +88,13 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, #ifdef DEBUG_EXT /* Sanity check */ if (offset s-cluster_size) -

[Qemu-devel] Re: [PATCH 2/2] Add proper -errno error return values to qcow2_open()

2010-12-17 Thread Jes Sorensen
On 12/17/10 15:27, Kevin Wolf wrote: Am 16.12.2010 17:05, schrieb jes.soren...@redhat.com: From: Jes Sorensen jes.soren...@redhat.com In addition this adds missing braces to the function to be consistent with the coding style. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block

[Qemu-devel] [PATCH v2 0/2] qcow2 cleanups

2010-12-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, These two patches tries to clean up the qcow2 code a little. First makes the function names consistent, ie. we shouldn't have qcow_ functions in the qcow2 code. Second tries to add proper errno return values to qcow2_open(). New in v2: Fix

[Qemu-devel] [PATCH 1/2] block/qcow2.c: rename qcow_ functions to qcow2_

2010-12-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com It doesn't really make sense for functions in qcow2.c to be named qcow_ so convert the names to match correctly. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block/qcow2-cluster.c |6 +- block/qcow2-snapshot.c |6 +- block/qcow2.c

[Qemu-devel] [PATCH 2/2] Add proper -errno error return values to qcow2_open()

2010-12-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com In addition this adds missing braces to the function to be consistent with the coding style. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block/qcow2.c | 60 +++- 1 files changed, 42

[Qemu-devel] [PATCH 1/3] qemu-img.c: Re-factor img_create()

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch re-factors img_create() moving the code doing the actual work into block.c where it can be shared with QEMU. This is needed to be able to create images from QEMU to be used for live snapshots. Signed-off-by: Jes Sorensen jes.soren

[Qemu-devel] [PATCH 3/3] Prevent creating an image with the same filename as backing file

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 765f9f3..027dc6a 100644 --- a/block.c +++ b/block.c @@ -2769,6 +2769,13 @@ int

[Qemu-devel] [PATCH v2 0/3] Re-factor img_create() and add live snapshots

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, This set of patches re-factors img_create() and moves the core part of it into block.c so it can be accessed from qemu as well as qemu-img. The second patch adds basic live snapshots support to the code, however only snapshots to external QCOW2

[Qemu-devel] [PATCH 2/3] Introduce do_snapshot_blkdev() and monitor command to handle it.

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com The monitor command is: snapshot_blkdev device [snapshot-file] [format] Default format is qcow2. For now snapshots without a snapshot-file, eg internal snapshots, are not supported. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- blockdev.c

[Qemu-devel] Re: [PATCH 2/3] Introduce do_snapshot_blkdev() and monitor command to handle it.

2010-12-16 Thread Jes Sorensen
On 12/16/10 12:45, Kevin Wolf wrote: Am 16.12.2010 12:04, schrieb jes.soren...@redhat.com: From: Jes Sorensen jes.soren...@redhat.com The monitor command is: snapshot_blkdev device [snapshot-file] [format] Default format is qcow2. For now snapshots without a snapshot-file, eg internal

[Qemu-devel] Re: [PATCH 1/3] qemu-img.c: Re-factor img_create()

2010-12-16 Thread Jes Sorensen
On 12/16/10 12:35, Kevin Wolf wrote: Am 16.12.2010 12:04, schrieb jes.soren...@redhat.com: + +backing_fmt = get_option_parameter(param, BLOCK_OPT_BACKING_FMT); +if (backing_fmt backing_fmt-value.s) { +if (!bdrv_find_format(backing_fmt-value.s)) { +

[Qemu-devel] [PATCH 2/4] Introduce do_snapshot_blkdev() and monitor command to handle it.

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com The monitor command is: snapshot_blkdev device [snapshot-file] [format] Default format is qcow2. For now snapshots without a snapshot-file, eg internal snapshots, are not supported. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- blockdev.c

[Qemu-devel] [PATCH 1/4] qemu-img.c: Re-factor img_create()

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch re-factors img_create() moving the code doing the actual work into block.c where it can be shared with QEMU. This is needed to be able to create images from QEMU to be used for live snapshots. Signed-off-by: Jes Sorensen jes.soren

[Qemu-devel] [PATCH v3 0/4] Re-factor img_create() and add live snapshots

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, This set of patches re-factors img_create() and moves the core part of it into block.c so it can be accessed from qemu as well as qemu-img. The second patch adds basic live snapshots support to the code, however only snapshots to external QCOW2

[Qemu-devel] [PATCH 4/4] bdrv_img_create() use proper errno return values

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Kevin suggested to have bdrv_img_create() return proper -errno values on error. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block.c | 23 ++- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/block.c b

[Qemu-devel] [PATCH 3/4] Prevent creating an image with the same filename as backing file

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block.c | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index a48b30c..0c14eee 100644 --- a/block.c +++ b/block.c @@ -2764,7 +2764,7 @@ int

[Qemu-devel] [PATCH] qemu.img.c: Use error_report() instead of own error() implementation

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c | 128 +-- 1 files changed, 63 insertions(+), 65 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 603bdb3..d3921b6 100644

[Qemu-devel] Re: [PATCH] qemu-img: Call error_set_progname

2010-12-16 Thread Jes Sorensen
On 12/16/10 15:13, Kevin Wolf wrote: Call error_set_progname during the qemu-img initialization, so that error messages printed with error_report() use the right prefix. Signed-off-by: Kevin Wolf kw...@redhat.com Acked-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c |3

[Qemu-devel] [PATCH 2/2] Add proper -errno error return values to qcow2_open()

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com In addition this adds missing braces to the function to be consistent with the coding style. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block/qcow2.c | 61 1 files changed, 43

[Qemu-devel] [PATCH 0/2] qcow2 cleanups

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, These two patches tries to clean up the qcow2 code a little. First makes the function names consistent, ie. we shouldn't have qcow_ functions in the qcow2 code. Second tries to add proper errno return values to qcow2_open(). Jes Sorensen (2

[Qemu-devel] [PATCH 1/2] block/qcow2.c: rename qcow_ functions to qcow2_

2010-12-16 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com It doesn't really make sense for functions in qcow2.c to be named qcow_ so convert the names to match correctly. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block/qcow2-cluster.c |6 +- block/qcow2-snapshot.c |6 +- block/qcow2.c

Re: [Qemu-devel] [PATCH v2 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-15 Thread Jes Sorensen
On 12/15/10 17:47, Markus Armbruster wrote: jes.soren...@redhat.com writes: From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument

[Qemu-devel] Re: [PATCH 2/3] Introduce do_snapshot_blkdev() and monitor command to handle it.

2010-12-15 Thread Jes Sorensen
On 12/15/10 17:55, Kevin Wolf wrote: +int do_snapshot_blkdev(Monitor *mon, const QDict *qdict, QObject **ret_data) +{ +const char *device = qdict_get_str(qdict, device); +const char *filename = qdict_get_try_str(qdict, snapshot_file); +const char *format = qdict_get_try_str(qdict,

[Qemu-devel] Re: [PATCH 0/3] Re-factor img_create() and add live snapshots

2010-12-15 Thread Jes Sorensen
On 12/15/10 17:52, Kevin Wolf wrote: Am 13.12.2010 08:32, schrieb jes.soren...@redhat.com: Jes Sorensen (3): qemu-img.c: Re-factor img_create() Introduce do_snapshot_blkdev() and monitor command to handle it. Prevent creating an image with the same filename as backing file

Re: [Qemu-devel] KVM call agenda for Dec 14

2010-12-14 Thread Jes Sorensen
On 12/14/10 01:12, Chris Wright wrote: Please send in any agenda items you are interested in covering. thanks, -chris Chris, Any chance you could fix your cronjob to send out the CFA a day earlier? 15 hrs before is a bit short notice. Cheers, Jes

[Qemu-devel] Re: [RFC][PATCH v5 08/21] virtagent: add agent_viewfile qmp/hmp command

2010-12-13 Thread Jes Sorensen
On 12/10/10 18:09, Michael Roth wrote: I think with strictly enforced size limits the major liability for viewfile is, as you mentioned, users using it to view binary data or carefully crafted files that can mess up or fool users/shells/programs interpreting monitor output. But plain-text

[Qemu-devel] [PATCH 3/3] Prevent creating an image with the same filename as backing file

2010-12-12 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 3ab062c..403a434 100644 --- a/block.c +++ b/block.c @@ -2752,6 +2752,13 @@ int

[Qemu-devel] [PATCH 0/3] Re-factor img_create() and add live snapshots

2010-12-12 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, This set of patches re-factors img_create() and moves the core part of it into block.c so it can be accessed from qemu as well as qemu-img. The second patch adds basic live snapshots support to the code, however only snapshots to external QCOW2

[Qemu-devel] [PATCH 2/3] Introduce do_snapshot_blkdev() and monitor command to handle it.

2010-12-12 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com The monitor command is: snapshot_blkdev device [snapshot-file] [format] Default format is qcow2. For now snapshots without a snapshot-file, eg internal snapshots, are not supported. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- blockdev.c

[Qemu-devel] [PATCH 1/3] qemu-img.c: Re-factor img_create()

2010-12-12 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch re-factors img_create() moving the code doing the actual work into block.c where it can be shared with QEMU. This is needed to be able to create images from QEMU to be used for live snapshots. Signed-off-by: Jes Sorensen jes.soren

[Qemu-devel] Re: [RFC][PATCH v5 07/21] virtagent: add va.getfile RPC

2010-12-10 Thread Jes Sorensen
On 12/09/10 22:04, Michael Roth wrote: On 12/09/2010 08:40 AM, Adam Litke wrote: Actually, a host-controlled interface would be both simpler to implement (on both ends) and would concentrate control in the host (which is what we probably want anyway). I also like the host-controlled

Re: [Qemu-devel] Re: [RFC][PATCH v5 09/21] virtagent: add va.getdmesg RPC

2010-12-09 Thread Jes Sorensen
On 12/07/10 18:32, Michael Roth wrote: On 12/07/2010 08:37 AM, Jes Sorensen wrote: On 12/03/10 19:03, Michael Roth wrote: +static xmlrpc_value *va_getdmesg(xmlrpc_env *env, + xmlrpc_value *param, + void *user_data) +{ +char

Re: [Qemu-devel] Re: [RFC][PATCH v5 04/21] virtagent: transport definitions and job callbacks

2010-12-09 Thread Jes Sorensen
On 12/07/10 18:19, Michael Roth wrote: On 12/07/2010 07:44 AM, Jes Sorensen wrote: +static int va_end_of_header(char *buf, int end_pos) +{ +return !strncmp(buf+(end_pos-2), \n\r\n, 3); +} Maybe I am missing something here, but it looks like you do a strncmp to a char that is one past

[Qemu-devel] Re: [RFC][PATCH v5 07/21] virtagent: add va.getfile RPC

2010-12-09 Thread Jes Sorensen
On 12/07/10 17:00, Adam Litke wrote: Hi Jes, you raise some good points and pitfalls with the current getfile approach. I've been thinking about an alternative and am wondering what you (and others) think... First off, I think we should switch to a copyfile() API that allows us to avoid

[Qemu-devel] [PATCH 2/2] Make img_create() use strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This reestablished the old default of using bytes as the default for the size argument, and not MB as we do in pretty much every other place. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c |2 +- 1 files changed, 1 insertions

[Qemu-devel] [PATCH v3 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument to the command line. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c

[Qemu-devel] [PATCH 1/2] Introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This introduces strtosz_suffix() which allows the caller to specify a default suffix in case the non default of MB is wanted. strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's current default of MB. Signed-off-by: Jes Sorensen

[Qemu-devel] [PATCH 1/2] Introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This introduces strtosz_suffix() which allows the caller to specify a default suffix in case the non default of MB is wanted. strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's current default of MB. Signed-off-by: Jes Sorensen

[Qemu-devel] [PATCH v4 0/2] Clean up img_create() and introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch set introduces strtosz_suffix() which is needed to be able to use strtosz parsing with a non MB default suffix. This is used to clean up qemu-img.c:img_create(). Kevin asked me to rebase this instead of applying the other patches on top, so

[Qemu-devel] [PATCH 2/2] qemu-img.c: Clean up handling of image size in img_create()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument to the command line. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c

[Qemu-devel] [PATCH 0/2] Fix size default for qemu-img

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Kevin pointed out that my chance to img_create()'s handling of the image size, changed the previous default of byte for size if no suffix was specified, since strtosz() defaults to MB. This patch set introduces strtosz_suffix() and then changes

[Qemu-devel] [PATCH 1/1] Introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This introduces strtosz_suffix() which allows the caller to specify a default suffix in case the non default of MB is wanted. strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's current default of MB. Signed-off-by: Jes Sorensen

[Qemu-devel] [PATCH 2/2] qemu-img.c: Clean up handling of image size in img_create()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument to the command line. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c

[Qemu-devel] [PATCH v5 0/2] Clean up img_create() and introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch set introduces strtosz_suffix() which is needed to be able to use strtosz parsing with a non MB default suffix. This is used to clean up qemu-img.c:img_create(). Kevin asked me to rebase this instead of applying the other patches on top, so

[Qemu-devel] Re: [PATCH 1/2] Introduce strtosz_suffix()

2010-12-09 Thread Jes Sorensen
On 12/09/10 13:53, Stefan Hajnoczi wrote: On Thu, Dec 09, 2010 at 01:13:33PM +0100, jes.soren...@redhat.com wrote: @@ -371,3 +377,8 @@ fail: return retval; } + +ssize_t strtosz(const char *nptr, char **end) +{ +return strtosz_suffix(nptr, end, 0); This obscures what the

[Qemu-devel] [PATCH 1/2] Introduce strtosz_suffix()

2010-12-09 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This introduces strtosz_suffix() which allows the caller to specify a default suffix in case the non default of MB is wanted. strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's current default of MB. Signed-off-by: Jes Sorensen

[Qemu-devel] Re: [RFC][PATCH v5 08/21] virtagent: add agent_viewfile qmp/hmp command

2010-12-09 Thread Jes Sorensen
On 12/09/10 22:12, Michael Roth wrote: On 12/07/2010 08:26 AM, Jes Sorensen wrote: I believe this suffers from the same architectural problem I mentioned in my comment to 07/21 - you don't restrict the file size, so it could blow up the QEMU process on the host trying to view the wrong file

Re: [Qemu-devel] Re: [RFC][PATCH v5 09/21] virtagent: add va.getdmesg RPC

2010-12-09 Thread Jes Sorensen
On 12/09/10 22:15, Michael Roth wrote: On 12/08/2010 01:22 PM, Jes Sorensen wrote: This param is kind of quirky though, size doesn't seem to have an affect for anything below 4KB, but if we stick with VA_DMESG_LEN= 4KB this should cover us, unless it's a distro-specific. But it should blow

[Qemu-devel] [PATCH v2 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-08 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument to the command line. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c

Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-08 Thread Jes Sorensen
On 12/08/10 09:54, Kevin Wolf wrote: Am 07.12.2010 21:36, schrieb Stefan Hajnoczi: Today it is possible to create 0 byte sized images. Your patch will change that: If there is a backing file, then the size will be taken from the backing file. If there is no backing file, then an error

Re: [Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handlers into utility functions

2010-12-08 Thread Jes Sorensen
On 12/08/10 10:15, Stefan Hajnoczi wrote: On Tue, Dec 07, 2010 at 04:02:03PM +0100, Jes Sorensen wrote: Anything to avoid qemu_set_fd_handler17() at some point. I think using __qemu_set_fd_handler() encourages people to modify that code rather than copy it. I agree that qemu_set_fd_handler3

Re: [Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handlers into utility functions

2010-12-08 Thread Jes Sorensen
On 12/08/10 10:23, Stefan Hajnoczi wrote: From 7.1.3 Reserved identifiers: All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. and All identifiers that begin with an underscore are always reserved for use

[Qemu-devel] Re: [RFC][PATCH v5 00/21] virtagent: host/guest RPC communication agent

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: These patches apply to master, and can also be obtained from: git://repo.or.cz/qemu/mdroth.git virtagent_v5 CHANGES IN V5: - Dependency on virtproxy dropped, virtagent now handles transport and multiplexing of bi-directional RPCs internally -

[Qemu-devel] [PATCH 1/1] qemu-img: Deprecate obsolete -6 and -e options

2010-12-07 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com If -6 or -e is specified, an error message is printed and we exit. It does not print help() to avoid the error message getting lost in the noise. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block_int.h |1 - qemu-img.c | 53

[Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handlers into utility functions

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: This allows us to implement an i/o loop outside of vl.c that can interact with objects that use qemu_set_fd_handler() Signed-off-by: Michael Roth mdr...@linux.vnet.ibm.com This commit message really tells us nothing. Please be more specific about what

[Qemu-devel] Re: [RFC][PATCH v5 03/21] virtagent: common code for managing client/server rpc jobs

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: This implements a simple state machine to manage client/server rpc jobs being multiplexed over a single channel. A client job consists of sending an rpc request, reading an rpc response, then making the appropriate callbacks. We allow one client job to

[Qemu-devel] Re: [RFC][PATCH v5 04/21] virtagent: transport definitions and job callbacks

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: +static void va_server_read_cb(const char *content, size_t content_len) +{ +xmlrpc_mem_block *resp_xml; +VAServerData *server_data = va_state-server_data; +int ret; + +TRACE(called); +resp_xml =

[Qemu-devel] Re: [RFC][PATCH v5 05/21] virtagent: base client definitions

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: +#ifndef VIRTAGENT_H +#define VIRTAGENT_H + +#include monitor.h + +#define GUEST_AGENT_PATH_CLIENT /tmp/virtagent-guest-client.sock +#define HOST_AGENT_PATH_CLIENT /tmp/virtagent-host-client.sock As mentioned last time, this belongs in a config file.

[Qemu-devel] Re: [RFC][PATCH v5 06/21] virtagent: base server definitions

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: +#define GUEST_AGENT_SERVICE_ID virtagent +#define GUEST_AGENT_PATH /tmp/virtagent-guest.sock +#define HOST_AGENT_SERVICE_ID virtagent-host +#define HOST_AGENT_PATH /tmp/virtagent-host.sock +#define VA_GETFILE_MAX 1 30 +#define VA_FILEBUF_LEN 16384

[Qemu-devel] Re: [RFC][PATCH v5 07/21] virtagent: add va.getfile RPC

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: Add RPC to retrieve a guest file. This interface is intended for smaller reads like peeking at logs and /proc and such. I think you need to redesign your approach here. see below. In 06/21 you had: +#define VA_GETFILE_MAX 1 30 +while ((ret =

[Qemu-devel] Re: [RFC][PATCH v5 08/21] virtagent: add agent_viewfile qmp/hmp command

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: Utilize the getfile RPC to provide a means to view text files in the guest. Getfile can handle binary files as well but we don't advertise that here due to the special handling requiring to store it and provide it back to the user (base64 encoding it for

[Qemu-devel] Re: [RFC][PATCH v5 09/21] virtagent: add va.getdmesg RPC

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: Add RPC to view guest dmesg output. Signed-off-by: Michael Roth mdr...@linux.vnet.ibm.com --- virtagent-server.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git

[Qemu-devel] Re: [RFC][PATCH v5 20/21] virtagent: integrate virtagent server/client via chardev

2010-12-07 Thread Jes Sorensen
On 12/03/10 19:03, Michael Roth wrote: +#include virtagent-common.h + +static CharDriverState *qemu_chr_open_virtagent(QemuOpts *opts) +{ +CharDriverState *chr; +int fd, ret; + +/* revert to/enforce default socket chardev options for virtagent */ +if (qemu_opt_get(opts,

Re: [Qemu-devel] Re: [RFC][PATCH v5 01/21] Move code related to fd handlers into utility functions

2010-12-07 Thread Jes Sorensen
On 12/07/10 15:48, Michael Roth wrote: On 12/07/2010 07:31 AM, Jes Sorensen wrote: On 12/03/10 19:03, Michael Roth wrote: This allows us to implement an i/o loop outside of vl.c that can interact with objects that use qemu_set_fd_handler() Signed-off-by: Michael Rothmdr...@linux.vnet.ibm.com

Re: [Qemu-devel] KVM call agenda for Dec 7

2010-12-07 Thread Jes Sorensen
On 12/07/10 00:51, Chris Wright wrote: Please send in any agenda items you are interested in covering. thanks, -chris No agenda, no replies Call canceled I presume? Jes

[Qemu-devel] Re: [PATCH 1/1] qemu-img: Deprecate obsolete -6 and -e options

2010-12-07 Thread Jes Sorensen
On 12/07/10 17:02, Kevin Wolf wrote: @@ -323,11 +310,13 @@ static int img_create(int argc, char **argv) fmt = optarg; break; case 'e': -flags |= BLOCK_FLAG_ENCRYPT; -break; +printf(qemu-img: option -e is deprecated,

[Qemu-devel] [PATCH v2 1/1] qemu-img: Deprecate obsolete -6 and -e options

2010-12-07 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com If -6 or -e is specified, an error message is printed and we exit. It does not print help() to avoid the error message getting lost in the noise. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- block_int.h |1 - qemu-img.c | 53

[Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-07 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This cleans up the handling of image size in img_create() by parsing the value early, and then only setting it once if a value has been added as the last argument to the command line. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c

Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create()

2010-12-07 Thread Jes Sorensen
On 12/07/10 21:36, Stefan Hajnoczi wrote: On Tue, Dec 7, 2010 at 5:39 PM, jes.soren...@redhat.com wrote: // The size for the image must always be specified, with one exception: // If we are using a backing file, we can obtain the size from there -if (get_option_parameter(param,

Re: [Qemu-devel] [PATCH 3/3] Fail if detecting an unknown option

2010-12-06 Thread Jes Sorensen
On 12/03/10 12:46, Stefan Hajnoczi wrote: On Thu, Dec 2, 2010 at 5:46 PM, jes.soren...@redhat.com wrote: From: Jes Sorensen jes.soren...@redhat.com This patch changes qemu-img to exit if an unknown option is detected, instead of trying to continue with a set of arguments which may

[Qemu-devel] Re: [PATCH 3/3] Fail if detecting an unknown option

2010-12-06 Thread Jes Sorensen
On 12/03/10 13:30, Kevin Wolf wrote: Am 02.12.2010 18:46, schrieb jes.soren...@redhat.com: diff --git a/qemu-img.c b/qemu-img.c index d0dc445..f2e1c94 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -304,6 +304,12 @@ static int img_create(int argc, char **argv) flags = 0; for(;;) {

[Qemu-devel] [PATCH v2 0/3] Cleanup qemu-img code

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, These patches moves the handling of block help printing to shared code, which allows the ? detection to happen early in the parsing, instead of half way down img_create() and img_convert(). I would like to see this happen as I would like to pull

[Qemu-devel] [PATCH 3/3] Fail if detecting an unknown option

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch changes qemu-img to exit if an unknown option is detected, instead of trying to continue with a set of arguments which may be incorrect. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c |8 1 files changed, 8

[Qemu-devel] [PATCH 2/3] Fix formatting and missing braces in qemu-img.c

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- qemu-img.c | 77 +++ 1 files changed, 51 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This consolidates the printing of block driver options in print_block_option_help() which is called from both img_create() and img_convert(). This allows for the ? detection to be done just after the parsing of options and the filename, instead of half

[Qemu-devel] Re: [PATCH 3/3] Fail if detecting an unknown option

2010-12-06 Thread Jes Sorensen
On 12/06/10 10:37, Kevin Wolf wrote: Am 06.12.2010 09:02, schrieb Jes Sorensen: On 12/03/10 13:30, Kevin Wolf wrote: There is a perfectly logical explanation for that. Doing that would require for me to have clue, which is a bit much to expect :) That said, we should really do the same

Re: [Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options

2010-12-06 Thread Jes Sorensen
On 12/06/10 10:32, Stefan Hajnoczi wrote: On Mon, Dec 6, 2010 at 8:17 AM, jes.soren...@redhat.com wrote: @@ -694,6 +721,11 @@ static int img_convert(int argc, char **argv) out_filename = argv[argc - 1]; +if (options !strcmp(options, ?)) { +ret =

Re: [Qemu-devel] [PATCH 1/3] Consolidate printing of block driver options

2010-12-06 Thread Jes Sorensen
On 12/06/10 11:37, Stefan Hajnoczi wrote: On Mon, Dec 6, 2010 at 10:20 AM, Jes Sorensen jes.soren...@redhat.com wrote: On 12/06/10 10:32, Stefan Hajnoczi wrote: On Mon, Dec 6, 2010 at 8:17 AM, jes.soren...@redhat.com wrote: Why goto out2 and not just return like the bs 1 out_baseimg check

[Qemu-devel] [PATCH v3 0/7] Cleanup qemu-img code

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Hi, These patches applies a number of cleanups to qemu-img.c as well as a minor bug in qemu-malloc.c. The handling of block help printing is moved to shared code, which allows the ? detection to happen early in the parsing, instead of half way down

[Qemu-devel] [PATCH 1/7] Add missing tracing to qemu_mallocz()

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-malloc.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/qemu-malloc.c b/qemu-malloc.c index 28fb05a..b9b3851 100644 --- a/qemu-malloc.c +++ b/qemu-malloc.c

[Qemu-devel] [PATCH 2/7] Use qemu_mallocz() instead of calloc() in img_convert()

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index fa77ac0..eca99c4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -699,11 +699,7

[Qemu-devel] [PATCH 5/7] Consolidate printing of block driver options

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This consolidates the printing of block driver options in print_block_option_help() which is called from both img_create() and img_convert(). This allows for the ? detection to be done just after the parsing of options and the filename, instead of half

[Qemu-devel] [PATCH 4/7] Make error handling more consistent in img_create() and img_resize()

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index aded72d..7f4939e 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -314,13

[Qemu-devel] [PATCH 6/7] Fix formatting and missing braces in qemu-img.c

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- qemu-img.c | 77 +++ 1 files changed, 51 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH 3/7] img_convert(): Only try to free bs[] entries if bs is valid.

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This allows for jumping to 'out:' consistently for error exit. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index eca99c4

[Qemu-devel] [PATCH 7/7] Fail if detecting an unknown option

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com This patch changes qemu-img to exit if an unknown option is detected, instead of trying to continue with a set of arguments which may be incorrect. Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c |8 1 files changed, 8

[Qemu-devel] Re: [PATCH 4/7] Make error handling more consistent in img_create() and img_resize()

2010-12-06 Thread Jes Sorensen
On 12/06/10 16:25, Kevin Wolf wrote: } n = get_option_parameter(param, BLOCK_OPT_SIZE)-value.n; free_option_parameters(param); bs = bdrv_new_open(filename, fmt, BDRV_O_FLAGS | BDRV_O_RDWR); if (!bs) { -return 1; +ret = -1; +goto out;

[Qemu-devel] [PATCH 4/7] Make error handling more consistent in img_create() and img_resize()

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index aded72d..2deac67 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -314,13

[Qemu-devel] Re: [PATCH 4/7] Make error handling more consistent in img_create() and img_resize()

2010-12-06 Thread Jes Sorensen
On 12/06/10 16:57, Kevin Wolf wrote: bdrv_delete doesn't check for NULL, so this still isn't enough. Try something like qemu-img resize -f vmdx foo +0 and you'll get a segfault. G :( It's a bummer things are so inconsistent throughout QEMU, most of the free() functions can handle it.

[Qemu-devel] [PATCH v5 4/7] Make error handling more consistent in img_create() and img_resize()

2010-12-06 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- qemu-img.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index aded72d..6b2b18b 100644 --- a/qemu-img.c +++ b/qemu-img.c

<    1   2   3   4   5   6   7   8   9   >