From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26341 invoked by alias); 3 Sep 2009 17:13:48 -0000 Received: (qmail 26320 invoked by uid 9657); 3 Sep 2009 17:13:47 -0000 Date: Thu, 03 Sep 2009 17:13:00 -0000 Message-ID: <20090903171346.26318.qmail@sourceware.org> From: wysochanski@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/test/api vgtest.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00029.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2009-09-03 17:13:46 Modified files: test/api : vgtest.c Log message: Update lvm2app vgtest to take vgname and devices as parameters. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/api/vgtest.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 --- LVM2/test/api/vgtest.c 2009/08/13 12:16:45 1.10 +++ LVM2/test/api/vgtest.c 2009/09/03 17:13:46 1.11 @@ -25,9 +25,9 @@ lvm_t handle; vg_t vg; -const char *vg_name = "my_vg"; -const char *device = "/dev/loop3"; -const char *device2 = "/dev/loop4"; +const char *vg_name; +#define MAX_DEVICES 16 +const char *device[MAX_DEVICES]; uint64_t size = 1024; #define vg_create(vg_name) \ @@ -51,7 +51,7 @@ if (status) { \ fprintf(stderr, "Creation of volume group '%s' on " \ "device '%s' failed\n", \ - lvm_vg_get_name(vg), device); \ + lvm_vg_get_name(vg), device[0]); \ goto bad; \ } #define vg_open(vg_name, mode) \ @@ -84,11 +84,29 @@ goto bad; \ } +int init_vgtest(int argc, char *argv[]) +{ + int i; + + if (argc < 4) { + fprintf(stderr, "Usage: %s [... ]", + argv[0]); + return -1; + } + vg_name = argv[1]; + for(i=2; i