qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name()


From: Alberto Garcia
Subject: Re: [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name()
Date: Thu, 19 Mar 2015 22:49:25 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Mar 19, 2015 at 03:37:13PM -0400, Max Reitz wrote:

> > This series adds a new function bdrv_get_device_or_node_name(),
> > that returns the node name if there is no device name for that
> > node. Since both the device and the node name live in the same
> > namespace, there's no ambiguity. And since it gives preference to
> > the device name, it maintains backward compatibility.
> 
> Not necessarily. Imagine a program interpreting the
> BLOCK_IMAGE_CORRUPTED event, for example (after this series): It
> sees the @device value and expects a device name there; then it
> tries to do something with that, assuming it is a device, but
> that may fail (like looking it up in its own list of devices, or
> launching a block job, or whatever; I can very well imagine someone
> wanting to automatically start a blockdev_backup() on that event,
> for instance).
> 
> Of course, this is a very weak argument. Before this series, in
> these cases the caller only received an empty string, which didn't
> help it very much either. So I just want to point out that it does
> not fully maintain compatibility, but I don't think there will be
> any problems whatsoever either.

The idea is that if some software can handle the return data of some
operation, it should be able to continue doing so. So we return device
names in the same cases where we used to return device names.

The cases where we are returning different data now are cases that
older software probably doesn't know how to handle anyway.

But yeah, you're right. Having better compatibility would require us
to add a different field for the node name. But this didn't seem to be
much of a concern for Eric, at least in the BlockJobInfo case.

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]