summaryrefslogtreecommitdiff
path: root/tools/hv
AgeCommit message (Collapse)AuthorFilesLines
2012-09-11tools/hv: Parse /etc/os-releaseBen Hutchings1-4/+55
There is a new convention, used by systemd and supported by most distributions, to put basic OS release information in /etc/os-release. Added some additional error checking on strdup() Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11tools/hv: Check for read/write errorsBen Hutchings1-3/+19
hv_kvp_daemon currently does not check whether fread() or fwrite() succeed. Add the necessary checks. Also, remove the incorrect use of feof() before fread(). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11tools/hv: Fix exit() error codeBen Hutchings1-11/+11
Linux native exit codes are 8-bit unsigned values. exit(-1) results in an exit code of 255, which is usually reserved for shells reporting 'command not found'. Use the portable value EXIT_FAILURE. (Not that this matters much for a daemon.) Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11tools/hv: Fix file handle leakBen Hutchings1-1/+2
Match up each fopen() with an fclose(). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Implement the KVP verb - KVP_OP_GET_IP_INFOK. Y. Srinivasan1-3/+90
Now implement the KVP verb - KVP_OP_GET_IP_INFO. This operation retrieves IP information for the specified interface. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Rename the function kvp_get_ip_address()K. Y. Srinivasan1-3/+3
Rename the function kvp_get_ip_address() to better reflect the functionality being implemented. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Implement the KVP verb - KVP_OP_SET_IP_INFOK. Y. Srinivasan1-0/+443
Implement the KVP verb - KVP_OP_SET_IP_INFO. This operation configures the specified interface based on the given configuration. Since configuring an interface is very distro specific, we invoke an external (Distro specific) script to configure the interface. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Add an example script to configure an interfaceK. Y. Srinivasan1-0/+68
To keep the KVP daemon code free of distro specific details, we invoke an external script to configure the interface. This is an example script that was used to test the KVP code. This script has to be implemented in a Distro specific fashion. For instance on distros that ship with Network Manager enabled, this script can be based on NM APIs. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Gather DHCP informationK. Y. Srinivasan1-0/+31
Collect information on dhcp setting for the specified interface. We invoke an external (Distro specific) script to get this information. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11Tools: hv: Add an example script to retrieve dhcp stateK. Y. Srinivasan1-0/+28
To keep the KVP daemon code free of distro specific details, we invoke an external script to retrieve the DHCP state. This is an example script that was used to test the KVP code. This script has to be implemented in a Distro specific fashion. For instance on distros that ship with Network Manager enabled, this script can be based on NM APIs. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05Tools: hv: Gather DNS informationK. Y. Srinivasan1-0/+23
Now, gather DNS information. Invoke an external script (that can be distro dependent) to gather the DNS information. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05Tools: hv: Add an example script to retrieve DNS entriesK. Y. Srinivasan1-0/+13
To keep the KVP daemon code free of distro specific details, we invoke an external script to retrieve the DNS entries. This is an example script that was used to test the KVP code. This script has to be implemented in a Distro specific fashion. For instance on distros that ship with Network Manager enabled, this script can be based on NM APIs. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05Tools: hv: Correctly type string variablesK. Y. Srinivasan1-4/+4
Correctly type character strings. Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05Tools: hv: Get rid of some unused variablesK. Y. Srinivasan1-2/+1
Get rid of unused variables. Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Gather ipv[4,6] gateway informationK. Y. Srinivasan1-0/+68
Gather information on the default gateways - ipv4/ipv6. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Represent the ipv6 mask using CIDR notationK. Y. Srinivasan1-10/+36
Transform ipv6 subnet information to CIDR notation. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Gather subnet informationK. Y. Srinivasan1-2/+29
Now, gather sub-net information for the specified interface. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Gather address family informationK. Y. Srinivasan1-0/+11
Now, gather address family information for the specified interface. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Further refactor kvp_get_ip_address()K. Y. Srinivasan1-52/+42
In preparation for making kvp_get_ip_address() more generic, factor out the code for handling IP addresses. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Tools: hv: Prepare to expand kvp_get_ip_address() functionalityK. Y. Srinivasan1-45/+84
kvp_get_ip_address() implemented the functionality to retrieve IP address info. Make this function more generic so that we could retrieve additional per-interface information. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Drivers: hv: kvp: Cleanup error handling in KVPK. Y. Srinivasan1-33/+33
In preparation to implementing IP injection, cleanup the way we propagate and handle errors both in the driver as well as in the user level daemon. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17Drivers: hv: Add KVP definitions for IP address injectionK. Y. Srinivasan1-1/+1
Add the necessary definitions for supporting the IP injection functionality. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-09Tools: hv: verify origin of netlink connector messageOlaf Hering1-3/+7
The SuSE security team suggested to use recvfrom instead of recv to be certain that the connector message is originated from kernel. CVE-2012-2669 Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Marcus Meissner <meissner@suse.de> Signed-off-by: Sebastian Krahmer <krahmer@suse.de> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-17Tools: hv: Support enumeration from all the poolsK. Y. Srinivasan1-7/+117
We have only supported enumeration only from the AUTO pool. Now support enumeration from all the available pools. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-17Tools: hv: Fully support the new KVP verbs in the user level daemonK. Y. Srinivasan1-1/+280
Now fully support the new KVP messages in the user level daemon. Hyper-V defines multiple persistent pools to which the host can write/read/modify KVP tuples. In this patch we implement a file for each specified pool, where the KVP tuples will be stored in the guest. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-17Drivers: hv: Support the newly introduced KVP messages in the driverK. Y. Srinivasan1-0/+7
Support the newly defined KVP message types. It turns out that the host pushes a set of standard key value pairs as soon as the guest opens the KVP channel. Since we cannot handle these tuples until the user level daemon loads up, defer reading the KVP channel until the user level daemon is launched. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-14Drivers: hv: Add new message types to enhance KVPK. Y. Srinivasan1-1/+1
Add additional KVP (Key Value Pair) protocol messages to enhance KVP functionality for Linux guests on Hyper-V. As part of this, patch define an explicit version negoitiation message. Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09drivers: hv: kvp: Cleanup the kernel/user protocolK. Y. Srinivasan1-15/+15
Now, cleanup the user/kernel KVP protocol by using the same structure definition that is used for host/guest KVP protocol. This simplifies the code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09tools: hv: Use hyperv.h to get the KVP definitionsK. Y. Srinivasan1-27/+1
Now use hyperv.h to get the KVP defines in the KVP user-mode code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-03drivers: hv: kvp: Add/cleanup connector definesK. Y. Srinivasan1-4/+0
The current KVP code carries some private connector related defines. Update connector.h to have all the KVP defines. As part of this patch get rid of some unused defines. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-10-11Staging: hv: move hyperv code out of staging directoryGreg Kroah-Hartman1-0/+500
After many years wandering the desert, it is finally time for the Microsoft HyperV code to move out of the staging directory. Or at least the core hyperv bus code, and the utility driver, the rest still have some review to get through by the various subsystem maintainers. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>