From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1l02-0007aV-1l for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:28:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1kzw-0005N9-A4 for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:28:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1kzw-0005M9-0L for qemu-devel@nongnu.org; Mon, 30 Jun 2014 19:28:32 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5UNSUwm031524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Jun 2014 19:28:31 -0400 Received: from [10.3.113.171] (ovpn-113-171.phx2.redhat.com [10.3.113.171]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5UNSUch006679 for ; Mon, 30 Jun 2014 19:28:30 -0400 Message-ID: <53B1F29E.1080202@redhat.com> Date: Mon, 30 Jun 2014 17:28:30 -0600 From: Eric Blake MIME-Version: 1.0 References: <53B1EFE2.9040202@redhat.com> In-Reply-To: <53B1EFE2.9040202@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SAQCWvmMixT65tLtGSx7lHXd1A9UUWUfA" Subject: Re: [Qemu-devel] core dump with drive-mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SAQCWvmMixT65tLtGSx7lHXd1A9UUWUfA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/30/2014 05:16 PM, Eric Blake wrote: > I'm trying to track down a core dump with the QMP drive-mirror command.= Oh, and a followup question: I discovered that if I try to use drive-mirror to a file that is not already large enough, the job starts successfully but fails at the point where it exceeds the block size. It would be much nicer if the job auto-resized the destination to be large enough to hold the copy, but if that is not possible, then if the drive-mirror would fail up front rather than succeeding at starting a job that is doomed to failure, where the failure is only reported by an event and lacks useful information at why it failed. To trigger this scenario, alter my setup..= =2E >=20 > # in one terminal: > cd /tmp > rm -f base.img snap1.img snap2.img copy.img >=20 > # base.img <- snap1.img <- snap2.img; intentionally populating base.img= > # with a qcow2 header, but treating it as raw data > qemu-img create -f qcow2 base.img 10M =2E..by creating the base.img file with '-f raw'... > qemu-img create -f qcow2 -b base.img -o backing_fmt=3Draw snap1.img > qemu-img create -f qcow2 -b snap1.img -o backing_fmt=3Dqcow2 snap2.img > cp base.img copy.img =2E..and using 'touch copy.img' instead of 'cp base.img copy.img'. > # Yes, this command line is derived from libvirt... > LC_ALL=3DC PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin \ > QEMU_AUDIO_DRV=3Dnone gdb --args /usr/bin/qemu-system-x86_64 \ > -machine accel=3Dkvm -name testvm1 -S \ > -machine pc-i440fx-2.0,accel=3Dkvm,usb=3Doff -m 256 \ > -realtime mlock=3Doff -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ > -uuid 5a74eeb4-09c5-4fc2-869d-0e04c13f9db0 -no-user-config \ > -nodefaults -chardev socket,id=3Dcharmonitor,\ > path=3D/var/lib/libvirt/qemu/testvm1.monitor,server,nowait \ > -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol -rtc base=3Dutc= \ > -no-shutdown -no-acpi -boot strict=3Don \ > -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ > -drive file=3D/tmp/snap2.img,if=3Dnone,id=3Ddrive-virtio-disk0,format=3D= qcow2 \ > -device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x3,\ > drive=3Ddrive-virtio-disk0,id=3Dvirtio-disk0,bootindex=3D1 \ > -vnc 127.0.0.1:0 -device cirrus-vga,id=3Dvideo0,bus=3Dpci.0,addr=3D0x2= \ > -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 \ > -msg timestamp=3Don >=20 > # in next terminal: > mkdir -p /var/lib/libvirt/qemu > nc -u /var/lib/libvirt/qemu/testvm1.monitor > {"execute":"qmp_capabilities"} > {"execute":"cont"} > {"execute":"drive-mirror","arguments":{"device":"drive-virtio-disk0", > "target":"/tmp/copy.img","format":"raw", "mode":"existing","sync":"full= "}} everything else being the same, the drive-mirror starts but I get an early event that the job fails, and query-blockjobs no longer knows about it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SAQCWvmMixT65tLtGSx7lHXd1A9UUWUfA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTsfKeAAoJEKeha0olJ0Nqb1YH/jDrqBQpCBqFMFI+LNjAQwW/ 5X66Ibg8LuEkX5n89F7wAZw7N3rCOMJKSeltirkChyNFiZ6DVLjoCLPEcUMOLuHj lQwfdeFAbKH3UGvj+0uGeD0XV86JrmUADhxHDZ23rkO+biBFxjpsPqXWm9F/Hw5K CCa3eDnvo1WE1txW+p0dqnr2wESJvy4hWKt3eIHGJOtAIqQoWUc/sIHORgb/kzVE wkjaDDAXxaNbHArH/ZlM0v1XVYZc92wGCkHq9k/ZQeawHsbH0q5yjKFKFMC5adcP aQBltu0IovlwTD1FHTdDcdqb56VR7Rt+gPDTfxQZNQ0AIZuRnGca5uKZsHUkeUc= =YgKT -----END PGP SIGNATURE----- --SAQCWvmMixT65tLtGSx7lHXd1A9UUWUfA--