On Fri, 24 Feb 2012 13:03:08 +0100 Kevin Wolf <kw...@redhat.com> wrote:
> > static void eject_device(BlockDriverState *bs, int force, Error **errp) > > { > > if (bdrv_in_use(bs)) { > > diff --git a/hmp-commands.hx b/hmp-commands.hx > > index 573b823..ccb1f62 100644 > > --- a/hmp-commands.hx > > +++ b/hmp-commands.hx > > @@ -886,6 +886,42 @@ Snapshot device, using snapshot file as target if > > provided > > ETEXI > > > > { > > + .name = "blkdev_reopen", > > NACK on the name. Let's reserve blkdev_*/blockdev_* for the proper API > (that we'll release with the qemu version that comes with Hurd 1.0). lol. > > ## > > +# @blockdev-reopen > > +# > > +# Assigns a new image file to a device. > > +# > > +# @device: the name of the device for which we are chainging the image > > file. > > +# > > +# @new-image-file: the target of the new image. If the file doesn't exists > > the > > +# command will fail. > > +# > > +# @format: #optional the format of the new image, default is 'qcow2'. > > +# > > +# Returns: nothing on success > > +# If @device is not a valid block device, DeviceNotFound > > +# If @new-image-file can't be opened, OpenFileFailed > > +# If @format is invalid, InvalidBlockFormat > > +# > > +# Since 1.1 > > +## > > + > > +{ 'command': 'blockdev-reopen', > > + 'data': { 'device': 'str', 'new-image-file': 'str', '*format': 'str' } } > > Same consideration on the name. > > Also I think we should immediately mark the command as deprecated (I > think there is precedence for it, though I can't remember which command > it was). This is not an interface we'll want to keep long term. We can only mark an interface as deprecated when there's a substitute for it.