From nobody Sun Feb 8 03:27:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1642096280; cv=none; d=zohomail.com; s=zohoarc; b=T4G/6OVtgQAMvwHbmpagii/QZVXLogPKneSWoIyHoBeuVESaDVZpQGYFzpFm6Gk9EGeMBUsMYxtrVcQuRniGPyGh9+OU97/SyRIm1cPpTdnbpPu3ytiRWBi+fFhlcqhjbpFbCn9WQH3NeqLPS2EKJXKBrEpWs5U1ttAWlRYWIDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642096280; 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=vh0/+GkcZjNB162vWuBkFJinWpQWbHRNXMci3uby3zI=; b=fiqFdvZcCIdTfx6xD4jWuUqBzlDH2tZDtiEIkPosACdT+kPF7OnDICcweASB572UxlkpF0wyzTcYEPF9dV99Sd2wkL1TF4zfcMhRdXJ0HkJZfC1PHsCw+juSTN4Ko4wKcRh3Lf8+XnhduakOQ7rI+LaGLPa6SCRWkcSpBb8PJRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642096280814317.58432276513486; Thu, 13 Jan 2022 09:51:20 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-GRNkFZN3NVqoIxPwJOHDDA-1; Thu, 13 Jan 2022 12:50:32 -0500 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 C27A8100CCCB; Thu, 13 Jan 2022 17:50:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E2D464BF0; Thu, 13 Jan 2022 17:50:27 +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 61BC74A7C9; Thu, 13 Jan 2022 17:50:27 +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 20DHlxa1004999 for ; Thu, 13 Jan 2022 12:47:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 878692ED67; Thu, 13 Jan 2022 17:47:59 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 102FC2E053 for ; Thu, 13 Jan 2022 17:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642096279; 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=vh0/+GkcZjNB162vWuBkFJinWpQWbHRNXMci3uby3zI=; b=ff9+fG9CqRNnP8Sk277YL1PkmuOijcPPWoePqVPTtBHgBsf9oqUQEZbheo/RaEUTpeq/0u MT8p+3e1WDz3O+/i9OxgpWbhC0mTpK3tOg8Y0dPhvehSn5MdI+Tou7Gpt0pT0z7JXhO819 GXhc1joWthzkMZ9Ei8tzovzjedwvq+E= X-MC-Unique: GRNkFZN3NVqoIxPwJOHDDA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/7] util: remove virGetDeviceID Date: Thu, 13 Jan 2022 18:47:40 +0100 Message-Id: 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 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642096281964100001 It was only used to construct the hash key for the (now removed) shared devices in the qemu driver. Remove it and its mocking. Signed-off-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 1 - src/util/virutil.c | 29 ----------------------------- src/util/virutil.h | 3 --- tests/qemuhotplugmock.c | 17 ----------------- 4 files changed, 50 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 48e8ef6c72..ae132f9b11 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3510,7 +3510,6 @@ virDoesUserExist; virDoubleToStr; virFormatIntDecimal; virFormatIntPretty; -virGetDeviceID; virGetGroupID; virGetGroupList; virGetGroupName; diff --git a/src/util/virutil.c b/src/util/virutil.c index 0acdc052c3..4dc421a85f 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1324,35 +1324,6 @@ virValidateWWN(const char *wwn) return true; } =20 -#if defined(major) && defined(minor) -int -virGetDeviceID(const char *path, int *maj, int *min) -{ - struct stat sb; - - if (stat(path, &sb) < 0) - return -errno; - - if (!S_ISBLK(sb.st_mode)) - return -EINVAL; - - if (maj) - *maj =3D major(sb.st_rdev); - if (min) - *min =3D minor(sb.st_rdev); - - return 0; -} -#else -int -virGetDeviceID(const char *path G_GNUC_UNUSED, - int *maj, - int *min) -{ - *maj =3D *min =3D 0; - return -ENOSYS; -} -#endif =20 int virSetDeviceUnprivSGIO(const char *path G_GNUC_UNUSED, diff --git a/src/util/virutil.h b/src/util/virutil.h index bd2c69bfaa..c8b8445bbc 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -116,9 +116,6 @@ bool virDoesGroupExist(const char *name); =20 bool virValidateWWN(const char *wwn); =20 -int virGetDeviceID(const char *path, - int *maj, - int *min) G_GNUC_NO_INLINE; int virSetDeviceUnprivSGIO(const char *path, const char *sysfs_dir, int unpriv_sgio); diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c index 3b5f858044..051f2b20dc 100644 --- a/tests/qemuhotplugmock.c +++ b/tests/qemuhotplugmock.c @@ -27,7 +27,6 @@ #include "virmock.h" #include =20 -static int (*real_virGetDeviceID)(const char *path, int *maj, int *min); static bool (*real_virFileExists)(const char *path); =20 static void @@ -36,7 +35,6 @@ init_syms(void) if (real_virFileExists) return; =20 - VIR_MOCK_REAL_INIT(virGetDeviceID); VIR_MOCK_REAL_INIT(virFileExists); } =20 @@ -68,21 +66,6 @@ virDevMapperGetTargets(const char *path, } =20 =20 -int -virGetDeviceID(const char *path, int *maj, int *min) -{ - init_syms(); - - if (STREQ(path, "/dev/mapper/virt")) { - *maj =3D 254; - *min =3D 0; - return 0; - } - - return real_virGetDeviceID(path, maj, min); -} - - bool virFileExists(const char *path) { --=20 2.31.1