diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create_config | 6 | ||||
-rwxr-xr-x | scripts/gtester-cat | 26 | ||||
-rw-r--r-- | scripts/qapi-commands.py | 2 | ||||
-rw-r--r-- | scripts/qapi-visit.py | 20 | ||||
-rwxr-xr-x | scripts/qtest | 5 | ||||
-rwxr-xr-x | scripts/tracetool | 4 |
6 files changed, 55 insertions, 8 deletions
diff --git a/scripts/create_config b/scripts/create_config index 0098e683e2..470e05e397 100755 --- a/scripts/create_config +++ b/scripts/create_config @@ -16,7 +16,7 @@ case $line in prefix=* | [a-z]*dir=*) # directory configuration name=${line%=*} value=${line#*=} - define_name=`echo $name | tr '[:lower:]' '[:upper:]'` + define_name=`echo $name | LC_ALL=C tr '[a-z]' '[A-Z]'` eval "define_value=\"$value\"" echo "#define CONFIG_QEMU_$define_name \"$define_value\"" # save for the next definitions @@ -48,7 +48,7 @@ case $line in ;; ARCH=*) # configuration arch=${line#*=} - arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'` + arch_name=`echo $arch | LC_ALL=C tr '[a-z]' '[A-Z]'` echo "#define HOST_$arch_name 1" ;; HOST_USB=*) @@ -73,7 +73,7 @@ case $line in TARGET_BASE_ARCH=*) # configuration target_base_arch=${line#*=} if [ "$target_base_arch" != "$target_arch" ]; then - base_arch_name=`echo $target_base_arch | tr '[:lower:]' '[:upper:]'` + base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'` echo "#define TARGET_$base_arch_name 1" fi ;; diff --git a/scripts/gtester-cat b/scripts/gtester-cat new file mode 100755 index 0000000000..061a952cad --- /dev/null +++ b/scripts/gtester-cat @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright IBM, Corp. 2012 +# +# Authors: +# Anthony Liguori <aliguori@us.ibm.com> +# +# This work is licensed under the terms of the GNU GPLv2 or later. +# See the COPYING file in the top-level directory. + +cat <<EOF +<?xml version="1.0"?> +<gtester> + <info> + <package>qemu</package> + <version>0.0</version> + <revision>rev</revision> + </info> +EOF + +sed \ + -e '/<?xml/d' \ + -e '/^<gtester>$/d' \ + -e '/<info>/,/<\/info>/d' \ + -e '$b' \ + -e '/^<\/gtester>$/d' "$@" diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 30a24d211b..0b4f0a0fe1 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -140,7 +140,7 @@ v = qapi_dealloc_get_visitor(md); ''') else: ret += mcgen(''' -mi = qmp_input_visitor_new(%(obj)s); +mi = qmp_input_visitor_new_strict(%(obj)s); v = qmp_input_get_visitor(mi); ''', obj=obj) diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 78c947cd9c..8d4e94a45f 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -61,7 +61,13 @@ def generate_visit_struct(name, members): void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error **errp) { + if (error_is_set(errp)) { + return; + } visit_start_struct(m, (void **)obj, "%(name)s", name, sizeof(%(name)s), errp); + if (obj && !*obj) { + goto end; + } ''', name=name) push_indent() @@ -69,6 +75,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error ** pop_indent() ret += mcgen(''' +end: visit_end_struct(m, errp); } ''') @@ -79,11 +86,14 @@ def generate_visit_list(name, members): void visit_type_%(name)sList(Visitor *m, %(name)sList ** obj, const char *name, Error **errp) { - GenericList *i, **head = (GenericList **)obj; + GenericList *i, **prev = (GenericList **)obj; + if (error_is_set(errp)) { + return; + } visit_start_list(m, name, errp); - for (*head = i = visit_next_list(m, head, errp); i; i = visit_next_list(m, &i, errp)) { + for (; (i = visit_next_list(m, prev, errp)) != NULL; prev = &i) { %(name)sList *native_i = (%(name)sList *)i; visit_type_%(name)s(m, &native_i->value, NULL, errp); } @@ -112,7 +122,13 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error ** { Error *err = NULL; + if (error_is_set(errp)) { + return; + } visit_start_struct(m, (void **)obj, "%(name)s", name, sizeof(%(name)s), &err); + if (obj && !*obj) { + goto end; + } visit_type_%(name)sKind(m, &(*obj)->kind, "type", &err); if (err) { error_propagate(errp, err); diff --git a/scripts/qtest b/scripts/qtest new file mode 100755 index 0000000000..4ef6c1c500 --- /dev/null +++ b/scripts/qtest @@ -0,0 +1,5 @@ +#!/bin/sh + +export QTEST_QEMU_BINARY=$1 +shift +"$@" diff --git a/scripts/tracetool b/scripts/tracetool index 5e77aa243d..47389b62ea 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -422,7 +422,7 @@ linetoh_dtrace() args=$(get_args "$1") argnames=$(get_argnames "$1", ",") - nameupper=`echo $name | tr '[:lower:]' '[:upper:]'` + nameupper=`echo $name | LC_ALL=C tr '[a-z]' '[A-Z]'` # Define an empty function for the trace event cat <<EOF @@ -553,7 +553,7 @@ convert() fi if [ "$1" = "h" ]; then name=$(get_name "$str") - NAME=$(echo $name | tr '[:lower:]' '[:upper:]') + NAME=$(echo $name | LC_ALL=C tr '[a-z]' '[A-Z]') echo "#define TRACE_${NAME}_ENABLED ${enabled}" fi done |