mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
util: remove virGetDeviceID
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án Tomko <jtomko@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
89803eb5f8
commit
44aaa02992
@ -3508,7 +3508,6 @@ virDoesUserExist;
|
|||||||
virDoubleToStr;
|
virDoubleToStr;
|
||||||
virFormatIntDecimal;
|
virFormatIntDecimal;
|
||||||
virFormatIntPretty;
|
virFormatIntPretty;
|
||||||
virGetDeviceID;
|
|
||||||
virGetGroupID;
|
virGetGroupID;
|
||||||
virGetGroupList;
|
virGetGroupList;
|
||||||
virGetGroupName;
|
virGetGroupName;
|
||||||
|
@ -1324,35 +1324,6 @@ virValidateWWN(const char *wwn)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#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 = major(sb.st_rdev);
|
|
||||||
if (min)
|
|
||||||
*min = minor(sb.st_rdev);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int
|
|
||||||
virGetDeviceID(const char *path G_GNUC_UNUSED,
|
|
||||||
int *maj,
|
|
||||||
int *min)
|
|
||||||
{
|
|
||||||
*maj = *min = 0;
|
|
||||||
return -ENOSYS;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
virSetDeviceUnprivSGIO(const char *path G_GNUC_UNUSED,
|
virSetDeviceUnprivSGIO(const char *path G_GNUC_UNUSED,
|
||||||
|
@ -116,9 +116,6 @@ bool virDoesGroupExist(const char *name);
|
|||||||
|
|
||||||
bool virValidateWWN(const char *wwn);
|
bool virValidateWWN(const char *wwn);
|
||||||
|
|
||||||
int virGetDeviceID(const char *path,
|
|
||||||
int *maj,
|
|
||||||
int *min) G_GNUC_NO_INLINE;
|
|
||||||
int virSetDeviceUnprivSGIO(const char *path,
|
int virSetDeviceUnprivSGIO(const char *path,
|
||||||
const char *sysfs_dir,
|
const char *sysfs_dir,
|
||||||
int unpriv_sgio);
|
int unpriv_sgio);
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "virmock.h"
|
#include "virmock.h"
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
static int (*real_virGetDeviceID)(const char *path, int *maj, int *min);
|
|
||||||
static bool (*real_virFileExists)(const char *path);
|
static bool (*real_virFileExists)(const char *path);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -36,7 +35,6 @@ init_syms(void)
|
|||||||
if (real_virFileExists)
|
if (real_virFileExists)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_MOCK_REAL_INIT(virGetDeviceID);
|
|
||||||
VIR_MOCK_REAL_INIT(virFileExists);
|
VIR_MOCK_REAL_INIT(virFileExists);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,21 +66,6 @@ virDevMapperGetTargets(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
virGetDeviceID(const char *path, int *maj, int *min)
|
|
||||||
{
|
|
||||||
init_syms();
|
|
||||||
|
|
||||||
if (STREQ(path, "/dev/mapper/virt")) {
|
|
||||||
*maj = 254;
|
|
||||||
*min = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return real_virGetDeviceID(path, maj, min);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
virFileExists(const char *path)
|
virFileExists(const char *path)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user