[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

lvm_queryvgs Subroutine

Purpose

Queries volume groups and returns information to online volume groups.

Library

Logical Volume Manager Library (liblvm.a)

Syntax

#include <lvm.h>


int lvm_queryvgs ( QueryVGS, Kmid)
struct queryvgs **QueryVGS;
mid_t Kmid;

Description

Note
The lvm_queryvgs subroutine uses the sysconfig system call, which requires root user authority, to query and update kernel data structures describing a volume group. You must have root user authority to use the lvm_queryvgs subroutine.

The lvm_queryvgs subroutine returns the volume group IDs and major numbers for all volume groups in the system that are online.

The caller passes the address of a pointer to a queryvgs structure, and the Logical Volume Manager (LVM) allocates enough space for the structure and returns the address of the structure in the pointer passed in by the user. The caller also passes in a Kmid parameter, which identifies the entry point of the logical device driver module:

struct queryvgs {
       long num_vgs;
       struct {
       long major_num  
       struct unique_id vg_id;
       } vgs  [LVM_MAXVGS];  
 }

Field Description
num_vgs Contains the number of online volume groups on the system. The vgs is an array of the volume group IDs and major numbers of all online volume groups in the system.

Parameters

QueryVGS Points to the queryvgs structure.
Kmid Identifies the address of the entry point of the logical volume device driver module.

Return Values

The lvm_queryvgs subroutine returns a value of 0 upon successful completion.

Error Codes

If the lvm_queryvgs subroutine fails, it returns one of the following error codes:

LVM_ALLOCERR The routine cannot allocate enough space for the complete buffer.
LVM_INVALID_PARAM An invalid parameter was passed into the routine.
LVM_INVCONFIG An error occurred while attempting to configure this volume group into the kernel. This error will normally result if the module ID is invalid, if the major number given is already in use, or if the volume group device could not be opened.

Related Information

List of Logical Volume Subroutines and Logical Volume Programming Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]