X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fblockdev.c;h=1aa6eaa20afa18c0b7ab55de8e5a9901f23c52d1;hb=a3dfe9398c9f629d013a82c1ba8014b500462f7d;hp=a5f769143505dadd075da3a84a2f0bf0394f6bbe;hpb=1997858e90da728287ef26a6d01a5766ac914312;p=libguestfs.git diff --git a/daemon/blockdev.c b/daemon/blockdev.c index a5f7691..1aa6eaa 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, const char *switc, int extraarg, int prints) { int r; int64_t rv; @@ -46,8 +46,6 @@ call_blockdev (char *device, char *switc, int extraarg, int prints) }; char buf[64]; - RESOLVE_DEVICE (device, return -1); - if (extraarg > 0) { snprintf (buf, sizeof buf, "%d", extraarg); argv[2] = buf; @@ -55,7 +53,7 @@ call_blockdev (char *device, char *switc, int extraarg, int prints) } else argv[2] = device; - r = commandv (&out, &err, argv); + r = commandv (&out, &err, (char **) argv); if (r == -1) { reply_with_error ("%s: %s", argv[0], err); @@ -80,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"); @@ -120,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); }