diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-09-11 12:07:29 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-09-11 12:07:29 +0100 |
commit | ba9cef7b6e487a5a8969db81d09b8eec8a2b50c6 (patch) | |
tree | 5d864537d44177d855b5af77934e860b0d484ec5 /util | |
parent | 7b9c09f7d486647784c605739d69b708a7249c9b (diff) | |
parent | af5b83d7d5297f8bdfd3353a420c120c4fd5adfd (diff) | |
download | hqemu-ba9cef7b6e487a5a8969db81d09b8eec8a2b50c6.zip hqemu-ba9cef7b6e487a5a8969db81d09b8eec8a2b50c6.tar.gz |
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-09-11' into staging
trivial patches for 2015-09-11
# gpg: Signature made Fri 11 Sep 2015 12:02:43 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
* remotes/mjt/tags/pull-trivial-patches-2015-09-11: (26 commits)
virtio-vga: enable for i386
hw/arm/spitz: Remove meaningless blank Property
hw/gpio/zaurus: Remove meaningless blank Property
hw/virtio/virtio-pci: Remove meaningless blank Property
hw/s390x/s390-virtio-bus: Remove meaningless blank Property
typofixes - v4
qapi-schema: remove legacy<> from doc
disas/microblaze: Remove unused code
help: dd missing newline
Target-ppc: Remove unnecessary variable
baum: Fix build with debugging enabled
linux-user: Fix warnings caused by missing 'static' attribute
opts: produce valid command line in qemu_opts_print
docs: fix a qga/qapi-schema.json comment
trivial: remove trailing newline from error_report
maint: avoid useless "if (foo) free(foo)" pattern
maint: avoid useless "if (foo) free(foo)" pattern
maint: remove unused include for strings.h
maint: remove unused include for signal.h
maint: remove unused include for dirent.h
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/bitmap.c | 2 | ||||
-rw-r--r-- | util/qemu-option.c | 29 | ||||
-rw-r--r-- | util/qemu-thread-posix.c | 2 |
3 files changed, 28 insertions, 5 deletions
diff --git a/util/bitmap.c b/util/bitmap.c index 300a68e..44f0f48 100644 --- a/util/bitmap.c +++ b/util/bitmap.c @@ -14,7 +14,7 @@ #include "qemu/atomic.h" /* - * bitmaps provide an array of bits, implemented using an an + * bitmaps provide an array of bits, implemented using an * array of unsigned longs. The number of valid bits in a * given bitmap does _not_ need to be an exact multiple of * BITS_PER_LONG. diff --git a/util/qemu-option.c b/util/qemu-option.c index efd6f02..b1fb57c 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -735,14 +735,35 @@ void qemu_opts_del(QemuOpts *opts) g_free(opts); } -void qemu_opts_print(QemuOpts *opts, const char *sep) +/* print value, escaping any commas in value */ +static void escaped_print(const char *value) +{ + const char *ptr; + + for (ptr = value; *ptr; ++ptr) { + if (*ptr == ',') { + putchar(','); + } + putchar(*ptr); + } +} + +void qemu_opts_print(QemuOpts *opts, const char *separator) { QemuOpt *opt; QemuOptDesc *desc = opts->list->desc; + const char *sep = ""; + + if (opts->id) { + printf("id=%s", opts->id); /* passed id_wellformed -> no commas */ + sep = separator; + } if (desc[0].name == NULL) { QTAILQ_FOREACH(opt, &opts->head, next) { - printf("%s%s=\"%s\"", sep, opt->name, opt->str); + printf("%s%s=", sep, opt->name); + escaped_print(opt->str); + sep = separator; } return; } @@ -755,13 +776,15 @@ void qemu_opts_print(QemuOpts *opts, const char *sep) continue; } if (desc->type == QEMU_OPT_STRING) { - printf("%s%s='%s'", sep, desc->name, value); + printf("%s%s=", sep, desc->name); + escaped_print(value); } else if ((desc->type == QEMU_OPT_SIZE || desc->type == QEMU_OPT_NUMBER) && opt) { printf("%s%s=%" PRId64, sep, desc->name, opt->value.uint); } else { printf("%s%s=%s", sep, desc->name, value); } + sep = separator; } } diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index ba67cec..b1abe97 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -389,7 +389,7 @@ void qemu_event_wait(QemuEvent *ev) /* * Leave the event reset and tell qemu_event_set that there * are waiters. No need to retry, because there cannot be - * a concurent busy->free transition. After the CAS, the + * a concurrent busy->free transition. After the CAS, the * event will be either set or busy. */ if (atomic_cmpxchg(&ev->value, EV_FREE, EV_BUSY) == EV_SET) { |