[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, 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: You must have root user authority to use this 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.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The lvm_varyonvg subroutine.

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


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]