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

Re: [Xen-devel] [PATCH 12 of 14 v4] libxl: set frontend status to 6 on domain destroy



2011/12/14 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
> So if you rm the backend directory the NetBSD does not take that as a
> sign to tear down the device? That sounds like a bug in the NetBSD
> backend -- it should treat deletion of the backend state dir as if it
> were reading state = "6" and shut everything down.

Yes, if I delete the frontend from xenstore, the devices are detached.
Anyway, doing it one way or another (deletion or setting state to 6)
doesn't really make a difference, you still have to wait for the
backend to be disconnected (detached) before executing hotplug
scripts.

> Or is the issue only in the userspace portions?
>
>> ÂI've added some libxl__wait_for_device_state logic here, to
>> assure the backend state is set to 6 before trying to execute hotplug
>> scripts.
>
> But that will always be true with this patch since you set it that way
> just before, right?

I set frontend status to 6, and I suggest to wait for backend status
to be 6 also, then execute hotplug scripts. It won't be true, because
frontend and backend status are not tied (in the NetBSD case backend
status is set by the Dom0 kernel or hotplug scripts, while frontend
status is set by the DomU).

> If you go down this path then I think you need to set the state to
> "5" (Closing) in order to prompt the backend to transition to
> "6" (Closed) itself. However you need to be careful about adding a
> synchronous wait to the device destroy function. This should eventually
> work even if the frontend and backend are not co-operating. That starts
> to look a bit like calling libxl__device_remove instead.

Do you mean to set backend status to 5 instead of setting frontend to
6, and then wait for the kernel to do the transition from 5 to 6,
instead of setting the frontend to 6?

>> ÂThe truth is that I had it in previous versions of my patch,
>> but it seems the kernel always switches contexts and detaches the
>> devices before executing hotplug scripts (it might just be luck).
>
> Probably just luck and partly due e.g. to your presumably system being
> only very lightly loaded.
>
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.