From: Juan Quintela <quintela@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com, lvivier@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] migration: Move check_migratable() into qdev.c
Date: Wed, 26 Apr 2017 12:31:32 +0200 [thread overview]
Message-ID: <871ssflat7.fsf@secure.mitica> (raw)
In-Reply-To: <20170426100623.GD16228@pxdev.xzpeter.org> (Peter Xu's message of "Wed, 26 Apr 2017 18:06:23 +0800")
Peter Xu <peterx@redhat.com> wrote:
> On Tue, Apr 25, 2017 at 12:17:57PM +0200, Juan Quintela wrote:
>> The function is only used once, and nothing else in migration knows
>> about objects. Create the function vmstate_device_is_migratable() in
>> savem.c that really do the bit that is related with migration.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>
> Here the name vmstate_device_is_migratable() let me think of "return
> true if the device can migrate, false otherwise". However what it
> actually does is mixed with "--only-migratable" parameter, say, when
> without that parameter, all device will be getting "true" here, even
> unmigratable devices...
>
> Not sure whether it'll be nicer we do this:
>
> bool vmstate_device_is_migratable(const VMStateDescription *vmsd)
> {
> return !(vmsd & vmsd->unmigratable);
> }
>
> Then we can define check_migratable() as:
>
> static int check_migratable(Object *obj, Error **err)
> {
> DeviceClass *dc = DEVICE_GET_CLASS(obj);
>
> /* no check needed if --only-migratable not specified */
> if (!only_migratable) {
> return true;
> }
>
> if (!vmstate_device_is_migratable(dc->vmsd)) {
> error_setg(err, "Device %s is not migratable, but "
> "--only-migratable was specified",
> object_get_typename(obj));
> return -1;
> }
>
> return 0;
> }
>
> Thanks,
I see your point. We have to teach things about migrate to qdev.c or
things about objects to migration.
Will change.
Thanks, Juan.
next prev parent reply other threads:[~2017-04-26 10:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 10:17 [Qemu-devel] [PATCH 0/2] Misc migration fixes Juan Quintela
2017-04-25 10:17 ` [Qemu-devel] [PATCH 1/2] migration: Move check_migratable() into qdev.c Juan Quintela
2017-04-25 11:58 ` Laurent Vivier
2017-04-26 10:06 ` Peter Xu
2017-04-26 10:31 ` Juan Quintela [this message]
2017-04-25 10:17 ` [Qemu-devel] [PATCH 2/2] migration: to_dst_file at that point is NULL Juan Quintela
2017-04-25 12:39 ` Laurent Vivier
2017-04-25 12:59 ` Juan Quintela
2017-04-25 13:10 ` Laurent Vivier
2017-04-25 13:14 ` Daniel P. Berrange
2017-04-26 11:53 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ssflat7.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).