25 Mar, 2015

2 commits


26 Jan, 2015

4 commits

  • We don't need to add additional '/' to smsg->path_name as snprintf("%s/%s")
    does the right thing. Without the patch we get doubled '//' in the log message.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • This patch addresses two types of compiler warnings:
    ... warning: unused variable .fd. [-Wunused-variable]
    and
    ... warning: format .%s. expects argument of type .char *., but argument 5 has type .__u16 *. [-Wformat=]

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • This patch addresses two types of compiler warnings:
    ... warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    and
    ... warning: pointer targets in passing argument N of .kvp_.... differ in signedness [-Wpointer-sign]

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • fwrite() does not actually return the number of bytes written and
    this value is being ignored anyway and ferror() is being called to
    check for an error. As we assign to this variable and never use it
    we get the following compile-time warning:
    hv_kvp_daemon.c:149:9: warning: variable .bytes_written. set but not used [-Wunused-but-set-variable]
    Remove bytes_written completely.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     

12 Jan, 2015

2 commits


27 Nov, 2014

3 commits

  • Under high memory pressure and very high KVP R/W test pressure, the netlink
    recvfrom() may transiently return ENOBUFS to the daemon -- we found this
    during a 2-week stress test.

    We'd better not terminate the daemon on the failure, because a typical KVP
    user will re-try the R/W and hopefully it will succeed next time.

    We can also ignore the errors on sending.

    Cc: K. Y. Srinivasan
    Signed-off-by: Dexuan Cui
    Reviewed-by: Vitaly Kuznetsov
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • Instead of making a list of exceptions for readonly filesystems
    in addition to iso9660 we already have it is better to skip freeze
    operation for all readonly-mounted filesystems.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Acked-by: Dexuan Cui
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • When ioctl(fd, FIFREEZE, 0) results in an error we cannot report it
    to syslog instantly since that can cause write to a frozen disk.
    However, the name of the filesystem which caused the error and errno
    are valuable and we would like to get a nice human-readable message
    in the log. Save errno before calling vss_operate(VSS_OP_THAW) and
    report the error right after.

    Unfortunately, FITHAW errors cannot be reported the same way as we
    need to finish thawing all filesystems before calling syslog().

    We should also avoid calling endmntent() for the second time in
    case we encountered an error during freezing of '/' as it usually
    results in SEGSEGV.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Acked-by: Dexuan Cui
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     

08 Nov, 2014

2 commits

  • All tools/hv daemons do mandatory daemon() on startup. However, no pidfile
    is created, this make it difficult for an init system to track such daemons.
    Modern linux distros use systemd as their init system. It can handle the
    daemonizing by itself, however, it requires a daemon to stay in foreground
    for that. Some distros already carry distro-specific patch for hv tools
    which switches off daemon().

    Introduce -n/--no-daemon option for all 3 daemons in hv/tools. Parse options
    with getopt() to make this part easily expandable.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Vitaly Kuznetsov
     
  • If a partition appears mounted more than once in /proc/mounts, vss_do_freeze()
    succeeds only for the first time and gets EBUSY (on freeze) or EINVAL (on
    thaw) for the second time. The patch ignores these to make the backup feature
    work.

    Also improved the error handling in case a freeze operation fails.

    Signed-off-by: Dexuan Cui
    Reviewed-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     

10 Jul, 2014

1 commit


17 Apr, 2014

1 commit


19 Feb, 2014

1 commit

  • Implement the file copy service for Linux guests on Hyper-V. This permits the
    host to copy a file (over VMBUS) into the guest. This facility is part of
    "guest integration services" supported on the Windows platform.
    Here is a link that provides additional details on this functionality:

    http://technet.microsoft.com/en-us/library/dn464282.aspx

    In V1 version of the patch I have addressed comments from
    Olaf Hering and Dan Carpenter

    In V2 version of this patch I did some minor cleanup (making some globals
    static). In V4 version of the patch I have addressed all of Olaf's
    most recent set of comments/concerns.

    In V5 version of the patch I had addressed Greg's most recent comments.
    I would like to thank Greg for suggesting that I use misc device; it has
    significantly simplified the code.

    In V6 version of the patch I have cleaned up error message based on Olaf's
    comments. I have also rebased the patch based on the current tip.

    In this version of the patch, I have addressed the latest comments from Greg.

    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     

16 Feb, 2014

2 commits


09 Dec, 2013

1 commit

  • With very old libc headers the inclusion of sys/types.h causes conflicts
    with linux/types.h. Since the latter is not required anyway, remove it
    from the source files. If any of the headers really needs linux/types.h
    it has to include it itself.

    Signed-off-by: Olaf Hering
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     

27 Sep, 2013

2 commits

  • send_buffer is used only once during registration. To reduce runtime
    memory usage reuse the recv_buffer for registration. Also use
    NLMSG_LENGTH instead of NLMSG_HDRLEN to take alignment into account.

    Signed-off-by: Olaf Hering
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     
  • kvp_daemon does some operations which take an unpredicable amount of
    time. In addition the kernel driver gives the kvp_daemon a 5 second
    timeout to respond to message from the host. If an operation such as
    getaddrinfo takes a long time and the timeout triggers then netlink
    errors occour. As a result of such errors the daemon just terminates and
    the service becomes unavailable.

    Idendifying and fixing these shortcomings in the kernel-userland
    communication protocol will be done in separate patches. This change
    fixes just one obvious timeout bug.

    Update kvp_get_domain_name to not return a value, better diagnostic for
    the consumer of the hostname string, remove trailing newline in error
    case, use snprintf to not overrun output buffer, get hostname only once
    and return the cached result.

    Signed-off-by: Olaf Hering
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     

13 Aug, 2013

2 commits

  • There is no need to have a nlmsghdr pointer to another temporary buffer.
    Instead use a full struct nlmsghdr.

    Signed-off-by: Olaf Hering
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     
  • netlink_send is supposed to send just the cn_msg+hv_kvp_msg via netlink.
    Currently it sets an incorrect iovec size, as reported by valgrind.

    In the case of registering with the kernel the allocated buffer is large
    enough to hold nlmsghdr+cn_msg+hv_kvp_msg, no overrun happens. In the
    case of responding to the kernel the cn_msg is located in the middle of
    recv_buffer, after the nlmsghdr. Currently the code in netlink_send adds
    also the size of nlmsghdr to the payload. But nlmsghdr is a separate
    iovec. This leads to an (harmless) out-of-bounds access when the kernel
    processes the iovec. Correct the iovec size of the cn_msg to be just
    cn_msg + its payload.

    Signed-off-by: Olaf Hering
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     

05 Aug, 2013

2 commits


02 Aug, 2013

2 commits

  • hv_kvp_daemon.c: In function 'main':
    hv_kvp_daemon.c:1441:8: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result [-Wunused-result]

    Signed-off-by: Olaf Hering
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     
  • hv_kvp_daemon fails to start in current openSuSE 13.1 snapshots because
    the kvp_send_buffer is too small to hold cn_msg+hv_kvp_msg, the very
    first sendmsg returns with EFAULT. In addition it fixes the Network info
    tab in Windows Server 2012R2 in SLES11.

    Adjust the code in kvp and vss daemon to allocate the needed buffers at
    runtime. To keep the code simple, the buffer_len includes also the
    nlmsghdr, although only the recv_buffer needs this extra space.

    Signed-off-by: Olaf Hering
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Olaf Hering
     

30 Jul, 2013

1 commit


27 Jul, 2013

3 commits


17 Jul, 2013

1 commit


18 Jun, 2013

1 commit


04 Jun, 2013

4 commits


25 Apr, 2013

3 commits