[libvirt-users] libvirt error messages
by Anastasiya Ruzhanskaya
Hello,
I am experimenting with libvirt for my diploma. I set up an environment,
where I can stop, resend, generate messages for libvirt.
I am capable also standing between client and server and analyze the number
of current procedure and decide what to do next ( I mean rpc procedure).
So, for example I want to always drop creating snapshots and send an error
to client with my custom message (NOT custom error type, but exactly custom
message, I don't want to modify any libvirt code on client and adding my
errors). I am operating with bare tcp traffic, so I can easily read
everything in the middle.
So, I noticed one error for libvirt snapshots:
'internal error: unexpected domain snapshot snapshot1 already exists'
and started sending it every time I see procedure :
REMOTE_PROC_DOMAIN_SNAPSHOT_CREATE_XML
I thought, that this is possible to insert custom message here, but this is
not true. When I change the length of the message on one symbol - it is
still correct, on two -also , on three symbols - I get an error that the
size of the payload is incorrect. Some other errors when I insert a message
of random length.
What is strange, that if I insert 'xxxxxxxxxxxxx...' message , which has
the same length as 'internal error: unexpected domain snapshot snapshot1
already exists' - everything is parsed fine.
So, how does this stuff work? Are there anywhere predefined lengths for
error messages and checks against them, or are there checks against exact
error strings? How all this stuff is regulated? I know now, that I can pad
my message with ...say, space symbols and it will be ok, but I want to know
how error parsing works in all cases.
I have looked through files, where an overall structure and logic of errors
is described but didn't find any helpful information. And I don't a good
way to debug libvirt to see, where this happens.