svn commit: r308664 - in head: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/tools us...
Sepherosa Ziehau
sephe at freebsd.org
Thu Nov 17 01:35:11 UTC 2016
On Thu, Nov 17, 2016 at 6:14 AM, Mark Johnston <markj at freebsd.org> wrote:
> On Tue, Nov 15, 2016 at 02:36:12AM +0000, Sepherosa Ziehau wrote:
>> Author: sephe
>> Date: Tue Nov 15 02:36:12 2016
>> New Revision: 308664
>> URL: https://svnweb.freebsd.org/changeset/base/308664
>>
>> Log:
>> hyperv/vss: Add driver and tools for VSS
>>
>> VSS stands for "Volume Shadow Copy Service". Unlike virtual machine
>> snapshot, it only takes snapshot for the virtual disks, so both
>> filesystem and applications have to aware of it, and cooperate the
>> whole VSS process.
>>
>> This driver exposes two device files to the userland:
>>
>> /dev/hv_fsvss_dev
>>
>> Normally userland programs should _not_ mess with this device file.
>> It is currently used by the hv_vss_daemon(8), which freezes and
>> thaws the filesystem. NOTE: currently only UFS is supported, if
>> the system mounts _any_ other filesystems, the hv_vss_daemon(8)
>> will veto the VSS process.
>>
>> If hv_vss_daemon(8) was disabled, then this device file must be
>> opened, and proper ioctls must be issued to keep the VSS working.
>>
>> /dev/hv_appvss_dev
>>
>> Userland application can opened this device file to receive the
>> VSS freeze notification, hold the VSS for a while (mainly to flush
>> application data to filesystem), release the VSS process, and
>> receive the VSS thaw notification i.e. applications can run again.
>>
>> The VSS will still work, even if this device file is not opened.
>> However, only filesystem consistency is promised, if this device
>> file is not opened or is not operated properly.
>>
>> hv_vss_daemon(8) is started by devd(8) by default. It can be disabled
>> by editting /etc/devd/hyperv.conf.
>>
>> Submitted by: Hongjiang Zhang <honzhan microsoft com>
>> Reviewed by: kib, mckusick
>> MFC after: 3 weeks
>> Sponsored by: Microsoft
>> Differential Revision: https://reviews.freebsd.org/D8224
>>
>> Added:
>> head/contrib/hyperv/tools/hv_vss_daemon.8
>> head/contrib/hyperv/tools/hv_vss_daemon.c
>> head/share/man/man4/hv_vss.4 (contents, props changed)
>> head/sys/dev/hyperv/utilities/hv_snapshot.c (contents, props changed)
>> head/sys/dev/hyperv/utilities/hv_snapshot.h (contents, props changed)
>> head/usr.sbin/hyperv/tools/kvp/
>> head/usr.sbin/hyperv/tools/kvp/Makefile
>> - copied, changed from r308663, head/usr.sbin/hyperv/tools/Makefile
>> head/usr.sbin/hyperv/tools/kvp/Makefile.depend
>> - copied unchanged from r308663, head/usr.sbin/hyperv/tools/Makefile.depend
>> head/usr.sbin/hyperv/tools/vss/
>> head/usr.sbin/hyperv/tools/vss/Makefile (contents, props changed)
>> head/usr.sbin/hyperv/tools/vss/Makefile.depend (contents, props changed)
>> Deleted:
>> head/usr.sbin/hyperv/tools/Makefile
>> head/usr.sbin/hyperv/tools/Makefile.depend
>> Modified:
>> head/etc/devd/hyperv.conf
>> head/etc/mtree/BSD.include.dist
>> head/include/Makefile
>> head/share/man/man4/Makefile
>> head/sys/conf/files.amd64
>> head/sys/conf/files.i386
>> head/sys/modules/hyperv/utilities/Makefile
>> head/usr.sbin/hyperv/Makefile
>
> This appears to install hv_kvp_daemon and hv_vss_daemon to / instead of
> /usr/sbin, and breaks the -DNO_ROOT build. I think a Makefile.inc is
> needed in usr.sbin/hyperv/tools in order to preserve BINDIR from
> usr.sbin/Makefile.inc. I fixed the problem in my tree with the diff
> below, but am not sure if this is the right way to do it. For some
> reason, doing this resulted in unused var warnings compiling
> hv_vss_daemon.c.
>
> diff --git a/contrib/hyperv/tools/hv_vss_daemon.c b/contrib/hyperv/tools/hv_vss_daemon.c
> index 8b58bc9..a1ba98d 100644
> --- a/contrib/hyperv/tools/hv_vss_daemon.c
> +++ b/contrib/hyperv/tools/hv_vss_daemon.c
> @@ -158,10 +158,9 @@ main(int argc, char* argv[])
>
> struct pollfd hv_vss_poll_fd[1];
> uint32_t op;
> - int ch, r, len, error;
> + int ch, r, error;
> int hv_vss_dev_fd;
>
> - int freeze_thaw = UNDEF_FREEZE_THAW;
> while ((ch = getopt(argc, argv, "dnh")) != -1) {
> switch (ch) {
> case 'n':
> diff --git a/usr.sbin/hyperv/Makefile.inc b/usr.sbin/hyperv/tools/Makefile.inc
> similarity index 60%
> rename from usr.sbin/hyperv/Makefile.inc
> rename to usr.sbin/hyperv/tools/Makefile.inc
> index edb0129..7e09f32 100644
> --- a/usr.sbin/hyperv/Makefile.inc
> +++ b/usr.sbin/hyperv/tools/Makefile.inc
> @@ -1,4 +1,4 @@
> # $FreeBSD$
>
> CFLAGS.gcc+= -Wno-uninitialized
> -.include "../Makefile.inc"
> +.include "../../Makefile.inc"
Thank you for the patch! I will handle it today!
--
Tomorrow Will Never Die
More information about the svn-src-all
mailing list