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

Re: [Xen-devel] libxl_cdrom_insert

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>, Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Subject: Re: [Xen-devel] libxl_cdrom_insert
From: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxx>
Date: Thu, 20 Jan 2011 17:11:46 -0500
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 20 Jan 2011 14:12:40 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JA6wTZHyBRTB91PKVLCRZ9oqkl0GRNy0DMlZzXXePJY=; b=hb9GJp2yt+BjeTLFrx1TNqEt56jZW3DjmQ1YcMVeXv6Z06zJY38ItI/iyml7N3VZk7 UteUSaMQe5SK3HhhF6Uvgdc2PLPHsEPi63zUgVbS3jARKaEumwdX2iPChOBVIuelmSRz jA4+uGQl4X7HZp8HVHcACofhQ7w32g6D+ghKc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bxUAtJt/8vJ3bLOhl1q0J4tJmahgEp8H7msvxr+TxDYHUZD/bK5wHtjcI5sDTjLTO6 UvLb1VnjR2mTBUiDJHuhaRnhhk250MbgdbE9Ft5rtPX4qKKxb1ZDbMGYwQNyNcDQwU/L hofgqms38gxnKMoFl79cfrvYub1OL1C/9ONSA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTinE_LXPkBi+aD5tNzMsNmQqr+bs0nt3z0YYEH-c@xxxxxxxxxxxxxx>
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>
References: <AANLkTim2J=oxtoDcEJTeq69v6c0Z=wrYB_PzcbwP=zMP@xxxxxxxxxxxxxx> <1295103828.12280.134.camel@xxxxxxxxxxxxxxxxxxxxx> <AANLkTinE_LXPkBi+aD5tNzMsNmQqr+bs0nt3z0YYEH-c@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Just realized that we missed this one.  IanJ mentioned that he
wouldn't want any interface changes for 4.1 in which case the below
change is necessary to fix a bug.

Kamala

On Sat, Jan 15, 2011 at 1:57 PM, Kamala Narasimhan
<kamala.narasimhan@xxxxxxxxx> wrote:
> On Sat, Jan 15, 2011 at 10:03 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> 
> wrote:
>> On Fri, 2011-01-14 at 22:37 +0000, Kamala Narasimhan wrote:
>>> 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 :)
>>
>> I think it might indicate an empty CDROM drive in the HVM case. Arguably
>> a PHYSTYPE_EMPTY/NONE or some such concept might have been clearer. "hg
>> annotate" should lead you to the original commit.
>>
>
> In that case, if we want to keep "", per Gianni Tedesco we would need
> the below fix as the string would get freed later -
>
> diff -r ce208811f540 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c       Thu Jan 13 01:26:44 2011 +0000
> +++ b/tools/libxl/libxl.c       Fri Jan 14 17:39:16 2011 -0500
> @@ -1676,7 +1676,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u
>     int ret = ERROR_FAIL;
>
>     if (!disk->physpath) {
> -        disk->physpath = "";
> +        disk->physpath = strdup("");
>         disk->phystype = PHYSTYPE_PHY;
>     }
>     disks = libxl_device_disk_list(ctx, domid, &num);
>
> Gianni might have to sign off on it or at least ack it but here is
> mine if that is needed too -
>
> Signed-off-by: Kamala Narasimhan <kamala.narasimhan@xxxxxxxxxx>
>
> Kamala
>

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

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