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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] xenbackendd: clean variable in loop

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenbackendd: clean variable in loop
From: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>
Date: Thu, 14 Jul 2011 19:21:52 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 14 Jul 2011 10:22:35 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+lWXrBTE/R4Q8ugP4AlpVs6awnoCL/ZHz8pgKLM3INk=; b=FQoCzehBl+eJ9pofyUmYJaFmQMSsRZ/FNhcTG49lbIXQ64fqgpie7ZVi1QPMmzueDX q4jUpOocY1hnkMZE4K+piw0fJr4H8Q38bjwpZt19nAQBx++9ekgjpu3UjALfTFWT23z2 9dx+6GDKKHBeB2R5vFTGKoKQjeg1VvtUxUKJQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19999.6942.613816.462844@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: <CAPLaKK5wnGZdicsHE6YfvqneRrNX7rr6GzuOBf5P+eYLvCznAw@xxxxxxxxxxxxxx> <19999.6942.613816.462844@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The problem is that console usually comes after vbd, and it executes
the block hotplug script with the console device (because 'type' is
still set from the previous loop), nothing bad happens, just wanted to
get rid of the error message. Since the variable is reused trough the
for loop, I think it's best to clean it at the start/end of the loop,
this makes the code easier to understand (for me). Where do you
exactly suggest to put the initialization?

Thanks, Roger.

2011/7/14 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>:
> Roger Pau Monné writes ("[Xen-devel] [PATCH] xenbackendd: clean variable in 
> loop"):
>> Fixed a cleanup of a variable used in a loop that was giving error
>> messages, and added a debug message.
> Thanks, but I'm not entirely clear about the bug you think this is
> fixing.
> Looking at the existing code it seems like the problem is that if the
> loop is repeated and the 2nd device isn't a vbd or a vif, the previous
> type is erroneously reused.
> I think this woudl be better fixed by moving the initialisation of
> type from the top of the function to just before it might first be
> set.
> Ian.

Xen-devel mailing list