From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kamala Narasimhan Subject: Re: [PATCH 2/5] Xl interface change plus changes to code it impacts Date: Thu, 10 Feb 2011 09:44:27 -0500 Message-ID: <4D53F9CB.2050908@gmail.com> References: <4D5060EB.3060109@gmail.com> <4D52DB1E.6080101@gmail.com> <1297329798.19526.20.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1297329798.19526.20.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Ian Campbell wrote: >> -static int validate_virtual_disk(libxl_ctx *ctx, char *file_name, >> libxl_disk_phystype disk_type) >> +static int validate_virtual_disk(libxl_ctx *ctx, char *file_name, >> + libxl_disk_backend backend_type, libxl_disk_format format) >> { >> struct stat stat_buf; >> >> - if ( (file_name[0] == '\0') && (disk_type == PHYSTYPE_EMPTY) ) >> + if ((file_name[0] == '\0') && (format == DISK_FORMAT_EMPTY)) >> return 0; > > If format == DISK_FORMAT_EMPTY then does the content of file_name > matter? > Good catch! Just checking for format should do. I will make that change. > Alternatively, if format == DISK_FORMAT_EMPTY then is file_name != "" > actually an error? > Ideally we should never end up that way as our code checks the string before setting format to DISK_FORMAT_EMPTY. Kamala