From patchwork Mon May 2 23:09:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 67051 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp294554qge; Mon, 2 May 2016 16:12:43 -0700 (PDT) X-Received: by 10.194.168.194 with SMTP id zy2mr41030942wjb.143.1462230763637; Mon, 02 May 2016 16:12:43 -0700 (PDT) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id k79si23390373wmc.55.2016.05.02.16.12.43 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 May 2016 16:12:43 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u42N9tsG013114; Mon, 2 May 2016 19:09:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u42N9r4U017969 for ; Mon, 2 May 2016 19:09:53 -0400 Received: from colepc.redhat.com (ovpn-113-44.phx2.redhat.com [10.3.113.44]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u42N9qgp012832; Mon, 2 May 2016 19:09:53 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 2 May 2016 19:09:35 -0400 Message-Id: <9f0a7e92429f3050ab2fb30ae31f959181d06c36.1462230544.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: hotplug: Report error if we hit tray status timeout X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com If we exceed the timeout waiting for the tray status to change, we don't report an error. Fix it --- I hit this trying to eject floppy media for a win10 VM with F24 qemu, but I didn't dig deeper to figure out _why_ it's timing out... src/qemu/qemu_hotplug.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 03e5309..e5f8a38 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -224,7 +224,13 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, goto error; while (disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) { - if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0) + int rc2 = virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT); + if (rc2 == 1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("timed out waiting for " + "disk tray status update")); + } + if (rc2 != 0) goto error; } } while (rc < 0);