libxl: disks: rename disk param "unpluggable" to "removable"
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 2 Jun 2011 17:46:35 +0000 (18:46 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 2 Jun 2011 17:46:35 +0000 (18:46 +0100)
This property corresponds to what is called "removable" in xenstore,
and is the conventional meaning of "removable": ie, the _media_ can be
removed even as the _device_ remains present.

"unpluggable" is a misleading name for this.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.idl
tools/libxl/libxl_utils.c
tools/libxl/xl_cmdimpl.c

index d7672e35dddc1e3ad0490f3859d892991a2cb197..c21cfe7d89755f570fad03e7d03708cf7da30cd9 100644 (file)
@@ -707,7 +707,7 @@ int libxl_event_get_disk_eject_info(libxl_ctx *ctx, uint32_t domid, libxl_event
     disk->format = LIBXL_DISK_FORMAT_EMPTY;
     /* this value is returned to the user: do not free right away */
     disk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(&gc, "%s/dev", backend), NULL);
-    disk->unpluggable = 1;
+    disk->removable = 1;
     disk->readwrite = 0;
     disk->is_cdrom = 1;
 
@@ -1047,7 +1047,7 @@ int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *dis
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "removable");
-    flexarray_append(back, libxl__sprintf(&gc, "%d", (disk->unpluggable) ? 1 : 0));
+    flexarray_append(back, libxl__sprintf(&gc, "%d", (disk->removable) ? 1 : 0));
     flexarray_append(back, "bootable");
     flexarray_append(back, libxl__sprintf(&gc, "%d", 1));
     flexarray_append(back, "state");
@@ -1590,7 +1590,7 @@ static unsigned int libxl__append_disk_list_of_type(libxl__gc *gc,
                 libxl__sprintf(gc, "%s/%s/type", be_path, *dir)), 
                 &(pdisk->backend));
             pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "%s/%s/dev", be_path, *dir), &len);
-            pdisk->unpluggable = atoi(libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/%s/removable", be_path, *dir)));
+            pdisk->removable = atoi(libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/%s/removable", be_path, *dir)));
             if (!strcmp(libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/%s/mode", be_path, *dir)), "w"))
                 pdisk->readwrite = 1;
             else
index b2ab52cfb1656da1a5283a0ac2efe42a55beb5d2..6e3973422bb672caf3c57578f788ea35988a42a2 100644 (file)
@@ -280,7 +280,7 @@ libxl_device_disk = Struct("device_disk", [
     ("backend", libxl_disk_backend),
     ("format", libxl_disk_format),
     ("script", string),
-    ("unpluggable", integer),
+    ("removable", integer),
     ("readwrite", integer),
     ("is_cdrom", integer),
     ])
index 68b5a9afeb91e91b63cd49dadd392ad5956ea295..b23cf2550be79d43a43c2f88c17e5b11d7e1caa4 100644 (file)
@@ -556,7 +556,7 @@ int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid,
     libxl_string_to_backend(ctx, val, &(disk->backend));
     disk->vdev = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/dev", be_path));
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/removable", be_path));
-    disk->unpluggable = !strcmp(val, "1");
+    disk->removable = !strcmp(val, "1");
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/mode", be_path));
     disk->readwrite = !!strcmp(val, "w");
     val = libxl__xs_read(&gc, XBT_NULL, libxl__sprintf(&gc, "%s/device-type", diskpath));
index ca0841d5e0bc54fb93e1d891476df13adb88c1a1..ecfcac484bcafda92f7525ca9d064c646077c7e9 100644 (file)
@@ -393,7 +393,7 @@ static void printf_info(int domid,
         printf("\t\t\t(physpath %s)\n", d_config->disks[i].pdev_path);
         printf("\t\t\t(phystype %d)\n", d_config->disks[i].backend);
         printf("\t\t\t(virtpath %s)\n", d_config->disks[i].vdev);
-        printf("\t\t\t(unpluggable %d)\n", d_config->disks[i].unpluggable);
+        printf("\t\t\t(unpluggable %d)\n", d_config->disks[i].removable);
         printf("\t\t\t(readwrite %d)\n", d_config->disks[i].readwrite);
         printf("\t\t\t(is_cdrom %d)\n", d_config->disks[i].is_cdrom);
         printf("\t\t)\n");
@@ -591,7 +591,7 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2)
                 *p = '\0';
                 if ( !strcmp(tok, "cdrom") ) {
                     disk->is_cdrom = 1;
-                    disk->unpluggable = 1;
+                    disk->removable = 1;
                 }else{
                     fprintf(stderr, "Unknown virtual disk type: %s\n", tok);
                     return 0;
@@ -4181,7 +4181,7 @@ int main_blockattach(int argc, char **argv)
         return 1;
     }
     disk.vdev = argv[optind+2];
-    disk.unpluggable = 1;
+    disk.removable = 1;
     disk.readwrite = ((argc-optind <= 3) || (argv[optind+3][0] == 'w'));
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {