xl block-detach: allow other than numeric-decimal specification of the disk
PATCH 1/1 xl block-detach: allow other than numeric-decimal specification of the disk
... to be in sync with block-attach.
tools/libxl/libxl.c +5 -1
@@ -1476,12 +1476,16 @@ static void libxl__device_disk_from_xs_b }int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid, -int devid,libxl_device_disk *disk) +const char *dev,libxl_device_disk *disk) {GC_INIT (ctx);char *dompath, *path; +int devid =libxl__device_disk_dev_number (dev,NULL ,NULL );int rc =ERROR_FAIL ; +if (devid <0 ) +return ERROR_INVAL ; +libxl_device_disk_init (disk); dompath =libxl__xs_get_dompath (gc, domid);
tools/libxl/libxl_utils.h +1 -1
@@ -61,7 +61,7 @@ int libxl_mac_to_device_nic(libxl_ctx *cint libxl_devid_to_device_nic (libxl_ctx *ctx,uint32_t domid,int devid,libxl_device_nic *nic); -int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,int devid, +int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,const char *dev,libxl_device_disk *disk);int libxl_cpumap_alloc (libxl_ctx *ctx,libxl_cpumap *cpumap);
tools/libxl/xl_cmdimpl.c +1 -1
@@ -4804,7 +4804,7 @@ int main_blockdetach(int argc, char **arfprintf (stderr,"%s is an invalid domain identifier\n" , argv[optind]);return 1 ; } -if (libxl_devid_to_device_disk (ctx, domid,atoi (argv[optind+1 ]), &disk)) { +if (libxl_devid_to_device_disk (ctx, domid, argv[optind+1 ], &disk)) {fprintf (stderr,"Error: Device %s not connected.\n" , argv[optind+1 ]);return 1 ; }
xl block-detach: allow other than numeric-decimal specification of the disk
... to be in sync with block-attach.
tools/libxl/libxl.c +5 -1
@@ -1476,12 +1476,16 @@ static void libxl__device_disk_from_xs_b }int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid, -int devid,libxl_device_disk *disk) +const char *dev,libxl_device_disk *disk) {GC_INIT (ctx);char *dompath, *path; +int devid =libxl__device_disk_dev_number (dev,NULL ,NULL );int rc =ERROR_FAIL ; +if (devid <0 ) +return ERROR_INVAL ; +libxl_device_disk_init (disk); dompath =libxl__xs_get_dompath (gc, domid);
tools/libxl/libxl_utils.h +1 -1
@@ -61,7 +61,7 @@ int libxl_mac_to_device_nic(libxl_ctx *cint libxl_devid_to_device_nic (libxl_ctx *ctx,uint32_t domid,int devid,libxl_device_nic *nic); -int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,int devid, +int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,const char *dev,libxl_device_disk *disk);int libxl_cpumap_alloc (libxl_ctx *ctx,libxl_cpumap *cpumap);
tools/libxl/xl_cmdimpl.c +1 -1
@@ -4804,7 +4804,7 @@ int main_blockdetach(int argc, char **arfprintf (stderr,"%s is an invalid domain identifier\n" , argv[optind]);return 1 ; } -if (libxl_devid_to_device_disk (ctx, domid,atoi (argv[optind+1 ]), &disk)) { +if (libxl_devid_to_device_disk (ctx, domid, argv[optind+1 ], &disk)) {fprintf (stderr,"Error: Device %s not connected.\n" , argv[optind+1 ]);return 1 ; }
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 3 lines · Jan Beulich
... to be in sync with block-attach.
Signed-off-by Jan Beulich <[email protected]>
Does docs/misc/xl.pod.1 need an update to reflect this?
I'd be half tempted to s/libxl_devid_to_device_disk/libxl_vdev_to_device_disk/ since the function no longer takes a devid as such but I don't think it's critical.
Quoted 45 lines
tools/libxl/libxl.c +5
-1@@ -1476,12 +1476,16 @@ static void libxl__device_disk_from_xs_b }int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid, -int devid,libxl_device_disk *disk) +const char *dev,libxl_device_disk *disk) {GC_INIT (ctx);char *dompath, *path; +int devid =libxl__device_disk_dev_number (dev,NULL ,NULL );int rc =ERROR_FAIL ; +if (devid <0 ) +return ERROR_INVAL ; +libxl_device_disk_init (disk); dompath =libxl__xs_get_dompath (gc, domid);tools/libxl/libxl_utils.h +1
-1@@ -61,7 +61,7 @@ int libxl_mac_to_device_nic(libxl_ctx *cint libxl_devid_to_device_nic (libxl_ctx *ctx,uint32_t domid,int devid,libxl_device_nic *nic); -int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,int devid, +int libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,const char *dev,libxl_device_disk *disk);int libxl_cpumap_alloc (libxl_ctx *ctx,libxl_cpumap *cpumap);tools/libxl/xl_cmdimpl.c +1
-1@@ -4804,7 +4804,7 @@ int main_blockdetach(int argc, char **arfprintf (stderr,"%s is an invalid domain identifier\n" , argv[optind]);return 1 ; } -if (libxl_devid_to_device_disk (ctx, domid,atoi (argv[optind+1 ]), &disk)) { +if (libxl_devid_to_device_disk (ctx, domid, argv[optind+1 ], &disk)) {fprintf (stderr,"Error: Device %s not connected.\n" , argv[optind+1 ]);return 1 ; }
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 3 lines · Jan Beulich
... to be in sync with block-attach.
Signed-off-by Jan Beulich <[email protected]>Acked-by Ian Campbell <[email protected]>Does docs/misc/xl.pod.1 need an update to reflect this?
It already says "I<devid> may be the symbolic name or the numeric device id given to the device ...".
Quoted 4 lines
I'd be half tempted to s/libxl_devid_to_device_disk/libxl_vdev_to_device_disk/ since the function no longer takes a devid as such but I don't think it's critical.
Just done; will re-submit soon.
Jan