From nobody Mon Feb 9 00:55:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1594391669; cv=none; d=zohomail.com; s=zohoarc; b=IgkzIghP7/FUvlwj8aWZIUCKhLGLzPrran1Rk91kUIEURUZh2zxHf30cRMTm8hbGSZBhPZpNQQAZm80CLtfCqaPEKxQ2fjVC/67n56vUh0/jtI4UENiKXxqz3fP1cy890nIL2EIkJFt0v8wralx+/3nJWLJEgILjlci4oNN8Dlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594391669; h=Content-Type:Content-Transfer-Encoding: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=kehb8Vkt/3rVqfKJoqooREPzcgkViOya18zjosGaSqk=; b=XLCuIbHK8wqt97X4iDC6Jrg8xX0FHbS403FkPwzVdFT0hJuYTc7J/abMAoMz4TZSis8AzdKAfGJNS8o6gkIwYuY2gBm1Tne44WSG1shF8DIbkojtZxaPEGc7VPF1QT1gAvlyhbLjkmLhg25ECpK8U8ZLqqk/hVROa7j7IAnfAY4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15943916698827.524027762978903; Fri, 10 Jul 2020 07:34:29 -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-147-kWgYwDtMNkOT2H_wh2qI5g-1; Fri, 10 Jul 2020 10:34:23 -0400 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 BE5DC102C7E9; Fri, 10 Jul 2020 14:34:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B2A31A7D9; Fri, 10 Jul 2020 14:34:12 +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 6B5E2180CB27; Fri, 10 Jul 2020 14:34:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06AEXxP5007153 for ; Fri, 10 Jul 2020 10:33:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92B0A17D82; Fri, 10 Jul 2020 14:33:59 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFF6678A41 for ; Fri, 10 Jul 2020 14:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594391668; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kehb8Vkt/3rVqfKJoqooREPzcgkViOya18zjosGaSqk=; b=KZff9A1sWp/Oz7tSEHJvLoxzx4Q4vAmoMfKtdR8YTw/ZTMXr77BQ2C1iWBJv8YX8mEhd4l 7YVK2QaP4RHeluGV3IkDCkAk6jrbLLJ2cgJilhcOfO5Sqgt85JCcb5IbNmKwSFPtr/uvr/ tdXd9TodNCxWFwUEj50vLKgvwakpXcc= X-MC-Unique: kWgYwDtMNkOT2H_wh2qI5g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/18] qemuBuildHostdevSCSICommandLine: Use new infrastructure Date: Fri, 10 Jul 2020 16:33:35 +0200 Message-Id: <2c7e0acd2db9bb25bbfd770d3db52f817d35202d.1594391524.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@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.84 on 10.5.11.23 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" In preparation for instantiating (i)SCSI hostdevs via -blockdev, refactor qemuBuildHostdevSCSICommandLine to use the new infrastructure which will do it automatically. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 44 ++++------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6b3b1b39ca..7f624a031e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -695,27 +695,6 @@ qemuBuildObjectSecretCommandLine(virCommandPtr cmd, } -/* qemuBuildDiskSecinfoCommandLine: - * @cmd: Pointer to the command string - * @secinfo: Pointer to a possible secinfo - * - * Add the secret object for the disks that will be using it to perform - * their authentication. - * - * Returns 0 on success, -1 w/ error on some sort of failure. - */ -static int -qemuBuildDiskSecinfoCommandLine(virCommandPtr cmd, - qemuDomainSecretInfoPtr secinfo) -{ - /* Not necessary for non AES secrets */ - if (!secinfo || secinfo->type !=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) - return 0; - - return qemuBuildObjectSecretCommandLine(cmd, secinfo); -} - - /* qemuBuildGeneralSecinfoURI: * @uri: Pointer to the URI structure to add to * @secinfo: Pointer to the secret info data (if present) @@ -5151,29 +5130,14 @@ qemuBuildHostdevSCSICommandLine(virCommandPtr cmd, virDomainHostdevDefPtr hostdev, virQEMUCapsPtr qemuCaps) { - virDomainHostdevSubsysSCSIPtr scsisrc =3D &hostdev->source.subsys.u.sc= si; + g_autoptr(qemuBlockStorageSourceAttachData) data =3D NULL; g_autofree char *devstr =3D NULL; - g_autofree char *drvstr =3D NULL; - g_autofree char *backendAlias =3D NULL; + const char *backendAlias =3D NULL; - if (scsisrc->protocol =3D=3D VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISC= SI) { - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc =3D - &scsisrc->u.iscsi; - qemuDomainStorageSourcePrivatePtr srcPriv =3D - QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(iscsisrc->src); - - if (qemuBuildDiskSecinfoCommandLine(cmd, srcPriv ? - srcPriv->secinfo : - NULL) < 0) - return -1; - } - - virCommandAddArg(cmd, "-drive"); - if (!(drvstr =3D qemuBuildSCSIHostdevDrvStr(hostdev, qemuCaps))) + if (!(data =3D qemuBuildHostdevSCSIAttachPrepare(hostdev, &backendAlia= s, qemuCaps))) return -1; - virCommandAddArg(cmd, drvstr); - if (!(backendAlias =3D qemuAliasFromHostdev(hostdev))) + if (qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data) < 0) return -1; virCommandAddArg(cmd, "-device"); --=20 2.26.2