Skip to contentSkip to conversation

Trivial patches

PATCH Applied Maria Kustova 3 participants 8 messages Mar 18, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

v2 cover Trivial patches

These patches are the part of OPW application.
Two of them update help messages of qemu-io utility. And last one replaces fprintf() with error_setg() in curl.c

Changes v1 -> v2:
* Removed trailing "\n" from the error string in error_setg() call

Maria Kustova (3):
qemu-io-cmds: Fixed typo in example for writev.
block: Replaced old error handling with error reporting API.
qemu-io: Extended "--cmd" description in usage text

 block/curl.c   | 2 +-
 qemu-io-cmds.c | 2 +-
 qemu-io.c      | 9 ++++++---
 3 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v2 1/3 qemu-io-cmds: Fixed typo in example for writev.

---
 qemu-io-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-io-cmds.c +1 -1
index f1de24c..5707bda 100644
@@ -1087,7 +1087,7 @@ writev_help(void)
 " writes a range of bytes from the given offset source from multiple buffers\n"
 "\n"
 " Example:\n"
-" 'write 512 1k 1k' - writes 2 kilobytes at 512 bytes into the open file\n"
+" 'writev 512 1k 1k' - writes 2 kilobytes at 512 bytes into the open file\n"
 "\n"
 " Writes into a segment of the currently open file, using a buffer\n"
 " filled with a set pattern (0xcdcdcdcd).\n"
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v2 2/3 block: Replaced old error handling with error reporting API.

In reply to Maria Kustova

---
Changes v1 -> v2:
* Removed trailing "\n" from the error string

---
 block/curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/curl.c +1 -1
index 3494c6d..359637e 100644
@@ -538,8 +538,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
     return 0;
 
 out:
-    fprintf(stderr, "CURL: Error opening file: %s\n", state->errmsg);
+    error_setg(errp, "CURL: Error opening file: %s", state->errmsg);
     curl_easy_cleanup(state->curl);
     state->curl = NULL;
 out_noclean:
Signature · 1 line
1.8.2.1
#3 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] block: Replaced old error handling with error reporting API.

Am 18.03.2014 um 06:59 hat Maria Kustova geschrieben:

block/curl.c static int curl_open(BlockDriverState *bs, QDict *options, int flags,

Quoted 13 lines

---
Changes v1 -> v2:
* Removed trailing "\n" from the error string

---
 block/curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/curl.c +0 -0
index 3494c6d..359637e 100644
@@ -538,8 +538,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,

Did you manually edit this patch? It is corrupted and I had to manually s/538,8/538,7/ before I could apply it.

Kevin

Quoted 11 lines
block/curl.c +1 -1
     return 0;
 
 out:
-    fprintf(stderr, "CURL: Error opening file: %s\n", state->errmsg);
+    error_setg(errp, "CURL: Error opening file: %s", state->errmsg);
     curl_easy_cleanup(state->curl);
     state->curl = NULL;
 out_noclean:
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH v2 3/3 qemu-io: Extended "--cmd" description in usage text

In reply to Maria Kustova

It's not clear from the usage description that "--cmd" option accepts its argument as a string, so any special symbols have to be quoted from the shell. Updates in usage text:
- Specified parameter format for "--cmd" option.
- Added an instruction how to get help for "--cmd" option.

---
 qemu-io.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
qemu-io.c +6 -3
index fc38608..be68d96 100644
@@ -194,10 +194,11 @@ static const cmdinfo_t quit_cmd = {
 static void usage(const char *name)
 {
     printf(
-"Usage: %s [-h] [-V] [-rsnm] [-c cmd] ... [file]\n"
+"Usage: %s [-h] [-V] [-rsnm] [-c STRING] ... [file]\n"
 "QEMU Disk exerciser\n"
 "\n"
-"  -c, --cmd            command to execute\n"
+"  -c, --cmd STRING     execute command with its arguments\n"
+"                       from the given string\n"
 "  -r, --read-only      export read-only\n"
 "  -s, --snapshot       use snapshot file\n"
 "  -n, --nocache        disable host cache\n"
@@ -208,8 +209,10 @@ static void usage(const char *name)
 "  -T, --trace FILE     enable trace events listed in the given file\n"
 "  -h, --help           display this help and exit\n"
 "  -V, --version        output version information and exit\n"
+"\n"
+"See '%s -c help' for information on available commands."
 "\n",
-    name);
+    name, name);
 }
 
 static char *get_prompt(void)
Signature · 1 line
1.8.2.1
#5 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] qemu-io: Extended "--cmd" description in usage text

Am 18.03.2014 um 06:59 hat Maria Kustova geschrieben:

Quoted 1 line

It's not clear from the usage description that "--cmd" option accepts its argument as a string, so any special symbols have to be quoted from the shell.

For future patches, please make sure to wrap your lines in the commit message at ideally ~72, but at most 80 characters. This instance I fixed up while applying the patch.

Kevin

Quoted 5 lines

Updates in usage text:
- Specified parameter format for "--cmd" option.
- Added an instruction how to get help for "--cmd" option.

Applied
#6 lore raw
In reply to Maria Kustova

Am 18.03.2014 um 06:59 hat Maria Kustova geschrieben:

Quoted 11 lines

These patches are the part of OPW application.
Two of them update help messages of qemu-io utility. And last one replaces fprintf() with error_setg() in curl.c

Changes v1 -> v2:
* Removed trailing "\n" from the error string in error_setg() call

Maria Kustova (3):
qemu-io-cmds: Fixed typo in example for writev.
block: Replaced old error handling with error reporting API.
qemu-io: Extended "--cmd" description in usage text

Thanks, applied patches 1 and 3 to the block branch for 2.0, and patch 2 to block-next for 2.1.

Kevin

Acked-by on the v2 series
#7 lore raw
In reply to Maria Kustova
Quoted 12 lines · Maria Kustova

These patches are the part of OPW application.
Two of them update help messages of qemu-io utility. And last one replaces fprintf() with error_setg() in curl.c

Changes v1 -> v2:
* Removed trailing "\n" from the error string in error_setg() call

Maria Kustova (3):
qemu-io-cmds: Fixed typo in example for writev.
block: Replaced old error handling with error reporting API.
qemu-io: Extended "--cmd" description in usage text

Quoted 4 lines
 block/curl.c   | 2 +-
 qemu-io-cmds.c | 2 +-
 qemu-io.c      | 9 ++++++---
 3 files changed, 8 insertions(+), 5 deletions(-)

Thanks!