All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Anton Kuchin <antonkuchin@yandex-team.ru>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, virtio-fs@redhat.com,
	Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	yc-core@yandex-team.ru, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Virtio-fs] [PATCH] vhost-user-fs: add capability to allow migration
Date: Fri, 10 Feb 2023 17:08:16 +0100	[thread overview]
Message-ID: <87mt5ly03z.fsf@secure.mitica> (raw)
In-Reply-To: <626f6e7c-07e4-4aa7-3cce-b96d9fd96d33@yandex-team.ru> (Anton Kuchin's message of "Fri, 10 Feb 2023 16:09:23 +0200")

Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
> On 02/02/2023 11:59, Juan Quintela wrote:
>> Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>> On 01/02/2023 16:26, Juan Quintela wrote:
>>>> Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>> On 19/01/2023 18:02, Stefan Hajnoczi wrote:
>>>>>> On Thu, 19 Jan 2023 at 10:29, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>>>> On 19/01/2023 16:30, Stefan Hajnoczi wrote:
>>>>>>>> On Thu, 19 Jan 2023 at 07:43, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>>>>>> On 18/01/2023 17:52, Stefan Hajnoczi wrote:
>>>>>>>>>> On Sun, 15 Jan 2023 at 12:21, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>> Once told that, I think that you are making your live harder in the
>>>> future when you add the other migratable devices.
>>>>
>>>> static const VMStateDescription vuf_vmstate = {
>>>>       .name = "vhost-user-fs",
>>>>       .minimum_version_id = 0,
>>>>       .version_id = 0,
>>>>       .fields = (VMStateField[]) {
>>>>           VMSTATE_INT8(migration_type, struct VHostUserFS),
>>>>           VMSTATE_VIRTIO_DEVICE,
>>>>           VMSTATE_END_OF_LIST()
>>>>       },
>>>>       .pre_save = vhost_user_fs_pre_save,
>>>>       .subsections = (const VMStateDescription*[]) {
>>>>           &vmstate_vhost_user_fs_internal_sub,
>>>>           NULL
>>>>       }
>>>> };
>>>>
>>>> And you are done.
>>>>
>>>> I will propose to use a property to set migration_type, but I didn't
>>>> want to write the code right now.
>
> I have a little problem with implementation here and need an advice:
>
> Can we make this property adjustable at runtime after device was realized?
> There is a statement in qemu wiki [1] that makes me think this is possible
> but I couldn't find any code for it or example in other devices.
>> "Properties are, by default, locked while the device is
>   realized. Exceptions
>> can be made by the devices themselves in order to implement a way
>   for a user
>> to interact with a device while it is realized."
>
> Or is your idea just to set this property once at construction and keep it
> constant for device lifetime?
>
> [1] https://wiki.qemu.org/Features/QOM

I have no clue here.  Markus?  Stefan?

>>>>
>>>> I think that this proposal will make Stephan happy, and it is just
>>>> adding and extra uint8_t that is helpul to implement everything.
>>> That is exactly the approach I'm trying to implement it right now. Single
>>> flag can be convenient for orchestrator but makes it too hard to account in
>>> all cases for all devices on qemu side without breaking future
>>> compatibility.
>>> So I'm rewriting it with properties.
>> Nice.  That would be my proposal.  Just a bit complicated for a proof of concetp.
>>
>>> BTW do you think each vhost-user device should have its own enum of
>>> migration
>>> types or maybe we could make them common for all device types?
>> I will put it for vhost-user, because as far as I know nobody else is
>> asking for this functionality.
>
> I mean do we need it for all vhost-user devices or only for vhost-user-fs
> that I'm implementing now?

I will put it only for vhost-user-fs, except if there is a central place
that is used for all vhost-user and its easy to put there.

But I don't know enough about vhost-user to know if there is any common
struct to put this.

>> The most similar device that I can think of right now is vfio devices.
>> But they are implemeting callbacks to save hardware device state, and
>> they go device by device, i.e. there is nothing general there.
>>
>> Later, Juan.
>>

Later, Juan.


WARNING: multiple messages have this Message-ID (diff)
From: Juan Quintela <quintela@redhat.com>
To: Anton Kuchin <antonkuchin@yandex-team.ru>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	 qemu-devel@nongnu.org, virtio-fs@redhat.com,
	 Markus Armbruster <armbru@redhat.com>,
	 Eric Blake <eblake@redhat.com>,
	 "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	 yc-core@yandex-team.ru,  "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] vhost-user-fs: add capability to allow migration
