From patchwork Fri Mar 1 04:13:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 08005325@163.com X-Patchwork-Id: 159464 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp341782jad; Thu, 28 Feb 2019 22:16:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxQqWeKeu3YVN+qRohJG4hZaAMGUeO7DM0QEKZSspDuGwTYQLTU/eolvyG7YOHCw8txRH5a X-Received: by 2002:a25:d448:: with SMTP id m69mr2793563ybf.447.1551421013232; Thu, 28 Feb 2019 22:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551421013; cv=none; d=google.com; s=arc-20160816; b=e6Ty7rdfRC/hd04qt50JMtqcWOCSyZOA3EqEvaPmIew6xxNP6YJMIRO1la4h200vDZ Cg+FDRHTQzyDX23Bj0iP/7SOAxs7d9vvJwkjFS5sF1uY84LeKasxycwQiAMs5UIMoVLf T7rdrE26u5lv8dFwGVBxEu0UK+T9ISRHzQhEKZqCcxInRMdGVUaFkWW6uIicRp6bunMt ko9GqvQy6KKSJhZ2YhQGp2FaZPL0SLIf70zY5gl9grQ34nkRgDnzOpFq1i/pJL2KBQA/ FrRJSVcMpGfgkK6QOP21F9MMsPT38a6zjv8wNaeca/IH+ZWg+PrSrC1GBQnTfPZQtIXM 5BKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature; bh=49nO+Bk73t9uid3bNzjysz+RUgRDYPJaa9AFmcCs494=; b=dCnTYWxiCPyh0ArlsNhX5/UrH3396Hl0AC3fdLG+VDLrRveIYqLVbMKvB0u/NeL+RO zkvOkxHleOAowJuZ2hjMf+ISou6mPKxa0OmHuu057/Lq08mkZptgJCh2brFzaFA/hmWd ieVwJzNkre+YK8vguHO9jTFU6Wvq8nMsjAYrIxsPpY6A0bqKssH0+tDMBuj1UCOuGz+d kzQNIYhkT5ZUZ/q4u14/zK8jTgpPI6q3kSq+M+e/xgydimzY+1NcfjzxMUI9DtMpp0L+ ephcwvC+fYBK2RFgvLNPNu9/OxI2fFBeOsgofoIPXnmifG99dwSQB7rFhzrdD+8VQTXO tZAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@163.com header.s=s110527 header.b=ZSNxhktY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m10si12059350ybp.0.2019.02.28.22.16.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Feb 2019 22:16:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@163.com header.s=s110527 header.b=ZSNxhktY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from localhost ([127.0.0.1]:51408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzbTY-0000pa-Pt for patch@linaro.org; Fri, 01 Mar 2019 01:16:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <08005325@163.com>) id 1gzZY6-00036p-Gy for qemu-devel@nongnu.org; Thu, 28 Feb 2019 23:13:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <08005325@163.com>) id 1gzZY5-0001XB-Lh for qemu-devel@nongnu.org; Thu, 28 Feb 2019 23:13:26 -0500 Received: from m50-138.163.com ([123.125.50.138]:50584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <08005325@163.com>) id 1gzZY4-0001Uc-GM for qemu-devel@nongnu.org; Thu, 28 Feb 2019 23:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=49nO+Bk73t9uid3bNz jysz+RUgRDYPJaa9AFmcCs494=; b=ZSNxhktYVffTPNDu/TepRPbK9kwwRcUEFJ aVA6e/Kr3SKS4O9QE7aXxhxNoD7BktV/I39WP2c8cFUYsX3xstdXMOdZGgu1an0R seR21i1hhmJ1LrgXQgdRiMPvyz3ZPaxkK8mVTMiob9rl/eRGCZWuDjiZUgsDXBLV fG0kii1Iw= Received: from computevgpu01.localdomain (unknown [180.168.17.114]) by smtp1 (Coremail) with SMTP id C9GowABn1jZWsXhcNKKuAw--.19S2; Fri, 01 Mar 2019 12:13:14 +0800 (CST) From: 08005325@163.com To: qemu-devel@nongnu.org Date: Fri, 1 Mar 2019 12:13:08 +0800 Message-Id: <1551413588-36475-1-git-send-email-08005325@163.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: C9GowABn1jZWsXhcNKKuAw--.19S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uFW7ZF4kAw4kCFW8WF1rWFg_yoW8JFyDpw nrXF1fZr17JFnrtan3A3WUWF1Ykw4qqryxtry3Za4Igw1xXrnxt3WUCrya9rZ2kFW8Aa1x WF10gr42qrWkZaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jV_M3UUUUU= X-Originating-IP: [180.168.17.114] X-CM-SenderInfo: qqyqikqtsvqiywtou0bp/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 123.125.50.138 X-Mailman-Approved-At: Fri, 01 Mar 2019 01:15:14 -0500 Subject: [Qemu-devel] [PATCH] Fix coredump when using virtio-vga 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: Michael Qiu , kraxel@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Michael Qiu When using command -device virtio-vga,virgl=on the default max_outputs is 0, this will lead coredump, (con=0x0, hw_ops=0x5555564452e0 , opaque=0x55555754ec60) at ui/console.c:1872 (vpci_dev=0x55555754ec60, errp=0x7fffffffdbb8) at qemu/hw/display/virtio-vga.c:160 (pci_dev=0x55555754ec60, errp=0x7fffffffdbb8) at hw/virtio/virtio-pci.c:1786 ... This patch force ths max_outputs to 1 when it not greater than 0. Signed-off-by: Michael Qiu --- hw/display/virtio-gpu-pci.c | 5 +++++ 1 file changed, 5 insertions(+) -- 1.8.3.1 diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index bdcd33c..59b571d 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -46,6 +46,11 @@ static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) int i; Error *local_error = NULL; + if (g->conf.max_outputs <= 0) { + qemu_log("WARNING: virtio gpu max_outputs must greater than 1"); + g->conf.max_outputs = 1; + } + qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); virtio_pci_force_virtio_1(vpci_dev); object_property_set_bool(OBJECT(vdev), true, "realized", &local_error);