Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov :
> On Sun, Jan 19, 2014 at 03:37:24PM +0100, Bjarke Istrup Pedersen wrote:
>> > Oh, and some build infra so that they can be buildable from within the
>> > kernel tree.
>>
>> Indeed, but first lets get it building :-)
>
> Oh, I didn't mean you with that, rather the other readers on this
> thread. Unless you really want to do it - which is then cool. :-)

I have sent a patch adding the makefile for the hyperv tools :-)
It does not include any of there changes, so it does not replace the v2 patch.

/Bjarke

> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 03:37:24PM +0100, Bjarke Istrup Pedersen wrote:
> > Oh, and some build infra so that they can be buildable from within the
> > kernel tree.
> 
> Indeed, but first lets get it building :-)

Oh, I didn't mean you with that, rather the other readers on this
thread. Unless you really want to do it - which is then cool. :-)

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov :
> On Sun, Jan 19, 2014 at 12:57:11AM +0100, Bjarke Istrup Pedersen wrote:
>> To be able to build the kvp deamon, which has been broken since the
>> UAPI split a few versions ago.
>
> Right.
>
>> The tool located in tools/hv.
>
> Ah, I see.
>
> Those things there could use a Makefile, btw.
>
> $ gcc -Wall -o hv_kvp_daemon{,.c}
> hv_kvp_daemon.c:38:26: fatal error: linux/hyperv.h: No such file or directory
>  #include 
>   ^
> compilation terminated.

Yep, but applying the v2 patch, and then building the headers,
followed by copying hyperv.h from the output to /usr/include/linux
makes it build fine. :-)

> Oh, and some build infra so that they can be buildable from within the
> kernel tree.

Indeed, but first lets get it building :-)

/Bjarke

> Oh well...
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 12:57:11AM +0100, Bjarke Istrup Pedersen wrote:
> To be able to build the kvp deamon, which has been broken since the
> UAPI split a few versions ago.

Right.

> The tool located in tools/hv.

Ah, I see.

Those things there could use a Makefile, btw.

$ gcc -Wall -o hv_kvp_daemon{,.c}
hv_kvp_daemon.c:38:26: fatal error: linux/hyperv.h: No such file or directory
 #include 
  ^
compilation terminated.

Oh, and some build infra so that they can be buildable from within the
kernel tree.

Oh well...

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 KY Srinivasan :
>
>
>> -Original Message-
>> From: Bjarke Istrup Pedersen [mailto:gurlige...@gmail.com] On Behalf Of 
>> Bjarke
>> Istrup Pedersen
>> Sent: Saturday, January 18, 2014 12:48 PM
>> To: linux-kernel@vger.kernel.org
>> Cc: Haiyang Zhang; Hank Janssen; KY Srinivasan; Bjarke Istrup Pedersen
>> Subject: [PATCH] Adding hyperv.h to uapi headers
>>
>> This patch adds the hyperv.h header to the uapi folder, and adds it to the 
>> Kbuild
>> file.
>> Doing this enables compiling userspace Hyper-V tools using the installed 
>> headers.
>>
>
> Not all of the contents hyperv.h is needed for users-space programs.
>
> I would not ack this patch.

I agree, but is the v2 better?

/Bjarke

