From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH v11 01/17] libxl: fix stubdom console destruction Date: Tue, 24 Jul 2012 13:14:23 +0100 Message-ID: <500E919F.509@citrix.com> References: <1343064465-17864-1-git-send-email-roger.pau@citrix.com> <1343064465-17864-2-git-send-email-roger.pau@citrix.com> <1343116236.8016.24.camel@dagon.hellion.org.uk> <500E5F5D.1000601@citrix.com> <500E7F03.2050903@citrix.com> <1343127442.18971.7.camel@zakaz.uk.xensource.com> <500E80A0.60306@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Ian Jackson , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Stefano Stabellini wrote: > On Tue, 24 Jul 2012, Roger Pau Monne wrote: >> Ian Campbell wrote: >>> On Tue, 2012-07-24 at 11:54 +0100, Roger Pau Monne wrote: >>>>>>> Does it apply to LIBXL__CONSOLE_BACKEND_IOEMU as well >>>>>>> as ..._XENCONSOLED? I took a look through tools/console and I cannot >>>>>>> find any handling of a state node in xenstore at all, so the XENCONSOLED >>>>>>> case seems clear. I notice that xen_console.c registers the device with >>>>>>> DEVOPS_FLAG_IGNORE_STATE but that only seems to affect startup not >>>>>>> teardown. I don't see a qemu_chr_close (or anything similar) anywhere in >>>>>>> hw/xen_console.c >>>>>> So it should apply to any console device? This means I don't have to >>>>>> wait for any device of type LIBXL__DEVICE_KIND_CONSOLE, and there's no >>>>>> need to check for the specific console type or Qemu. >>>>> xen_console registers a disconnect handler, con_disconnect, that should >>>>> be able to unbind the evtchn and unmap the ring. >>>>> "disconnect" is called by xen_backend, if the backend and frontend >>>>> states are 5 or 6. >>>> Yes, but I don't see that con_disconnect sets the state to 6 after doing >>>> the cleanup, neither xenconsoled does so. I think con_disconnect should >>>> set xendev->be_state = 6, so the parent function xen_be_disconnect would >>>> notice the state change and write it to xenstore. >>>> >>> The caller in xen_backend.c does this. >> The caller is xen_be_disconnect, which doesn't seem to change the state, >> and the caller of xen_be_disconnect is xen_be_check_state which also >> doesn't seem to change the state. >> > > It is done by xen_be_set_state(xendev, state), called at the end of > xen_be_disconnect. xen_be_set_state is only called if there's a state change (if state read from xenstore is different than xendev->be_state), but I cannot see any part of the code setting xendev->be_state to 6 (maybe I'm missing something).