From nobody Wed Nov 5 14:37:10 2025 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534873527465331.0153934364848; Tue, 21 Aug 2018 10:45:27 -0700 (PDT) Received: from localhost ([::1]:55162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsAiY-00005p-8X for importer@patchew.org; Tue, 21 Aug 2018 13:45:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsA4o-0002IT-42 for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsA4b-0006w4-2X for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:13 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:40657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsA4Z-0006sx-BE for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:03 -0400 Received: by mail-wm0-x22e.google.com with SMTP id y9-v6so3498825wma.5 for ; Tue, 21 Aug 2018 10:04:03 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id v6-v6sm2608955wmc.43.2018.08.21.10.04.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 10:04:01 -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=sgujkgIPdDMSa0rHcGAfyqh8u6qWHxzM94pdHmVQH20=; b=QaD1FjZvUNdf35r/nTbEchL/2YZcJdCvI7p0fJnSR3HQM3etEks5pqkSPhVCSAdZgj IuGOrLVimlF3b9NofUddYy7dD7q3iqAun10gDJcR/g93BUsL8b+BYn5cyn4okKMsz7eT //uBCA6K4mtjJaD5iF8+t+mC5q8l9tD2XyyQFiazobG/Ur8ICRmZF6wVT059kzIi13KD AQ3O6+SQE3/iteL6Syer0vR/K5sn/QoTmwS7Xq+ssCCD+zycwblv5XbEL91LHpvki34T HxemYUDXiGe8uuN0T+fMHVtl4qDoMcDdO+4/Ty3kdg28kmrAjYY5eHuKRIuMJto7AsgZ 7eHA== 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=sgujkgIPdDMSa0rHcGAfyqh8u6qWHxzM94pdHmVQH20=; b=d12U7huZYJJnvqhO1+9oCYqeNMis0mawvz5X5RfIiGWAxW2Edxo/y9qX00g1HQbpG5 h6dT5ACvaXvGCDUnDFhn/Qnq3z5Cdji+b+iK7tuWDvNNeflYL8CbfIxiafZLhuzpjewz +vTN0Xcsp8uKKg2SmXoz4Le7WZyLhZ7YjbGlgqiIfwD/EUyoZ6KIOubiXsbsuL6oEX6q 15OCfhvmwiztt4P4C1lFqZoWnDHOqM6pPPslbsE9fQ1QUu1TLzik3y5skRf91fGRIhx/ VxbhXFRg7ltQ/Tr3ag/fHPhsQyILCc2vRdqB/7w3vfacdlt+YuEIPfZxcdSSRB6lZ8w8 nd9g== X-Gm-Message-State: APzg51DgUKJu4sw87RyXbWUwnB6xY5RLzqjQOjg/aBXkAm42iTKOlQCu UZEDLSFAdYA+KByRNNN3Uq389FUB X-Google-Smtp-Source: ANB0VdZf261C6k90TBRGu7rmGLOCCBJTZWP1Amq1hx6yH2+Jrp9zsgxAerqvNZI45OjNQfhMxQE6cw== X-Received: by 2002:a1c:c14:: with SMTP id 20-v6mr130045wmm.117.1534871041988; Tue, 21 Aug 2018 10:04:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 19:02:27 +0200 Message-Id: <1534870966-9287-56-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> References: <1534870966-9287-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:c09::22e Subject: [Qemu-devel] [PULL 55/74] vhost-scsi: unify vhost-scsi get_features implementations 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: Greg Edwards Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 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: Greg Edwards Move the enablement of preset host features into the common vhost_scsi_common_get_features() function. This is in preparation for having vhost-scsi also make use of host_features. Signed-off-by: Greg Edwards Message-Id: <20180808195235.5843-3-gedwards@ddn.com> Reviewed-by: Felipe Franciosi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-scsi-common.c | 3 +++ hw/scsi/vhost-user-scsi.c | 14 +------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index e2a5828..b7fbab6 100644 --- a/hw/scsi/vhost-scsi-common.c +++ b/hw/scsi/vhost-scsi-common.c @@ -96,6 +96,9 @@ uint64_t vhost_scsi_common_get_features(VirtIODevice *vde= v, uint64_t features, { VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(vdev); =20 + /* Turn on predefined features supported by this device */ + features |=3D vsc->host_features; + return vhost_get_features(&vsc->dev, vsc->feature_bits, features); } =20 diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 694cb80..26491da 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -137,18 +137,6 @@ static void vhost_user_scsi_unrealize(DeviceState *dev= , Error **errp) } } =20 -static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev, - uint64_t features, Error **er= rp) -{ - VHostUserSCSI *s =3D VHOST_USER_SCSI(vdev); - VHostSCSICommon *vsc =3D VHOST_SCSI_COMMON(s); - - /* Turn on predefined features supported by this device */ - features |=3D vsc->host_features; - - return vhost_scsi_common_get_features(vdev, features, errp); -} - static Property vhost_user_scsi_properties[] =3D { DEFINE_PROP_CHR("chardev", VirtIOSCSICommon, conf.chardev), DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0), @@ -188,7 +176,7 @@ static void vhost_user_scsi_class_init(ObjectClass *kla= ss, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); vdc->realize =3D vhost_user_scsi_realize; vdc->unrealize =3D vhost_user_scsi_unrealize; - vdc->get_features =3D vhost_user_scsi_get_features; + vdc->get_features =3D vhost_scsi_common_get_features; vdc->set_config =3D vhost_scsi_common_set_config; vdc->set_status =3D vhost_user_scsi_set_status; fwc->get_dev_path =3D vhost_scsi_common_get_fw_dev_path; --=20 1.8.3.1