> K. Y
>> Signed-off-by: Bjarke Istrup Pedersen 
>> ---
>>  include/uapi/linux/Kbuild   |1 +
>>  include/uapi/linux/hyperv.h | 1469
>> +++
>>  2 files changed, 1470 insertions(+)
>>  create mode 100644 include/uapi/linux/hyperv.h
>>
>> diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
>> index 33d2b8f..6389736 100644
>> --- a/include/uapi/linux/Kbuild
>> +++ b/include/uapi/linux/Kbuild
>> @@ -139,6 +139,7 @@ header-y += hid.h
>>  header-y += hiddev.h
>>  header-y += hidraw.h
>>  header-y += hpet.h
>> +header-y += hyperv.h
>>  header-y += hysdn_if.h
>>  header-y += i2c-dev.h
>>  header-y += i2c.h
>> diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
>> new file mode 100644
>> index 000..15da677
>> --- /dev/null
>> +++ b/include/uapi/linux/hyperv.h
>> @@ -0,0 +1,1469 @@
>> +/*
>> + *
>> + * Copyright (c) 2011, Microsoft Corporation.
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms and conditions of the GNU General Public License,
>> + * version 2, as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>> for
>> + * more details.
>> + *
>> + * You should have received a copy of the GNU General Public License along
>> with
>> + * this program; if not, write to the Free Software Foundation, Inc., 59 
>> Temple
>> + * Place - Suite 330, Boston, MA 02111-1307 USA.
>> + *
>> + * Authors:
>> + *   Haiyang Zhang 
>> + *   Hank Janssen  
>> + *   K. Y. Srinivasan 
>> + *
>> + */
>> +
>> +#ifndef _HYPERV_H
>> +#define _HYPERV_H
>> +
>> +#include 
>> +
>> +/*
>> + * Framework version for util services.
>> + */
>> +#define UTIL_FW_MINOR  0
>> +
>> +#define UTIL_WS2K8_FW_MAJOR  1
>> +#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 |
>> UTIL_FW_MINOR)
>> +
>> +#define UTIL_FW_MAJOR  3
>> +#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
>> +
>> +
>> +/*
>> + * Implementation of host controlled snapshot of the guest.
>> + */
>> +
>> +#define VSS_OP_REGISTER 128
>> +
>> +enum hv_vss_op {
>> + VSS_OP_CREATE = 0,
>> + VSS_OP_DELETE,
>> + VSS_OP_HOT_BACKUP,
>> + VSS_OP_GET_DM_INFO,
>> + VSS_OP_BU_COMPLETE,
>> + /*
>> +  * Following operations are only supported with IC version >= 5.0
>> +  */
>> + VSS_OP_FREEZE, /* Freeze the file systems in the VM */
>> + VSS_OP_THAW, /* Unfreeze the file systems */
>> + VSS_OP_AUTO_RECOVER,
>> + VSS_OP_COUNT /* Number of operations, must be last */
>> +};
>> +
>> +
>> +/*
>> + * Header for all VSS messages.
>> + */
>> +struct hv_vss_hdr {
>> + __u8 operation;
>> + __u8 reserved[7];
>> +} __attribute__((packed));
>> +
>> +
>> +/*
>> + * Flag values for the hv_vss_check_feature. Linux supports only
>> + * one value.
>> + */
>> +#define VSS_HBU_NO_AUTO_RECOVERY 0x0005
>> +
>> +struct hv_vss_check_feature {
>> + __u32 flags;
>> +} __attribute__((packed));
>> +
>> +struct hv_vss_check_dm_info {
>> + __u32 flags;
>> +} __attribute__((packed));
>> +
>> +struct hv_vss_msg {
>> + union {
>> + struct hv_vss_hdr vss_hdr;
>> + int error;
>> + };
>> + union {
>> + struct hv_vss_check_feature vss_cf;
>> + struct hv_vss_check_dm_info dm_info;
>> + };
>> +} __attribute__((packed));
>> +
>> +/*
>> + * An implementation of HyperV key value pair (KVP) functionality for Linux.
>> + *
>> + *
>> + * Copyright (C) 2010, Novell, Inc.
>> + * Author : K. Y. Srinivasan 
>> + *
>> + */
>> +
>> +/*
>> + * Maximum value size - used for both key names and value data, and includes
>> + * any applicable NULL terminators.
>> + *
>> + * Note:  This limit is somewhat arbitrary, but falls easily within what is
>> + * supported for all native guests (back to Win 2000) and what is reasonable
>> + * for the IC KVP exchange functionality.  Note that Windows Me/98/95 are
>> + * limited to 255 character key names.
>> + *
>> + * MSDN recommends not storing data values larger than 2048 bytes in the
>> + * 

Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 KY Srinivasan k...@microsoft.com:


 -Original Message-
 From: Bjarke Istrup Pedersen [mailto:gurlige...@gmail.com] On Behalf Of 
 Bjarke
 Istrup Pedersen
 Sent: Saturday, January 18, 2014 12:48 PM
 To: linux-kernel@vger.kernel.org
 Cc: Haiyang Zhang; Hank Janssen; KY Srinivasan; Bjarke Istrup Pedersen
 Subject: [PATCH] Adding hyperv.h to uapi headers

 This patch adds the hyperv.h header to the uapi folder, and adds it to the 
 Kbuild
 file.
 Doing this enables compiling userspace Hyper-V tools using the installed 
 headers.


 Not all of the contents hyperv.h is needed for users-space programs.

 I would not ack this patch.

I agree, but is the v2 better?

/Bjarke

 K. Y
 Signed-off-by: Bjarke Istrup Pedersen gurlige...@gentoo.org
 ---
  include/uapi/linux/Kbuild   |1 +
  include/uapi/linux/hyperv.h | 1469
 +++
  2 files changed, 1470 insertions(+)
  create mode 100644 include/uapi/linux/hyperv.h

 diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
 index 33d2b8f..6389736 100644
 --- a/include/uapi/linux/Kbuild
 +++ b/include/uapi/linux/Kbuild
 @@ -139,6 +139,7 @@ header-y += hid.h
  header-y += hiddev.h
  header-y += hidraw.h
  header-y += hpet.h
 +header-y += hyperv.h
  header-y += hysdn_if.h
  header-y += i2c-dev.h
  header-y += i2c.h
 diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
 new file mode 100644
 index 000..15da677
 --- /dev/null
 +++ b/include/uapi/linux/hyperv.h
 @@ -0,0 +1,1469 @@
 +/*
 + *
 + * Copyright (c) 2011, Microsoft Corporation.
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
 + * version 2, as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope it will be useful, but WITHOUT
 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for
 + * more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 with
 + * this program; if not, write to the Free Software Foundation, Inc., 59 
 Temple
 + * Place - Suite 330, Boston, MA 02111-1307 USA.
 + *
 + * Authors:
 + *   Haiyang Zhang haiya...@microsoft.com
 + *   Hank Janssen  hjans...@microsoft.com
 + *   K. Y. Srinivasan k...@microsoft.com
 + *
 + */
 +
 +#ifndef _HYPERV_H
 +#define _HYPERV_H
 +
 +#include linux/types.h
 +
 +/*
 + * Framework version for util services.
 + */
 +#define UTIL_FW_MINOR  0
 +
 +#define UTIL_WS2K8_FW_MAJOR  1
 +#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR  16 |
 UTIL_FW_MINOR)
 +
 +#define UTIL_FW_MAJOR  3
 +#define UTIL_FW_VERSION (UTIL_FW_MAJOR  16 | UTIL_FW_MINOR)
 +
 +
 +/*
 + * Implementation of host controlled snapshot of the guest.
 + */
 +
 +#define VSS_OP_REGISTER 128
 +
 +enum hv_vss_op {
 + VSS_OP_CREATE = 0,
 + VSS_OP_DELETE,
 + VSS_OP_HOT_BACKUP,
 + VSS_OP_GET_DM_INFO,
 + VSS_OP_BU_COMPLETE,
 + /*
 +  * Following operations are only supported with IC version = 5.0
 +  */
 + VSS_OP_FREEZE, /* Freeze the file systems in the VM */
 + VSS_OP_THAW, /* Unfreeze the file systems */
 + VSS_OP_AUTO_RECOVER,
 + VSS_OP_COUNT /* Number of operations, must be last */
 +};
 +
 +
 +/*
 + * Header for all VSS messages.
 + */
 +struct hv_vss_hdr {
 + __u8 operation;
 + __u8 reserved[7];
 +} __attribute__((packed));
 +
 +
 +/*
 + * Flag values for the hv_vss_check_feature. Linux supports only
 + * one value.
 + */
 +#define VSS_HBU_NO_AUTO_RECOVERY 0x0005
 +
 +struct hv_vss_check_feature {
 + __u32 flags;
 +} __attribute__((packed));
 +
 +struct hv_vss_check_dm_info {
 + __u32 flags;
 +} __attribute__((packed));
 +
 +struct hv_vss_msg {
 + union {
 + struct hv_vss_hdr vss_hdr;
 + int error;
 + };
 + union {
 + struct hv_vss_check_feature vss_cf;
 + struct hv_vss_check_dm_info dm_info;
 + };
 +} __attribute__((packed));
 +
 +/*
 + * An implementation of HyperV key value pair (KVP) functionality for Linux.
 + *
 + *
 + * Copyright (C) 2010, Novell, Inc.
 + * Author : K. Y. Srinivasan ksriniva...@novell.com
 + *
 + */
 +
 +/*
 + * Maximum value size - used for both key names and value data, and includes
 + * any applicable NULL terminators.
 + *
 + * Note:  This limit is somewhat arbitrary, but falls easily within what is
 + * supported for all native guests (back to Win 2000) and what is reasonable
 + * for the IC KVP exchange functionality.  Note that Windows Me/98/95 are
 + * limited to 255 character key names.
 + *
 + * MSDN recommends not storing data values larger than 2048 bytes in the
 + * registry.
 + *
 + * Note:  This value is used in defining the KVP exchange message - this 
 value
 + * cannot be modified without affecting the message size and compatibility.
 + */
 +
 +/*
 + * 

Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 12:57:11AM +0100, Bjarke Istrup Pedersen wrote:
 To be able to build the kvp deamon, which has been broken since the
 UAPI split a few versions ago.

Right.

 The tool located in tools/hv.

Ah, I see.

Those things there could use a Makefile, btw.

$ gcc -Wall -o hv_kvp_daemon{,.c}
hv_kvp_daemon.c:38:26: fatal error: linux/hyperv.h: No such file or directory
 #include linux/hyperv.h
  ^
compilation terminated.

Oh, and some build infra so that they can be buildable from within the
kernel tree.

Oh well...

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov b...@alien8.de:
 On Sun, Jan 19, 2014 at 12:57:11AM +0100, Bjarke Istrup Pedersen wrote:
 To be able to build the kvp deamon, which has been broken since the
 UAPI split a few versions ago.

 Right.

 The tool located in tools/hv.

 Ah, I see.

 Those things there could use a Makefile, btw.

 $ gcc -Wall -o hv_kvp_daemon{,.c}
 hv_kvp_daemon.c:38:26: fatal error: linux/hyperv.h: No such file or directory
  #include linux/hyperv.h
   ^
 compilation terminated.

Yep, but applying the v2 patch, and then building the headers,
followed by copying hyperv.h from the output to /usr/include/linux
makes it build fine. :-)

 Oh, and some build infra so that they can be buildable from within the
 kernel tree.

Indeed, but first lets get it building :-)

/Bjarke

 Oh well...

 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 03:37:24PM +0100, Bjarke Istrup Pedersen wrote:
  Oh, and some build infra so that they can be buildable from within the
  kernel tree.
 
 Indeed, but first lets get it building :-)

Oh, I didn't mean you with that, rather the other readers on this
thread. Unless you really want to do it - which is then cool. :-)

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-19 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov b...@alien8.de:
 On Sun, Jan 19, 2014 at 03:37:24PM +0100, Bjarke Istrup Pedersen wrote:
  Oh, and some build infra so that they can be buildable from within the
  kernel tree.

 Indeed, but first lets get it building :-)

 Oh, I didn't mean you with that, rather the other readers on this
 thread. Unless you really want to do it - which is then cool. :-)

I have sent a patch adding the makefile for the hyperv tools :-)
It does not include any of there changes, so it does not replace the v2 patch.

/Bjarke

 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread KY Srinivasan


> -Original Message-
> From: Bjarke Istrup Pedersen [mailto:gurlige...@gmail.com] On Behalf Of Bjarke
> Istrup Pedersen
> Sent: Saturday, January 18, 2014 12:48 PM
> To: linux-kernel@vger.kernel.org
> Cc: Haiyang Zhang; Hank Janssen; KY Srinivasan; Bjarke Istrup Pedersen
> Subject: [PATCH] Adding hyperv.h to uapi headers
> 
> This patch adds the hyperv.h header to the uapi folder, and adds it to the 
> Kbuild
> file.
> Doing this enables compiling userspace Hyper-V tools using the installed 
> headers.
> 

Not all of the contents hyperv.h is needed for users-space programs.

I would not ack this patch.

K. Y
> Signed-off-by: Bjarke Istrup Pedersen 
> ---
>  include/uapi/linux/Kbuild   |1 +
>  include/uapi/linux/hyperv.h | 1469
> +++
>  2 files changed, 1470 insertions(+)
>  create mode 100644 include/uapi/linux/hyperv.h
> 
> diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
> index 33d2b8f..6389736 100644
> --- a/include/uapi/linux/Kbuild
> +++ b/include/uapi/linux/Kbuild
> @@ -139,6 +139,7 @@ header-y += hid.h
>  header-y += hiddev.h
>  header-y += hidraw.h
>  header-y += hpet.h
> +header-y += hyperv.h
>  header-y += hysdn_if.h
>  header-y += i2c-dev.h
>  header-y += i2c.h
> diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
> new file mode 100644
> index 000..15da677
> --- /dev/null
> +++ b/include/uapi/linux/hyperv.h
> @@ -0,0 +1,1469 @@
> +/*
> + *
> + * Copyright (c) 2011, Microsoft Corporation.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
> for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> with
> + * this program; if not, write to the Free Software Foundation, Inc., 59 
> Temple
> + * Place - Suite 330, Boston, MA 02111-1307 USA.
> + *
> + * Authors:
> + *   Haiyang Zhang 
> + *   Hank Janssen  
> + *   K. Y. Srinivasan 
> + *
> + */
> +
> +#ifndef _HYPERV_H
> +#define _HYPERV_H
> +
> +#include 
> +
> +/*
> + * Framework version for util services.
> + */
> +#define UTIL_FW_MINOR  0
> +
> +#define UTIL_WS2K8_FW_MAJOR  1
> +#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 |
> UTIL_FW_MINOR)
> +
> +#define UTIL_FW_MAJOR  3
> +#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
> +
> +
> +/*
> + * Implementation of host controlled snapshot of the guest.
> + */
> +
> +#define VSS_OP_REGISTER 128
> +
> +enum hv_vss_op {
> + VSS_OP_CREATE = 0,
> + VSS_OP_DELETE,
> + VSS_OP_HOT_BACKUP,
> + VSS_OP_GET_DM_INFO,
> + VSS_OP_BU_COMPLETE,
> + /*
> +  * Following operations are only supported with IC version >= 5.0
> +  */
> + VSS_OP_FREEZE, /* Freeze the file systems in the VM */
> + VSS_OP_THAW, /* Unfreeze the file systems */
> + VSS_OP_AUTO_RECOVER,
> + VSS_OP_COUNT /* Number of operations, must be last */
> +};
> +
> +
> +/*
> + * Header for all VSS messages.
> + */
> +struct hv_vss_hdr {
> + __u8 operation;
> + __u8 reserved[7];
> +} __attribute__((packed));
> +
> +
> +/*
> + * Flag values for the hv_vss_check_feature. Linux supports only
> + * one value.
> + */
> +#define VSS_HBU_NO_AUTO_RECOVERY 0x0005
> +
> +struct hv_vss_check_feature {
> + __u32 flags;
> +} __attribute__((packed));
> +
> +struct hv_vss_check_dm_info {
> + __u32 flags;
> +} __attribute__((packed));
> +
> +struct hv_vss_msg {
> + union {
> + struct hv_vss_hdr vss_hdr;
> + int error;
> + };
> + union {
> + struct hv_vss_check_feature vss_cf;
> + struct hv_vss_check_dm_info dm_info;
> + };
> +} __attribute__((packed));
> +
> +/*
> + * An implementation of HyperV key value pair (KVP) functionality for Linux.
> + *
> + *
> + * Copyright (C) 2010, Novell, Inc.
> + * Author : K. Y. Srinivasan 
> + *
> + */
> +
> +/*
> + * Maximum value size - used for both key names and value data, and includes
> + * any applicable NULL terminators.
> + *
> + * Note:  This limit is somewhat arbitrary, but falls easily within what is
> + * supported for all native guests (back to Win 2000) and what is reasonable
> + * for the IC KVP exchange functionality.  Note that Windows Me/98/95 are
> + * limited to 255 character key names.
> + *
> + * MSDN recommends not storing data values larger than 2048 bytes in the
> + * registry.
> + *
> + * Note:  This value is used in defining the KVP exchange message - this 
> value
> + * cannot be modified without affecting the message size and compatibility.
> + */
> +
> +/*
> + * bytes, including any null 

Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov :
> On Sun, Jan 19, 2014 at 12:24:10AM +0100, Bjarke Istrup Pedersen wrote:
>> I have submitted a v2 patch - does it look better?
>
> If you mean this:
>
>  include/linux/hyperv.h  | 321 +
>  include/uapi/linux/Kbuild   |   1 +
>  include/uapi/linux/hyperv.h | 344 
> 
>  3 files changed, 347 insertions(+), 319 deletions(-)
>  create mode 100644 include/uapi/linux/hyperv.h
>
> you've got the rough idea of uapi headers :-).

Yep, that one, thanks :-)

> Whether that makes sense at all in the hyperv case, you'll have to wait
> for the hyperv guys to say something.
>
> What makes me wonder is why do you need to export this now?

To be able to build the kvp deamon, which has been broken since the
UAPI split a few versions ago.

> Because if those userspace hyperv tools would really need the
> definitions in that header, then they never did build before. Which
> would be really stupid. Btw, which userspace hyperv tools do you mean?
> Where are they?

The tool located in tools/hv.
For some reason, this was never fixed, but now my machines started
complaining in dmesg that the kvp deamon should be updated, so I took
a look at it.

/Bjarke

> What am I missing?
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 12:24:10AM +0100, Bjarke Istrup Pedersen wrote:
> I have submitted a v2 patch - does it look better?

If you mean this:

 include/linux/hyperv.h  | 321 +
 include/uapi/linux/Kbuild   |   1 +
 include/uapi/linux/hyperv.h | 344 
 3 files changed, 347 insertions(+), 319 deletions(-)
 create mode 100644 include/uapi/linux/hyperv.h

you've got the rough idea of uapi headers :-).

Whether that makes sense at all in the hyperv case, you'll have to wait
for the hyperv guys to say something.

What makes me wonder is why do you need to export this now?

Because if those userspace hyperv tools would really need the
definitions in that header, then they never did build before. Which
would be really stupid. Btw, which userspace hyperv tools do you mean?
Where are they?

What am I missing?

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov :
> On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
>> I should take all the parts the is not guarded by __KERNEL__, and move
>> them to a uapi header, and then include it at the top of the normal
>> header. Correct understood? :)
>
> Yes, that's basically the approach but be conservative - export only
> stuff which *really* is needed by userspace. And hyperv people should
> sanity-check what you're exporting because once it is out, it is cast in
> stone and there's no changing.

I have submitted a v2 patch - does it look better?

Thanks :)

/Bjarke

> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov :
> On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
>> I should take all the parts the is not guarded by __KERNEL__, and move
>> them to a uapi header, and then include it at the top of the normal
>> header. Correct understood? :)
>
> Yes, that's basically the approach but be conservative - export only
> stuff which *really* is needed by userspace. And hyperv people should
> sanity-check what you're exporting because once it is out, it is cast in
> stone and there's no changing.
>
Okay - I'll take a look at it, and post a v2 patch in a moment.
>From what I can see, it looks like the userspace parts are all logical
to have exported (quite a few of them are using by the kvp tool, and
the rest makes sense AFAICS).

/Bjarke
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
> I should take all the parts the is not guarded by __KERNEL__, and move
> them to a uapi header, and then include it at the top of the normal
> header. Correct understood? :)

Yes, that's basically the approach but be conservative - export only
stuff which *really* is needed by userspace. And hyperv people should
sanity-check what you're exporting because once it is out, it is cast in
stone and there's no changing.

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov :
> On Sat, Jan 18, 2014 at 11:07:10PM +0100, Bjarke Istrup Pedersen wrote:
>> I have been thinking about other solutions, but so far, I haven't been
>> able to find one that solves it, so the tools build. (An option might
>> be to strip it from the __KERNEL__ part, to make it smaller, but I
>> don't know what difference that would make :-)
>
> The fix is to move the userspace stuff into the uapi header and include
> that header in the kernel header.
>
> See include/linux/sched.h and many others for an example.
>
Okay, so let me see if I get this right.

I should take all the parts the is not guarded by __KERNEL__, and move
them to a uapi header, and then include it at the top of the normal
header.
Correct understood? :)

/Bjarke
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sat, Jan 18, 2014 at 11:07:10PM +0100, Bjarke Istrup Pedersen wrote:
> I have been thinking about other solutions, but so far, I haven't been
> able to find one that solves it, so the tools build. (An option might
> be to strip it from the __KERNEL__ part, to make it smaller, but I
> don't know what difference that would make :-)

The fix is to move the userspace stuff into the uapi header and include
that header in the kernel header.

See include/linux/sched.h and many others for an example.

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Paul Bolle 
>
> Bjarke Istrup Pedersen schreef op za 18-01-2014 om 20:48 [+]:
> > This patch adds the hyperv.h header to the uapi folder, and adds it to the 
> > Kbuild file.
> > Doing this enables compiling userspace Hyper-V tools using the installed 
> > headers.
> >
> > Signed-off-by: Bjarke Istrup Pedersen 
> > ---
> >  include/uapi/linux/Kbuild   |1 +
> >  include/uapi/linux/hyperv.h | 1469 
> > +++
> >  2 files changed, 1470 insertions(+)
> >  create mode 100644 include/uapi/linux/hyperv.h
>
> Now we have two identical files: include/linux/hyperv.h and
> include/uapi/linux/hyperv.h. That seems sub-optimal at best.
>
(Resending, since gmail seems to default to html mails...)

I agree, but it fixes the problem.

I have been thinking about other solutions, but so far, I haven't been
able to find one that solves it, so the tools build. (An option might
be to strip it from the __KERNEL__ part, to make it smaller, but I
don't know what difference that would make :-)

/Bjarke
>
> Paul Bolle
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Paul Bolle
Bjarke Istrup Pedersen schreef op za 18-01-2014 om 20:48 [+]:
> This patch adds the hyperv.h header to the uapi folder, and adds it to the 
> Kbuild file.
> Doing this enables compiling userspace Hyper-V tools using the installed 
> headers.
> 
> Signed-off-by: Bjarke Istrup Pedersen 
> ---
>  include/uapi/linux/Kbuild   |1 +
>  include/uapi/linux/hyperv.h | 1469 
> +++
>  2 files changed, 1470 insertions(+)
>  create mode 100644 include/uapi/linux/hyperv.h

Now we have two identical files: include/linux/hyperv.h and
include/uapi/linux/hyperv.h. That seems sub-optimal at best.


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Paul Bolle
Bjarke Istrup Pedersen schreef op za 18-01-2014 om 20:48 [+]:
 This patch adds the hyperv.h header to the uapi folder, and adds it to the 
 Kbuild file.
 Doing this enables compiling userspace Hyper-V tools using the installed 
 headers.
 
 Signed-off-by: Bjarke Istrup Pedersen gurlige...@gentoo.org
 ---
  include/uapi/linux/Kbuild   |1 +
  include/uapi/linux/hyperv.h | 1469 
 +++
  2 files changed, 1470 insertions(+)
  create mode 100644 include/uapi/linux/hyperv.h

Now we have two identical files: include/linux/hyperv.h and
include/uapi/linux/hyperv.h. That seems sub-optimal at best.


Paul Bolle

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Paul Bolle pebo...@tiscali.nl

 Bjarke Istrup Pedersen schreef op za 18-01-2014 om 20:48 [+]:
  This patch adds the hyperv.h header to the uapi folder, and adds it to the 
  Kbuild file.
  Doing this enables compiling userspace Hyper-V tools using the installed 
  headers.
 
  Signed-off-by: Bjarke Istrup Pedersen gurlige...@gentoo.org
  ---
   include/uapi/linux/Kbuild   |1 +
   include/uapi/linux/hyperv.h | 1469 
  +++
   2 files changed, 1470 insertions(+)
   create mode 100644 include/uapi/linux/hyperv.h

 Now we have two identical files: include/linux/hyperv.h and
 include/uapi/linux/hyperv.h. That seems sub-optimal at best.

(Resending, since gmail seems to default to html mails...)

I agree, but it fixes the problem.

I have been thinking about other solutions, but so far, I haven't been
able to find one that solves it, so the tools build. (An option might
be to strip it from the __KERNEL__ part, to make it smaller, but I
don't know what difference that would make :-)

/Bjarke

 Paul Bolle

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sat, Jan 18, 2014 at 11:07:10PM +0100, Bjarke Istrup Pedersen wrote:
 I have been thinking about other solutions, but so far, I haven't been
 able to find one that solves it, so the tools build. (An option might
 be to strip it from the __KERNEL__ part, to make it smaller, but I
 don't know what difference that would make :-)

The fix is to move the userspace stuff into the uapi header and include
that header in the kernel header.

See include/linux/sched.h and many others for an example.

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov b...@alien8.de:
 On Sat, Jan 18, 2014 at 11:07:10PM +0100, Bjarke Istrup Pedersen wrote:
 I have been thinking about other solutions, but so far, I haven't been
 able to find one that solves it, so the tools build. (An option might
 be to strip it from the __KERNEL__ part, to make it smaller, but I
 don't know what difference that would make :-)

 The fix is to move the userspace stuff into the uapi header and include
 that header in the kernel header.

 See include/linux/sched.h and many others for an example.

Okay, so let me see if I get this right.

I should take all the parts the is not guarded by __KERNEL__, and move
them to a uapi header, and then include it at the top of the normal
header.
Correct understood? :)

/Bjarke
 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
 I should take all the parts the is not guarded by __KERNEL__, and move
 them to a uapi header, and then include it at the top of the normal
 header. Correct understood? :)

Yes, that's basically the approach but be conservative - export only
stuff which *really* is needed by userspace. And hyperv people should
sanity-check what you're exporting because once it is out, it is cast in
stone and there's no changing.

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov b...@alien8.de:
 On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
 I should take all the parts the is not guarded by __KERNEL__, and move
 them to a uapi header, and then include it at the top of the normal
 header. Correct understood? :)

 Yes, that's basically the approach but be conservative - export only
 stuff which *really* is needed by userspace. And hyperv people should
 sanity-check what you're exporting because once it is out, it is cast in
 stone and there's no changing.

Okay - I'll take a look at it, and post a v2 patch in a moment.
From what I can see, it looks like the userspace parts are all logical
to have exported (quite a few of them are using by the kvp tool, and
the rest makes sense AFAICS).

/Bjarke

 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/18 Borislav Petkov b...@alien8.de:
 On Sat, Jan 18, 2014 at 11:24:53PM +0100, Bjarke Istrup Pedersen wrote:
 I should take all the parts the is not guarded by __KERNEL__, and move
 them to a uapi header, and then include it at the top of the normal
 header. Correct understood? :)

 Yes, that's basically the approach but be conservative - export only
 stuff which *really* is needed by userspace. And hyperv people should
 sanity-check what you're exporting because once it is out, it is cast in
 stone and there's no changing.

I have submitted a v2 patch - does it look better?

Thanks :)

/Bjarke

 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Borislav Petkov
On Sun, Jan 19, 2014 at 12:24:10AM +0100, Bjarke Istrup Pedersen wrote:
 I have submitted a v2 patch - does it look better?

If you mean this:

 include/linux/hyperv.h  | 321 +
 include/uapi/linux/Kbuild   |   1 +
 include/uapi/linux/hyperv.h | 344 
 3 files changed, 347 insertions(+), 319 deletions(-)
 create mode 100644 include/uapi/linux/hyperv.h

you've got the rough idea of uapi headers :-).

Whether that makes sense at all in the hyperv case, you'll have to wait
for the hyperv guys to say something.

What makes me wonder is why do you need to export this now?

Because if those userspace hyperv tools would really need the
definitions in that header, then they never did build before. Which
would be really stupid. Btw, which userspace hyperv tools do you mean?
Where are they?

What am I missing?

-- 
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread Bjarke Istrup Pedersen
2014/1/19 Borislav Petkov b...@alien8.de:
 On Sun, Jan 19, 2014 at 12:24:10AM +0100, Bjarke Istrup Pedersen wrote:
 I have submitted a v2 patch - does it look better?

 If you mean this:

  include/linux/hyperv.h  | 321 +
  include/uapi/linux/Kbuild   |   1 +
  include/uapi/linux/hyperv.h | 344 
 
  3 files changed, 347 insertions(+), 319 deletions(-)
  create mode 100644 include/uapi/linux/hyperv.h

 you've got the rough idea of uapi headers :-).

Yep, that one, thanks :-)

 Whether that makes sense at all in the hyperv case, you'll have to wait
 for the hyperv guys to say something.

 What makes me wonder is why do you need to export this now?

To be able to build the kvp deamon, which has been broken since the
UAPI split a few versions ago.

 Because if those userspace hyperv tools would really need the
 definitions in that header, then they never did build before. Which
 would be really stupid. Btw, which userspace hyperv tools do you mean?
 Where are they?

The tool located in tools/hv.
For some reason, this was never fixed, but now my machines started
complaining in dmesg that the kvp deamon should be updated, so I took
a look at it.

/Bjarke

 What am I missing?

 --
 Regards/Gruss,
 Boris.

 Sent from a fat crate under my desk. Formatting is fine.
 --
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Adding hyperv.h to uapi headers

2014-01-18 Thread KY Srinivasan


 -Original Message-
 From: Bjarke Istrup Pedersen [mailto:gurlige...@gmail.com] On Behalf Of Bjarke
 Istrup Pedersen
 Sent: Saturday, January 18, 2014 12:48 PM
 To: linux-kernel@vger.kernel.org
 Cc: Haiyang Zhang; Hank Janssen; KY Srinivasan; Bjarke Istrup Pedersen
 Subject: [PATCH] Adding hyperv.h to uapi headers
 
 This patch adds the hyperv.h header to the uapi folder, and adds it to the 
 Kbuild
 file.
 Doing this enables compiling userspace Hyper-V tools using the installed 
 headers.
 

Not all of the contents hyperv.h is needed for users-space programs.

I would not ack this patch.

K. Y
 Signed-off-by: Bjarke Istrup Pedersen gurlige...@gentoo.org
 ---
  include/uapi/linux/Kbuild   |1 +
  include/uapi/linux/hyperv.h | 1469
 +++
  2 files changed, 1470 insertions(+)
  create mode 100644 include/uapi/linux/hyperv.h
 
 diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
 index 33d2b8f..6389736 100644
 --- a/include/uapi/linux/Kbuild
 +++ b/include/uapi/linux/Kbuild
 @@ -139,6 +139,7 @@ header-y += hid.h
  header-y += hiddev.h
  header-y += hidraw.h
  header-y += hpet.h
 +header-y += hyperv.h
  header-y += hysdn_if.h
  header-y += i2c-dev.h
  header-y += i2c.h
 diff --git a/include/uapi/linux/hyperv.h b/include/uapi/linux/hyperv.h
 new file mode 100644
 index 000..15da677
 --- /dev/null
 +++ b/include/uapi/linux/hyperv.h
 @@ -0,0 +1,1469 @@
 +/*
 + *
 + * Copyright (c) 2011, Microsoft Corporation.
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
 + * version 2, as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope it will be useful, but WITHOUT
 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for
 + * more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 with
 + * this program; if not, write to the Free Software Foundation, Inc., 59 
 Temple
 + * Place - Suite 330, Boston, MA 02111-1307 USA.
 + *
 + * Authors:
 + *   Haiyang Zhang haiya...@microsoft.com
 + *   Hank Janssen  hjans...@microsoft.com
 + *   K. Y. Srinivasan k...@microsoft.com
 + *
 + */
 +
 +#ifndef _HYPERV_H
 +#define _HYPERV_H
 +
 +#include linux/types.h
 +
 +/*
 + * Framework version for util services.
 + */
 +#define UTIL_FW_MINOR  0
 +
 +#define UTIL_WS2K8_FW_MAJOR  1
 +#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR  16 |
 UTIL_FW_MINOR)
 +
 +#define UTIL_FW_MAJOR  3
 +#define UTIL_FW_VERSION (UTIL_FW_MAJOR  16 | UTIL_FW_MINOR)
 +
 +
 +/*
 + * Implementation of host controlled snapshot of the guest.
 + */
 +
 +#define VSS_OP_REGISTER 128
 +
 +enum hv_vss_op {
 + VSS_OP_CREATE = 0,
 + VSS_OP_DELETE,
 + VSS_OP_HOT_BACKUP,
 + VSS_OP_GET_DM_INFO,
 + VSS_OP_BU_COMPLETE,
 + /*
 +  * Following operations are only supported with IC version = 5.0
 +  */
 + VSS_OP_FREEZE, /* Freeze the file systems in the VM */
 + VSS_OP_THAW, /* Unfreeze the file systems */
 + VSS_OP_AUTO_RECOVER,
 + VSS_OP_COUNT /* Number of operations, must be last */
 +};
 +
 +
 +/*
 + * Header for all VSS messages.
 + */
 +struct hv_vss_hdr {
 + __u8 operation;
 + __u8 reserved[7];
 +} __attribute__((packed));
 +
 +
 +/*
 + * Flag values for the hv_vss_check_feature. Linux supports only
 + * one value.
 + */
 +#define VSS_HBU_NO_AUTO_RECOVERY 0x0005
 +
 +struct hv_vss_check_feature {
 + __u32 flags;
 +} __attribute__((packed));
 +
 +struct hv_vss_check_dm_info {
 + __u32 flags;
 +} __attribute__((packed));
 +
 +struct hv_vss_msg {
 + union {
 + struct hv_vss_hdr vss_hdr;
 + int error;
 + };
 + union {
 + struct hv_vss_check_feature vss_cf;
 + struct hv_vss_check_dm_info dm_info;
 + };
 +} __attribute__((packed));
 +
 +/*
 + * An implementation of HyperV key value pair (KVP) functionality for Linux.
 + *
 + *
 + * Copyright (C) 2010, Novell, Inc.
 + * Author : K. Y. Srinivasan ksriniva...@novell.com
 + *
 + */
 +
 +/*
 + * Maximum value size - used for both key names and value data, and includes
 + * any applicable NULL terminators.
 + *
 + * Note:  This limit is somewhat arbitrary, but falls easily within what is
 + * supported for all native guests (back to Win 2000) and what is reasonable
 + * for the IC KVP exchange functionality.  Note that Windows Me/98/95 are
 + * limited to 255 character key names.
 + *
 + * MSDN recommends not storing data values larger than 2048 bytes in the
 + * registry.
 + *
 + * Note:  This value is used in defining the KVP exchange message - this 
 value
 + * cannot be modified without affecting the message size and compatibility.
 + */
 +
 +/*
 + * bytes, including any null terminators
 + */
 +#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE