+ drv->data = NULL;
+ /* We could fill the device field in, but in fact we
+ * only use it for the -N option at present.
+ */
+ drv->device = NULL;
+ drv->next = drvs;
+ drvs = drv;
+ next_drive++;
+ break;
+
+ case 'N':
+ if (STRCASEEQ (optarg, "list")) {
+ list_prepared_drives ();
+ exit (EXIT_SUCCESS);
+ }
+ drv = malloc (sizeof (struct drv));
+ if (!drv) {
+ perror ("malloc");
+ exit (EXIT_FAILURE);
+ }
+ if (asprintf (&drv->filename, "test%d.img",
+ next_prepared_drive++) == -1) {
+ perror ("asprintf");
+ exit (EXIT_FAILURE);
+ }
+ drv->data = create_prepared_file (optarg, drv->filename);
+ if (asprintf (&drv->device, "/dev/sd%c", next_drive++) == -1) {
+ perror ("asprintf");
+ exit (EXIT_FAILURE);
+ }