All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Bruce Rogers <brogers@suse.com>
Cc: jasowang@redhat.com, qemu-devel@nongnu.org,
	Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] libvirt fails to start guest with latest code checkins
Date: Sat, 02 Feb 2013 01:03:49 +0100	[thread overview]
Message-ID: <510C57E5.2000108@redhat.com> (raw)
In-Reply-To: <510BE21D02000048000D4B45@novprvoes0310.provo.novell.com>

On 02/01/13 23:41, Bruce Rogers wrote:

> Here is the invocation by libvirt, as recorded in /var/log/libvirt/qemu/<vmname>:
> 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]----
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;
----[cut here]----

Laszlo

  reply	other threads:[~2013-02-02  0:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 21:29 [Qemu-devel] libvirt fails to start guest with latest code checkins Bruce Rogers
2013-02-01 22:16 ` Anthony Liguori
2013-02-01 22:41   ` Bruce Rogers
2013-02-02  0:03     ` Laszlo Ersek [this message]
2013-02-02  0:05       ` Bruce Rogers
2013-02-02  0:14       ` Anthony Liguori
2013-02-02  0:09     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=510C57E5.2000108@redhat.com \
    --to=lersek@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=brogers@suse.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.