From: Ian Campbell Subject: Re: [RFC Patch v4 9/9] update libxl__device_disk_from_xs_be() to support blktap device Date: Tue, 23 Sep 2014 11:12:42 +0100 Message-ID: <1411467162.14989.53.camel@kazak.uk.xensource.com> References: <1411365561-29242-1-git-send-email-wency@cn.fujitsu.com> <1411365561-29242-10-git-send-email-wency@cn.fujitsu.com> <1411398519.14971.25.camel@kazak.uk.xensource.com> <5420E400.5080300@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5420E400.5080300@cn.fujitsu.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: Wen Congyang Cc: Lai Jiangshan , Ian Jackson , Jiang Yunhong , Dong Eddie , xen devel , Shriram Rajagopalan , Yang Hongyang List-Id: xen-devel@lists.xenproject.org On Tue, 2014-09-23 at 11:07 +0800, Wen Congyang wrote: > >> + if (disk->format != LIBXL_DISK_FORMAT_VHD && > >> + disk->format != LIBXL_DISK_FORMAT_RAW) { > >> + LOG(ERROR, "unsupported tapdisk format: %s\n", tmp); > > > > Hrm, if we get here then is there any reason to reject this? obviously > > something wrote it etc. > > Hmm, we can get here only when the xenstore node is corrupted. > > > > > This function is supposed to read the current state and return it, I'm > > not sure it should be rejecting what it finds TBH, and it would simplify > > things not to do so. > > The xenstore node is corrupted, what should we do? Ignore this disk or return > error? I think if it contains a valid format string you should just continue using that value, rather than trying to second guess what other code may or may not have written. If it contains some completely corrupt value then you should error out, which IIRC you do already in the error handling of the from_string call) Ian.