WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] libxl_cdrom_insert

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] libxl_cdrom_insert
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Fri, 14 Jan 2011 17:37:23 -0500
Delivery-date: Fri, 14 Jan 2011 14:38:08 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=KmZSqNLq2gBu+6ftSwwDNVpt37ChezA1dksYuC0c3EA=; b=cA8yeJJWynQKxmkJdfpw0+GbYRzmcpd3qKD+ZbCgTsUVBU7VvlQa/YYWtIG+cl6nXf jJz+9IXGn8DsqPI6UxTvuPShueAsojn8bGVqRN+xsorEHwYaIvAtm2jclUiSScPN3DZP 0+MOkmx0qgeAmJcURZp62WiGjuAM3imAGAHjY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=agYuJLhZmuUnf4zxywz2EOJfiOcYRTYIGs6JPVnFv/WHNR4qYD/Gue0bbRuAGAebjj NA0DWPkzhEZm4WwkHvYUtTgnYfkcV51Px+0NRL6La0amvY/RhEzWY1ZiDw1/HI0AASQe RGogv1QLJJPLpT8q19Wrwud5eL/ODVUvvY4OI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Do we know the rationale behind setting disk->physpath to "" in the
below code in libxl?  Hopefully there is more to it than to avoid a
potential null pointer crash at a later point :)

int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid,
libxl_device_disk *disk) {
    int num, i;
    uint32_t stubdomid;
    libxl_device_disk *disks;
    int ret = ERROR_FAIL;

    if (!disk->physpath) {
        disk->physpath = "";
        disk->phystype = PHYSTYPE_PHY;
    }

Here is why I ask - I moved the disk file path validation code to
libxl and was looking at the code in that area and stumbled on this.
With the above logic the validate code I wrote will fail for cdrom
insert as I am validating the block device path also.  So, if I am
going to special case this I would like to first understand why I
would want to do that.

Kamala

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>