From nobody Mon Feb 9 02:28:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1595857860; cv=none; d=zohomail.com; s=zohoarc; b=cmLTjHsXkYkI1SD0VI63Jjk6ZVsQP1x4s4nP8G1+8bDQ+p+HXMCLc/iHRny6sBZ6ZF3AqEd81yrKnhZ1mWYBn6/HC2ekT/jMupFbHqRYuq5bZmsbVjqCEZQKQ+9fS9USwUclaFh5ETzapsqD7LpBdNbn0/xmSdT/FX+IaXt6raM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595857860; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AHMvwCpHzHvg1F3ImQSbDTzqzrVUtZ/6UHRF8xJVQi0=; b=B7VC9qpRqhu43nmxDhp8xm0fMeCtOK67NygaPp5RVZT4UNnTi7SSwQuuBONPrEkgpVn4hWdR8gwAy0yoKrucaVGMmY3SXMS5QcHnpzOJyd7Nc/3y0Lktb7vKhBsaeDSzvRdK1MLP+8ePe+kweITF53scXfNNS8tVUaQJTUo4kUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159585786079330.136378951153006; Mon, 27 Jul 2020 06:51:00 -0700 (PDT) Received: from localhost ([::1]:56306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k03Ws-0006s7-T4 for importer@patchew.org; Mon, 27 Jul 2020 09:50:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k03Vb-00055y-Vs for qemu-devel@nongnu.org; Mon, 27 Jul 2020 09:49:40 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24392 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k03VZ-0001r4-8g for qemu-devel@nongnu.org; Mon, 27 Jul 2020 09:49:39 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-99-vAS3g852PNSyXkNeCbsmag-1; Mon, 27 Jul 2020 09:49:34 -0400 Received: by mail-wr1-f70.google.com with SMTP id z1so3958288wrn.18 for ; Mon, 27 Jul 2020 06:49:34 -0700 (PDT) Received: from redhat.com ([192.117.173.58]) by smtp.gmail.com with ESMTPSA id 88sm13343163wrk.43.2020.07.27.06.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 06:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595857776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AHMvwCpHzHvg1F3ImQSbDTzqzrVUtZ/6UHRF8xJVQi0=; b=CXR9dZvvJh9rHBdgzzzOiL/aCEhzhCidiwVRlKoHT9RwvyTZMWCbAFv6vjEZsc8YZ10HgE /iPR98kK1cH2qSgevO2br/VNDyBqfNm4mx7xQTqKgRQ442hbChfEp1Wl+pbSgfbM6jmFR8 msV8GBujgepjQNb+dVZu/nCRg16gf10= X-MC-Unique: vAS3g852PNSyXkNeCbsmag-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AHMvwCpHzHvg1F3ImQSbDTzqzrVUtZ/6UHRF8xJVQi0=; b=CVUiRcLf7dshG08UT8SxNjsbGSTuakhpd/mCo+q9gFCVCmuAwz41WuZHrGqLcSxEbu BAhy/mG9GgIZGpOxOYH9YVP7SyGZDpNbo6F1uytsWSX0UhL52wXT4Is91g+kuuT86PKd Wj8rft//rRTH3LopQHBR8Juklt62Tixvzmsxr9FPQF21qw1JYRohEIZtHC4PPHVmU+9+ q6kXFJiFGFcKOrYfei0dyhzEejk8U4hvCkg4JbLTLewRQLSm1h4ya2GaKzhDER7jJWMk FcMT7u+Qy5xt6qGkCaUhVIcQeP0OWbWlCWtERywlSqt2dM7Ex9bSTI5FVh1KkK5ggVyM wATQ== X-Gm-Message-State: AOAM532qzj1sLjfzAL79BofWuRZBOEY75wDklm3F1uO523XrG0wHhgMJ V9TjTzuNJVVsEgn2wu+Vpe+P/tC2YH3s0ZKucsTfxRETnXOrVr1JcgC+ao8/BqRdP485oK9wWGV GzMl28Fd4cHjrNPQ= X-Received: by 2002:adf:e94a:: with SMTP id m10mr8069260wrn.249.1595857772844; Mon, 27 Jul 2020 06:49:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS7895x4hajfh+pBoM36f+0F94u3SBOH21OiopxXQCuKgddXx8EDy1TgZNblfui/NJEE9s5w== X-Received: by 2002:adf:e94a:: with SMTP id m10mr8069244wrn.249.1595857772636; Mon, 27 Jul 2020 06:49:32 -0700 (PDT) Date: Mon, 27 Jul 2020 09:49:29 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 1/7] virtio-mem-pci: force virtio version 1 Message-ID: <20200727134614.96376-2-mst@redhat.com> References: <20200727134614.96376-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200727134614.96376-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/27 00:16:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cornelia Huck , qemu-stable@nongnu.org, David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Trying to run simple virtio-mem-pci examples currently fails with qemu-system-x86_64: -device virtio-mem-pci,id=3Dvm0,memdev=3Dmem0,node= =3D0, requested-size=3D300M: device is modern-only, use disable-legacy=3Don due to the added safety checks in 9b3a35ec8236 ("virtio: verify that legacy support is not accidentally on"). As noted by Conny, we have to force virtio version 1. While at it, use qdev_realize() to set the parent bus and realize - like most other virtio-*-pci implementations. Fixes: 0b9a2443a48b ("virtio-pci: Proxy for virtio-mem") Reviewed-by: Cornelia Huck Cc: Cornelia Huck Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand Message-Id: <20200727115905.129397-1-david@redhat.com> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-mem-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index d375280ee1..590cec041b 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -21,8 +21,8 @@ static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_d= ev, Error **errp) VirtIOMEMPCI *mem_pci =3D VIRTIO_MEM_PCI(vpci_dev); DeviceState *vdev =3D DEVICE(&mem_pci->vdev); =20 - qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); - object_property_set_bool(OBJECT(vdev), "realized", true, errp); + virtio_pci_force_virtio_1(vpci_dev); + qdev_realize(vdev, BUS(&vpci_dev->bus), errp); } =20 static void virtio_mem_pci_set_addr(MemoryDeviceState *md, uint64_t addr, --=20 MST