qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qmp_device_add() ret_data argument


From: Markus Armbruster
Subject: Re: [Qemu-devel] qmp_device_add() ret_data argument
Date: Thu, 10 Sep 2015 11:01:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Programmingkid <address@hidden> writes:

> What does the function qmp_device_add() have a ret_data argument if it
> isn't used? This function is located in qdev-monitor.c.

QMP command handlers all implement the same interface:

        void (*cmd_new)(QDict *params, QObject **ret_data, Error **errp);

Handlers of commands returning a value store the value to *ret_data.
Handlers of commands not returning a value (such as device_add) leave
ret_data alone.

We could require them to store NULL, but that would be easy to forget,
and usually catastrophic, so we don't.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]