Bug 781895

Summary: missing functions on remote libvirt give wrong error
Product: Red Hat Enterprise Linux 6 Reporter: Min Zhan <mzhan>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, dallan, dyuan, eblake, mzhan, rwu, weizhan, whuang, yupzhang, zhpeng
Target Milestone: rcKeywords: Regression, Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 738439 Environment:
Last Closed: 2012-02-24 22:25:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 738439    
Bug Blocks: 743047    

Comment 2 Huang Wenlong 2012-01-16 06:57:41 UTC
Test this bug  with :
Client : libvirt-0.9.9-1.el6.x86_64
Server:  libvirt-0.9.3-2.el6.x86_64


Client : 

#  gcc -o foo foo.c -lvirt


# ./foo qemu+ssh://10.66.5.12/system /tmp/
root.5.12's password: 
libvir: RPC error : unknown procedure: 235
success


it seems good.

Comment 3 Huang Wenlong 2012-01-16 09:40:38 UTC
Test this bug  with :
Client : libvirt-0.9.8-1.el6.x86_64
Server:  libvirt-0.9.3-2.el6.x86_64


Client : 

#  gcc -o foo foo.c -lvirt


# ./foo qemu+ssh://10.66.5.12/system /tmp/
root.5.12's password: 
libvir: RPC error : unknown procedure: 235
success


it is fine too.

Comment 5 Eric Blake 2012-01-16 14:03:54 UTC
(In reply to comment #3)
> Test this bug  with :
> Client : libvirt-0.9.8-1.el6.x86_64
> Server:  libvirt-0.9.3-2.el6.x86_64
> 
> 
> Client : 
> 
> #  gcc -o foo foo.c -lvirt
> 
> 
> # ./foo qemu+ssh://10.66.5.12/system /tmp/
> root.5.12's password: 
> libvir: RPC error : unknown procedure: 235
> success
> 

The fact that the error message states "unknown procedure" instead of "this function is not supported by the connection driver" may mean that we have a regression in error reporting quality.  The code in virterror.c for VIR_ERR_NO_SUPPORT should prefer the latter message, although I haven't tested whether older versions of libvirt (preferably both server and client older than 0.9.2, before our RPC rewrite) actually used this message on encountering an unknown RPC call.  I'm reopening this, so that we can investigate whether there really is an issue in poor error message quality.

Comment 6 Michal Privoznik 2012-02-09 15:17:34 UTC
Eric & all,

what you are describing is not a bug IMHO. This API from the example was introduced in 0.9.4; So if we are talking to any previous daemon we have to receive "unknown procedure" as the procedure really not known. The VIR_ERR_NO_SUPPORT is used in cases where the procedure is known, however not implemented in driver yet. E.g. virDomainSaveImageGetXMLDesc is implemented only for qemu, so issuing this api against say virtual box or xen driver (and 0.9.4+ daemon of course) will gain VIR_ERR_NO_SUPPORT.

Server version:
v0.9.1 - success
v0.9.2 - success
v0.9.3 - success
v0.9.4 - error: libvir: QEMU error : operation failed: cannot read domain image

However, trying different driver (LXC):
libvir: error : this function is not supported by the connection driver: virDomainSaveImageGetXMLDesc
success

Comment 7 Dave Allan 2012-02-10 21:10:42 UTC
Michal, what's the result of an 0.9.2 client calling an unknown procedure in a server <= 0.9.2 ?

Comment 8 Eric Blake 2012-02-10 21:29:47 UTC
The question is not whether the error is tagged VIR_ERR_NO_SUPPORT, but whether the error message has regressed in quality.  That is, if 0.8.0 talking to 0.7.0 and calling an unknown function reported "this function is not supported by the connection driver", while 0.9.4 talking to 0.9.2 gets "unknown procedure: NNN", we've made the reporting worse over time.

Comment 9 Michal Privoznik 2012-02-24 15:44:37 UTC
I still don't think this is a bug. We've fixed the error code; But even for older version we've always reported "unknown procedure: NNN".

Comment 10 Dave Allan 2012-02-24 22:25:57 UTC
(In reply to comment #9)
> I still don't think this is a bug. We've fixed the error code; But even for
> older version we've always reported "unknown procedure: NNN".

Given that, I think we've confirmed that the behavior is unchanged, so I'm closing as NOTABUG.