Received: from eggs.gnu.org ([2001:4830:134:3::10]:36882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGREW-000464-2E for qemu-devel@nongnu.org; Wed, 28 Jan 2015 06:56:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGRES-0002W6-L5 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 06:56:31 -0500 Received: from indium.canonical.com ([91.189.90.7]:43913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGRES-0002Vw-D0 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 06:56:28 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1YGRER-0002U7-DV for ; Wed, 28 Jan 2015 11:56:27 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6485B2E80C1 for ; Wed, 28 Jan 2015 11:56:27 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Jan 2015 11:49:16 -0000 From: Serge Hallyn <897750@bugs.launchpad.net> Sender: bounces@canonical.com References: <20111129155310.23239.76602.malonedeb@wampee.canonical.com> Message-Id: <20150128114918.12586.73006.launchpad@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 897750] Re: libvirt/kvm problem with disk attach/detach/reattach on running virt Reply-To: Bug 897750 <897750@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Changed in: qemu-kvm (Ubuntu) Status: Confirmed =3D> Incomplete -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/897750 Title: libvirt/kvm problem with disk attach/detach/reattach on running virt Status in QEMU: New Status in qemu-kvm package in Ubuntu: Incomplete Bug description: Release: Ubuntu 11.10 (Oneiric) libvirt-bin: 0.9.2-4ubuntu15.1 qemu-kvm: 0.14.1+noroms-0ubuntu6 Summary: With a running KVM virt, performing an 'attach-disk', then= a 'detach-disk', then another 'attach-disk' = in an attempt to reattach the volume at the same point on the virt, fails= , with the qemu reporting back to libvirt a 'Duplicate ID' error. Expected behavior: The 2nd invocation of 'attach-disk' should have succ= eeded Actual behavior: Duplicate ID error reported = I believe this is most likely a qemu-kvm issue, as the DOM kvm spits bac= k at libvirt after the 'detach-disk' does not show the just-detached disk. There is some kind of registry/lo= okup for devices in qemu-kvm and for whatever reason, the entry for the disk does not get removed when= it is detached from the virt. Specifically, the error gets reported at the 2nd attach-disk atte= mpt from: = qemu-option.c:qemu_opts_create:697 684 QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fa= il_if_exists) = 685 { = = 686 QemuOpts *opts =3D NULL; = = 687 = = 688 if (id) { = = 689 if (!id_wellformed(id)) { = = 690 qerror_report(QERR_INVALID_PARAMETER_VALUE, "id", "an ide= ntifier"); = 691 error_printf_unless_qmp("Identifiers consist of letters, = digits, '-', '.', '_', starting with a letter.\n"); = 692 return NULL; = = 693 } = = 694 opts =3D qemu_opts_find(list, id); = = 695 if (opts !=3D NULL) { = = 696 if (fail_if_exists) { = = 697 qerror_report(QERR_DUPLICATE_ID, id, list->name); = <<<< =3D=3D=3D=3D=3D=3D HERE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = = 698 return NULL; = = 699 } else { = = 700 return opts; = = 701 } = = 702 } = = 703 } = = 704 opts =3D qemu_mallocz(sizeof(*opts)); = = 705 if (id) { = = 706 opts->id =3D qemu_strdup(id); = = 707 } = = 708 opts->list =3D list; = = 709 loc_save(&opts->loc); = = 710 QTAILQ_INIT(&opts->head); = = 711 QTAILQ_INSERT_TAIL(&list->head, opts, next); = = 712 return opts; = = 713 } = = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Output of my attach/detach/attach =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D virsh # attach-disk base1 /var/lib/libvirt/images/extrastorage.img vdb Disk attached successfully virsh # dumpxml base1 base1 9ebebe7f-7dfa-4735-a80c-c19ebe4e1459 1048576 1048576 2 hvm Opteron_G3 AMD destroy restart restart /usr/bin/kvm