From nobody Sun Feb 8 23:41:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1565783894; cv=none; d=zoho.com; s=zohoarc; b=PJohT6ciPspWOhBlU/GdyEVFYXjuU3Cxha3ztyVhttZZc542R2k09cE3yvA/JQHxqATX1yvneN1k+9sByH0/rymO8QL8R13emDBSjA1uU3fIRI1pyt34A1zkzry0Y5Xl25piXgYX6MYglqcACAeoPBke/UG4b5iWaohdzAMtALk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565783894; 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:ARC-Authentication-Results; bh=uvK/aGVRuig91FynOljPr2lDqdS/JOciktmTbD94vRg=; b=SgH7uZyDeUzA5moNO03RmoslFtKr3FkGwrQwqBX0xhQAsrrNxhgb02JhrNASI56XiAAP0vA8M+baW7tgZlqJkbgIXDWtc8Futptc8S30NgB69DHCnhy6DRk3N8w0NuiHjhQchyrnXlAg22Sd5pct5pHOJZ6l0dxoD5WU53tfYSU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565783894856818.8779705515467; Wed, 14 Aug 2019 04:58:14 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 9AA773001FA4; Wed, 14 Aug 2019 11:58:13 +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 764A97AB75; Wed, 14 Aug 2019 11:58: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 3CABA180B536; Wed, 14 Aug 2019 11:58:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7EBw5pU015547 for ; Wed, 14 Aug 2019 07:58:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id D97F9348C3; Wed, 14 Aug 2019 11:58:05 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6397334940 for ; Wed, 14 Aug 2019 11:58:03 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 14 Aug 2019 13:57:37 +0200 Message-Id: <7f3759f76a3ba16afa23f40de6d13cf23a0a5a4b.1565777704.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/18] virpcimock: Create devices/ and drivers/ under /sys/bus/pci upfront 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 14 Aug 2019 11:58:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In near future, we will be creating devices under different location and just symlink them under devices/. Just like real kernel does. But for that we need the directories to exists. Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza --- tests/virpcimock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index e97dbd81f8..213f906500 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -187,6 +187,19 @@ make_file(const char *path, VIR_FORCE_CLOSE(fd); } =20 +static void +make_dir(const char *path, + const char *name) +{ + VIR_AUTOFREE(char *) dirpath =3D NULL; + + if (virAsprintfQuiet(&dirpath, "%s/%s", path, name) < 0) + ABORT_OOM(); + + if (virFileMakePath(dirpath) < 0) + ABORT("Unable to create: %s", dirpath); +} + static void make_symlink(const char *path, const char *name, @@ -846,6 +859,8 @@ init_env(void) if (virFileMakePath(tmp) < 0) ABORT("Unable to create: %s", tmp); =20 + make_dir(tmp, "devices"); + make_dir(tmp, "drivers"); make_file(tmp, "drivers_probe", NULL, -1); =20 # define MAKE_PCI_DRIVER(name, ...) \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list