summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-02 12:46:14 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-07 11:24:44 +0100
commit612b540b3e751959dd3293505d1e9a7569fbf210 (patch)
treeefad6cd1b272b2eea22d6c4f6cc9b6dfcfb63daf
parent93244048216c42375241208f076401ee9ec64bea (diff)
downloadlibguestfs-612b540b3e751959dd3293505d1e9a7569fbf210.tar.gz
libguestfs-612b540b3e751959dd3293505d1e9a7569fbf210.tar.xz
libguestfs-612b540b3e751959dd3293505d1e9a7569fbf210.zip
Rename qemu option cache=off to cache=none.
Note that qemu treats these identically, so this change has no functional effect. (cherry picked from commit 1608ca182b094a1dbe22094f39a5e86f18f728b7) Conflicts: src/launch.c
-rw-r--r--src/guestfs-internal.h2
-rw-r--r--src/launch.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index c6a2089b..e6b4b1ae 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -138,7 +138,7 @@ struct drive {
char *format;
char *iface;
char *name;
- int use_cache_off;
+ int use_cache_none;
};
struct guestfs_h
diff --git a/src/launch.c b/src/launch.c
index fb0172b9..61b903d9 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -229,19 +229,19 @@ guestfs__config (guestfs_h *g,
return 0;
}
-/* cache=off improves reliability in the event of a host crash.
+/* cache=none improves reliability in the event of a host crash.
*
* However this option causes qemu to try to open the file with
* O_DIRECT. This fails on some filesystem types (notably tmpfs).
* So we check if we can open the file with or without O_DIRECT,
- * and use cache=off (or not) accordingly.
+ * and use cache=none (or not) accordingly.
*
* NB: This function is only called on the !readonly path. We must
* try to open with O_RDWR to test that the file is readable and
* writable here.
*/
static int
-test_cache_off (guestfs_h *g, const char *filename)
+test_cache_none (guestfs_h *g, const char *filename)
{
int fd = open (filename, O_RDWR|O_DIRECT);
if (fd >= 0) {
@@ -296,7 +296,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
char *iface;
char *name;
char *abs_path = NULL;
- int use_cache_off;
+ int use_cache_none;
int check_duplicate;
if (check_path(g, filename) == -1)
@@ -326,8 +326,8 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
* checks for the existence of the file. For readonly we have
* to do the check explicitly.
*/
- use_cache_off = readonly ? 0 : test_cache_off (g, filename);
- if (use_cache_off == -1)
+ use_cache_none = readonly ? 0 : test_cache_none (g, filename);
+ if (use_cache_none == -1)
goto err_out;
if (readonly) {
@@ -360,7 +360,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
(*i)->format = format;
(*i)->iface = iface;
(*i)->name = name;
- (*i)->use_cache_off = use_cache_off;
+ (*i)->use_cache_none = use_cache_none;
free (abs_path);
return 0;
@@ -1415,7 +1415,7 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv)
snprintf (r, len, "file=%s%s%s%s%s,if=%s",
drv->path,
drv->readonly ? ",snapshot=on" : "",
- drv->use_cache_off ? ",cache=off" : "",
+ drv->use_cache_none ? ",cache=none" : "",
drv->format ? ",format=" : "",
drv->format ? drv->format : "",
drv->iface);