コード例 #1
0
ファイル: uuids.c プロジェクト: kelledge/libguestfs
int
do_set_uuid (const char *device, const char *uuid)
{
  int r;

  /* How we set the UUID depends on the filesystem type. */
  CLEANUP_FREE char *vfs_type = get_blkid_tag (device, "TYPE");
  if (vfs_type == NULL)
    return -1;

  if (fstype_is_extfs (vfs_type))
    r = e2uuid (device, uuid);

  else if (STREQ (vfs_type, "xfs"))
    r = xfsuuid (device, uuid);

  else if (STREQ (vfs_type, "swap"))
    r = swapuuid (device, uuid);

  else if (STREQ (vfs_type, "btrfs")) {
    reply_with_error ("btrfs filesystems' UUID cannot be changed");
    r = -1;
  }

  else {
    reply_with_error ("don't know how to set the UUID for '%s' filesystems",
                      vfs_type);
    r = -1;
  }

  return r;
}
コード例 #2
0
ファイル: blkid.c プロジェクト: AlphaStaxLLC/libguestfs
char *
do_vfs_label (const mountable_t *mountable)
{
  CLEANUP_FREE char *type = do_vfs_type (mountable);

  if (type) {
    if (STREQ (type, "btrfs") && optgroup_btrfs_available ())
      return btrfs_get_label (mountable->device);
    if (STREQ (type, "ntfs") && optgroup_ntfsprogs_available ())
      return ntfs_get_label (mountable->device);
  }

  return get_blkid_tag (mountable->device, "LABEL");
}
コード例 #3
0
ファイル: blkid.c プロジェクト: dineshbhoopathy/libguestfs
char *
do_vfs_uuid (const mountable_t *mountable)
{
  return get_blkid_tag (mountable->device, "UUID");
}
コード例 #4
0
ファイル: blkid.c プロジェクト: dineshbhoopathy/libguestfs
char *
do_vfs_label (const mountable_t *mountable)
{
  return get_blkid_tag (mountable->device, "LABEL");
}
コード例 #5
0
ファイル: blkid.c プロジェクト: dineshbhoopathy/libguestfs
char *
do_vfs_type (const mountable_t *mountable)
{
  return get_blkid_tag (mountable->device, "TYPE");
}
コード例 #6
0
ファイル: blkid.c プロジェクト: gaowanlong/libguestfs
char *
do_vfs_uuid (const char *device)
{
  return get_blkid_tag (device, "UUID");
}
コード例 #7
0
ファイル: blkid.c プロジェクト: gaowanlong/libguestfs
char *
do_vfs_label (const char *device)
{
  return get_blkid_tag (device, "LABEL");
}
コード例 #8
0
ファイル: blkid.c プロジェクト: gaowanlong/libguestfs
char *
do_vfs_type (const char *device)
{
  return get_blkid_tag (device, "TYPE");
}