From nobody Fri Dec 19 17:38:40 2025 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=1588766956; cv=none; d=zohomail.com; s=zohoarc; b=AlZy8/vLLDBe9HAc/w0sjPboYW04Q8hL5Go7QI91g//ZC6D+5zR50vAnvKj0c42nDQ5zDsH4h69adPgi5MJ/L/ZVpTdtLutdA5NX94fdBYtM7kwLuTU4KpF/VA6+8BWgRO1igs7IgBeRpU0RbkBoUQ6EgTS8esXJFw0MYtGIxIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588766956; 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=NZtCVwOY3ucECIqeQzYB1YBTDjk4KBg1/xyoGSPwp4g=; b=G5kF7l4Hfco0L3679329+zyM3QNXYAGVU3wwW+uL/uDfnEDFSjXlX/tpYnjv9gNMacSmpkJ0mBwRbAV6dNvAGp4CmUTnfiFdjjfd4FTjp5GqI4pRpl7Q5BInorDeoINDRsN4aCgvLIkePWbwzxqsb7iuBIhBB7OYElAaNUznI8A= 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 1588766956548363.70030068485164; Wed, 6 May 2020 05:09:16 -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-297-tiUu2OBjORCp89JL7BbXfQ-1; Wed, 06 May 2020 08:09:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8C93835BC1; Wed, 6 May 2020 12:09:06 +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 C2D4B5C1BD; Wed, 6 May 2020 12:09:06 +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 7C2A51809543; Wed, 6 May 2020 12:09:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 046C8pmM029634 for ; Wed, 6 May 2020 08:08:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id AD0D45C1D6; Wed, 6 May 2020 12:08:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F8E95C1BD for ; Wed, 6 May 2020 12:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588766955; 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=NZtCVwOY3ucECIqeQzYB1YBTDjk4KBg1/xyoGSPwp4g=; b=HUEPgz0lEmIrwdaUft956Qht2s0lQZqsLoE9BLsAcGzrzQC6he12Y5aYKJWqbrYHz0YVIF 98YWWxSzMNicbPLSH2N6Ij/G4WBuiqF3Kz/qgiU16eVbAGDLECvnItgcxMc/GkAjuOlU2+ npSXLTnqm/5azJGNh0IacAQfau3psyo= X-MC-Unique: tiUu2OBjORCp89JL7BbXfQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/20] qemu: Rename qemuDiskBusNeedsDriveArg to qemuDiskBusIsSD Date: Wed, 6 May 2020 14:08:22 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.16 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" The function effectively boils down to whether the disk is 'SD'. Since we'll need to make more decisions based on the fact whether the disk is on the SD bus, rename the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 ++++---- src/qemu/qemu_command.h | 2 +- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_process.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d9c3a7a52e..1b3651a758 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1141,7 +1141,7 @@ qemuCheckFips(void) /** - * qemuDiskBusNeedsDriveArg: + * qemuDiskBusIsSD: * @bus: disk bus * * Unfortunately it is not possible to use -device for SD devices. @@ -1149,7 +1149,7 @@ qemuCheckFips(void) * without -device. */ bool -qemuDiskBusNeedsDriveArg(int bus) +qemuDiskBusIsSD(int bus) { return bus =3D=3D VIR_DOMAIN_DISK_BUS_SD; } @@ -1441,7 +1441,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, if (qemuBuildDriveSourceStr(disk, qemuCaps, &opt) < 0) return NULL; - if (!qemuDiskBusNeedsDriveArg(disk->bus)) { + if (!qemuDiskBusIsSD(disk->bus)) { g_autofree char *drivealias =3D qemuAliasDiskDriveFromDisk(disk); if (!drivealias) return NULL; @@ -2158,7 +2158,7 @@ qemuBuildDiskCommandLine(virCommandPtr cmd, if (qemuBuildDiskSourceCommandLine(cmd, disk, qemuCaps) < 0) return -1; - if (!qemuDiskBusNeedsDriveArg(disk->bus)) { + if (!qemuDiskBusIsSD(disk->bus)) { if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_FDC || virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { if (qemuCommandAddExtDevice(cmd, &disk->info) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 0bb66c3f0b..53e05777e7 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -101,7 +101,7 @@ char *qemuBuildNicDevStr(virDomainDefPtr def, virQEMUCapsPtr qemuCaps); char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk); -bool qemuDiskBusNeedsDriveArg(int bus); +bool qemuDiskBusIsSD(int bus); qemuBlockStorageSourceAttachDataPtr qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 641b6f1fe1..f1b2fbb1a8 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1072,7 +1072,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverP= tr driver, case VIR_DOMAIN_DISK_BUS_SD: /* Note that SD card hotplug support should be added only once * they support '-device' (don't require -drive only). - * See also: qemuDiskBusNeedsDriveArg */ + * See also: qemuDiskBusIsSD */ case VIR_DOMAIN_DISK_BUS_LAST: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("disk bus '%s' cannot be hotplugged."), diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8ea470f75f..488ca91435 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5499,7 +5499,7 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, /* clear the 'blockdev' capability for VMs which have disks that need = -drive */ for (i =3D 0; i < vm->def->ndisks; i++) { - if (qemuDiskBusNeedsDriveArg(vm->def->disks[i]->bus)) { + if (qemuDiskBusIsSD(vm->def->disks[i]->bus)) { virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); break; } --=20 2.26.2