Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CDE434CFA6 for ; Fri, 21 Nov 2025 12:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763727297; cv=none; b=tBJPXskTMDBJ+NvzVd8aIQr82XfoQ2qAbPRDedCQdxWc2CdICTA0y6WL4A8buaPMYM5e4P4gtGJ4Vxfq7Rwxa+hjW0zMbJe1lXC2wGgNbtTjcX5L1wARpuYw4mAvhem22pI+ML/cFQkLpa5nCY53epC6XI/BrihU9T68SH+nYdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763727297; c=relaxed/simple; bh=uSumpO7NwKbklubkcj2PmtgMfYl7krDwAT2W4qehON0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gCnJ7WVIakO7XGEygznLPg3rUqFg7bMyBG44MmdojXjkxvTF3/3JtmgmFAz6h9pPs4aaMy4XFhlnFaKj60/j0Vk37MH0EKZSZv1j0EtdqYuwc0SCcmlefMaOjjwqk5stMRzjrD1PtdYCgNk0uDrDfLeVUvoGnaB+Lm6AeKd+2dM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IXHdmD6C; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IXHdmD6C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763727294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/QEiTeEFvA8zkWAoBuerCa692vNPnWKWwqHvysdpeIs=; b=IXHdmD6CttG9XiWykPb/qlBVomtxnab0mokX9kyxyZdVOUmtk1TuSvL+EyAmvruYgK44Je xDZf6zftDzw17M0NBoGyKnDJZ6Pz19Fs4EsBGLjLu8Crj6kgB17kmNNo5qtBB6nLyFDZY4 a1fKBelQ/chsP1x2cRrtaoKxwKxDboY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-116-_q0zrpcsOni3q2XTxVwVng-1; Fri, 21 Nov 2025 07:14:50 -0500 X-MC-Unique: _q0zrpcsOni3q2XTxVwVng-1 X-Mimecast-MFC-AGG-ID: _q0zrpcsOni3q2XTxVwVng_1763727286 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4DA111954B0C; Fri, 21 Nov 2025 12:14:46 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 92CEC1955F1C; Fri, 21 Nov 2025 12:14:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A194221E66B9; Fri, 21 Nov 2025 13:14:38 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: arei.gonglei@huawei.com, zhenwei.pi@linux.dev, alistair.francis@wdc.com, stefanb@linux.vnet.ibm.com, kwolf@redhat.com, hreitz@redhat.com, sw@weilnetz.de, qemu_oss@crudebyte.com, groug@kaod.org, mst@redhat.com, imammedo@redhat.com, anisinha@redhat.com, kraxel@redhat.com, shentey@gmail.com, npiggin@gmail.com, harshpb@linux.ibm.com, sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, edgar.iglesias@gmail.com, elena.ufimtseva@oracle.com, jag.raman@oracle.com, sgarzare@redhat.com, pbonzini@redhat.com, fam@euphon.net, philmd@linaro.org, alex@shazbot.org, clg@redhat.com, peterx@redhat.com, farosas@suse.de, lizhijian@fujitsu.com, dave@treblig.org, jasowang@redhat.com, samuel.thibault@ens-lyon.org, michael.roth@amd.com, kkostiuk@redhat.com, zhao1.liu@intel.com, mtosatti@redhat.com, rathc@linux.ibm.com, palmer@dabbelt.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, marcandre.lureau@redhat.com, qemu-block@nongnu.org, qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, qemu-riscv@nongnu.org Subject: [PATCH v2 06/15] hw/scsi: Use error_setg_file_open() for a better error message Date: Fri, 21 Nov 2025 13:14:29 +0100 Message-ID: <20251121121438.1249498-7-armbru@redhat.com> In-Reply-To: <20251121121438.1249498-1-armbru@redhat.com> References: <20251121121438.1249498-1-armbru@redhat.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 The error message changes from vhost-scsi: open vhost char device failed: REASON to Could not open '/dev/vhost-scsi': REASON I think the exact file name is more useful to know than the file's purpose. We could put back the "vhost-scsi: " prefix with error_prepend(). Not worth the bother. Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert --- hw/scsi/vhost-scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index cdf405b0f8..239138c931 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -245,8 +245,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp) } else { vhostfd = open("/dev/vhost-scsi", O_RDWR); if (vhostfd < 0) { - error_setg(errp, "vhost-scsi: open vhost char device failed: %s", - strerror(errno)); + error_setg_file_open(errp, errno, "/dev/vhost-scsi"); return; } } -- 2.49.0