[Qemu-devel] [PATCH v3 4/5] cutils: Add qemu_strtoull() wrapper

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoull() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 323 ++ util/cutils.c | 23 3 files ch

[Qemu-devel] [PATCH v3 2/5] cutils: Add qemu_strtoul() wrapper

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoul() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 318 ++ util/cutils.c | 32 + 3 files ch

[Qemu-devel] [PATCH v3 5/5] qmp: Add example usage of strto*l() qemu wrapper

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Signed-off-by: Carlos L. Torres --- qmp.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qmp.c b/qmp.c index 403805a..aa8c084 100644 --- a/qmp.c +++ b/qmp.c @@ -49,14 +49,20 @@ VersionInfo *qmp_query_version(Er

[Qemu-devel] [PATCH v3 3/5] cutils: Add qemu_strtoll() wrapper

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoll() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 320 ++ util/cutils.c | 23 3 files changed, 345

[Qemu-devel] [PATCH v3 1/5] cutils: Add qemu_strtol() wrapper

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtol() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 319 ++ util/cutils.c | 58 + 3 files ch

[Qemu-devel] [PATCH v3 0/5] cutils: Add qemu_strto*l() wrappers

2015-07-19 Thread Carlos L. Torres
From: "Carlos L. Torres" Introduce qemu_ wrappers for strtol/strtoul/strtoll/strtoull C functions, ensure that errno is checked, and if NULL is passed as the endptr argument, then whole string has to be a valid number on the given base, otherwise return appropriate error. Different

Re: [Qemu-devel] [PATCH v2 5/5] qmp: Add example usage of strto*l() qemu wrapper

2015-07-19 Thread Carlos L. Torres
On Sun, Jul 19, 2015 at 07:51:00PM +0200, Paolo Bonzini wrote: > > > On 19/07/2015 01:52, Carlos L. Torres wrote: > > +int err; > > > > info->qemu = g_new0(VersionTriple, 1); > > -info->qemu->major = strtol(version, &tmp, 10); > &

[Qemu-devel] [PATCH v2 4/5] cutils: Add qemu_strtoull() wrapper

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoull() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 323 ++ util/cutils.c | 23 3 files ch

[Qemu-devel] [PATCH v2 3/5] cutils: Add qemu_strtoll() wrapper

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoll() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 320 ++ util/cutils.c | 23 3 files changed, 345

[Qemu-devel] [PATCH v2 1/5] cutils: Add qemu_strtol() wrapper

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtol() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 319 ++ util/cutils.c | 58 + 3 files ch

[Qemu-devel] [PATCH v2 2/5] cutils: Add qemu_strtoul() wrapper

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoul() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 318 ++ util/cutils.c | 32 + 3 files ch

[Qemu-devel] [PATCH v2 0/5] cutils: Add qemu_strto*() wrappers

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Introduce qemu_ wrappers for strtol/strtoul/strtoll/strtoull C functions, ensure that errno is checked, and if NULL is passed as the endptr argument, then whole string has to be a valid number on the given base, otherwise return appropriate error. Different

[Qemu-devel] [PATCH v2 5/5] qmp: Add example usage of strto*l() qemu wrapper

2015-07-18 Thread Carlos L. Torres
From: "Carlos L. Torres" Signed-off-by: Carlos L. Torres --- qmp.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/qmp.c b/qmp.c index 403805a..837cb3f 100644 --- a/qmp.c +++ b/qmp.c @@ -49,14 +49,27 @@ VersionInfo *qmp_query_version(Er

[Qemu-devel] [PATCH 1/4] cutils: Add qemu_strtol() wrapper

2015-07-08 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtol() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 292 ++ util/cutils.c | 58 ++ 3 files ch

[Qemu-devel] [PATCH 3/4] cutils: Add qemu_strtoll() wrapper

2015-07-08 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoll() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 293 ++ util/cutils.c | 23 3 files changed, 318

[Qemu-devel] [PATCH 2/4] cutils: Add qemu_strtoul() wrapper

2015-07-08 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoul() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 291 ++ util/cutils.c | 27 + 3 files ch

[Qemu-devel] [PATCH 4/4] cutils: Add qemu_strtoull() wrapper

2015-07-08 Thread Carlos L. Torres
From: "Carlos L. Torres" Add wrapper for strtoull() function. Include unit tests. Signed-off-by: Carlos L. Torres --- include/qemu-common.h | 2 + tests/test-cutils.c | 296 ++ util/cutils.c | 23 3 files ch

[Qemu-devel] [PATCH 0/4] cutils: Add qemu_strto*l() wrappers

2015-07-08 Thread Carlos L. Torres
From: "Carlos L. Torres" Introduce qemu_ wrappers for strtol/strtoul/strtoll/strtoull C functions, ensure that errno is checked, and if NULL is passed as the endptr argument, then whole string has to be a valid number on the given base, otherwise return appropriate error. Different