On 05/18/2016 03:53 PM, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it (might) open up later, > so try again. > > It's not ideal, but it makes the semantics of the (legacy) eject > command more understandable to end users when they try to use it. > > Signed-off-by: John Snow <js...@redhat.com> > --- > blockdev.c | 51 ++++++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 40 insertions(+), 11 deletions(-)
Still somewhat complicated, but this time the complication is documented, and the clean <0, 0, and >0 semantics make parsing the return value a bit easier to understand. And I don't see any cleaner way to do it. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature