[libvirt] VM creation failed : Permission denied : bind(unix:/var/run/libvirt/qemu//VM.monitor)

Daniel P. Berrange berrange at redhat.com
Thu Jul 30 10:24:38 UTC 2009


On Thu, Jul 30, 2009 at 10:57:53AM +0200, Daniel Veillard wrote:
> On Thu, Jul 30, 2009 at 05:44:41PM +0900, Ryota Ozaki wrote:
> > On Thu, Jul 30, 2009 at 5:33 PM, Pierre-Gilles
> > Mialon<pmialon at linagora.com> wrote:
> > >        I use Ovirt under Fedora 11 with the latest developpement package and the VM
> > > creation failed with :
> > > bind(unix:/var/run/libvirt/qemu//VM-4.monitor): Permission denied
> > 
> > Ugh, this is a regression introduced by my patch...
> > (see [PATCH] qemu: fix monitor socket reconnection)
> > 
> > Eventually we need to add ENOENT to errno checks, not replace EACCES
> > with ENOENT, I'm not sure why EACCES happens though. Anyone knows that?
> [...]
> > > libvirt-0.7.0-0.2.gitf055724.fc11.x86_64
> > > libvirt-python-0.7.0-0.2.gitf055724.fc11.x86_64
> > > libvirt-client-0.7.0-0.2.gitf055724.fc11.x86_64
> > > libvirt-qpid-0.2.17-0.fc11.x86_64
> 
>   Unclear, he's using the prerelease code from monday, not the one
> with the EACCES -> ENOENT replacement patch.
> 
>   One possibility for EACCES could be if the socket creation in qemu was
> done with a mode not allowing access and modified in subsequent code,
> allowing for a small windows where EACCES would be returned. Someone
> should check qemu code.
>   I think allowing again retry on EACCES should be fine anyway, I don't
> see how that could break things, we would just hit a time out in the
> worst case where access is never granted.



> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> index 9fb8506..1877cc0 100644
> --- a/src/qemu_driver.c
> +++ b/src/qemu_driver.c
> @@ -917,8 +917,9 @@ qemudOpenMonitorUnix(virConnectPtr conn,
>          if (ret == 0)
>              break;
>  
> -        if (errno == ENOENT || errno == ECONNREFUSED) {
> +        if (errno == ENOENT || errno == EACCES || errno == ECONNREFUSED) {
>              /* ENOENT       : Socket may not have shown up yet
> +             * EACCES       : acces is not yet granted
>               * ECONNREFUSED : Leftover socket hasn't been removed yet */
>              continue;
>          }

NACK, this is not going to help. 

The error message is coming from QEMU itself, unable to bind() to the
socket. THis code is in libvirtd attempting to connect() to the socket.
So this isn't where the bug is. In any case if permissions aren't
correct, retrying isn't going to magically make them work.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list