diff --git a/opengcs/README.md b/opengcs/README.md deleted file mode 100644 index acc247fa90..0000000000 --- a/opengcs/README.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Open Guest Compute Service (opengcs) [![Build Status](https://github.com/microsoft/opengcs/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/opengcs/actions/workflows/ci.yml) - -Open Guest Compute Service is a Linux open source project to further the development of a production quality implementation of Linux Hyper-V containers on Windows (LCOW). It's designed to run inside a custom Linux OS for supporting Linux container payload. - -# LCOW v1 (deprecated) - -The original version of `LCOW v1` was designed to run directly through `Docker` against the `HCS` (Host Compute Service) on Windows. This workflow is no longer supported by this repository however it has not been intentionally broken. If you would like to continue to use `LCOW v1` there is a branch `lcow_v1` that is the LKG branch previous to the removal of `LCOW v1` from the `master` branchline. All future efforts are focused on `LCOW v2`. - -# LCOW v2 - -The primary difference between `LCOW v1` and `LCOW v2` is that `v1` was designed to hide the concept of the Utility VM. The caller created a _Linux container_ and operated on the container as if it was natively running on Windows. In the background a lightweight Utility VM was created that actually hosted the container but this was not visible and its resources not controllable via the caller. Although this works, it severely limited certain abilities such as the concept of Kubernetes pod or placing multiple LCOW containers in a single hypervisor boundary and set of resources. - -Thus `LCOW v2` was created which has two primary differences. -- The Utility VM backing the Linux containers is a first class construct. Thus it can be managed in a lifetime separate from the actual containers running in it. -- The communication from host to guest is no longer done via the platform. This means that `LCOW v2` can iterate simply by improving its host/guest protocol with no need for taking Windows updates. - -The focus of `LCOW v2` as a replacement of `LCOW v1` is through the coordination and work that has gone into [containerd/containerd](https://github.com/containerd/containerd) and its [Runtime V2](https://github.com/containerd/containerd/tree/master/runtime/v2) interface. To see our `containerd` hostside shim please look here [Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1](https://github.com/microsoft/hcsshim/tree/master/cmd/containerd-shim-runhcs-v1). - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -We also ask that contributors [sign their commits](https://git-scm.com/docs/git-commit) using `git commit -s` or `git commit --signoff` to certify they either authored the work themselves or otherwise have permission to use it in this project. - -# Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/test/go.sum b/test/go.sum index 8a26714ab6..51c80c3442 100644 --- a/test/go.sum +++ b/test/go.sum @@ -363,9 +363,11 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -803,6 +805,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/vsockexec/vsock.c b/vsockexec/vsock.c index 03973dae68..a1d8920475 100644 --- a/vsockexec/vsock.c +++ b/vsockexec/vsock.c @@ -1,30 +1,30 @@ -#include "vsock.h" -#include - -struct sockaddr_vm { - unsigned short svm_family; - unsigned short svm_reserved1; - unsigned int svm_port; - unsigned int svm_cid; - unsigned char svm_zero[sizeof(struct sockaddr) - - sizeof(sa_family_t) - - sizeof(unsigned short) - - sizeof(unsigned int) - sizeof(unsigned int)]; -}; - -int openvsock(unsigned int cid, unsigned int port) { - int s = socket(AF_VSOCK, SOCK_STREAM, 0); - if (s < 0) { - return -1; - } - - struct sockaddr_vm addr = {0}; - addr.svm_family = AF_VSOCK; - addr.svm_port = port; - addr.svm_cid = cid; - if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - return -1; - } - - return s; -} +#include "vsock.h" +#include + +struct sockaddr_vm { + unsigned short svm_family; + unsigned short svm_reserved1; + unsigned int svm_port; + unsigned int svm_cid; + unsigned char svm_zero[sizeof(struct sockaddr) - + sizeof(sa_family_t) - + sizeof(unsigned short) - + sizeof(unsigned int) - sizeof(unsigned int)]; +}; + +int openvsock(unsigned int cid, unsigned int port) { + int s = socket(AF_VSOCK, SOCK_STREAM, 0); + if (s < 0) { + return -1; + } + + struct sockaddr_vm addr = {0}; + addr.svm_family = AF_VSOCK; + addr.svm_port = port; + addr.svm_cid = cid; + if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + return -1; + } + + return s; +} diff --git a/vsockexec/vsock.h b/vsockexec/vsock.h index a02579cf81..b9ace84ce6 100644 --- a/vsockexec/vsock.h +++ b/vsockexec/vsock.h @@ -1,8 +1,8 @@ -#ifndef VSOCK_H -#define VSOCK_H - -#define VMADDR_CID_HOST 2 - -int openvsock(unsigned int cid, unsigned int port); - -#endif +#ifndef VSOCK_H +#define VSOCK_H + +#define VMADDR_CID_HOST 2 + +int openvsock(unsigned int cid, unsigned int port); + +#endif