From nobody Fri May 17 05:54:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1619018514; cv=none; d=zohomail.com; s=zohoarc; b=DpwBbptTKaAgvcOJxEZOC85XgF7tuqlyS4DzxEJOCw8NvejIONxmueyYiWFdj7ahMAgA2I9RvWX88i4VVopHPvXVsSz3lQrGji+gk2qvTAE3fZf54Jxp9572SQUA6U4Y20xmZuS/Q/tS66DsLTcwigdb2/MiTc/lOjcAoM+YLno= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619018514; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XyU9ZlcSKQYQqtfcVQQp6syX15Y0Hplv5eF/JsNgWuY=; b=OEssBgzamyWlv2WFIDcijmHVa+1YDGBJU9GxeTlBmNCpvzZLD9wjmL7EnHZIHov9iHEkDJ628DMIb7sXxbmNsFzue+90L3uwosyjNvcRjGu6cWVJYQ0yaf7xbmVC4vqBLgJF2uN085giuuUnyM3PAUHlkrVTarYpj6l7rnqXVUI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 161901851428685.19042673425213; Wed, 21 Apr 2021 08:21:54 -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-290-10FjAkefNSaxVskCdNhMkQ-1; Wed, 21 Apr 2021 11:21:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 231788B8D3D; Wed, 21 Apr 2021 15:17:14 +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 EDA355DAA5; Wed, 21 Apr 2021 15:17:13 +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 662931806D1B; Wed, 21 Apr 2021 15:17:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13LFHBxH003791 for ; Wed, 21 Apr 2021 11:17:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id A003C60871; Wed, 21 Apr 2021 15:17:11 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.195.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C2B66085A for ; Wed, 21 Apr 2021 15:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619018513; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XyU9ZlcSKQYQqtfcVQQp6syX15Y0Hplv5eF/JsNgWuY=; b=R66S7sZh0FFRKkmBqW776H31ME4w3D7pl1XXZZqR05fYETkjcZ3sMX1zHfXo0JyXzm3+jJ xVsUS/T5wefWQSUHcGLtFtmPbAAWIybDaSEUZsEJmkcqvIIodgunFoRbvisdgHxTMHLUye keKgJfvEmp52OMV1L9rIiZND9aT8vuA= X-MC-Unique: 10FjAkefNSaxVskCdNhMkQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v2] storage_backend_fs: use MKFS ony if WITH_STORAGE_FS is defined Date: Wed, 21 Apr 2021 17:17:06 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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 code in storage_backend_fs is used for storage_dir and storage_fs drivers so some parts need to be guarded by checking for WITH_STORAGE_FS. Fixes: 16c69e7aaed4cabfd8e8c19cc326854d4c480437 Signed-off-by: Pavel Hrdina Reviewed-by: Michal Privoznik --- GitLab CI faild on MacOS and FreeBSD where storage_fs is disabled. Changes in v2: - guard only virFindFileInPath instead of the whole function src/storage/storage_backend_fs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index af645ea9de..be3c3c6839 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -402,7 +402,11 @@ virStorageBackendExecuteMKFS(const char *device, const char *format) { g_autoptr(virCommand) cmd =3D NULL; - g_autofree char *mkfs =3D virFindFileInPath(MKFS); + g_autofree char *mkfs =3D NULL; + +#if WITH_STORAGE_FS + mkfs =3D virFindFileInPath(MKFS); +#endif /* WITH_STORAGE_FS */ =20 if (!mkfs) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -412,7 +416,7 @@ virStorageBackendExecuteMKFS(const char *device, return -1; } =20 - cmd =3D virCommandNewArgList(MKFS, "-t", format, NULL); + cmd =3D virCommandNewArgList(mkfs, "-t", format, NULL); =20 /* use the force, otherwise mkfs.xfs won't overwrite existing fs. * Similarly mkfs.ext2, mkfs.ext3, and mkfs.ext4 require supplying -F --=20 2.30.2