summaryrefslogtreecommitdiffstats
path: root/fish/fish.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-11-23 13:16:01 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-25 15:40:56 +0000
commit70faafe8d4f0c06c3e62c1e1469289255ee30c53 (patch)
treee18090adb68cb3bade62a3f25e58925a1376cdb2 /fish/fish.c
parentdfa9d6cf32b23e34eeba916a9a263483990a3fce (diff)
downloadlibguestfs-70faafe8d4f0c06c3e62c1e1469289255ee30c53.tar.gz
libguestfs-70faafe8d4f0c06c3e62c1e1469289255ee30c53.tar.xz
libguestfs-70faafe8d4f0c06c3e62c1e1469289255ee30c53.zip
fish: Keep device names in options drives list.
In the 'struct drv *drvs' structure, keep a list of the device name(s) for each added drive or guest. The device name is the canonical name as that drive would be known inside libguestfs, eg. "/dev/sda"
Diffstat (limited to 'fish/fish.c')
-rw-r--r--fish/fish.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fish/fish.c b/fish/fish.c
index 5d7aac6a..c1dbfb4d 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -339,6 +339,8 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
drv->type = drv_N;
+ drv->device = NULL;
+ drv->nr_drives = -1;
if (asprintf (&drv->N.filename, "test%d.img",
next_prepared_drive++) == -1) {
perror ("asprintf");
@@ -346,7 +348,6 @@ main (int argc, char *argv[])
}
drv->N.data = create_prepared_file (optarg, drv->N.filename);
drv->N.data_free = free_prep_data;
- drv->N.device = NULL; /* filled in by add_drives */
drv->next = drvs;
drvs = drv;
break;
@@ -554,7 +555,7 @@ prepare_drives (struct drv *drv)
if (drv) {
prepare_drives (drv->next);
if (drv->type == drv_N)
- prepare_drive (drv->N.filename, drv->N.data, drv->N.device);
+ prepare_drive (drv->N.filename, drv->N.data, drv->device);
}
}