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]improve suspend_evtchn lock processing

To: "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx>
Subject: 答复: Re: [Xen-devel][PATCH]improve suspend_evtchn lock processing
From: "Chun Yan Liu" <cyliu@xxxxxxxxxx>
Date: Tue, 21 Dec 2010 23:32:53 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 21 Dec 2010 22:33:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19719.47984.131922.392205@xxxxxxxxxxxxxxxxxxxxxxxx>
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: <4CEFC793020000660001A739@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <19719.47984.131922.392205@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Sorry for delay, following is an explanation:

>> --- a/tools/libxc/xc_suspend.c    Thu Aug 26 11:16:56 2010 +0100
>> +++ b/tools/libxc/xc_suspend.c    Fri Nov 26 19:41:23 2010 +0800
>> @@ -16,19 +16,19 @@
>...
>> +#include

>That looks like a mistake.
 
I wonder if you think the header file has something wrong?
flock is defined in <sys/file.h>. To use it, need to include that header file.

>> @@ -127,8 +115,7 @@
>>      return suspend_evtchn;
>> 
>>  cleanup:
>> -    if (suspend_evtchn != -1)
>> -        xc_suspend_evtchn_release(xch, xce, domid, suspend_evtchn);
>> +    xc_suspend_evtchn_release(xch, xce, domid, suspend_evtchn);
>> 
>>      return -1;
>>  }

>What is this change for ?

if (suspend_evtchn != -1) part is unnecessary and might leave an orphan lock file.
Only suspend_evtchn > 0 means we got the lock successfully, all other values means we failed to bind suspend event channel, so we should do cleanup work, including: the lock file we created before should be removed. Otherwise, in xc_save, if suspend_evtchn = -1, there will be no chance to remove the lock file. 
I noticed this part was added by Jiang, Yunhong, I've talked with him before, he also thought that the if (suspend_evtchn != -1) part should be removed altogether.
 
Thanks.

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