It is currently Fri, 31 Oct 2014 09:36:27 GMT



 
Author Message
 I need help in programmieng lvm_queryvg.
Hello,

I have a problem in programming the lvm_queryvg. I am using the IBM
C-Compiler 5.0.2.5 and AIX 4.3.3.81 (ML10). The problem is I do not
know how to define the unique_id Structure that this function needs to
work. I can get the VG_ID with the command lsvg <VGNAME>, but I don't
know if it is the right number.

Which VG_ID does IBM mean?

Best regards

Kai



 Fri, 25 Feb 2005 21:12:02 GMT   
 I need help in programmieng lvm_queryvg.
I've done this before - but there may be an easier way.  For my
application, I needed to first get a list of all volume groups, so first
I call lvm_queryvgs.  This returns a queryvgs struct, which has a
'num_vgs' field, and an array of queryvg structs pointed to by 'vgs'.
 From the queryvg struct, you can get the 'vg_id' field. This does map
to the ID returned in the output for 'lsvg <vgname>'.

Here is an example of what I have, but like I said, there may be an
easier way.  You should note that the unique_id struct is broken into 4
word fields, each an unsigned long(word1, word2, word3, word4):

struct queryvgs qvgs;
struct queryvg qvg;

int queryrc = lvm_queryvgs(&qvgs, NULL);
for (i=0; i<qvgs->num_vgs; i++){
    queryrc = lvm_queryvg(&qvgs->vgs[i].vg_id, &qvg, NULL);
    // Do what you want with the qvg struct that is returned
    // for this volume group

Janel



 Fri, 25 Feb 2005 23:33:05 GMT   
 I need help in programmieng lvm_queryvg.

Hello,

many thanks to you Janel. I wrote this code:

void main(void)
{
        int i;
        struct queryvgs qvgs;
        struct queryvgs *pqvgs=&qvgs;
        struct queryvg qvg;
        struct queryvg *pqvg=&qvg;

        lvm_queryvgs(&pqvgs,NULL);

        for(i=0;i<pqvgs->num_vgs;i++)
        {      
                lvm_queryvg(&pqvgs->vgs[i].vg_id,&pqvg,NULL);
                printf("maxlvs: %d\n",pqvg->maxlvs);
        }

and now it works fine.

Best regards.

Kai



 Sat, 26 Feb 2005 16:39:55 GMT   
 
   [ 3 post ] 

Similar Threads

1. Need help getting connected, bootp help needed

2. ARCNET Drivers Needed for Linux...help help help!

3. ARCNET Drivers Needed for Linux...help help help!

4. need help with LaTex, help help

5. m$-win guy needs linux help-need content fitering software

6. need to set up common logins across unix shop need help

7. DESPARATE need help needed installing..

8. Need help, need to add new /etc/rc script

9. HELP NEEDED: Need DOS emulator for WABI under Solaris

10. RH 7.1: Applixware 4.4.2 needs older ldd need some help


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software