-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request moby#14709 from rhvgoyal/base-size-100G
devicemapper: Change default basesize to 100G Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: rhatdan)
- Loading branch information
Showing
7 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// +build windows | ||
|
||
package machine | ||
|
||
func Register(name string, id string, pid int, root_directory string) error { | ||
return nil | ||
} | ||
|
||
func Terminate(name string) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// +build !windows | ||
|
||
package machine | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/Sirupsen/logrus" | ||
"github.com/docker/docker/pkg/systemd" | ||
) | ||
|
||
/* | ||
Register Machine with systemd. There is a potential race condition here | ||
where the container could have exited before the call gets made. This | ||
call requires the container.Pid. | ||
*/ | ||
func Register(name string, id string, pid int, root_directory string) error { | ||
err := systemd.RegisterMachine(name, id, pid, root_directory) | ||
if err != nil { | ||
if strings.Contains(err.Error(), "Failed to determine unit of process") { | ||
return nil | ||
} | ||
logrus.Errorf("Unable to RegisterMachine %s for %s: %s", name, id, err) | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func Terminate(name string) { | ||
systemd.TerminateMachine(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// +build linux | ||
|
||
package systemd | ||
|
||
import ( | ||
"encoding/hex" | ||
"github.com/godbus/dbus" | ||
) | ||
|
||
var conn *dbus.Conn | ||
|
||
// RegisterMachine with systemd on the host system | ||
func RegisterMachine(name string, id string, pid int, root_directory string) error { | ||
var ( | ||
av []byte | ||
err error | ||
) | ||
if !SdBooted() { | ||
return nil | ||
} | ||
|
||
if conn == nil { | ||
conn, err = dbus.SystemBus() | ||
if err != nil { | ||
return (err) | ||
} | ||
} | ||
|
||
av, err = hex.DecodeString(id[0:32]) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
obj := conn.Object("org.freedesktop.machine1", "/org/freedesktop/machine1") | ||
return obj.Call("org.freedesktop.machine1.Manager.RegisterMachine", 0, name, av, "docker", "container", uint32(pid), root_directory).Err | ||
} | ||
|
||
// TerminateMachine registered with systemd on the host system | ||
func TerminateMachine(name string) error { | ||
var ( | ||
err error | ||
) | ||
if !SdBooted() { | ||
return nil | ||
} | ||
|
||
if conn == nil { | ||
conn, err = dbus.SystemBus() | ||
if err != nil { | ||
return (err) | ||
} | ||
} | ||
|
||
obj := conn.Object("org.freedesktop.machine1", "/org/freedesktop/machine1") | ||
return obj.Call("org.freedesktop.machine1.Manager.TerminateMachine", 0, name).Err | ||
} |