From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: [ANNOUNCE] kvm-83 release Date: Tue, 13 Jan 2009 23:35:53 +0300 Message-ID: <496CFB29.6070809@msgid.tls.msk.ru> References: <496C9CE0.2080103@redhat.com> <496CBE09.4060801@wonghome.net> <1231867653.4290.196.camel@localhost.localdomain> <496CFA65.9000706@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: John Wong , Avi Kivity , KVM list To: Mark McLoughlin Return-path: Received: from hobbit.corpit.ru ([81.13.33.150]:21413 "EHLO hobbit.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbZAMUfz (ORCPT ); Tue, 13 Jan 2009 15:35:55 -0500 In-Reply-To: <496CFA65.9000706@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: Michael Tokarev wrote: > Mark McLoughlin wrote: [] >> --- qemu/net.c >> +++ qemu/net.c >> @@ -1740,7 +1740,7 @@ void net_cleanup(void) >> TAPState *s = vc->opaque; >> >> if (strcmp(vc->model, "tap") == 0 && >> - sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 && >> + sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 && > > Hmm. What if ifname=foo is the last parameter? And while we're at it.. Why the parsing isn't done like this: for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) { if (strncmp(tok, "ifname=", 7) == 0) strcpy(ifname, tok+7); else if ... } -- here and everywhere else? /mjt