From nobody Mon Feb 9 07:23:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502215133819901.603905049605; Tue, 8 Aug 2017 10:58:53 -0700 (PDT) Received: from localhost ([::1]:43910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df8mJ-0001Ux-5W for importer@patchew.org; Tue, 08 Aug 2017 13:58:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df8l4-0000tt-6I for qemu-devel@nongnu.org; Tue, 08 Aug 2017 13:57:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df8l3-0002Lb-76 for qemu-devel@nongnu.org; Tue, 08 Aug 2017 13:57:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54568) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df8kz-0002GA-5g; Tue, 08 Aug 2017 13:57:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB0F48553E; Tue, 8 Aug 2017 17:57:27 +0000 (UTC) Received: from probe.redhat.com (ovpn-123-63.rdu2.redhat.com [10.10.123.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86F2D7093A; Tue, 8 Aug 2017 17:57:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EB0F48553E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jsnow@redhat.com From: John Snow To: qemu-block@nongnu.org Date: Tue, 8 Aug 2017 13:57:08 -0400 Message-Id: <20170808175711.12203-2-jsnow@redhat.com> In-Reply-To: <20170808175711.12203-1-jsnow@redhat.com> References: <20170808175711.12203-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 08 Aug 2017 17:57:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] IDE: Do not flush empty CDROM drives X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow , pjp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The block backend changed in a way that flushing empty CDROM drives is now an error. Amend IDE to avoid doing so until the root problem can be addressed for 2.11. Reported-by: Kieron Shorrock Signed-off-by: John Snow Reviewed-by: Eric Blake --- hw/ide/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 0b48b64..6cbca43 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1053,17 +1053,21 @@ static void ide_flush_cb(void *opaque, int ret) ide_set_irq(s->bus); } =20 -static void ide_flush_cache(IDEState *s) +static bool ide_flush_cache(IDEState *s) { if (s->blk =3D=3D NULL) { ide_flush_cb(s, 0); - return; + return false; + } else if (!blk_bs(s->blk)) { + /* Nothing to flush */ + return true; } =20 s->status |=3D BUSY_STAT; ide_set_retry(s); block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH); s->pio_aiocb =3D blk_aio_flush(s->blk, ide_flush_cb, s); + return false; } =20 static void ide_cfata_metadata_inquiry(IDEState *s) @@ -1508,8 +1512,7 @@ static bool cmd_write_dma(IDEState *s, uint8_t cmd) =20 static bool cmd_flush_cache(IDEState *s, uint8_t cmd) { - ide_flush_cache(s); - return false; + return ide_flush_cache(s); } =20 static bool cmd_seek(IDEState *s, uint8_t cmd) --=20 2.9.4