On Mon, 2019-07-22 at 11:41 +0200, Kevin Wolf wrote: > Am 21.07.2019 um 20:15 hat Maxim Levitsky geschrieben: > > Currently we print message like that: > > > > " > > new_file.qcow2 : error message > > " > > > > However the error could have come from opening the backing file (e.g when > > it missing encryption keys), > > thus try to clarify this by using this format: > > > > " > > qemu-img: error creating new_file.qcow2: base_file.qcow2: error message > > Could not open backing image to determine size. > > " > > The old error message was just unspecific. Your new error message can be > actively misleading because you just unconditionally print the filename > of the direct backing file, even though the error could have occurred > while opening the backing file of the backing file (or even further down > the backing chain). > > It's a common problem we have with backing files and error messages: We > either don't print the filename where the error actually happened (like > in this case), or we print all of the backing files in the chain (such > as "Could not open top.qcow2: Could not open mid.qcow2: Could not open > base.qcow2: Invalid something"). > > Ideally, we'd find a way to print only the backing filename in such > cases ("Could not open base.qcow2: Invalid something"). I'd gladly > accept a patch that fixes error messages in this way for both open and > create, but I'm afraid that your approach in this patch is too > simplistic and not an improvement
You raise a very good point, I didn't thought about this. Thanks, Best regards, Maxim Levitsky