About RO connection

Michal Prívozník mprivozn at redhat.com
Mon Mar 7 11:31:31 UTC 2022


On 3/2/22 03:28, Xingbo Kan wrote:
> Dear developers and users:
> Is there any standard or convention of which kind of APIs&flags could
> be invoked by RO connection? If there is any, please tell me in
> detail, thanks a lot!

Your best bet is to look at public API implementation [1] and see if
virCheckReadOnly*() is called. But in general, anything that can't
change state of a domain/network/... is considered okay for RO
connections (e.g. listing domains, getting domain XML without security
info, etc.). For everything else you'll need RW connection.

Alternatively, you may look at our RPC protocol description [2] and if
the API is described with "domain:read" then it's okay for RO connection.

1: https://gitlab.com/libvirt/libvirt/-/blob/master/src/libvirt-domain.c
2:
https://gitlab.com/libvirt/libvirt/-/blob/master/src/remote/remote_protocol.x#L3918

Michal



More information about the libvirt-users mailing list