summaryrefslogtreecommitdiffstats
path: root/daemon/blockdev.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-11 15:59:56 +0200
committerJim Meyering <meyering@redhat.com>2009-08-13 14:45:34 +0200
commit84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0 (patch)
tree5ac525b34b3bf5b3ef336f567c72cd8859b18ab6 /daemon/blockdev.c
parent79b5084f70cb67c37dd7cbe60821a78981fd8d59 (diff)
downloadlibguestfs-84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0.tar.gz
libguestfs-84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0.tar.xz
libguestfs-84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0.zip
generator.ml: use new "Pathname" designation
Nearly every file-related function in daemons/*.c is affected: Remove this pair of statements from each affected do_* function: - NEED_ROOT (return -1); - ABS_PATH (dir, return -1); and change the type of the corresponding parameter to "const char *". * src/generator.ml: Emit NEED_ROOT just once, even when there are two or more Pathname args.
Diffstat (limited to 'daemon/blockdev.c')
-rw-r--r--daemon/blockdev.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/daemon/blockdev.c b/daemon/blockdev.c
index 46ee9948..0745007a 100644
--- a/daemon/blockdev.c
+++ b/daemon/blockdev.c
@@ -32,7 +32,7 @@
* we centralize it in one call.
*/
static int64_t
-call_blockdev (char *device, char *switc, int extraarg, int prints)
+call_blockdev (const char *device, char *switc, int extraarg, int prints)
{
int r;
int64_t rv;
@@ -78,37 +78,37 @@ call_blockdev (char *device, char *switc, int extraarg, int prints)
}
int
-do_blockdev_setro (char *device)
+do_blockdev_setro (const char *device)
{
return (int) call_blockdev (device, "--setro", 0, 0);
}
int
-do_blockdev_setrw (char *device)
+do_blockdev_setrw (const char *device)
{
return (int) call_blockdev (device, "--setrw", 0, 0);
}
int
-do_blockdev_getro (char *device)
+do_blockdev_getro (const char *device)
{
return (int) call_blockdev (device, "--getro", 0, 1);
}
int
-do_blockdev_getss (char *device)
+do_blockdev_getss (const char *device)
{
return (int) call_blockdev (device, "--getss", 0, 1);
}
int
-do_blockdev_getbsz (char *device)
+do_blockdev_getbsz (const char *device)
{
return (int) call_blockdev (device, "--getbsz", 0, 1);
}
int
-do_blockdev_setbsz (char *device, int blocksize)
+do_blockdev_setbsz (const char *device, int blocksize)
{
if (blocksize <= 0 /* || blocksize >= what? */) {
reply_with_error ("blockdev_setbsz: blocksize must be > 0");
@@ -118,25 +118,25 @@ do_blockdev_setbsz (char *device, int blocksize)
}
int64_t
-do_blockdev_getsz (char *device)
+do_blockdev_getsz (const char *device)
{
return call_blockdev (device, "--getsz", 0, 1);
}
int64_t
-do_blockdev_getsize64 (char *device)
+do_blockdev_getsize64 (const char *device)
{
return call_blockdev (device, "--getsize64", 0, 1);
}
int
-do_blockdev_flushbufs (char *device)
+do_blockdev_flushbufs (const char *device)
{
return call_blockdev (device, "--flushbufs", 0, 0);
}
int
-do_blockdev_rereadpt (char *device)
+do_blockdev_rereadpt (const char *device)
{
return call_blockdev (device, "--rereadpt", 0, 0);
}