From patchwork Sat Feb 2 00:03:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 217626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 02BEF2C0295 for ; Sat, 2 Feb 2013 11:02:05 +1100 (EST) Received: from localhost ([::1]:59798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1QYU-0007Hs-N0 for incoming@patchwork.ozlabs.org; Fri, 01 Feb 2013 19:02:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1QYL-0007Hl-RE for qemu-devel@nongnu.org; Fri, 01 Feb 2013 19:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1QYJ-0005I9-98 for qemu-devel@nongnu.org; Fri, 01 Feb 2013 19:01:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1QYJ-0005Hu-1B for qemu-devel@nongnu.org; Fri, 01 Feb 2013 19:01:51 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1201nf2027465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Feb 2013 19:01:49 -0500 Received: from lacos-laptop.usersys.redhat.com (vpn1-4-181.ams2.redhat.com [10.36.4.181]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1201lLp012000; Fri, 1 Feb 2013 19:01:48 -0500 Message-ID: <510C57E5.2000108@redhat.com> Date: Sat, 02 Feb 2013 01:03:49 +0100 From: Laszlo Ersek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130108 Thunderbird/10.0.12 MIME-Version: 1.0 To: Bruce Rogers References: <510BD16002000048000D4B30@novprvoes0310.provo.novell.com> <87ip6bznm1.fsf@codemonkey.ws> <510BE21D02000048000D4B45@novprvoes0310.provo.novell.com> In-Reply-To: <510BE21D02000048000D4B45@novprvoes0310.provo.novell.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: jasowang@redhat.com, qemu-devel@nongnu.org, Anthony Liguori Subject: Re: [Qemu-devel] libvirt fails to start guest with latest code checkins X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 02/01/13 23:41, Bruce Rogers wrote: > Here is the invocation by libvirt, as recorded in /var/log/libvirt/qemu/: > 2013-02-01 21:35:45.597+0000: starting up > LC_ALL=C > PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin: > /bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin > HOME=/root USER=root LOGNAME=root TMPDIR=/tmp QEMU_AUDIO_DRV=none > /usr/bin/qemu-kvm -name sles11 -S -M pc -cpu > core2duo,+lahf_lm,+pdcm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds > -enable-kvm -m 512 -smp 2,sockets=2,cores=1,threads=1 -uuid > 36975709-16ae-85e0-c90f-09eb4ec7dec3 -no-user-config -nodefaults > -chardev > socket,id=charmonitor,path=/var/lib/libvirt/qemu/sles11.monitor,server,nowait > -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc > -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 > -drive > file=/var/lib/kvm/images/sles11/disk0.raw,if=none,id=drive-virtio-disk0,format=raw > -device > virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 > -drive if=none,id=drive-ide0-0-0,readonly=on,format=raw -device > ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev > tap,fd=18,id=hostnet0 -device > virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:59:31:da,bus=pci.0,addr=0x3 > -vnc 127.0.0.1:0 -vga cirrus -device > virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 > WARNING: failed to find acpi-dsdt.aml > qemu-kvm: -device > virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:59:31:da,bus=pci.0,addr=0x3: > Property 'virtio-net-pci.netdev' can't find value 'hostnet0' > 2013-02-01 21:35:46.491+0000: shutting down (The "WARNING: failed to find acpi-dsdt.aml" message is fixed by commit 7e973bb2.) I think the following could be happening. -netdev tap,fd=18,id=hostnet0 is specified on the command line (generated by libvirt). Accordingly, the net_init_tap() function is entered with name="hostnet0". Looking at the tree at 264986e2^ (= e5dc0b4): - "tap->has_fd" is true, - fd / vnet_hdr / model are set up in that branch, - the net_init_tap() tail-calls net_init_tap_one(), with the configured local variables, including "name" (input param): return net_init_tap_one(tap, peer, model, name, ifname, script, downscript, tap->has_vhostfd ? tap->vhostfd : NULL, vnet_hdr, fd); Commit 264986e2, among other things, instantiates the net_init_tap_one() call for each branch of net_init_tap(), open-coding the parameters at each call site that originally used to be "buffered up" for the common final call. Unfortunately, there's a typo in the "tap->has_fd" branch: if (net_init_tap_one(tap, peer, "tap", NULL, NULL, script, downscript, vhostfdname, vnet_hdr, fd)) { return -1; } The "name" parameter, which would ultimately go to qemu_net_client_setup(), is lost, hence assign_name() is used instead. The rest of the arguments seems OK. Suggested patch: ----[cut here]---- ----[cut here]---- Laszlo diff --git a/net/tap.c b/net/tap.c index 1bf7609..48c254e 100644 --- a/net/tap.c +++ b/net/tap.c @@ -711,7 +711,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name, vnet_hdr = tap_probe_vnet_hdr(fd); - if (net_init_tap_one(tap, peer, "tap", NULL, NULL, + if (net_init_tap_one(tap, peer, "tap", name, NULL, script, downscript, vhostfdname, vnet_hdr, fd)) { return -1;