From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-block@nongnu.org, raphael@enfabrica.net, mst@redhat.com,
qemu-devel@nongnu.org, eblake@redhat.com, eduardo@habkost.net,
berrange@redhat.com, pbonzini@redhat.com, hreitz@redhat.com,
kwolf@redhat.com, yc-core@yandex-team.ru
Subject: Re: [PATCH v4 3/3] qapi: introduce device-sync-config
Date: Thu, 02 May 2024 09:25:26 +0200 [thread overview]
Message-ID: <87ikzwr7yx.fsf@pond.sub.org> (raw)
In-Reply-To: <a5993c67-6631-4fd0-a67b-c9dd52596030@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Wed, 1 May 2024 11:50:12 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> On 30.04.24 11:31, Vladimir Sementsov-Ogievskiy wrote:
>> On 30.04.24 11:19, Markus Armbruster wrote:
>>> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
>>>
>>>> Add command to sync config from vhost-user backend to the device. It
>>>> may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not
>>>> triggered interrupt to the guest or just not available (not supported
>>>> by vhost-user server).
>>>>
>>>> Command result is racy if allow it during migration. Let's allow the
>>>> sync only in RUNNING state.
>>>>
>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
[...]
>>>> diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c
>>>> index 264978aa40..47bfc0506e 100644
>>>> --- a/system/qdev-monitor.c
>>>> +++ b/system/qdev-monitor.c
>>>> @@ -23,6 +23,7 @@
>>>> #include "monitor/monitor.h"
>>>> #include "monitor/qdev.h"
>>>> #include "sysemu/arch_init.h"
>>>> +#include "sysemu/runstate.h"
>>>> #include "qapi/error.h"
>>>> #include "qapi/qapi-commands-qdev.h"
>>>> #include "qapi/qmp/dispatch.h"
>>>> @@ -971,6 +972,53 @@ void qmp_device_del(const char *id, Error **errp)
>>>> }
>>>> }
>>>>
>>>> +int qdev_sync_config(DeviceState *dev, Error **errp)
>>>> +{
>>>> + DeviceClass *dc = DEVICE_GET_CLASS(dev);
>>>> +
>>>> + if (!dc->sync_config) {
>>>> + error_setg(errp, "device-sync-config is not supported for '%s'",
>>>> + object_get_typename(OBJECT(dev)));
>>>> + return -ENOTSUP;
>>>> + }
>>>> +
>>>> + return dc->sync_config(dev, errp);
>>>> +}
>>>> +
>>>> +void qmp_device_sync_config(const char *id, Error **errp)
>>>> +{
>>>> + DeviceState *dev;
>>>> +
>>>> + /*
>>>> + * During migration there is a race between syncing`configuration and
>>>> + * migrating it (if migrate first, that target would get outdated version),
>>>> + * so let's just not allow it.
>>>
>>> Wrap comment lines around column 70 for legibility, please.
>>>
>>>> + *
>>>> + * Moreover, let's not rely on setting up interrupts in paused
>>>> + * state, which may be a part of migration process.
>>>
>>> We discussed this in review of v3. You wanted to check whether the
>>> problem is real. Is it?
>>
>> We discussed it later than I've sent v4 :) No, I didn't check yet.
>
> Checked. Seems this works (in scheme pause -> migrate -> resume, interrupts are migrated and triggered on target after resume), so my doubt was wrong.
Thanks!
[...]
prev parent reply other threads:[~2024-05-02 7:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 10:16 [PATCH v4 0/3] vhost-user-blk: live resize additional APIs Vladimir Sementsov-Ogievskiy
2024-04-29 10:16 ` [PATCH v4 1/3] qdev-monitor: add option to report GenericError from find_device_state Vladimir Sementsov-Ogievskiy
2024-04-29 10:16 ` [PATCH v4 2/3] vhost-user-blk: split vhost_user_blk_sync_config() Vladimir Sementsov-Ogievskiy
2024-04-30 8:15 ` Markus Armbruster
2024-04-30 8:27 ` Vladimir Sementsov-Ogievskiy
2024-04-30 11:16 ` Markus Armbruster
2024-04-29 10:16 ` [PATCH v4 3/3] qapi: introduce device-sync-config Vladimir Sementsov-Ogievskiy
2024-04-30 8:19 ` Markus Armbruster
2024-04-30 8:31 ` Vladimir Sementsov-Ogievskiy
2024-05-01 8:50 ` Vladimir Sementsov-Ogievskiy
2024-05-02 7:25 ` Markus Armbruster [this message]
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=87ikzwr7yx.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael@enfabrica.net \
--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).