From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH v6 01/13] libxl: change ao_device_remove to ao_device Date: Mon, 18 Jun 2012 09:58:15 +0100 Message-ID: <4FDEEDA7.4070308@citrix.com> References: <1339676475-33265-1-git-send-email-roger.pau@citrix.com> <1339676475-33265-2-git-send-email-roger.pau@citrix.com> <20443.26269.316806.269605@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20443.26269.316806.269605@mariner.uk.xensource.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: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: > 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". Is it possible to change this part of the code after you have committed your series? If you want I can send a patch to fix this so you can add it at the end of your series. > And you need to check the return values from libxl__xs_path_cleanup. Even if I check the return value from libxl__xs_path_cleanup I will only print an error message, but the logic of the function will not change, and the error message it's already printed by libxl__xs_path_cleanup. If front or back xenstore entries remove failed, I will still try to remove the other entries and commit the transaction. Thanks for the review. Roger.