[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: [PATCH 4/4] vhost-user-blk: fix crash in realize process
From: |
Li Feng |
Subject: |
Fwd: [PATCH 4/4] vhost-user-blk: fix crash in realize process |
Date: |
Fri, 17 Apr 2020 18:07:35 +0800 |
Add mail group list.
Thank you, Raphael .
Raphael Norwitz <address@hidden> 于2020年4月17日周五 下午12:10写道:
>
> Mostly looks good - just a few superficial notes.
>
> On Wed, Apr 15, 2020 at 11:28:26AM +0800, Li Feng wrote:
> > 1. set s->connected to true after vhost_dev_init;
> > 2. call vhost_dev_get_config when s->connected is true, otherwise the
> > hdev->host_ops will be nullptr.
>
> You mean hdev->vhost_ops, right?
>
Yes.
> >
> > Signed-off-by: Li Feng <address@hidden>
> > ---
> > hw/block/vhost-user-blk.c | 47
> > +++++++++++++++++++++++++----------------------
> > 1 file changed, 25 insertions(+), 22 deletions(-)
> > + /*
> > + * set true util vhost_dev_init return ok, because CLOSE event may
> > happen
> > + * in vhost_dev_init routine.
> > + */
>
> I'm a little confused by this comment. Do you mean to say “wait until
> vhost_dev_init
> succeeds to set connected to true, because a close event may happen while
> vhost_dev_init is executing”?
Yes. This is the exception path:
qemu_chr_fe_set_handlers
-> vhost_user_blk_event(OPEN)
-> vhost_user_blk_connect
-> vhost_dev_init
-> vhost_user_blk_event(CLOSE)
-> vhost_dev_cleanup
We should set connected to true only when vhost_dev_init returns OK.
If a close event is triggered, we shouldn't set connected to true.
--
The SmartX email address is only for business purpose. Any sent message
that is not related to the business is not authorized or permitted by
SmartX.
本邮箱为北京志凌海纳科技有限公司(SmartX)工作邮箱. 如本邮箱发出的邮件与工作无关,该邮件未得到本公司任何的明示或默示的授权.