On Tue, Dec 06, 2016 at 04:29:21PM +0100, Pino Toscano wrote:
@@ -1820,7 +1833,7 @@ resolve_fstab_device (guestfs_h *g, const char
*spec, Hash_table *md_map,
char *type, *slice, *disk, *part;
int r;
- if (STRPREFIX (spec, "/dev/mapper/") && guestfs_exists (g, spec)
> 0) {
+ if (STRPREFIX (spec, "/dev/mapper/") && dev_mapper_exists (g, spec)
> 0) {
...
device = guestfs_lvm_canonical_lv_name (g, spec);
}
I think really the problem is with the call to
guestfs_lvm_canonical_lv_name.
Can we not replace this code with:
if (STRPREFIX (spec, "/dev/mapper/")) {
...
guestfs_push_error_handler (g, NULL, NULL);
device = guestfs_lvm_canonical_lv_name (g, spec);
guestfs_pop_error_handler (g);
if (device == NULL) {
if (guestfs_last_errno (g) == ENOENT)
// ignore error
else {
guestfs_int_error_errno (/* copy the handle error message & errno here */);
return -1;
}
}
?
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v