Do not query the disk image for the filesystems.

That is the job of the worker.
This commit is contained in:
2024-03-02 21:44:39 -05:00
parent c17ae09fb6
commit 57b50915c8

View File

@@ -12,31 +12,5 @@ int main(int argc, char **argv) {
// One worker per disk image. // One worker per disk image.
zactor_t *workers[argc-1]; zactor_t *workers[argc-1];
char **filesystems = guestfs_list_filesystems(g);
if (filesystems == NULL)
return EXIT_FAILURE;
for (int i = 0; filesystems[i] != NULL; i += 2) {
printf("%s:%s is a %s filesystem\n",
argv[2], filesystems[i], filesystems[i+1]);
free(filesystems[i]);
free(filesystems[i+1]);
}
free(filesystems);
guestfs_mount(g, "/dev/sda3", "/");
char *passwd = guestfs_cat(g, "/etc/passwd");
printf("passwd contents:\n\n%s", passwd);
free(passwd);
/* Unmount everything. */
if (guestfs_umount_all(g) == -1)
return EXIT_FAILURE;
guestfs_shutdown(g);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }