From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6fab-0003Ec-Sk for qemu-devel@nongnu.org; Fri, 24 Jan 2014 07:10:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6faR-0005qK-Ch for qemu-devel@nongnu.org; Fri, 24 Jan 2014 07:10:24 -0500 Received: from ulysses.noc.ntua.gr ([2001:648:2000:de::230]:52069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6faQ-0005q8-VX for qemu-devel@nongnu.org; Fri, 24 Jan 2014 07:10:15 -0500 Date: Fri, 24 Jan 2014 13:40:11 +0200 From: Dimitris Aragiorgis Message-ID: <20140124114011.GA19717@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline Subject: [Qemu-devel] Strange monitor behavior related to hotplug commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: synnefo-devel@googlegroups.com, ganeti-devel@googlegroups.com --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, After having heavily used device_add/netdev_add lately with QEMU 1.7, we encountered the following strange behavior: 1) Get network/PCI configuration for a VM # echo info network | socat STDIO UNIX-CONNECT:/path/to/monitor/socket QEMU 1.7.0 monitor - type 'help' for more information (qemu) info network hotnic-42932f20-pci-5: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,maca= ddr=3Daa:00:08:28:1b:3c \ hotnic-42932f20-pci-5: index=3D0,type=3Dtap,fd=3D8 hotnic-ab323482-pci-6: index=3D0,type=3Dnic,model=3Dvirtio-net-pci,maca= ddr=3Daa:0c:f8:9d:d9:52 \ hotnic-ab323482-pci-6: index=3D0,type=3Dtap,fd=3D9 (qemu)=20 # echo info pci | socat STDIO UNIX-CONNECT:/path/to/monitor/socket QEMU 1.7.0 monitor - type 'help' for more information (qemu) info pci Bus 0, device 0, function 0: Host bridge: PCI device 8086:1237 id "" Bus 0, device 1, function 0: ISA bridge: PCI device 8086:7000 id "" Bus 0, device 1, function 1: IDE controller: PCI device 8086:7010 BAR4: I/O at 0xc0c0 [0xc0cf]. id "" Bus 0, device 1, function 2: USB controller: PCI device 8086:7020 IRQ 11. BAR4: I/O at 0xc0a0 [0xc0bf]. id "" Bus 0, device 1, function 3: Bridge: PCI device 8086:7113 IRQ 9. id "" Bus 0, device 2, function 0: VGA controller: PCI device 1013:00b8 BAR0: 32 bit prefetchable memory at 0xfc000000 [0xfdffffff]. BAR1: 32 bit memory at 0xfebf3000 [0xfebf3fff]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. id "" Bus 0, device 3, function 0: Class 0255: PCI device 1af4:1002 IRQ 11. BAR0: I/O at 0xc080 [0xc09f]. id "" Bus 0, device 4, function 0: SCSI controller: PCI device 1af4:1001 IRQ 11. BAR0: I/O at 0xc000 [0xc03f]. BAR1: 32 bit memory at 0xfebf2000 [0xfebf2fff]. id "hotdisk-1d455fed-pci-4" Bus 0, device 5, function 0: Ethernet controller: PCI device 1af4:1000 IRQ 10. BAR0: I/O at 0xc060 [0xc07f]. BAR1: 32 bit memory at 0xfebf1000 [0xfebf1fff]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. id "hotnic-42932f20-pci-5" Bus 0, device 6, function 0: Ethernet controller: PCI device 1af4:1000 IRQ 10. BAR0: I/O at 0xc040 [0xc05f]. BAR1: 32 bit memory at 0xfebf0000 [0xfebf0fff]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. id "hotnic-ab323482-pci-6" (qemu) 2) Monitor states that it has two Ethernet controllers (devices at PCI 5 an= d 6) with the corresponding netdev. 3) Try to remove the one on PCI 6 with id hotnic-ab323482-pci-6 # echo device_del hotnic-ab323482-pci-6 | socat STDIO UNIX-CONNECT:/pat= h/to/monitor/socket/ QEMU 1.7.0 monitor - type 'help' for more information (qemu) device_del hotnic-ab323482-pci-6 (qemu)=20 4) Monitor output points out that `device_del` succeeded. 5) *Still* info pci/network returns the same as above! 6) Try to remove the corresponding netdev: # echo netdev_del hotnic-ab323482-pci-6 | socat STDIO UNIX-CONNECT:/pat= h/to/monitor/socket QEMU 1.7.0 monitor - type 'help' for more information (qemu) netdev_del hotnic-ab323482-pci-6 Device 'hotnic-ab323482-pci-6' not found (qemu)=20 7) Monitor output points out that `netdev_del` has failed because the corresponding device (not netdev?) ID was not found! 8) *Still* info pci/network returns the same as above! Any ideas why this is happening? Is there another way to get further debug info or even another monitor command to work this around? Random thought: Is there any chance that a previous back-to-back netdev_add/device_add command has actually failed (due to a race or something) but the corresponding configuration not properly updated? Thanks in advance, dimara PS: Has commit 03060d on 1.6.2 anything to do with the aforementioned? qdev-monitor: Unref device when device_add fails qdev_device_add() leaks the created device upon failure. I suspect this problem crept in because qdev_free() unparents the device but does not drop a reference - confusing name. --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJS4lEbAAoJEHFDHex6CBG9pSgH/jIZTDjBLN27rnb8OmvGF6d9 uhqnUs8u/r6HuZQVgvyzEkhlnKntS+Y/2LHy+/uAe5WQboHyGVBYg/+WWP4vSKfh 8M/IOPalydHj1qOPCE+81aXV/xendHGaRFiWeK4PL7EwZGgN1saMVbfoWqYPiP7g Zvz7KA3zEDHGSTOzVk8okJinNh6IjCD2ZSiy+7orSmEpmvtj5GoHvTqR2INCN4oS 7olyS7VBmiBGAeti8BiPndkb3gNAm+MJUAAVGuWzNizeSvF/aqQPO5bFmvAt2XQJ aZRKEvTeAsAQ4qOM8mDmPCkACBQA0s4C9YVHgZD6C0axG1QUXjcRVsbmxQmIHOM= =RHoF -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--