From: Ian Jackson Subject: Re: [PATCH v6 01/13] libxl: change ao_device_remove to ao_device Date: Fri, 15 Jun 2012 17:45:17 +0100 Message-ID: <20443.26269.316806.269605@mariner.uk.xensource.com> References: <1339676475-33265-1-git-send-email-roger.pau@citrix.com> <1339676475-33265-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1339676475-33265-2-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH v6 01/13] libxl: change ao_device_remove to ao_device"): > Introduce a new structure to track state of device backends, that will > be used in following patches on this series. ... Looks good. I have only one comment: > +static void device_xsentries_remove(libxl__egc *egc, libxl__ao_device *aodev) > +{ > + STATE_AO_GC(aodev->ao); > + char *be_path = libxl__device_backend_path(gc, aodev->dev); > + char *fe_path = libxl__device_frontend_path(gc, aodev->dev); > + xs_transaction_t t = 0; > + int ret = 0; > + > + if (aodev->action == DEVICE_DISCONNECT) { > + do { > + t = xs_transaction_start(CTX->xsh); > + libxl__xs_path_cleanup(gc, t, fe_path); > + libxl__xs_path_cleanup(gc, t, be_path); > + ret = !xs_transaction_end(CTX->xsh, t, 0); > + } while (ret && errno == EAGAIN); The error handling here seems a bit lacking. Perhaps you should import my "[PATCH 08/21] libxl: provide libxl__xs_*_checked ..." into your series and use those ? You can see an example of how they're used in "[PATCH 09/21] libxl: wait for qemu to acknowledge logdirty command". And you need to check the return values from libxl__xs_path_cleanup. Thanks, Ian.