Jean-Pierre Ribeauville
2015-Dec-07 12:14 UTC
[libvirt-users] libvirt logging of virDomainAttachDeviceFlags()
Hi, When using « virsh attach-device ....." to add a channel device to a Guest , I see following entry in libvirt log : 2015-12-07 11:14:47.307+0000: 14551: debug : virDomainAttachDeviceFlags:10433 : dom=0x7f2a58252fc0, ........ Great !! But , when calling virDomainAttachDeviceFlags( ) from a C program , I got return code -1 but nothing appears related to virDomainAttachDeviceFlags( ) in the libvirt log file . Others libvirt calls of this C program are correctly logged . Did I misunderstand something ? To add traces I've added these lines within /etc/libvirt/libvirtd.conf log_level = 1 log_outputs="1:file:/var/log/libvirt/libvirtd.log" Thx for help. Regards, J.P. Ribeauville P: +33.(0).1.47.17.20.49 . Puteaux 3 Etage 5 Bureau 4 jpribeauville@axway.com<mailto:jpribeauville@axway.com> http://www.axway.com<http://www.axway.com/> P Pensez à l'environnement avant d'imprimer.
Michal Privoznik
2015-Dec-07 12:48 UTC
Re: [libvirt-users] libvirt logging of virDomainAttachDeviceFlags()
On 07.12.2015 13:14, Jean-Pierre Ribeauville wrote:> Hi, > > When using « virsh attach-device ....." to add a channel device to a Guest , I see following entry in libvirt log : > > 2015-12-07 11:14:47.307+0000: 14551: debug : virDomainAttachDeviceFlags:10433 : dom=0x7f2a58252fc0, ........ > > Great !! > > But , when calling virDomainAttachDeviceFlags( ) from a C program , I got return code -1 but nothing appears related to virDomainAttachDeviceFlags( ) in the libvirt log file . > Others libvirt calls of this C program are correctly logged . > > Did I misunderstand something ?This looks like the client has not even gotten into RPC call. This means that you are passing a wrong argument somewhere. You can: 1) check here what arguments are being checked for: http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libvirt-domain.c;h=b91388e77e00bf30674f3e25fbdfd38b8626c351;hb=HEAD#l8301 2) Use virGetLastError() to check the actual error. Michal
Jean-Pierre Ribeauville
2015-Dec-07 13:41 UTC
Re: [libvirt-users] libvirt logging of virDomainAttachDeviceFlags()
Hi, Michel, you're right ; I got this error : virDomainAttachDeviceFlags( ) error operation forbidden: read only access prevents virDomainAttachDeviceFlags Either via "virsh attach-device" or via "virDomainAttachDeviceFlags()" , I encounter an error due to the fact that an authorized user is required. Script-wise the error is the following : Please enter your authentication name:> Please enter your password: > error: failed to connect to the hypervisor > error: no valid connection > error: authentication failed: Failed to step SASL negotiation: -1 > (SASL(-1): generic failure: All-whitespace username.)I have now to add a user , following this ovirt people recommendation : When you attach a compute node to oVirt, it sets up auth with libvirt to prevent admins from connecting to libvirt. If you want to override that you need to create yourself a SASL user + password using the saslpasswd2 command Thx for help. Regards, J.P. -----Message d'origine----- De : Michal Privoznik [mailto:mprivozn@redhat.com] Envoyé : lundi 7 décembre 2015 13:48 À : Jean-Pierre Ribeauville; libvirt-users@redhat.com Objet : Re: [libvirt-users] libvirt logging of virDomainAttachDeviceFlags() On 07.12.2015 13:14, Jean-Pierre Ribeauville wrote:> Hi, > > When using « virsh attach-device ....." to add a channel device to a Guest , I see following entry in libvirt log : > > 2015-12-07 11:14:47.307+0000: 14551: debug : virDomainAttachDeviceFlags:10433 : dom=0x7f2a58252fc0, ........ > > Great !! > > But , when calling virDomainAttachDeviceFlags( ) from a C program , I got return code -1 but nothing appears related to virDomainAttachDeviceFlags( ) in the libvirt log file . > Others libvirt calls of this C program are correctly logged . > > Did I misunderstand something ?This looks like the client has not even gotten into RPC call. This means that you are passing a wrong argument somewhere. You can: 1) check here what arguments are being checked for: http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libvirt-domain.c;h=b91388e77e00bf30674f3e25fbdfd38b8626c351;hb=HEAD#l8301 2) Use virGetLastError() to check the actual error. Michal