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@xxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 6 +++---
tools/libxl/libxl.idl | 2 +-
tools/libxl/libxl_utils.c | 2 +-
tools/libxl/xl_cmdimpl.c | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index ac7b68a..fe012cb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -705,7 +705,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;
@@ -1045,7 +1045,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");
@@ -1588,7 +1588,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
diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl
index 546cd3c..74c82f4 100644
--- a/tools/libxl/libxl.idl
+++ b/tools/libxl/libxl.idl
@@ -262,7 +262,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),
])
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 68b5a9a..b23cf25 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -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));
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 28e810c..97a1241 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -385,7 +385,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");
@@ -583,7 +583,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;
@@ -4093,7 +4093,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) {
--
1.7.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|