Extend container API with a new method SetTimeout
which allows to set SO_RCVTIMEO for LXC client socket.
Issue #4257
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Add attach option RemountSysProc to remount /sys and /proc for
the executed command (similar 'lxc-attach --remount-sys-proc').
Add attach option ElevatedPrivileges to elevate all privileges of the
executed command (similar to 'lxc-attach --elevated-privileges').
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
Reduce memory allocation for snapshots to allow building on 32bit.
This will limit the total number of snapshots that this can handle but
it's still such a ludicrous number that it shouldn't be an issue until
we can fully ignore 32bit.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Handling our garbage explicitly is way more simpler and idiomatic
then relying on runtime magic. Finalizers also are not guaranteed to
run so stop using them, instead Container now provides Release()
to call it via defer.
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
As it stands right now, there is no way to figure out what the exit code of
a container spawned by StartExecute() was. liblxc stores the value in
c->error_num, so let's make that accessible.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This adds support to use the newly added MIGRATE_FEATURE_CHECK command
in the migrate() call. With this change LXD can query LXC if CRIU
supports features like dirty memory tracking or userfaultfd based
process migration.
Signed-off-by: Adrian Reber <areber@redhat.com>
With the immanent arrival of StartExecute(), Execute() is probably going to
be enshrined in hackery-whackery for the rest of time. So let's get rid of
this commented out code.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
The original code where we were doing following
func X() {
call makesure
makesure locks
...work
makesure unlocks
lock
...work
unlock
}
was potentially racy as someone else could obtain the lock in between
makesure and mutex.Lock call.
Changes since last attempt:
- Running LXD tests locally ends up with success.
...
==> Deleting all storage pools
Storage pool lxdtest-cjU deleted
==> Checking for locked DB tables
==> Checking for leftover files
==> Checking for leftover DB entries
==> Tearing down directory backend in
/home/caglar/go/src/github.com/lxc/lxd/test/tmp.IQA/cjU
==> Test result: success
...
This reverts commit c57efc7ce2.
The locking change was causing LXD tests to hang so there's an issue
somewhere with the locks.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
The original code where we were doing following
func X() {
call makesure
makesure locks
...work
makesure unlocks
lock
...work
unlock
}
was potentially racy as someone else could obtain the lock in between
makesure and mutex.Lock call.
Now all exported functions are holding the lock throughout their scope.
This changes the return type of 3 functions. This should be safe
assuming the expected usage of those functions in the form of;
```
c := lxc.DefinedContainers(lxcpath)
...
```
Should help to #82 as well