Date: Fri, 10 Feb 2023 17:08:16 +0100	[thread overview]
Message-ID: <87mt5ly03z.fsf@secure.mitica> (raw)
In-Reply-To: <626f6e7c-07e4-4aa7-3cce-b96d9fd96d33@yandex-team.ru> (Anton Kuchin's message of "Fri, 10 Feb 2023 16:09:23 +0200")

Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
> On 02/02/2023 11:59, Juan Quintela wrote:
>> Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>> On 01/02/2023 16:26, Juan Quintela wrote:
>>>> Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>> On 19/01/2023 18:02, Stefan Hajnoczi wrote:
>>>>>> On Thu, 19 Jan 2023 at 10:29, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>>>> On 19/01/2023 16:30, Stefan Hajnoczi wrote:
>>>>>>>> On Thu, 19 Jan 2023 at 07:43, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>>>>>>> On 18/01/2023 17:52, Stefan Hajnoczi wrote:
>>>>>>>>>> On Sun, 15 Jan 2023 at 12:21, Anton Kuchin <antonkuchin@yandex-team.ru> wrote:
>>>> Once told that, I think that you are making your live harder in the
>>>> future when you add the other migratable devices.
>>>>
>>>> static const VMStateDescription vuf_vmstate = {
>>>>       .name = "vhost-user-fs",
>>>>       .minimum_version_id = 0,
>>>>       .version_id = 0,
>>>>       .fields = (VMStateField[]) {
>>>>           VMSTATE_INT8(migration_type, struct VHostUserFS),
>>>>           VMSTATE_VIRTIO_DEVICE,
>>>>           VMSTATE_END_OF_LIST()
>>>>       },
>>>>       .pre_save = vhost_user_fs_pre_save,
>>>>       .subsections = (const VMStateDescription*[]) {
>>>>           &vmstate_vhost_user_fs_internal_sub,
>>>>           NULL
>>>>       }
>>>> };
>>>>
>>>> And you are done.
>>>>
>>>> I will propose to use a property to set migration_type, but I didn't
>>>> want to write the code right now.
>
> I have a little problem with implementation here and need an advice:
>
> Can we make this property adjustable at runtime after device was realized?
> There is a statement in qemu wiki [1] that makes me think this is possible
> but I couldn't find any code for it or example in other devices.
>> "Properties are, by default, locked while the device is
>   realized. Exceptions
>> can be made by the devices themselves in order to implement a way
>   for a user
>> to interact with a device while it is realized."
>
> Or is your idea just to set this property once at construction and keep it
> constant for device lifetime?
>
> [1] https://wiki.qemu.org/Features/QOM

I have no clue here.  Markus?  Stefan?

>>>>
>>>> I think that this proposal will make Stephan happy, and it is just
>>>> adding and extra uint8_t that is helpul to implement everything.
>>> That is exactly the approach I'm trying to implement it right now. Single
>>> flag can be convenient for orchestrator but makes it too hard to account in
>>> all cases for all devices on qemu side without breaking future
>>> compatibility.
>>> So I'm rewriting it with properties.
>> Nice.  That would be my proposal.  Just a bit complicated for a proof of concetp.
>>
>>> BTW do you think each vhost-user device should have its own enum of
>>> migration
>>> types or maybe we could make them common for all device types?
>> I will put it for vhost-user, because as far as I know nobody else is
>> asking for this functionality.
>
> I mean do we need it for all vhost-user devices or only for vhost-user-fs
> that I'm implementing now?

I will put it only for vhost-user-fs, except if there is a central place
that is used for all vhost-user and its easy to put there.

But I don't know enough about vhost-user to know if there is any common
struct to put this.

>> The most similar device that I can think of right now is vfio devices.
>> But they are implemeting callbacks to save hardware device state, and
>> they go device by device, i.e. there is nothing general there.
>>
>> Later, Juan.
>>

Later, Juan.



  reply	other threads:[~2023-02-10 16:08 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 17:09 [Virtio-fs] [PATCH] vhost-user-fs: add capability to allow migration Anton Kuchin
2023-01-15 17:09 ` Anton Kuchin
2023-01-18 15:52 ` [Virtio-fs] " Stefan Hajnoczi
2023-01-18 15:52   ` Stefan Hajnoczi
2023-01-19 12:43   ` [Virtio-fs] " Anton Kuchin
2023-01-19 12:43     ` Anton Kuchin
2023-01-19 14:30     ` [Virtio-fs] " Stefan Hajnoczi
2023-01-19 14:30       ` Stefan Hajnoczi
2023-01-19 15:29       ` [Virtio-fs] " Anton Kuchin
2023-01-19 15:29         ` Anton Kuchin
2023-01-19 16:02         ` [Virtio-fs] " Stefan Hajnoczi
2023-01-19 16:02           ` Stefan Hajnoczi
2023-01-19 16:58           ` [Virtio-fs] " Anton Kuchin
2023-01-19 16:58             ` Anton Kuchin
2023-01-19 20:40             ` [Virtio-fs] " Stefan Hajnoczi
2023-01-19 20:40               ` Stefan Hajnoczi
2023-02-01 14:26             ` [Virtio-fs] " Juan Quintela
2023-02-01 14:26               ` Juan Quintela
2023-02-02  0:54               ` [Virtio-fs] " Anton Kuchin
2023-02-02  0:54                 ` Anton Kuchin
2023-02-02  9:59                 ` [Virtio-fs] " Juan Quintela
2023-02-02  9:59                   ` Juan Quintela
2023-02-10 14:09                   ` [Virtio-fs] " Anton Kuchin
2023-02-10 14:09                     ` Anton Kuchin
2023-02-10 16:08                     ` Juan Quintela [this message]
2023-02-10 16:08                       ` Juan Quintela
2023-02-16 21:00                       ` [Virtio-fs] " Stefan Hajnoczi
2023-02-16 21:00                         ` Stefan Hajnoczi
2023-01-19 12:51 ` [Virtio-fs] " Michael S. Tsirkin
2023-01-19 12:51   ` Michael S. Tsirkin
2023-01-19 13:45   ` [Virtio-fs] " Anton Kuchin
2023-01-19 13:45     ` Anton Kuchin
2023-01-19 19:00     ` [Virtio-fs] " Dr. David Alan Gilbert
2023-01-19 19:00       ` Dr. David Alan Gilbert
2023-01-19 20:47       ` [Virtio-fs] " Anton Kuchin
2023-01-19 20:47         ` Anton Kuchin
2023-01-20 13:58     ` [Virtio-fs] " Michael S. Tsirkin
2023-01-20 13:58       ` Michael S. Tsirkin
2023-01-20 17:37       ` [Virtio-fs] " Anton Kuchin
2023-01-20 17:37         ` Anton Kuchin
2023-01-22  8:16         ` [Virtio-fs] " Michael S. Tsirkin
2023-01-22  8:16           ` Michael S. Tsirkin
2023-01-22 12:36           ` [Virtio-fs] " Anton Kuchin
2023-01-22 12:36             ` Anton Kuchin
2023-01-22 14:46             ` [Virtio-fs] " Michael S. Tsirkin
2023-01-22 14:46               ` Michael S. Tsirkin
2023-01-22 16:09               ` [Virtio-fs] " Anton Kuchin
2023-01-22 16:09                 ` Anton Kuchin
2023-01-22 16:17                 ` [Virtio-fs] " Michael S. Tsirkin
2023-01-22 16:17                   ` Michael S. Tsirkin
2023-01-23 14:09                   ` [Virtio-fs] " Stefan Hajnoczi
2023-01-23 14:09                     ` Stefan Hajnoczi
2023-01-23 15:52                     ` [Virtio-fs] " Anton Kuchin
2023-01-23 15:52                       ` Anton Kuchin
2023-01-23 19:49                       ` [Virtio-fs] " Stefan Hajnoczi
2023-01-23 19:49                         ` Stefan Hajnoczi
2023-01-23 21:00                         ` [Virtio-fs] " Michael S. Tsirkin
2023-01-23 21:00                           ` Michael S. Tsirkin
2023-01-23 21:56                           ` [Virtio-fs] " Stefan Hajnoczi
2023-01-23 21:56                             ` Stefan Hajnoczi
2023-01-23 18:27                   ` [Virtio-fs] " Dr. David Alan Gilbert
2023-01-23 18:27                     ` Dr. David Alan Gilbert
2023-01-23 19:53                     ` [Virtio-fs] " Stefan Hajnoczi
2023-01-23 19:53                       ` Stefan Hajnoczi
2023-01-24  1:46                       ` [Virtio-fs] " Stefan Hajnoczi
2023-01-24  1:46                         ` Stefan Hajnoczi
2023-01-24  9:50                         ` [Virtio-fs] " Dr. David Alan Gilbert
2023-01-24  9:50                           ` Dr. David Alan Gilbert
2023-01-24 12:48                           ` [Virtio-fs] " Stefan Hajnoczi
2023-01-24 12:48                             ` Stefan Hajnoczi
2023-02-01 14:37                             ` [Virtio-fs] " Juan Quintela
2023-02-01 14:37                               ` Juan Quintela
2023-01-25 19:46 ` [Virtio-fs] " Stefan Hajnoczi
2023-01-25 19:46   ` Stefan Hajnoczi
2023-01-26 14:20   ` [Virtio-fs] " Anton Kuchin
2023-01-26 14:20     ` Anton Kuchin
2023-01-26 15:13     ` [Virtio-fs] " Stefan Hajnoczi
2023-01-26 15:13       ` Stefan Hajnoczi
2023-01-26 15:21       ` [Virtio-fs] " Anton Kuchin
2023-01-26 15:21         ` Anton Kuchin

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=87mt5ly03z.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=antonkuchin@yandex-team.ru \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-fs@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.