summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-06-07 08:40:52 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-06-07 08:40:52 -0500
commit7387de16d0e4d2988df350926537cd12a8e34206 (patch)
tree8b7aafb79e2a8197ae002dc3250d9b0ba44520c9 /util
parentb8a75b6093309a43f9837bc2ce63bcf15a7b305f (diff)
parente73fe2b46c38776288415ce7bc8ba3fcd23721c4 (diff)
downloadqemu-7387de16d0e4d2988df350926537cd12a8e34206.tar.gz
Merge remote-tracking branch 'stefanha/block' into staging
# By Kevin Wolf (19) and others # Via Stefan Hajnoczi * stefanha/block: (26 commits) hmp: add parameters device and -v for info block hmp: show ImageInfo in 'info block' qmp: add ImageInfo in BlockDeviceInfo used by query-block block: add image info query function bdrv_query_image_info() block: add snapshot info query function bdrv_query_snapshot_info_list() ide-test: Add FLUSH CACHE test case ide: Set BSY bit during FLUSH ide-test: Add enum value for DEV blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events Make qemu-io commands available in HMP qemu-io: Use the qemu version for -V qemu-io: Interface cleanup qemu-io: Move remaining helpers from cmd.c qemu-io: Move command_loop() and friends qemu-io: Move functions for registering and running commands qemu-io: Move qemu_strsep() to cutils.c qemu-io: Move 'quit' function qemu-io: Move 'help' function qemu-io: Factor out qemuio_command qemu-io: Split off commands to qemu-io-cmds.c ... Message-id: 1370606325-10680-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'util')
-rw-r--r--util/cutils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/cutils.c b/util/cutils.c
index a1658197cf..0116fcde74 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;
@@ -267,6 +288,10 @@ static int64_t suffix_mul(char suffix, int64_t unit)
return unit * unit * unit;
case STRTOSZ_DEFSUFFIX_TB:
return unit * unit * unit * unit;
+ case STRTOSZ_DEFSUFFIX_PB:
+ return unit * unit * unit * unit * unit;
+ case STRTOSZ_DEFSUFFIX_EB:
+ return unit * unit * unit * unit * unit * unit;
}
return -1;
}