Skip to content

Commit c83b900

Browse files
huguesalaryzchee
authored andcommitted
Retiring --xhyve-experimental-nfs-share-enable and updating README.md
Using --xhyve-experimental-nfs-shares to set up NFS shares implies --xhyve-experimental-nfs-share-enable, which now becomes redundant. Removing --xhyve-experimental-nfs-share-enable makes the command line easier to use.
1 parent 5ed10e7 commit c83b900

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ Usage
118118
| `--xhyve-boot-initrd` | `XHYVE_BOOT_INITRD` | string | `''` |
119119
| `--xhyve-qcow2` | `XHYVE_QCOW2` | bool | `false` |
120120
| `--xhyve-virtio-9p` | `XHYVE_VIRTIO_9P` | bool | `false` |
121-
| `--xhyve-experimental-nfs-share-enable` | `XHYVE_EXPERIMENTAL_NFS_SHARE_ENABLE` | bool | Enable `NFS` folder share (experimental) | `false` |
122121
| `--xhyve-experimental-nfs-share` | `XHYVE_EXPERIMENTAL_NFS_SHARE` | string | Path to a host folder to be shared inside the guest | |
123122
| `--xhyve-experimental-nfs-share-root` | `XHYVE_EXPERIMENTAL_NFS_SHARE_ROOT` | string | root path at which the NFS shares will be mounted| `/xhyve-nfsshares` |
124123

@@ -176,9 +175,18 @@ This may be significantly faster for I/O intensive applications, at the potentia
176175
Enable `virtio-9p` folder share.
177176
If you using docker-machine, `CONFIG_NET_9P=y` support is included in boot2docker as of version v1.10.2.
178177

179-
#### `--xhyve-experimental-nfs-share`
178+
#### `--xhyve-experimental-nfs-share /path/to/host/folder`
179+
180+
Share `path/to/host/folder` inside the guest at the path specified by `--xhyve-experimental-nfs-share-root` (which itself defaults to `/xhyve-nfsshares`).
181+
182+
Can be specified multiple times
183+
184+
#### `--xhyve-experimental-nfs-share-root /path`
185+
186+
By default, NFS Shares will be mounted in the Guest at `/xhyve-nfsshares`.
187+
188+
You can change this default by specifying `--xhyve-experimental-nfs-share-root /path`, `/path` being a path to the root
180189

181-
Enable `NFS` folder sharing.
182190

183191
Known isuue
184192
-----------

xhyve/xhyve.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const (
5353
defaultISOFilename = "boot2docker.iso"
5454
defaultPrivateKeyPath = ""
5555
defaultUUID = ""
56-
defaultNFSShareEnable = false
5756
defaultNFSSharesRoot = "/xhyve-nfsshares"
5857
rootVolumeName = "root-volume"
5958
defaultDiskNumber = -1
@@ -78,7 +77,6 @@ type Driver struct {
7877
UUID string
7978
Qcow2 bool
8079
RawDisk bool
81-
NFSShareEnable bool
8280
NFSShares []string
8381
NFSSharesRoot string
8482
Virtio9p bool
@@ -118,7 +116,6 @@ func NewDriver(hostName, storePath string) *Driver {
118116
Memory: defaultMemory,
119117
PrivateKeyPath: defaultPrivateKeyPath,
120118
UUID: defaultUUID,
121-
NFSShareEnable: defaultNFSShareEnable,
122119
NFSSharesRoot: defaultNFSSharesRoot,
123120
DiskNumber: defaultDiskNumber,
124121
Virtio9p: defaultVirtio9p,
@@ -194,11 +191,6 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
194191
Name: "xhyve-virtio-9p",
195192
Usage: "Setup virtio-9p folder share",
196193
},
197-
mcnflag.BoolFlag{
198-
EnvVar: "XHYVE_EXPERIMENTAL_NFS_SHARE_ENABLE",
199-
Name: "xhyve-experimental-nfs-share-enable",
200-
Usage: "Setup NFS shared folder (requires root)",
201-
},
202194
mcnflag.StringSliceFlag{
203195
EnvVar: "XHYVE_EXPERIMENTAL_NFS_SHARE",
204196
Name: "xhyve-experimental-nfs-share",
@@ -266,7 +258,6 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
266258
d.UUID = flags.String("xhyve-uuid")
267259
d.Virtio9p = flags.Bool("xhyve-virtio-9p")
268260
d.Virtio9pFolder = "/Users"
269-
d.NFSShareEnable = flags.Bool("xhyve-experimental-nfs-share-enable")
270261
d.NFSShares = flags.StringSlice("xhyve-experimental-nfs-share")
271262
d.NFSSharesRoot = flags.String("xhyve-experimental-nfs-share-root")
272263

@@ -586,7 +577,7 @@ func (d *Driver) Remove() error {
586577
return err
587578
}
588579

589-
if d.NFSShareEnable {
580+
if len(d.NFSShares) > 0 {
590581
log.Infof("Remove NFS share folder must be root. Please insert root password.")
591582
for _, share := range d.NFSShares {
592583
if _, err := nfsexports.Remove("", d.nfsExportIdentifier(share)); err != nil {
@@ -832,7 +823,7 @@ func (d *Driver) setupMounts() error {
832823
}
833824

834825
// Setup NFS sharing
835-
if d.NFSShareEnable {
826+
if len(d.NFSShares) > 0 {
836827
log.Infof("NFS share folder must be root. Please insert root password.")
837828
err := d.setupNFSShare()
838829
if err != nil {

0 commit comments

Comments
 (0)