Skip to contentSkip to conversation

libxl error reporting

DISCUSSION Olaf Hering 3 participants 3 messages Mar 6, 2014 – Mar 11, 2014

lore
Share & tools
lore
#0 lore raw

How are users of libxl supposed to report errors that occour during an libxl function call?

For example "virsh migrate" calls libxl_domain_suspend, which has many ways to fail. What details about the specific error should be returned to the caller? Right now its just some sort of libxl_error. All virsh could do is to show "please see logfile for details".

I think this specifc function should return some sort of state, which is preserved within the function call. It could be something like "remote side had issues", "guest was too busy", "guest lacks PV drivers", "some unexpected (internal) error".

Unfortunately libxl.h contains nothing about error handling.

Olaf

#1 lore raw

Olaf Hering writes ("libxl error reporting"):

Quoted 4 lines

For example "virsh migrate" calls libxl_domain_suspend, which has many ways to fail. What details about the specific error should be returned to the caller? Right now its just some sort of libxl_error. All virsh could do is to show "please see logfile for details".

Unfortunately, yes.

Quoted 6 lines

I think this specifc function should return some sort of state, which is preserved within the function call. It could be something like "remote side had issues", "guest was too busy", "guest lacks PV drivers", "some unexpected (internal) error".

Unfortunately libxl.h contains nothing about error handling.

I have been considering a campaign of adding (many) more error codes.

Ian.

#2 lore raw
Quoted 7 lines · Ian Jackson

Olaf Hering writes ("libxl error reporting"):

Quoted 4 lines

For example "virsh migrate" calls libxl_domain_suspend, which has many ways to fail. What details about the specific error should be returned to the caller? Right now its just some sort of libxl_error. All virsh could do is to show "please see logfile for details".

Unfortunately, yes.

libvirt could also provide its own xtllog implementation which could store and provide the log messages in a "virsh friendly" manner (whatever that might be) as well as logging (if it wants).

Quoted 8 lines
Quoted 6 lines

I think this specifc function should return some sort of state, which is preserved within the function call. It could be something like "remote side had issues", "guest was too busy", "guest lacks PV drivers", "some unexpected (internal) error".

Unfortunately libxl.h contains nothing about error handling.

I have been considering a campaign of adding (many) more error codes.

Good idea.

Ian.