From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 11/26] qemu-io: Move qemu_strsep() to cutils.c
Date: Fri, 7 Jun 2013 13:58:30 +0200 [thread overview]
Message-ID: <1370606325-10680-12-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1370606325-10680-1-git-send-email-stefanha@redhat.com>
From: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
cmd.c | 21 ---------------------
include/qemu-common.h | 1 +
util/cutils.c | 21 +++++++++++++++++++++
3 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/cmd.c b/cmd.c
index 8496e74..f6bf2c5 100644
--- a/cmd.c
+++ b/cmd.c
@@ -255,27 +255,6 @@ fetchline(void)
}
#endif
-static char *qemu_strsep(char **input, const char *delim)
-{
- char *result = *input;
- if (result != NULL) {
- char *p;
-
- for (p = result; *p != '\0'; p++) {
- if (strchr(delim, *p)) {
- break;
- }
- }
- if (*p == '\0') {
- *input = NULL;
- } else {
- *p = '\0';
- *input = p + 1;
- }
- }
- return result;
-}
-
char **breakline(char *input, int *count)
{
int c = 0;
diff --git a/include/qemu-common.h b/include/qemu-common.h
index d95ea1e..ed8b6e2 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -174,6 +174,7 @@ char *pstrcat(char *buf, int buf_size, const char *s);
int strstart(const char *str, const char *val, const char **ptr);
int stristart(const char *str, const char *val, const char **ptr);
int qemu_strnlen(const char *s, int max_len);
+char *qemu_strsep(char **input, const char *delim);
time_t mktimegm(struct tm *tm);
int qemu_fls(int i);
int qemu_fdatasync(int fd);
diff --git a/util/cutils.c b/util/cutils.c
index 8f28896..0116fcd 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -107,6 +107,27 @@ int qemu_strnlen(const char *s, int max_len)
return i;
}
+char *qemu_strsep(char **input, const char *delim)
+{
+ char *result = *input;
+ if (result != NULL) {
+ char *p;
+
+ for (p = result; *p != '\0'; p++) {
+ if (strchr(delim, *p)) {
+ break;
+ }
+ }
+ if (*p == '\0') {
+ *input = NULL;
+ } else {
+ *p = '\0';
+ *input = p + 1;
+ }
+ }
+ return result;
+}
+
time_t mktimegm(struct tm *tm)
{
time_t t;
--
1.8.1.4
next prev parent reply other threads:[~2013-06-07 11:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 11:58 [Qemu-devel] [PULL 00/26] Block patches Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 01/26] blockdev: reset werror/rerror on drive_del Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 02/26] qemu-io: Remove unused args_command Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 03/26] cutils: Support 'P' and 'E' suffixes in strtosz() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 04/26] qemu-io: Make cvtnum() a wrapper around strtosz_suffix() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 05/26] qemu-io: Handle cvtnum() errors in 'alloc' Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 06/26] qemu-io: Don't use global bs in command implementations Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 07/26] qemu-io: Split off commands to qemu-io-cmds.c Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 08/26] qemu-io: Factor out qemuio_command Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 09/26] qemu-io: Move 'help' function Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 10/26] qemu-io: Move 'quit' function Stefan Hajnoczi
2013-06-07 11:58 ` Stefan Hajnoczi [this message]
2013-06-07 11:58 ` [Qemu-devel] [PULL 12/26] qemu-io: Move functions for registering and running commands Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 13/26] qemu-io: Move command_loop() and friends Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 14/26] qemu-io: Move remaining helpers from cmd.c Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 15/26] qemu-io: Interface cleanup Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 16/26] qemu-io: Use the qemu version for -V Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 17/26] Make qemu-io commands available in HMP Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 18/26] blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 19/26] ide-test: Add enum value for DEV Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 20/26] ide: Set BSY bit during FLUSH Stefan Hajnoczi
2013-06-07 12:10 ` Paolo Bonzini
2013-06-07 11:58 ` [Qemu-devel] [PULL 21/26] ide-test: Add FLUSH CACHE test case Stefan Hajnoczi
2013-06-14 17:54 ` Peter Maydell
2013-06-14 18:11 ` Peter Maydell
2013-06-14 18:18 ` Anthony Liguori
2013-06-17 12:45 ` Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 22/26] block: add snapshot info query function bdrv_query_snapshot_info_list() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 23/26] block: add image info query function bdrv_query_image_info() Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 24/26] qmp: add ImageInfo in BlockDeviceInfo used by query-block Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 25/26] hmp: show ImageInfo in 'info block' Stefan Hajnoczi
2013-06-07 11:58 ` [Qemu-devel] [PULL 26/26] hmp: add parameters device and -v for info block Stefan Hajnoczi
2013-06-17 21:17 ` [Qemu-devel] [PULL 00/26] Block patches Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370606325-10680-12-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).