virtio-blk: Clean up signedness casts

Switch to size_t type for ->bio_bcount in struct bio and clean up
virtio-blk signedness casts.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
run.py: configurable bridge name for qemu with vhost configurations

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
vfs: fix flags conversion on open()

The vfs converts the read/write flags from 0/1/2 (read-only/write-only/rw) to
bit fields which are more easily testable.  But in doing so it corrupts the
other flags.

Fix FFLAGS and OFLAGS to preserve those other flags.  The test for a file
that is not readable or writable is dropped, since it is impossible to fail.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: fix fcntl() GETFL/SETFL

We store the flags in a different format than fcntl() expects; perform the
needed conversions.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: define FEXCL

For zfs.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: const correctness for vget()

Make vget() accept a const char*, and adjust various other functions that
it calls in the same way.  This makes it easier to convert vfs_mount.c to
C++.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: fix open() definition

open()'s prototype is traditionally open(const char*, int, ...) since
the third mode_t parameter is optional, and only needed if O_CREAT is
specified.

Change the definition to conform.

This allows the LFS64() macro to be used to define open64() with a
similar prototype.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: declare some vfs64 entry points

Needed by libzfs.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch 'mkfs.vfs'

Some vfs fixes needed for mkfs; already posted as part of the mkfs patchset.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
partitions: fix empty parititon table entry detection

Partitions table entries with cyl=0 or head=0 are legal, avoid false
positives.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
partitions: remove bad checks on paritition table entries

head=254 is legal, and the check also assumes that heads=255, which is not
a given.  Remove the check and trust the LBA.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
partitions: fix partition offset truncation

The partition offset can be > 32 bits, so allow for it in the calculation.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch 'partitions'

Partition table fixes.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: allow mount() device parameter not to be a valid device

zfs interprets the device parameter as a pool name, so don't insist on opening
it as a device.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: implement nmount()

nmount() is a mount variant that works with key/value pairs to provide
options.  Implement it for osv.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: const correctness for dentry_alloc()

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: convert vfs_mount.c to C++

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: convert vfs_mount.cc to osv indents

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: add a function for getting all current mounts

Similar to /etc/mnttab, but without going through the file system.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vfs: save the mount resource to the mount entry

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>