git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0624da
)
guest_add_{drive,cdrom} now test if the files exist.
author
Richard Jones
<rjones@redhat.com>
Sat, 4 Apr 2009 13:51:31 +0000
(14:51 +0100)
committer
Richard Jones
<rjones@redhat.com>
Sat, 4 Apr 2009 13:51:31 +0000
(14:51 +0100)
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
aa0aadb
..
3492c62
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-488,6
+488,11
@@
guestfs_add_drive (guestfs_h *g, const char *filename)
return -1;
}
+ if (access (filename, F_OK) == -1) {
+ perrorf (g, "%s", filename);
+ return -1;
+ }
+
snprintf (buf, len, "file=%s", filename);
return guestfs_config (g, "-drive", buf);
@@
-501,6
+506,11
@@
guestfs_add_cdrom (guestfs_h *g, const char *filename)
return -1;
}
+ if (access (filename, F_OK) == -1) {
+ perrorf (g, "%s", filename);
+ return -1;
+ }
+
return guestfs_config (g, "-cdrom", filename);
}