const char *lvm_vgname_from_pvid(lvm_t libh, const char *pvid)
{
	struct cmd_context *cmd = (struct cmd_context *)libh;
	struct id id;

	if (!id_read_format(&id, pvid)) {
		log_error(INTERNAL_ERROR "Unable to convert uuid");
		return NULL;
	}
	return find_vgname_from_pvid(cmd, (char *)id.uuid);
}
Beispiel #2
0
const char *lvm_vgname_from_pvid(lvm_t libh, const char *pvid)
{
	const char *rc = NULL;
	struct cmd_context *cmd = (struct cmd_context *)libh;
	struct id id;
	struct saved_env e = store_user_env((struct cmd_context *)libh);

	if (id_read_format(&id, pvid)) {
		rc = find_vgname_from_pvid(cmd, (char *)id.uuid);
	} else {
		log_error(INTERNAL_ERROR "Unable to convert uuid");
	}

	restore_user_env(&e);
	return rc;
}