From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: [ANNOUNCE] kvm-83 release Date: Tue, 13 Jan 2009 22:30:56 +0000 Message-ID: <1231885856.4290.253.camel@localhost.localdomain> References: <496C9CE0.2080103@redhat.com> <496CBE09.4060801@wonghome.net> <1231867653.4290.196.camel@localhost.localdomain> <496CFA65.9000706@msgid.tls.msk.ru> <496CFB29.6070809@msgid.tls.msk.ru> <496CFB8E.1060407@codemonkey.ws> <496D0110.2020200@msgid.tls.msk.ru> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , John Wong , Avi Kivity , KVM list To: Michael Tokarev Return-path: Received: from mx2.redhat.com ([66.187.237.31]:56201 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935AbZAMWbL (ORCPT ); Tue, 13 Jan 2009 17:31:11 -0500 In-Reply-To: <496D0110.2020200@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2009-01-14 at 00:01 +0300, Michael Tokarev wrote: > Anthony Liguori wrote: > >> Michael Tokarev wrote: > ... > >>>> if (strcmp(vc->model, "tap") == 0 && > >>>> - sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 && > >>>> + sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 && > >> > >> 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 ... > >> } > > > > Because strtok is extremely evil. > > I didn't mean strtok, but the way -- something LIKE that, i.e, > by splitting the string into args and parsing each in turn. It shouldn't be parsing anything at all, it's a stupid lame hack. I fixed it with: http://git.kernel.org/?p=virt/qemu/qemu.git;a=commit;h=973cbd37ce Cheers, Mark.