From: Juan Quintela <quintela@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, leobras@redhat.com,
peterx@redhat.com, yc-core@yandex-team.ru
Subject: Re: [PATCH 2/5] migration: never fail in global_state_store()
Date: Thu, 18 May 2023 13:18:25 +0200 [thread overview]
Message-ID: <87ilcpevlq.fsf@secure.mitica> (raw)
In-Reply-To: <20230517123752.21615-3-vsementsov@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Wed, 17 May 2023 15:37:49 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> wrote:
> Actually global_state_store() can never fail. Let's get rid of extra
> error paths.
>
> To make things clear, use new runstate_get() and use same approach for
> global_state_store() and global_state_store_running().
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
I don't know.
On one hand, you have removed a lot of code that "can't" happen.
On the other:
> +static void global_state_do_store(RunState state)
> {
> - if (!runstate_store((char *)global_state.runstate,
> - sizeof(global_state.runstate))) {
> - error_report("runstate name too big: %s", global_state.runstate);
> - trace_migrate_state_too_big();
> - return -EINVAL;
> - }
> - return 0;
> + const char *state_str = RunState_str(state);
> + assert(strlen(state_str) < sizeof(global_state.runstate));
First: g_assert() please.
Second: We try really hard not to fail during migration and get the
whole qemu back. One assert is bad. Specially in a place like this
one, where we know that nothing is broken, simpli that we can't migrate.
Later, Juan.
next prev parent reply other threads:[~2023-05-18 11:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 12:37 [PATCH 0/5] Restore vmstate on cancelled/failed migration Vladimir Sementsov-Ogievskiy
2023-05-17 12:37 ` [PATCH 1/5] runstate: add runstate_get() Vladimir Sementsov-Ogievskiy
2023-05-18 11:13 ` Juan Quintela
2023-05-17 12:37 ` [PATCH 2/5] migration: never fail in global_state_store() Vladimir Sementsov-Ogievskiy
2023-05-18 11:18 ` Juan Quintela [this message]
2023-05-18 14:43 ` Vladimir Sementsov-Ogievskiy
2023-05-26 8:28 ` Juan Quintela
2023-05-17 12:37 ` [PATCH 3/5] runstate: drop unused runstate_store() Vladimir Sementsov-Ogievskiy
2023-05-18 11:19 ` Juan Quintela
2023-05-17 12:37 ` [PATCH 4/5] migration: switch from .vm_was_running to .vm_old_state Vladimir Sementsov-Ogievskiy
2023-05-18 11:20 ` Juan Quintela
2023-05-17 12:37 ` [PATCH 5/5] migration: restore vmstate on migration failure Vladimir Sementsov-Ogievskiy
2023-05-18 11:22 ` Juan Quintela
2023-05-18 11:23 ` [PATCH 0/5] Restore vmstate on cancelled/failed migration Juan Quintela
2023-05-18 14:49 ` Vladimir Sementsov-Ogievskiy
2023-05-26 7:59 ` Juan Quintela
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=87ilcpevlq.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=leobras@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
--cc=yc-core@yandex-team.ru \
/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).