Skip to content

Commit

Permalink
Merge pull request kubevirt#2435 from jimma/2434
Browse files Browse the repository at this point in the history
Remove duplicate code to delete/create socketPath in virt-launcher
  • Loading branch information
slintes authored Jun 28, 2019
2 parents f1a83d9 + f4fce11 commit ae9ead0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions cmd/virt-launcher/virt-launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ func startCmdServer(socketPath string,
domainManager virtwrap.DomainManager,
stopChan chan struct{},
options *cmdserver.ServerOptions) chan struct{} {

err := os.RemoveAll(socketPath)
if err != nil {
log.Log.Reason(err).Error("Could not clean up virt-launcher cmd socket")
panic(err)
}

err = os.MkdirAll(filepath.Dir(socketPath), 0755)
if err != nil {
log.Log.Reason(err).Error("Could not create directory for socket.")
panic(err)
}

done, err := cmdserver.RunServer(socketPath, domainManager, stopChan, options)
if err != nil {
log.Log.Reason(err).Error("Failed to start virt-launcher cmd server")
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/net/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func CreateSocket(socketPath string) (net.Listener, error) {

err := os.MkdirAll(filepath.Dir(socketPath), 0755)
if err != nil {
log.Log.Reason(err).Error("unable to create directory for unix socket")
log.Log.Reason(err).Errorf("unable to create directory for unix socket %v", socketPath)
return nil, err
}

Expand Down

0 comments on commit ae9ead0

Please sign in to comment.