Return proper error codes on failure so that scripts can tell whether
the command completed properly or not.
This is not a proper fix, since it fails to call
libxl_device_disk_dispose() on the error path. But a proper fix
requires some refactoring, so given where we are in the release
process, it's better to have a fix that is simple and obvious, and do
the refactoring once the next development window opens up.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
if (libxl_device_disk_add(ctx, fe_domid, &disk, 0)) {
fprintf(stderr, "libxl_device_disk_add failed.\n");
+ return 1;
}
return 0;
}
rc = libxl_device_disk_remove(ctx, domid, &disk, 0);
if (rc) {
fprintf(stderr, "libxl_device_disk_remove failed.\n");
+ return 1;
}
libxl_device_disk_dispose(&disk);
return rc;