summaryrefslogtreecommitdiffstats
path: root/daemon/md.c
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2011-11-24 12:09:03 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-11-24 13:22:42 +0000
commit182c25b2a42e9a8f76beba440da328e37f18c9b9 (patch)
treedec74bed603060cfb6009e25248cfb62ecaf82b1 /daemon/md.c
parent373dca7d12a8741e116205b4a3ac67a7d82cc782 (diff)
downloadlibguestfs-182c25b2a42e9a8f76beba440da328e37f18c9b9.tar.gz
libguestfs-182c25b2a42e9a8f76beba440da328e37f18c9b9.tar.xz
libguestfs-182c25b2a42e9a8f76beba440da328e37f18c9b9.zip
Rename mdadm_ apis to md_
This change renames the following 2 apis: * mdadm_create -> md_create * mdadm_detail -> md_detail This is more consistent with list_md_devices, and removes a reference to an implementation detail from the api.
Diffstat (limited to 'daemon/md.c')
-rw-r--r--daemon/md.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/daemon/md.c b/daemon/md.c
index 82ddb82c..8e4ff884 100644
--- a/daemon/md.c
+++ b/daemon/md.c
@@ -50,9 +50,9 @@ count_bits (uint64_t bitmap)
/* Takes optional arguments, consult optargs_bitmask. */
int
-do_mdadm_create (const char *name, char *const *devices,
- int64_t missingbitmap, int nrdevices, int spare,
- int64_t chunk, const char *level)
+do_md_create (const char *name, char *const *devices,
+ int64_t missingbitmap, int nrdevices, int spare,
+ int64_t chunk, const char *level)
{
char nrdevices_s[32];
char spare_s[32];
@@ -63,10 +63,10 @@ do_mdadm_create (const char *name, char *const *devices,
uint64_t umissingbitmap = (uint64_t) missingbitmap;
/* Check the optional parameters and set defaults where appropriate. */
- if (!(optargs_bitmask & GUESTFS_MDADM_CREATE_MISSINGBITMAP_BITMASK))
+ if (!(optargs_bitmask & GUESTFS_MD_CREATE_MISSINGBITMAP_BITMASK))
umissingbitmap = 0;
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_SPARE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_SPARE_BITMASK) {
if (spare < 0) {
reply_with_error ("spare must not be negative");
return -1;
@@ -75,7 +75,7 @@ do_mdadm_create (const char *name, char *const *devices,
else
spare = 0;
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_NRDEVICES_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_NRDEVICES_BITMASK) {
if (nrdevices < 2) {
reply_with_error ("nrdevices is less than 2");
return -1;
@@ -84,7 +84,7 @@ do_mdadm_create (const char *name, char *const *devices,
else
nrdevices = count_strings (devices) + count_bits (umissingbitmap);
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_LEVEL_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_LEVEL_BITMASK) {
if (STRNEQ (level, "linear") && STRNEQ (level, "raid0") &&
STRNEQ (level, "0") && STRNEQ (level, "stripe") &&
STRNEQ (level, "raid1") && STRNEQ (level, "1") &&
@@ -100,7 +100,7 @@ do_mdadm_create (const char *name, char *const *devices,
else
level = "raid1";
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_CHUNK_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_CHUNK_BITMASK) {
/* chunk is bytes in the libguestfs API, but K when we pass it to mdadm */
if ((chunk & 1023) != 0) {
reply_with_error ("chunk size must be a multiple of 1024 bytes");
@@ -131,12 +131,12 @@ do_mdadm_create (const char *name, char *const *devices,
ADD_ARG (argv, i, "--raid-devices");
snprintf (nrdevices_s, sizeof nrdevices_s, "%d", nrdevices);
ADD_ARG (argv, i, nrdevices_s);
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_SPARE_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_SPARE_BITMASK) {
ADD_ARG (argv, i, "--spare-devices");
snprintf (spare_s, sizeof spare_s, "%d", spare);
ADD_ARG (argv, i, spare_s);
}
- if (optargs_bitmask & GUESTFS_MDADM_CREATE_CHUNK_BITMASK) {
+ if (optargs_bitmask & GUESTFS_MD_CREATE_CHUNK_BITMASK) {
ADD_ARG (argv, i, "--chunk");
snprintf (chunk_s, sizeof chunk_s, "%" PRIi64, chunk / 1024);
ADD_ARG (argv, i, chunk_s);
@@ -233,7 +233,7 @@ error:
}
char **
-do_mdadm_detail(const char *md)
+do_md_detail(const char *md)
{
int r;
@@ -290,7 +290,7 @@ do_mdadm_detail(const char *md)
} else {
/* Ignore lines with no equals sign (shouldn't happen). Log to stderr so
* it will show up in LIBGUESTFS_DEBUG. */
- fprintf(stderr, "mdadm-detail: unexpected output ignored: %s", line);
+ fprintf(stderr, "md-detail: unexpected mdadm output ignored: %s", line);
}
}