Re: [PATCH]lxc: don't always print debug log in lxcContainerSetID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ping

> -----Original Message-----
> From: libvir-list-bounces@xxxxxxxxxx
[mailto:libvir-list-bounces@xxxxxxxxxx]
> On Behalf Of Chen Hanxiao
> Sent: Tuesday, October 22, 2013 4:52 PM
> To: libvir-list@xxxxxxxxxx
> Subject: Re:  [PATCH]lxc: don't always print debug log in
> lxcContainerSetID
> 
> ping
> 
> > -----Original Message-----
> > From: Chen Hanxiao [mailto:chenhanxiao@xxxxxxxxxxxxxx]
> > Sent: Wednesday, October 16, 2013 12:09 PM
> > To: libvir-list@xxxxxxxxxx
> > Cc: chenhanxiao@xxxxxxxxxxxxxx
> > Subject: [PATCH]lxc: don't always print debug log in
> lxcContainerSetID
> >
> > From: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
> >
> > lxcContainerSetID is used for user namespace.
> > If we don't enable user namespace, don't print debug log.
> >
> > Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
> > ---
> >  src/lxc/lxc_container.c | 14 ++++++++------
> >  1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
> > index 56df69e..ed1fe29 100644
> > --- a/src/lxc/lxc_container.c
> > +++ b/src/lxc/lxc_container.c
> > @@ -420,12 +420,14 @@ static int lxcContainerSetID(virDomainDefPtr def)
> >       * for this container. And user namespace is only enabled
> >       * when nuidmap&ngidmap is not zero */
> >
> > -    VIR_DEBUG("Set UID/GID to 0/0");
> > -    if (def->idmap.nuidmap &&
> > -        virSetUIDGID(0, 0, NULL, 0) < 0) {
> > -        virReportSystemError(errno, "%s",
> > -                             _("setuid or setgid failed"));
> > -        return -1;
> > +    if (def->idmap.nuidmap) {
> > +        if (virSetUIDGID(0, 0, NULL, 0) < 0) {
> > +            virReportSystemError(errno, "%s",
> > +                                 _("setuid or setgid failed"));
> > +            return -1;
> > +        } else {
> > +            VIR_DEBUG("Set UID/GID to 0/0");
> > +        }
> >      }
> >
> >      return 0;
> > --
> > 1.8.2.1
> 
> 
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]