From nobody Mon Feb 9 00:46:16 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522071881353783.9780345591508; Mon, 26 Mar 2018 06:44:41 -0700 (PDT) Received: from localhost ([::1]:56835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SQI-0004nk-E4 for importer@patchew.org; Mon, 26 Mar 2018 09:44:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SIy-0006WC-FQ for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0SIx-0006wJ-Eb for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:56 -0400 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:37959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0SIx-0006vx-8A for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:55 -0400 Received: by mail-wr0-x230.google.com with SMTP id m13so5631663wrj.5 for ; Mon, 26 Mar 2018 06:36:55 -0700 (PDT) Received: from 640k.lan (94-36-194-48.adsl-ull.clienti.tiscali.it. [94.36.194.48]) by smtp.gmail.com with ESMTPSA id g186sm6710105wmd.41.2018.03.26.06.36.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 06:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xF4OXRE97Bekf3LqRamsuiecYwEwgwQPpx4n1FOH+io=; b=iwz20/gXYOysCOg7bVwxI+xbp+MXu0Z3MWnLf8g6qvuy+VLDC7q0KiyPi6q9pw90JO LIwzRGh3X+GhyWTo59XE4WEXFBPNk/7oDzkfqcRDmXFdWBUDwjbRQ6Q6bcNiF/2hQ4d5 XV8A3BwYC5kUoL1+rWygZihHizRs8PeUBljX8yUC/18i03FWA8nx3XfnVTpO823ch2Vm 2pieP5yz8Yko+8Za5W83I+szYk/gKmYVHeB68wvrdRXXvucVaCZeo3fnrFcbsJLkCiI5 ba0R8nc26awbKiOPX3KZnos/BDGqlXU93hR0Sm80bMCym7bUHGjzOSWaA+2Hl2TmZ3J3 2xQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xF4OXRE97Bekf3LqRamsuiecYwEwgwQPpx4n1FOH+io=; b=GpFC4c0eZA3z2m3npcK6QluaSG8eak6KWrMqAsQpgqanTO5YRFfPuh21h8XHT3YGxd SEDfpd3L6H/IJn2BGZv1WIPaHZy5wW3kYxwQMQNzWrQV3UB8UMycUrvQjisGFjtRKEga rtRiyP82KyVKK2oIge2OudKhmr+1wDr3WtxOEm2GIeXFIVWAjeIl/umAawrdESqVCNtI VM5mjq/kxZzUPWi+UR1PCuuIPFu5Xn/ibAw4NoNOskaFa+TcOFMRvAHCxeyBj5dwmdg9 8XBqQeQsN+8e2cmpafcCZUzsUsmIIWL/D7M/uJMfS7atP3g8XSN4smbrWsACWm3rFFb1 s5eA== X-Gm-Message-State: AElRT7GBKfzJFAA9/Z8IZivkYnksiCCTVlMu1yw3wYmh6FU1Ll7z4Fap /cLRXLVP+s7KTebxlnqFp7xucvj5 X-Google-Smtp-Source: AG47ELsnVd2B1eqZ0tv34HlAYdQTz0fAt2h75tjsyMHSmCr9khK7B+EEpxm0wiWhFJARrybyWGxi1Q== X-Received: by 10.223.153.177 with SMTP id y46mr29872334wrb.215.1522071413790; Mon, 26 Mar 2018 06:36:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 26 Mar 2018 15:36:33 +0200 Message-Id: <1522071403-52486-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> References: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::230 Subject: [Qemu-devel] [PULL 06/16] fdc: Exit if ISA controller does not support DMA 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: Alexey Kardashevskiy , Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy A "powernv" machine type defines an ISA bus but it does not add any DMA controller to it so it is possible to hit assert(fdctrl->dma) by adding "-machine powernv -device isa-fdc". This replaces assert() with an error message. Signed-off-by: Alexey Kardashevskiy [thuth: Slightly adjusted error message and updated scripts/device-crash-te= st] Signed-off-by: Thomas Huth Message-Id: <1521193892-15552-3-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/block/fdc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 7b7dd41..cd29e27 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2695,7 +2695,10 @@ static void isabus_fdc_realize(DeviceState *dev, Err= or **errp) fdctrl->dma_chann =3D isa->dma; if (fdctrl->dma_chann !=3D -1) { fdctrl->dma =3D isa_get_dma(isa_bus_from_device(isadev), isa->dma); - assert(fdctrl->dma); + if (!fdctrl->dma) { + error_setg(errp, "ISA controller does not support DMA"); + return; + } } =20 qdev_set_legacy_instance_id(dev, isa->iobase, 2); --=20 1.8.3.1