On Wed, Apr 08, 2015 at 10:27:34AM -0600, Eric Blake wrote: > > +++ b/block/snapshot.c > > @@ -246,9 +246,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, > > if (bs->file) { > > return bdrv_snapshot_delete(bs->file, snapshot_id, name, errp); > > } > > - error_set(errp, QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, > > - drv->format_name, bdrv_get_device_name(bs), > > - "internal snapshot deletion"); > > + error_setg(errp, "Block format '%s' used by device '%s' " > > + "does not support internal snapshot deletion", > > + drv->format_name, bdrv_get_device_name(bs)); > > return -ENOTSUP; > > } > > > > @@ -329,9 +329,9 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs, > > if (drv->bdrv_snapshot_load_tmp) { > > return drv->bdrv_snapshot_load_tmp(bs, snapshot_id, name, errp); > > } > > - error_set(errp, QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, > > - drv->format_name, bdrv_get_device_name(bs), > > - "temporarily load internal snapshot"); > > + error_setg(errp, "Block format '%s' used by device '%s' " > > + "does not support temporarily loading internal snapshots", > > + drv->format_name, bdrv_get_device_name(bs)); > > Should these two messages use 'node' instead of 'device'? After > all, a format is tied to a node (as a backing chain can involve > multiple nodes using different formats) > > > +++ b/blockdev.c > > if (!bdrv_can_snapshot(bs)) { > > - error_set(errp, QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, > > - bs->drv->format_name, device, "internal snapshot"); > > + error_setg(errp, "Block format '%s' used by device '%s' " > > + "does not support internal snapshots", > > + bs->drv->format_name, device); > > but this is probably another one where node may be better.
I decided to leave 'device' in all cases where 'bs' cannot possibly be anything else that a root node. In this latter case, for example, that bs is obtained using blk_bs(blk_by_name(device)). Berto