From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3mhG-0005Op-At for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:18:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3mhA-0003eK-MK for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:18:26 -0500 Received: from relay.parallels.com ([195.214.232.42]:42595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3mhA-0003dz-C5 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:18:20 -0500 References: <1447687950-29350-1-git-send-email-den@openvz.org> <1447687950-29350-3-git-send-email-den@openvz.org> <87ziyd0wdm.fsf@blackfin.pond.sub.org> <565DAEE6.1060408@openvz.org> <87oaea8b04.fsf@blackfin.pond.sub.org> From: "Denis V. Lunev" Message-ID: <565DBA29.90407@openvz.org> Date: Tue, 1 Dec 2015 18:18:01 +0300 MIME-Version: 1.0 In-Reply-To: <87oaea8b04.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Amit Shah , qemu-devel@nongnu.org, Juan Quintela On 12/01/2015 06:05 PM, Markus Armbruster wrote: > "Denis V. Lunev" writes: > >> On 11/17/2015 01:10 PM, Markus Armbruster wrote: >>> "Denis V. Lunev" writes: >>> >>>> Signed-off-by: Denis V. Lunev >>>> CC: Juan Quintela >>>> CC: Amit Shah >>>> CC: Markus Armbruster >>>> CC: Eric Blake >>>> --- >>>> migration/savevm.c | 5 +++++ >>>> qapi-schema.json | 13 +++++++++++++ >>>> qmp-commands.hx | 25 +++++++++++++++++++++++++ >>>> 3 files changed, 43 insertions(+) >>>> >>>> diff --git a/migration/savevm.c b/migration/savevm.c >>>> index f83ffd0..565b10a 100644 >>>> --- a/migration/savevm.c >>>> +++ b/migration/savevm.c >>>> @@ -2010,6 +2010,11 @@ void hmp_savevm(Monitor *mon, const QDict *qdict) >>>> } >>>> } >>>> +void qmp_savevm(bool has_name, const char *name, Error **errp) >>>> +{ >>>> + do_savevm(has_name ? name : NULL, errp); >>>> +} >>>> + >>> Please name do_savevm() qmp_savevm() and drop this wrapper. >>> >>> We're working on omitting has_FOO for pointer-valued FOO. >> error code is used in the qemu-img. >> I can drop error code check there and replace it with checking of >> Error pointer. >> Is this OK for you? > Let me rephrase my request: > > 1. Instead of wrapping do_savevm() in qmp_savevm(), use it directly. > > 2. Rename do_savevm() to qmp_savevm(), and change its arguments to make > it work as QMP command handler. > > Does that make sense to you? sure! I have mismatched with load_vmstate which has return code and the error code was really checked in qemu_img.c I'll address that there, sorry for confusion. Den