qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/5] vhost: add device started check in migration set log


From: Jason Wang
Subject: Re: [PATCH v2 5/5] vhost: add device started check in migration set log
Date: Thu, 14 May 2020 15:34:24 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0


On 2020/5/13 下午5:47, Dima Stepanov wrote:
     case CHR_EVENT_CLOSED:
         /* a close event may happen during a read/write, but vhost
          * code assumes the vhost_dev remains setup, so delay the
          * stop & clear to idle.
          * FIXME: better handle failure in vhost code, remove bh
          */
         if (s->watch) {
             AioContext *ctx = qemu_get_current_aio_context();

             g_source_remove(s->watch);
             s->watch = 0;
             qemu_chr_fe_set_handlers(&s->chr, NULL, NULL, NULL, NULL,
                                      NULL, NULL, false);

             aio_bh_schedule_oneshot(ctx, chr_closed_bh, opaque);
         }
         break;

I think it's time we dropped the FIXME and moved the handling to common
code. Jason? Marc-André?
I agree. Just to confirm, do you prefer bh or doing changes like what is
done in this series? It looks to me bh can have more easier codes.
Could it be a good idea just to make disconnect in the char device but
postphone clean up in the vhost-user-blk (or any other vhost-user
device) itself? So we are moving the postphone logic and decision from
the char device to vhost-user device. One of the idea i have is as
follows:
   - Put ourself in the INITIALIZATION state
   - Start these vhost-user "handshake" commands
   - If we got a disconnect error, perform disconnect, but don't clean up
     device (it will be clean up on the roll back). I can be done by
     checking the state in vhost_user_..._disconnect routine or smth like it


Any issue you saw just using the aio bh as Michael posted above.

Then we don't need to deal with the silent vhost_dev_stop() and we will have codes that is much more easier to understand.

Thank


   - vhost-user command returns error back to the _start() routine
   - Rollback in one place in the start() routine, by calling this
     postphoned clean up for the disconnect





reply via email to

[Prev in Thread] Current Thread [Next in Thread]