* [Qemu-devel] [PULL 0/3] QMP queue
@ 2014-05-22 13:53 Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 1/3] doc: add "setup" to list of migration states Luiz Capitulino
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Luiz Capitulino @ 2014-05-22 13:53 UTC (permalink / raw)
To: peter.maydell; +Cc: qemu-devel, anthony
The following changes since commit c5fa6c86d0765f837515d1c10654c621724a77e0:
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging (2014-05-19 14:10:01 +0100)
are available in the git repository at:
git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
for you to fetch changes up to fc13d937269c1cd01a4b7720c1dcce01722727a2:
qapi: zero-initialize all QMP command parameters (2014-05-21 09:25:31 -0400)
----------------------------------------------------------------
Luiz Capitulino (1):
scripts/qapi.py: Avoid syntax not supported by Python 2.4
Michael Roth (1):
qapi: zero-initialize all QMP command parameters
Peter Feiner (1):
doc: add "setup" to list of migration states
qapi-schema.json | 2 +-
qmp-commands.hx | 2 +-
scripts/qapi-commands.py | 2 +-
scripts/qapi.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 1/3] doc: add "setup" to list of migration states
2014-05-22 13:53 [Qemu-devel] [PULL 0/3] QMP queue Luiz Capitulino
@ 2014-05-22 13:53 ` Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 2/3] scripts/qapi.py: Avoid syntax not supported by Python 2.4 Luiz Capitulino
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2014-05-22 13:53 UTC (permalink / raw)
To: peter.maydell; +Cc: qemu-devel, anthony
From: Peter Feiner <peter@gridcentric.ca>
On a slow VM (e.g., nested), you see the "setup" state when you query the
migration status.
Signed-off-by: Peter Feiner <peter@gridcentric.ca>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
qapi-schema.json | 2 +-
qmp-commands.hx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 36cb964..f4ffede 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -691,7 +691,7 @@
# Information about current migration process.
#
# @status: #optional string describing the current migration status.
-# As of 0.14.0 this can be 'active', 'completed', 'failed' or
+# As of 0.14.0 this can be 'setup', 'active', 'completed', 'failed' or
# 'cancelled'. If this field is not returned, no migration process
# has been initiated
#
diff --git a/qmp-commands.hx b/qmp-commands.hx
index cae890e..408ae9c 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2937,7 +2937,7 @@ block migration status.
The main json-object contains the following:
- "status": migration status (json-string)
- - Possible values: "active", "completed", "failed", "cancelled"
+ - Possible values: "setup", "active", "completed", "failed", "cancelled"
- "total-time": total amount of ms since migration started. If
migration has ended, it returns the total migration
time (json-int)
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 2/3] scripts/qapi.py: Avoid syntax not supported by Python 2.4
2014-05-22 13:53 [Qemu-devel] [PULL 0/3] QMP queue Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 1/3] doc: add "setup" to list of migration states Luiz Capitulino
@ 2014-05-22 13:53 ` Luiz Capitulino
2014-05-22 13:54 ` [Qemu-devel] [PULL 3/3] qapi: zero-initialize all QMP command parameters Luiz Capitulino
2014-05-23 10:31 ` [Qemu-devel] [PULL 0/3] QMP queue Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2014-05-22 13:53 UTC (permalink / raw)
To: peter.maydell; +Cc: qemu-devel, anthony
The Python "except Foo as x" syntax was only introduced in
Python 2.6, but we aim to support Python 2.4 and later.
Use the old-style "except Foo, x" syntax instead, thus
fixing configure/compile on systems with older Python.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
scripts/qapi.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 0265b40..86e9608 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -116,7 +116,7 @@ class QAPISchema:
continue
try:
fobj = open(include_path, 'r')
- except IOError as e:
+ except IOError, e:
raise QAPIExprError(expr_info,
'%s: %s' % (e.strerror, include))
exprs_include = QAPISchema(fobj, include, self.include_hist,
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PULL 3/3] qapi: zero-initialize all QMP command parameters
2014-05-22 13:53 [Qemu-devel] [PULL 0/3] QMP queue Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 1/3] doc: add "setup" to list of migration states Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 2/3] scripts/qapi.py: Avoid syntax not supported by Python 2.4 Luiz Capitulino
@ 2014-05-22 13:54 ` Luiz Capitulino
2014-05-23 10:31 ` [Qemu-devel] [PULL 0/3] QMP queue Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2014-05-22 13:54 UTC (permalink / raw)
To: peter.maydell; +Cc: qemu-devel, anthony
From: Michael Roth <mdroth@linux.vnet.ibm.com>
In general QMP command parameter values are specified by consumers of the
QMP/HMP interface, but in the case of optional parameters these values may
be left uninitialized.
It is considered a bug for code to make use of optional parameters that have
not been flagged as being present by the marshalling code (via corresponding
has_<parameter> parameter), however our marshalling code will still pass
these uninitialized values on to the corresponding QMP function (to then
be ignored). Some compilers (clang in particular) consider this unsafe
however, and generate warnings as a result. As reported by Peter Maydell:
This is something clang's -fsanitize=undefined spotted. The
code generated by qapi-commands.py in qmp-marshal.c for
qmp_marshal_* functions where there are some optional
arguments looks like this:
bool has_force = false;
bool force;
mi = qmp_input_visitor_new_strict(QOBJECT(args));
v = qmp_input_get_visitor(mi);
visit_type_str(v, &device, "device", errp);
visit_start_optional(v, &has_force, "force", errp);
if (has_force) {
visit_type_bool(v, &force, "force", errp);
}
visit_end_optional(v, errp);
qmp_input_visitor_cleanup(mi);
if (error_is_set(errp)) {
goto out;
}
qmp_eject(device, has_force, force, errp);
In the case where has_force is false, we never initialize
force, but then we use it by passing it to qmp_eject.
I imagine we don't then actually use the value, but clang
complains in particular for 'bool' variables because the value
that ends up being loaded from memory for 'force' is not either
0 or 1 (being uninitialized stack contents).
Fix this by initializing all QMP command parameters to {0} in the
marshalling code prior to passing them on to the QMP functions.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
scripts/qapi-commands.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 386f17e..7d93d01 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -111,7 +111,7 @@ bool has_%(argname)s = false;
argname=c_var(argname), argtype=c_type(argtype))
else:
ret += mcgen('''
-%(argtype)s %(argname)s;
+%(argtype)s %(argname)s = {0};
''',
argname=c_var(argname), argtype=c_type(argtype))
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] QMP queue
2014-05-22 13:53 [Qemu-devel] [PULL 0/3] QMP queue Luiz Capitulino
` (2 preceding siblings ...)
2014-05-22 13:54 ` [Qemu-devel] [PULL 3/3] qapi: zero-initialize all QMP command parameters Luiz Capitulino
@ 2014-05-23 10:31 ` Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-05-23 10:31 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: QEMU Developers, Anthony Liguori
On 22 May 2014 14:53, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> The following changes since commit c5fa6c86d0765f837515d1c10654c621724a77e0:
>
> Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging (2014-05-19 14:10:01 +0100)
>
> are available in the git repository at:
>
>
> git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
>
> for you to fetch changes up to fc13d937269c1cd01a4b7720c1dcce01722727a2:
>
> qapi: zero-initialize all QMP command parameters (2014-05-21 09:25:31 -0400)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-23 10:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 13:53 [Qemu-devel] [PULL 0/3] QMP queue Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 1/3] doc: add "setup" to list of migration states Luiz Capitulino
2014-05-22 13:53 ` [Qemu-devel] [PULL 2/3] scripts/qapi.py: Avoid syntax not supported by Python 2.4 Luiz Capitulino
2014-05-22 13:54 ` [Qemu-devel] [PULL 3/3] qapi: zero-initialize all QMP command parameters Luiz Capitulino
2014-05-23 10:31 ` [Qemu-devel] [PULL 0/3] QMP queue Peter Maydell
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).