diff --git a/.gitignore b/.gitignore index 49bac5ba7..753ea2bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -./bin/ +/bin/ capture.pcap tmp/ test/qcon.log diff --git a/cmd/gvproxy/main.go b/cmd/gvproxy/main.go index 8a67ea77d..20ebeeb16 100644 --- a/cmd/gvproxy/main.go +++ b/cmd/gvproxy/main.go @@ -46,7 +46,6 @@ var ( sshPort int pidFile string shareVolumes arrayFlags - vsockShares map[string]uint64 exitCode int ) diff --git a/pkg/fileserver/plan9/serve.go b/pkg/fileserver/plan9/serve.go index 563e0650e..34f3f77eb 100644 --- a/pkg/fileserver/plan9/serve.go +++ b/pkg/fileserver/plan9/serve.go @@ -11,7 +11,7 @@ import ( "github.com/sirupsen/logrus" ) -type Plan9Server struct { +type Server struct { server *p9.Server // TODO: Once server has a proper Close() we don't need this. // This is basically just a short-circuit to actually close the server @@ -23,7 +23,7 @@ type Plan9Server struct { // Expose a single directory (and all children) via the given net.Listener. // Directory given must be an absolute path and must exist. -func New9pServer(listener net.Listener, exposeDir string) (*Plan9Server, error) { +func New9pServer(listener net.Listener, exposeDir string) (*Server, error) { // Verify that exposeDir makes sense. if !filepath.IsAbs(exposeDir) { return nil, fmt.Errorf("path to expose to machine must be absolute: %s", exposeDir) @@ -50,7 +50,7 @@ func New9pServer(listener net.Listener, exposeDir string) (*Plan9Server, error) close(errChan) }() - toReturn := new(Plan9Server) + toReturn := new(Server) toReturn.listener = listener toReturn.server = server toReturn.errChan = errChan @@ -71,7 +71,7 @@ func New9pServer(listener net.Listener, exposeDir string) (*Plan9Server, error) // Please note that this does *BAD THINGS* to clients if they are still running // when the server stops. Processes get stuck in I/O deep sleep and zombify, and // nothing I do save restarting the VM can remove the zombies. -func (s *Plan9Server) Stop() error { +func (s *Server) Stop() error { if s.server != nil { if err := s.listener.Close(); err != nil { return err @@ -83,7 +83,7 @@ func (s *Plan9Server) Stop() error { } // Wait for an error from a running server. -func (s *Plan9Server) WaitForError() error { +func (s *Server) WaitForError() error { if s.server != nil { err := <-s.errChan return err diff --git a/pkg/fileserver/server_unsupported.go b/pkg/fileserver/server_unsupported.go index 02633ff3a..21a44acbe 100644 --- a/pkg/fileserver/server_unsupported.go +++ b/pkg/fileserver/server_unsupported.go @@ -8,5 +8,9 @@ import ( ) func StartShares(mounts map[string]uint64) error { + if len(mounts) == 0 { + return nil + } + return fmt.Errorf("this platform does not support sharing directories") }