From patchwork Fri Jul 14 04:23:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9839879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18E39602BD for ; Fri, 14 Jul 2017 04:32:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1078E28748 for ; Fri, 14 Jul 2017 04:32:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 056D228756; Fri, 14 Jul 2017 04:32:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9859928748 for ; Fri, 14 Jul 2017 04:32:53 +0000 (UTC) Received: from localhost ([::1]:35365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVsHc-0005lM-SB for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Jul 2017 00:32:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVsGk-0005k1-U7 for qemu-devel@nongnu.org; Fri, 14 Jul 2017 00:32:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVsGh-0006Nc-Pk for qemu-devel@nongnu.org; Fri, 14 Jul 2017 00:31:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44792) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVsGh-0006ND-Fs for qemu-devel@nongnu.org; Fri, 14 Jul 2017 00:31:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AE193680C for ; Fri, 14 Jul 2017 04:31:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7AE193680C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7AE193680C Received: from pxdev.xzpeter.org (ovpn-12-61.pek2.redhat.com [10.72.12.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA9977EA28; Fri, 14 Jul 2017 04:23:06 +0000 (UTC) Date: Fri, 14 Jul 2017 12:23:06 +0800 From: Peter Xu To: "Dr. David Alan Gilbert" Message-ID: <20170714042306.GH27284@pxdev.xzpeter.org> References: <1499842423-21101-1-git-send-email-peterx@redhat.com> <20170712190240.GM30658@work-vm> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170712190240.GM30658@work-vm> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 14 Jul 2017 04:31:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH 0/3] migration: export cap/params to qdev props X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Markus Armbruster , Juan Quintela , qemu-devel@nongnu.org, Eduardo Habkost Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jul 12, 2017 at 08:02:40PM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (peterx@redhat.com) wrote: > > We have the MigrationState as QDev now (which seems crazy). Let's > > continue to benefit. > > > > This series is exporting all migration capabilities/params as global > > parameters. Then we can do something like this: > > > > qemu -global migration.postcopy-ram=true \ > > -global migration.max-bandwidth=4096 > > > > The values will be inited just like we typed these values into HMP > > monitor. It'll simplify lots of migration scripts. > > > > The changes are fairly straightforward. One tiny loss is that we still > > don't support: > > > > -global migration.max-bandwidth=1g > > > > ...just like what we did in HMP: > > > > migrate_set_speed 1g > > > > ...while we need to use: > > > > -global migration.max-bandwidth=1073741824 > > > > However that should only be used in scripts, and that's good enough > > imho. > > > > These properties should only be used for debugging/testing purpose, > > and we should not guarantee any interface compatibility for them (just > > like HMP). > > I guess the sanity checks in qmp_migrate_set_parameters and > qmp_migrate_set_capabilities aren't run? Indeed I missed this point. Before that: Eduardo, do you think below change would make any sense? IMHO it'll make more sense if we call the parent post_init first (just like most of the other object hooks). Or is current ordering intended? If we can have above change, it'll be much easier for me to do the check that Dave mentioned, after the global properties applied (I can then just provide post_init hook for the migration object). > > Also, have you done any checks on multiple migrations; e.g. it's good > to check that the flags/state are all preserved if we do a migrate, that > migrate fails or is cancelled and then you do a 2nd migrate. I think so. They'll be applied only when creating the object, and they'll be there even after a e.g. migrate_cancel. Thanks, diff --git a/qom/object.c b/qom/object.c index 5f6fdfa..ca077a9 100644 --- a/qom/object.c +++ b/qom/object.c @@ -347,13 +347,13 @@ static void object_init_with_type(Object *obj, TypeImpl *ti) static void object_post_init_with_type(Object *obj, TypeImpl *ti) { - if (ti->instance_post_init) { - ti->instance_post_init(obj); - } - if (type_has_parent(ti)) { object_post_init_with_type(obj, type_get_parent(ti)); } + + if (ti->instance_post_init) { + ti->instance_post_init(obj); + } } static void object_initialize_with_type(void *data, size_t size, TypeImpl *type)