[libvirt] [PATCH] qemu: hotplug: unify "not found" logs when detaching device

Chen Hanxiao chen_han_xiao at 126.com
Sat Dec 16 02:50:00 UTC 2017



At 2017-12-16 09:26:32, "John Ferlan" <jferlan at redhat.com> wrote:
>
>
>On 12/14/2017 06:16 AM, Chen Hanxiao wrote:
>> From: Chen Hanxiao <chenhanxiao at gmail.com>
>> 
>> Some services, such as Nova, check whether device was not found
>> by errror messages "not found". [1]
>
>error
>
>> 
>> This patch unify logs of qemuDomainDetachDeviceLive, which will be helpful.
>> 
>> [1] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/guest.py#L406
>> 
>> Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
>> ---
>>  src/qemu/qemu_hotplug.c | 18 +++++++++++-------
>>  1 file changed, 11 insertions(+), 7 deletions(-)
>> 
>
>Something about a tool that parses the error message(s) looking for a
>specific message string in English and needing to alter libvirt sources
>to match that tools' needs strikes me as incorrect and a "slippery
>slope" to follow.
>
>I'm not in favor of this because we'll be constantly chasing these types
>of bugs to match some other tools' (what I think is) incorrect means to
>handle errors.
>

Agree.
But we don't have enough error code to cover all of scenario.

For qemuDomainDetachDeviceDiskLive, VIR_ERR_OPERATION_FAILED can be
"disk not found", also can be "cannot hot unplug multifunction PCI device"
in the following call of qemuDomainDetachVirtioDiskDevice.

So the tools powered by libvirt had to find a workaround by 
analyzing error messages...

Regards,
- Chen




More information about the libvir-list mailing list