[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] libxl_cdrom_insert


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.