From: Ian Jackson Subject: Re: [PATCH RFC v2 2/3] libxl: Port libxl_blktap2.c to blktap2.5 API. Date: Thu, 16 Apr 2015 17:45:12 +0100 Message-ID: <21807.59160.55600.293804@mariner.uk.xensource.com> References: <1429199767-25832-1-git-send-email-george.dunlap@eu.citrix.com> <1429199767-25832-3-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429199767-25832-3-git-send-email-george.dunlap@eu.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: George Dunlap Cc: Wei Liu , Dave Scott , Wen Congyang , Jonathan Ludlam , xen-devel@lists.xen.org, Yang Hongyang , Ian Campbell List-Id: xen-devel@lists.xenproject.org George Dunlap writes ("[PATCH RFC v2 2/3] libxl: Port libxl_blktap2.c to blktap2.5 API."): > This is code is in preparation for building against an external blktap > tree. (NB I'm not really familiar with the tapdisk API. I guess we'll want an ack from some blktap2.5 person ?) > +static int tap_ctl_find(const char *type, const char *disk, tap_list_t *tap) > +{ What does this function return ? > + int err; > + struct list_head list = LIST_HEAD_INIT(list); > + tap_list_t *entry; > + > + err = tap_ctl_list(&list); > + if (err) > + return err; > + > + err = ERROR_FAIL; ... But later, > err = tap_ctl_find(type, disk, &tap); > - if (err < 0) { > + if (err) { > /* returns -errno */ Also if it fails to find an entry it simply returns ERROR_FAIL without logging anything, which seems unhelpfully opaque. > char *libxl__blktap_devpath(libxl__gc *gc, > const char *disk, > - libxl_disk_format format) > + libxl_disk_format format, > + int readwrite) ... > + fprintf(stderr, "DEBUG %s %d %s\n", __func__, __LINE__, params); Mistakenly left in ? > @@ -55,7 +91,8 @@ int libxl__device_destroy_tapdisk(libxl__gc *gc, const char *params) > { > char *type, *disk; > int err; > - tap_list_t tap; > + struct list_head list = LIST_HEAD_INIT(list); Where is this variable `list' used ? Thanks, Ian.