Re: [libvirt-users] operation forbidden Read Only Access

Hi, I found an answer : Use virConnectOpenAuth() instead of virConnectOpenReadOnly(). As my piece of code is running silently (without user connected) , by using virConnectOpenAuth() , is it possible to avoid to prompt user to get user /password ? Thx. J.P. -----Message d'origine----- De : libvirt-users-bounces@redhat.com [mailto:libvirt-users-bounces@redhat.com] De la part de libvirt-users-request@redhat.com Envoyé : vendredi 8 janvier 2016 12:51 À : libvirt-users@redhat.com Objet : libvirt-users Digest, Vol 73, Issue 6 Send libvirt-users mailing list submissions to libvirt-users@redhat.com To subscribe or unsubscribe via the World Wide Web, visit https://www.redhat.com/mailman/listinfo/libvirt-users or, via email, send a message with subject or body 'help' to libvirt-users-request@redhat.com You can reach the person managing the list at libvirt-users-owner@redhat.com When replying, please edit your Subject line so it is more specific than "Re: Contents of libvirt-users digest..." Today's Topics: 1. Unable to retrieve Guest IP Addresses via libvirt API (Jean-Pierre Ribeauville) 2. Re: Unable to retrieve Guest IP Addresses via libvirt API (Martin Kletzander) 3. Re: Unable to retrieve Guest IP Addresses via libvirt API (Jean-Pierre Ribeauville) 4. Re: libvirtd and polkit: internal error: No Unix Process ID (Daniel P. Berrange) 5. operation forbidden Read Only Access (Jean-Pierre Ribeauville) ---------------------------------------------------------------------- Message: 1 Date: Thu, 7 Jan 2016 19:31:57 +0000 From: Jean-Pierre Ribeauville <jpribeauville@axway.com> To: "libvirt-users@redhat.com" <libvirt-users@redhat.com> Subject: [libvirt-users] Unable to retrieve Guest IP Addresses via libvirt API Message-ID: <1051EFB4D3A1704680C38CCAAC5836D292F01EF8@WPTXMAIL2.ptx.axway.int> Content-Type: text/plain; charset="iso-8859-1" Hi , Despite the fact that my Guest has an IP address , by running this piece of code on a KVM host : ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, NULL); ifaces_count = F_virDomainInterfaceAddresses(domain, &ifaces,VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT, NULL); I'm not able to get a ifaces_count different from -1 Additionnaly : - IP Addresses are not present within the xmldesc of this Guest.(not sure that they should appear there) I'm running libvirt-1.2.17-13.el7.x86_64 Did I misunderstood something ? As ovirt manager shows the address correctly , it should be possible to get it via libvirt ... Thanks for help. 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.

On 08.01.2016 14:30, Jean-Pierre Ribeauville wrote:
Hi,
I found an answer :
Use virConnectOpenAuth() instead of virConnectOpenReadOnly().
As my piece of code is running silently (without user connected) , by using virConnectOpenAuth() , is it possible to avoid to prompt user to get user /password ?
Yes it is. You basically need just to pass a callback that will supply credentials to libvirt. Does not matter how it gets it. You may want to read documentation: http://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenAuth or see the code for examples. Michal

Hi, Great if I'm able to avoid prompting the user. Thanks a lot. J.P. -----Message d'origine----- De : Michal Privoznik [mailto:mprivozn@redhat.com] Envoyé : lundi 11 janvier 2016 13:07 À : Jean-Pierre Ribeauville; libvirt-users@redhat.com Objet : Re: [libvirt-users] operation forbidden Read Only Access On 08.01.2016 14:30, Jean-Pierre Ribeauville wrote:
Hi,
I found an answer :
Use virConnectOpenAuth() instead of virConnectOpenReadOnly().
As my piece of code is running silently (without user connected) , by using virConnectOpenAuth() , is it possible to avoid to prompt user to get user /password ?
Yes it is. You basically need just to pass a callback that will supply credentials to libvirt. Does not matter how it gets it. You may want to read documentation: http://libvirt.org/html/libvirt-libvirt-host.html#virConnectOpenAuth or see the code for examples. Michal
participants (2)
-
Jean-Pierre Ribeauville
-
Michal Privoznik