From nobody Fri Apr 26 03:50:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593095707; cv=none; d=zohomail.com; s=zohoarc; b=naT98Epe+Ouka7vIcJ0gaIIdF5Vf482Os+yBR4TDLaee6pMBHDU3HnylJ4uZCVdLZTHMgqeXP2o2tUchBbIdZt8JOW012wKi7at+jtN7jD2QpHMkUOUH9FbcySfh10PNFxRQKhIv00/wGHDSiXbZpBKqMdaz12Rh9kda4aDI9PU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593095707; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=izg17FJ3gQCCkuzLxTNOSqZo+sYojUM8rjy0+8XWSt4=; b=dwANnHyzwLye/OO3vhrxNMdfI0ugagnYVz/mI3EFL5Muvq67Keu03Uhf+eW4W/oCcFoePq09lJNIvT0cvvbH5oGAkz5Yze7eHr2PFKe0zNXksI2AqvSdZFE3AeK8XJhVhFoBSmysNDbQl9O12OdXfB7ftORAI483iPaUcZLrAgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1593095707254456.40269623471727; Thu, 25 Jun 2020 07:35:07 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-Zbw6ONObMjmwEj56rBfQCg-1; Thu, 25 Jun 2020 10:35:03 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 14E8A107ACCA; Thu, 25 Jun 2020 14:34:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBA69579A3; Thu, 25 Jun 2020 14:34:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A8CBB8759F; Thu, 25 Jun 2020 14:34:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 05PEYrer008426 for ; Thu, 25 Jun 2020 10:34:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 978441001B07; Thu, 25 Jun 2020 14:34:53 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-114-170.phx2.redhat.com [10.3.114.170]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7DE91002393; Thu, 25 Jun 2020 14:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593095706; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=izg17FJ3gQCCkuzLxTNOSqZo+sYojUM8rjy0+8XWSt4=; b=El7VPFQ7JK79pTnyTlGVk8fKcMddqmvKquOgoJ9RtN4Hc1cuKgF5ghDGjCYVTy/PV01NrS KH9DAtaIb56hGfuXLB/KKN7ivHXpxLN4F3RwMIrHIWepp/hnE/MyQueG1IUqRtKQycaNjz UxNCt8yUt9npz8Dk987aWOl/4o6Ecwg= X-MC-Unique: Zbw6ONObMjmwEj56rBfQCg-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v2] qemu: ramfb video device doesn't support PCI address Date: Thu, 25 Jun 2020 09:34:47 -0500 Message-Id: <20200625143447.21279-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: laine@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Although a ramfb video device is not a PCI device, we don't currently report an error for ramfb device definitions containing a PCI address. However, a guest configured with such a device will fail to start: # virsh start test1 error: Failed to start domain test1 error: internal error: qemu unexpectedly closed the monitor: 2020-06-16= T05:23:02.759221Z qemu-kvm: -device ramfb,id=3Dvideo0,bus=3Dpcie.0,addr=3D0= x1: Device 'ramfb' can't go on PCIE bus A better approach is to reject any device definitions that contain PCI addresses. While this is a change in behavior, any existing configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=3D1847259 Signed-off-by: Jonathon Jongsma Reviewed-by: Laine Stump --- changes in v2: - move validation to qemu-specific validation function as suggested by Lai= ne src/qemu/qemu_validate.c | 8 ++++++++ tests/qemuxml2argvtest.c | 1 + 2 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 5082a29dc7..b13c03759e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1925,6 +1925,14 @@ qemuValidateDomainDeviceDefVideo(const virDomainVide= oDef *video, if (qemuValidateDomainVirtioOptions(video->virtio, qemuCaps) < 0) return -1; =20 + if (video->type =3D=3D VIR_DOMAIN_VIDEO_TYPE_RAMFB && + video->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'address' is not supported for 'ramfb' video dev= ices")); + return -1; + } + + return 0; } =20 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1195f9c982..f2522fa530 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2276,6 +2276,7 @@ mymain(void) QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS); DO_TEST_CAPS_LATEST("video-bochs-display-device"); DO_TEST_CAPS_LATEST("video-ramfb-display-device"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("video-ramfb-display-device-pci-addres= s"); DO_TEST("video-none-device", QEMU_CAPS_VNC); DO_TEST_PARSE_ERROR("video-invalid-multiple-devices", NONE); --=20 2.21.3