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] [PATCH 6 of 6 RESENT] libxl: Do not SEGV when no 'remova

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 6 of 6 RESENT] libxl: Do not SEGV when no 'removable' disk parameter in xenstore
From: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Date: Tue, 07 Jun 2011 14:00:18 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 07 Jun 2011 05:05:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1106071256290.12963@kaball-desktop>
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: <patchbomb.1307292630@devel14> <70fc2a0f0a6003f1bf59.1307292636@devel14> <alpine.DEB.2.00.1106071256290.12963@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10
On 07.06.2011 13:57, Stefano Stabellini wrote:
> On Sun, 5 Jun 2011, Marek Marczykowski wrote:
>> # HG changeset patch
>> # User Marek Marczykowski <marmarek@xxxxxxxxxxxx>
>> # Date 1307145395 -7200
>> # Node ID 70fc2a0f0a6003f1bf591cd941a841a9e6b69c01
>> # Parent  0c0f9e1bd14073b5cb1d4f58b6950d16128003fa
>> libxl: Do not SEGV when no 'removable' disk parameter in xenstore
>>
>> Just assume disk as not removable when no 'removable' paremeter
>>
>> Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
>>
>> diff -r 0c0f9e1bd140 -r 70fc2a0f0a60 tools/libxl/libxl.c
>> --- a/tools/libxl/libxl.c    Sat Jun 04 01:52:11 2011 +0200
>> +++ b/tools/libxl/libxl.c    Sat Jun 04 01:56:35 2011 +0200
>> @@ -1563,6 +1563,7 @@ static unsigned int libxl__append_disk_l
>>                               libxl__xs_get_dompath(gc, 0), type, domid);
>>      dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
>>      if (dir) {
>> +        char *removable;
>>          *disks = realloc(*disks, sizeof (libxl_device_disk) * (*ndisks + 
>> n));
>>          pdisk = *disks + *ndisks;
>>          *ndisks += n;
>> @@ -1581,6 +1582,11 @@ static unsigned int libxl__append_disk_l
>>                  &(pdisk->backend));
>>              pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, 
>> "%s/%s/dev", be_path, *dir), &len);
>>              pdisk->unpluggable = atoi(libxl__xs_read(gc, XBT_NULL, 
>> libxl__sprintf(gc, "%s/%s/removable", be_path, *dir)));
> 
> shouldn't you be removing this ^ line? 

Yes, should be...

> 
>> +            removable = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, 
>> "%s/%s/removable", be_path, *dir));
>> +            if (removable)
>> +                pdisk->unpluggable = atoi(removable);
>> +            else
>> +                pdisk->unpluggable = 0;
>>              if (!strcmp(libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, 
>> "%s/%s/mode", be_path, *dir)), "w"))
>>                  pdisk->readwrite = 1;
>>              else
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
>>


-- 
Pozdrawiam / Best Regards,
Marek Marczykowski         | RLU #390519
marmarek at mimuw edu pl   | xmpp:marmarek at staszic waw pl

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>