From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH v4 4/4] libxl: fix cd-eject Date: Wed, 17 Feb 2016 12:15:59 +0000 Message-ID: <22212.25727.162858.164530@mariner.uk.xensource.com> References: <1455644269-40358-1-git-send-email-roger.pau@citrix.com> <1455644269-40358-5-git-send-email-roger.pau@citrix.com> <22211.25400.584104.350999@mariner.uk.xensource.com> <56C45785.7020704@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW11Y-0002Xm-1K for xen-devel@lists.xenproject.org; Wed, 17 Feb 2016 12:16:04 +0000 In-Reply-To: <56C45785.7020704@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 =?iso-8859-1?Q?Monn=E9?= Cc: xen-devel@lists.xenproject.org, Wei Liu , Ian Campbell , Alex Braunegg List-Id: xen-devel@lists.xenproject.org Roger Pau Monn=E9 writes ("Re: [PATCH v4 4/4] libxl: fix cd-eject"): > Should we allow the PHY backend to handle empty files? > (pdev_path =3D=3D NULL || pdev_path =3D=3D ""). Yes. That is how it is supposed to work. I think this was broken in in 97ee1f5d "libxl: add support for image files for NetBSD" in 2011 (!) where this happened: - if (a->disk->format !=3D LIBXL_DISK_FORMAT_EMPTY && - !S_ISBLK(a->stab.st_mode)) { - LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=3D%s, backend phy" - " unsuitable as phys path not a block device", - a->disk->vdev); - return 0; - } = - return backend; + if (libxl__try_phy_backend(a->stab.st_mode)) + return backend; ... [libxl_linux.c:] ... +int libxl__try_phy_backend(mode_t st_mode) +{ + if (!S_ISBLK(st_mode)) { + return 0; + } + + return 1; +} Note that the "a->disk->format !=3D LIBXL_DISK_FORMAT_EMPTY" clause has been lost. Ian.