Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-machine-kvm-virtio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Schachten
docker-machine-kvm-virtio
Commits
6096a1a3
There was an error fetching the commit references. Please try again later.
Commit
6096a1a3
authored
Nov 15, 2015
by
Rodrigo Vaz
Browse files
Options
Downloads
Patches
Plain Diff
fix connection reference on NewDriver
parent
3c19ef3f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/main.go
+1
-1
1 addition, 1 deletion
bin/main.go
kvm.go
+13
-8
13 additions, 8 deletions
kvm.go
with
14 additions
and
9 deletions
bin/main.go
+
1
−
1
View file @
6096a1a3
...
...
@@ -6,5 +6,5 @@ import (
)
func
main
()
{
plugin
.
RegisterDriver
(
kvm
.
NewDriver
())
plugin
.
RegisterDriver
(
kvm
.
NewDriver
(
"default"
,
"path"
))
}
This diff is collapsed.
Click to expand it.
kvm.go
+
13
−
8
View file @
6096a1a3
...
...
@@ -162,7 +162,7 @@ func (d *Driver) DriverName() string {
}
func
(
d
*
Driver
)
SetConfigFromFlags
(
flags
drivers
.
DriverOptions
)
error
{
log
.
Debugf
(
"SetConfigFromFlags
a
clled"
)
log
.
Debugf
(
"SetConfigFromFlags c
a
lled"
)
d
.
Memory
=
flags
.
Int
(
"kvm-memory"
)
d
.
DiskSize
=
flags
.
Int
(
"kvm-disk-size"
)
d
.
CPU
=
flags
.
Int
(
"kvm-cpu-count"
)
...
...
@@ -274,7 +274,6 @@ func (d *Driver) validateNetwork(name string) error {
func
(
d
*
Driver
)
PreCreateCheck
()
error
{
// TODO We could look at d.conn.GetCapabilities()
// parse the XML, and look for kvm
log
.
Debug
(
"About to check libvirt version"
)
// TODO might want to check minimum version
...
...
@@ -670,13 +669,19 @@ func createDiskImage(dest string, size int, r io.Reader) error {
return
f
.
Close
()
}
func
NewDriver
()
*
Driver
{
d
:=
&
Driver
{}
conn
,
err
:=
libvirt
.
NewVirConnection
(
d
.
connectionString
)
func
NewDriver
(
hostName
,
storePath
string
)
drivers
.
Driver
{
conn
,
err
:=
libvirt
.
NewVirConnection
(
connectionString
)
if
err
!=
nil
{
log
.
Fatalf
(
"Failed to connect to libvirt: %s"
,
err
)
return
nil
}
return
&
Driver
{
conn
:
&
conn
,
PrivateNetwork
:
privateNetworkName
,
BaseDriver
:
&
drivers
.
BaseDriver
{
MachineName
:
hostName
,
StorePath
:
storePath
,
},
}
d
.
conn
=
&
conn
d
.
PrivateNetwork
=
privateNetworkName
return
d
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment