Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
ae8bffcd
Commit
ae8bffcd
authored
Jan 01, 2014
by
Matthew McKeen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mitchellh/packer
into docker-metadata
parents
8bdb7232
3a1908bb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
244 additions
and
231 deletions
+244
-231
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/vmware/iso/driver_esx5.go
builder/vmware/iso/driver_esx5.go
+8
-0
builder/vmware/iso/driver_esx5_test.go
builder/vmware/iso/driver_esx5_test.go
+4
-0
packer/rpc/muxconn.go
packer/rpc/muxconn.go
+231
-231
No files found.
CHANGELOG.md
View file @
ae8bffcd
...
...
@@ -4,6 +4,7 @@ BUG FIXES:
*
core: If a stream ID loops around, don't let it use stream ID 0 [GH-767]
*
builders/virtualbox-ovf:
`shutdown_timeout`
config works. [GH-772]
*
builders/vmware-iso: Remote driver works properly again. [GH-773]
## 0.5.0 (12/30/2013)
...
...
builder/vmware/iso/driver_esx5.go
View file @
ae8bffcd
...
...
@@ -214,6 +214,10 @@ func (d *ESX5Driver) SSHAddress(state multistep.StateBag) (string, error) {
return
address
,
nil
}
//-------------------------------------------------------------------
// OutputDir implementation
//-------------------------------------------------------------------
func
(
d
*
ESX5Driver
)
DirExists
()
(
bool
,
error
)
{
err
:=
d
.
sh
(
"test"
,
"-e"
,
d
.
outputDir
)
return
err
==
nil
,
nil
...
...
@@ -258,6 +262,10 @@ func (d *ESX5Driver) SetOutputDir(path string) {
d
.
outputDir
=
d
.
datastorePath
(
path
)
}
func
(
d
*
ESX5Driver
)
String
()
string
{
return
d
.
outputDir
}
func
(
d
*
ESX5Driver
)
datastorePath
(
path
string
)
string
{
return
filepath
.
Join
(
"/vmfs/volumes"
,
d
.
Datastore
,
path
)
}
...
...
builder/vmware/iso/driver_esx5_test.go
View file @
ae8bffcd
...
...
@@ -9,6 +9,10 @@ func TestESX5Driver_implDriver(t *testing.T) {
var
_
vmwcommon
.
Driver
=
new
(
ESX5Driver
)
}
func
TestESX5Driver_implOutputDir
(
t
*
testing
.
T
)
{
var
_
vmwcommon
.
OutputDir
=
new
(
ESX5Driver
)
}
func
TestESX5Driver_implRemoteDriver
(
t
*
testing
.
T
)
{
var
_
RemoteDriver
=
new
(
ESX5Driver
)
}
packer/rpc/muxconn.go
View file @
ae8bffcd
...
...
@@ -100,7 +100,7 @@ func (m *MuxConn) Close() error {
// Accept accepts a multiplexed connection with the given ID. This
// will block until a request is made to connect.
func
(
m
*
MuxConn
)
Accept
(
id
uint32
)
(
io
.
ReadWriteCloser
,
error
)
{
//
log.Printf("[TRACE] %p: Accept on stream ID: %d", m, id)
log
.
Printf
(
"[TRACE] %p: Accept on stream ID: %d"
,
m
,
id
)
// Get the stream. It is okay if it is already in the list of streams
// because we may have prematurely received a syn for it.
...
...
@@ -322,7 +322,7 @@ func (m *MuxConn) loop() {
continue
}
//
log.Printf("[TRACE] %p: Stream %d (%s) received packet %d", m, id, from, packetType)
log
.
Printf
(
"[TRACE] %p: Stream %d (%s) received packet %d"
,
m
,
id
,
from
,
packetType
)
switch
packetType
{
case
muxPacketSyn
:
// If the stream is nil, this is the only case where we'll
...
...
@@ -416,9 +416,9 @@ func (m *MuxConn) loop() {
stream
.
mu
.
Unlock
()
}
}
}
}
func
(
m
*
MuxConn
)
write
(
from
muxPacketFrom
,
id
uint32
,
dataType
muxPacketType
,
p
[]
byte
)
(
int
,
error
)
{
func
(
m
*
MuxConn
)
write
(
from
muxPacketFrom
,
id
uint32
,
dataType
muxPacketType
,
p
[]
byte
)
(
int
,
error
)
{
m
.
wlock
.
Lock
()
defer
m
.
wlock
.
Unlock
()
...
...
@@ -438,11 +438,11 @@ func (m *MuxConn) loop() {
return
0
,
nil
}
return
m
.
rwc
.
Write
(
p
)
}
}
// Stream is a single stream of data and implements io.ReadWriteCloser.
// A Stream is full-duplex so you can write data as well as read data.
type
Stream
struct
{
// Stream is a single stream of data and implements io.ReadWriteCloser.
// A Stream is full-duplex so you can write data as well as read data.
type
Stream
struct
{
from
muxPacketFrom
id
uint32
mux
*
MuxConn
...
...
@@ -452,11 +452,11 @@ func (m *MuxConn) loop() {
stateUpdated
time
.
Time
mu
sync
.
Mutex
writeCh
chan
<-
[]
byte
}
}
type
streamState
byte
type
streamState
byte
const
(
const
(
streamStateClosed
streamState
=
iota
streamStateListen
streamStateSynRecv
...
...
@@ -467,9 +467,9 @@ func (m *MuxConn) loop() {
streamStateCloseWait
streamStateClosing
streamStateLastAck
)
)
func
newStream
(
from
muxPacketFrom
,
id
uint32
,
m
*
MuxConn
)
*
Stream
{
func
newStream
(
from
muxPacketFrom
,
id
uint32
,
m
*
MuxConn
)
*
Stream
{
// Create the stream object and channel where data will be sent to
dataR
,
dataW
:=
io
.
Pipe
()
writeCh
:=
make
(
chan
[]
byte
,
4096
)
...
...
@@ -505,9 +505,9 @@ func (m *MuxConn) loop() {
}()
return
stream
}
}
func
(
s
*
Stream
)
Close
()
error
{
func
(
s
*
Stream
)
Close
()
error
{
s
.
mu
.
Lock
()
defer
s
.
mu
.
Unlock
()
...
...
@@ -523,13 +523,13 @@ func (m *MuxConn) loop() {
s
.
write
(
muxPacketFin
,
nil
)
return
nil
}
}
func
(
s
*
Stream
)
Read
(
p
[]
byte
)
(
int
,
error
)
{
func
(
s
*
Stream
)
Read
(
p
[]
byte
)
(
int
,
error
)
{
return
s
.
reader
.
Read
(
p
)
}
}
func
(
s
*
Stream
)
Write
(
p
[]
byte
)
(
int
,
error
)
{
func
(
s
*
Stream
)
Write
(
p
[]
byte
)
(
int
,
error
)
{
s
.
mu
.
Lock
()
state
:=
s
.
state
s
.
mu
.
Unlock
()
...
...
@@ -539,14 +539,14 @@ func (m *MuxConn) loop() {
}
return
s
.
write
(
muxPacketData
,
p
)
}
}
func
(
s
*
Stream
)
closeWriter
()
{
func
(
s
*
Stream
)
closeWriter
()
{
s
.
writeCh
<-
nil
}
}
func
(
s
*
Stream
)
setState
(
state
streamState
)
{
//
log.Printf("[TRACE] %p: Stream %d (%s) went to state %d", s.mux, s.id, s.from, state)
func
(
s
*
Stream
)
setState
(
state
streamState
)
{
log
.
Printf
(
"[TRACE] %p: Stream %d (%s) went to state %d"
,
s
.
mux
,
s
.
id
,
s
.
from
,
state
)
s
.
state
=
state
s
.
stateUpdated
=
time
.
Now
()
.
UTC
()
for
ch
,
_
:=
range
s
.
stateChange
{
...
...
@@ -555,9 +555,9 @@ func (m *MuxConn) loop() {
default
:
}
}
}
}
func
(
s
*
Stream
)
waitState
(
target
streamState
)
error
{
func
(
s
*
Stream
)
waitState
(
target
streamState
)
error
{
// Register a state change listener to wait for changes
stateCh
:=
make
(
chan
streamState
,
10
)
s
.
stateChange
[
stateCh
]
=
struct
{}{}
...
...
@@ -574,8 +574,8 @@ func (m *MuxConn) loop() {
}
else
{
return
fmt
.
Errorf
(
"Stream %d went to bad state: %d"
,
s
.
id
,
state
)
}
}
}
func
(
s
*
Stream
)
write
(
dataType
muxPacketType
,
p
[]
byte
)
(
int
,
error
)
{
func
(
s
*
Stream
)
write
(
dataType
muxPacketType
,
p
[]
byte
)
(
int
,
error
)
{
return
s
.
mux
.
write
(
s
.
from
,
s
.
id
,
dataType
,
p
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment