From nobody Tue Apr 23 10:28:46 2024 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=1610457554; cv=none; d=zohomail.com; s=zohoarc; b=N/+xj0sb+9H1CfFHl49XpH/bsPWCGB3anCaCp4ClfMCWBHrQUsHATFHQdAIH+t8MMP3hGzhRQ+1I+lMxzUZ1J0ZtWo9vCuuwM5sbzQPwUTRCv9g+l2AIgkwLHI799yiYT96WJmMFZVs37qjjKXDkpDpyXkba9g/cNlPsMUMMeGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610457554; 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=qPCsRvyJIxLLfz/NPlDXj9g/7oWwieYKf4L6AzLNrS8=; b=nexJ0MqPgd5zx3wPwH8Sqa0RUSgfDwbp245Ng2+CRbF9T0rVU9Mp6PGOLmbt+2JHCjACA/xQUkNZ3whFQyfSlpGKY+AJvdSjEcWIOzZR+d7iN3rKIUdy6szmo+RrmUV63NML2e6lOqL/nCXi1ny6aN0BFOhnhjS+NQiW8ufGAOM= 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 1610457554211738.0878932557326; Tue, 12 Jan 2021 05:19:14 -0800 (PST) Received: from localhost ([::1]:40992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzJZo-00008q-H6 for importer@patchew.org; Tue, 12 Jan 2021 08:19:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzJX6-0007RH-W9 for qemu-devel@nongnu.org; Tue, 12 Jan 2021 08:16:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kzJX4-0004VT-AY for qemu-devel@nongnu.org; Tue, 12 Jan 2021 08:16:24 -0500 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-1-0el1A1XrPayJTmZgV7kegw-1; Tue, 12 Jan 2021 08:16:17 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 818AD809DCE for ; Tue, 12 Jan 2021 13:16:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-98.ams2.redhat.com [10.36.112.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5C3219744; Tue, 12 Jan 2021 13:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610457380; 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: content-transfer-encoding:content-transfer-encoding; bh=qPCsRvyJIxLLfz/NPlDXj9g/7oWwieYKf4L6AzLNrS8=; b=JVcWW4sfhDB26wkMpmgxzcatd1VSaLPZ5pbRXn5w7aGIRJYZg+wCTz5fpSSdjHSbmwycva QZls4vuNf5Grl8YofvpXK0L57xy9C6lS7T9gJvu9ZC+g/HLbUwA5/RzYC1eDWhzwhg5l0w kX2vPCaH4zd6qOrb9QnFPuCDmA1/nho= X-MC-Unique: 0el1A1XrPayJTmZgV7kegw-1 From: Laszlo Ersek To: qemu devel list Subject: [PATCH v2] vhost-user-fs: add the "bootindex" property Date: Tue, 12 Jan 2021 14:16:03 +0100 Message-Id: <20210112131603.12686-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=216.205.24.124; envelope-from=lersek@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: virtio-fs@redhat.com, =?UTF-8?q?J=C3=A1n=20Tomko?= , "Dr. David Alan Gilbert" , Stefan Hajnoczi , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing. Add the property. Expose the property only in the PCI device, for now. There is no boot support for virtiofs on s390x (ccw) for the time being [1] [2], so leave the CCW device unchanged. Add the property to the base device still, because adding the alias to the CCW device later will be easier this way [3]. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01745.html [2] https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01870.html [3] https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01751.html Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder" fw_cfg file: /pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0 Cc: "Dr. David Alan Gilbert" Cc: "Michael S. Tsirkin" Cc: J=C3=A1n Tomko Cc: Stefan Hajnoczi Cc: virtio-fs@redhat.com Signed-off-by: Laszlo Ersek Acked-by: Dr. David Alan Gilbert Acked-by: Stefan Hajnoczi --- Notes: v2: - drop "hw/s390x/vhost-user-fs-ccw.c" hunk [Christian, Cornelia] =20 - document the same in the commit message =20 - remove fw_cfg kernel boot reference from the commit message (somewhat similar use case, but a comparison or even a hint doesn't necessarily belong in the commit message) =20 - pick up Dave's ACK include/hw/virtio/vhost-user-fs.h | 1 + hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/include/hw/virtio/vhost-user-fs.h b/include/hw/virtio/vhost-us= er-fs.h index 698575277101..0d62834c2510 100644 --- a/include/hw/virtio/vhost-user-fs.h +++ b/include/hw/virtio/vhost-user-fs.h @@ -39,6 +39,7 @@ struct VHostUserFS { VhostUserState vhost_user; VirtQueue **req_vqs; VirtQueue *hiprio_vq; + int32_t bootindex; =20 /*< public >*/ }; diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c index 8bb389bd282a..2ed8492b3fa3 100644 --- a/hw/virtio/vhost-user-fs-pci.c +++ b/hw/virtio/vhost-user-fs-pci.c @@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj) =20 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), TYPE_VHOST_USER_FS); + object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev), + "bootindex"); } =20 static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info =3D { diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index ed036ad9c13f..ac4fc34b36a2 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" =20 static void vuf_get_config(VirtIODevice *vdev, uint8_t *config) { @@ -279,6 +280,14 @@ static Property vuf_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +static void vuf_instance_init(Object *obj) +{ + VHostUserFS *fs =3D VHOST_USER_FS(obj); + + device_add_bootindex_property(obj, &fs->bootindex, "bootindex", + "/filesystem@0", DEVICE(obj)); +} + static void vuf_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -300,6 +309,7 @@ static const TypeInfo vuf_info =3D { .name =3D TYPE_VHOST_USER_FS, .parent =3D TYPE_VIRTIO_DEVICE, .instance_size =3D sizeof(VHostUserFS), + .instance_init =3D vuf_instance_init, .class_init =3D vuf_class_init, }; =20 --=20 2.19.1.3.g30247aa5d201