Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-16 Thread Jason Miesionczek
Thank you very much for your review and your excellent suggestions. I will 
revisit the code, clean things up as best I can and submit much smaller patches 
that can be reviewed and merged one at a time.

Thanks again!

Best,
Jason Miesionczek

> On Sep 15, 2016, at 5:56 PM, John Ferlan  wrote:
> 
> 
> 
> On 08/09/2016 08:39 AM, Jason Miesionczek wrote:
>> The following patches include work originally done by Yves Vinter back
>> in 2014. The last patch introduces support for Hyper-V 2012, while still
>> supporting 2008. I am not sure that the method I used to include the 2012
>> support is the best approach, mainly due to code duplication, but I am
>> open to suggestions on how to do this better.
>> 
>> Jason Miesionczek (16):
>>  hyperv: additional server 2008 wmi classes
>>  hyperv: add cim types support to code generator
>>  hyperv: add get capabilities
>>  hyperv: implement connectGetVersion
>>  hyperv: implement vcpu functions
>>  hyperv: implement nodeGetFreeMemory
>>  hyperv: implement ability to send xml soap requests
>>  hyperv: introduce basic network driver
>>  hyperv: add domain shutdown function
>>  hyperv: add get scheduler functions
>>  hyperv: add set memory functions
>>  hyperv: set vpcu functions
>>  hyperv: domain undefine functions
>>  hyperv: domain define and associated functions
>>  hyperv: network list functions
>>  hyperv: introduce 2012 support
>> 
>> src/Makefile.am   |2 +
>> src/hyperv/hyperv_driver.c| 1989 
>> -
>> src/hyperv/hyperv_driver_2012.c   |  299 +
>> src/hyperv/hyperv_driver_2012.h   |   55 +
>> src/hyperv/hyperv_network_driver.c|  280 +
>> src/hyperv/hyperv_network_driver.h|   30 +
>> src/hyperv/hyperv_private.h   |8 +
>> src/hyperv/hyperv_wmi.c   |  709 +++-
>> src/hyperv/hyperv_wmi.h   |   78 ++
>> src/hyperv/hyperv_wmi_generator.input |  518 -
>> src/hyperv/hyperv_wmi_generator.py|   68 +-
>> src/hyperv/openwsman.h|4 +
>> 12 files changed, 3989 insertions(+), 51 deletions(-)
>> create mode 100644 src/hyperv/hyperv_driver_2012.c
>> create mode 100644 src/hyperv/hyperv_driver_2012.h
>> create mode 100644 src/hyperv/hyperv_network_driver.c
>> create mode 100644 src/hyperv/hyperv_network_driver.h
>> 
> 
> That concludes my first adventure into the hyperv driver... Don't be too
> discouraged - there's a long list of changes that need to be done, it's
> not impossible.
> 
> It's very important to work from top of the upstream git tree and to be
> sure to "make check syntax-check" *before* posting patches - that'll
> clear out a lot of repetitive stuff.
> 
> I think though you need to consider posting in smaller chunks. It'll be
> a marathon, not a sprint. The bandwidth for reviews isn't very wide
> either.
> 
> FWIW: So that you can consider this earlier...
> 
> Eventually I realized the query strings that you're formulating that
> start with "associators of" - well I think you might be better of
> creating a "generic function" rather than cut-n-paste a similar sequence
> in every function.
> 
> So here's my suggestion create a common function now, then modify the
> existing code to call/use that function.  Then modify each of the
> subsequent patches to do the same for example:
> 
> (NOTE: Rename param1-4 to something better, it's my shorthand)
> 
> static Msvm_VirtualSystemSettingData *
> hypervBuildQueryBuffer(const char *param1, const char *param2,
>   const char *param3, const char *param4)
> {
>virBuffer query = VIR_BUFFER_INITIALIZER;
> 
>virBufferAddLit(, "associators of ");
>virBufferAsprintf(, "{%s=\"%s\"} ", param1, param2);
>virBufferAsprintf(, "where AssocClass = %s ", param3);
>virBufferAsprintf(, "ResultClass = %s", param4);
> 
>if (virBufferCheckError() < 0)
>return NULL;
> 
>return query;
> }
> 
> ...
> Then also create constant shortcuts, such as:
> 
> #define WIN32_CS_NAME "Win32_ComputerSystem.Name"
> #define WIN32_CSP "Win32_ComputerSystemProcessor"
> #define WIN32_PROC "Win32_Processor"
> 
> So that calling would be (for example from existing source)
> 
>  if (!(query = hypervBuildQueryBuffer(WIN32_CS_NAME,
>   computerSystem->data->Name,
>   WIN32_CSP,
>   WIN32_PROC)))
> goto cleanup/error
> ...
> 
> The rest I'll leave up to you, but doing some #define string
> concatenation will make things look better. The painful looking on is
> the "Msvm_ComputerSystem.CreationClassName=..."
> 
> *Anywhere* that it's possible to reuse code or reduce the cut-copy-paste
> should be considered.
> 
> You may even want to consider making some sort of static struct to
> "predefine" the lookup function to be called and the parameter,
> considering the following a start:
> 
> typedef int 

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-15 Thread John Ferlan


On 08/09/2016 08:39 AM, Jason Miesionczek wrote:
> The following patches include work originally done by Yves Vinter back
> in 2014. The last patch introduces support for Hyper-V 2012, while still
> supporting 2008. I am not sure that the method I used to include the 2012
> support is the best approach, mainly due to code duplication, but I am
> open to suggestions on how to do this better.
> 
> Jason Miesionczek (16):
>   hyperv: additional server 2008 wmi classes
>   hyperv: add cim types support to code generator
>   hyperv: add get capabilities
>   hyperv: implement connectGetVersion
>   hyperv: implement vcpu functions
>   hyperv: implement nodeGetFreeMemory
>   hyperv: implement ability to send xml soap requests
>   hyperv: introduce basic network driver
>   hyperv: add domain shutdown function
>   hyperv: add get scheduler functions
>   hyperv: add set memory functions
>   hyperv: set vpcu functions
>   hyperv: domain undefine functions
>   hyperv: domain define and associated functions
>   hyperv: network list functions
>   hyperv: introduce 2012 support
> 
>  src/Makefile.am   |2 +
>  src/hyperv/hyperv_driver.c| 1989 
> -
>  src/hyperv/hyperv_driver_2012.c   |  299 +
>  src/hyperv/hyperv_driver_2012.h   |   55 +
>  src/hyperv/hyperv_network_driver.c|  280 +
>  src/hyperv/hyperv_network_driver.h|   30 +
>  src/hyperv/hyperv_private.h   |8 +
>  src/hyperv/hyperv_wmi.c   |  709 +++-
>  src/hyperv/hyperv_wmi.h   |   78 ++
>  src/hyperv/hyperv_wmi_generator.input |  518 -
>  src/hyperv/hyperv_wmi_generator.py|   68 +-
>  src/hyperv/openwsman.h|4 +
>  12 files changed, 3989 insertions(+), 51 deletions(-)
>  create mode 100644 src/hyperv/hyperv_driver_2012.c
>  create mode 100644 src/hyperv/hyperv_driver_2012.h
>  create mode 100644 src/hyperv/hyperv_network_driver.c
>  create mode 100644 src/hyperv/hyperv_network_driver.h
> 

That concludes my first adventure into the hyperv driver... Don't be too
discouraged - there's a long list of changes that need to be done, it's
not impossible.

It's very important to work from top of the upstream git tree and to be
sure to "make check syntax-check" *before* posting patches - that'll
clear out a lot of repetitive stuff.

I think though you need to consider posting in smaller chunks. It'll be
a marathon, not a sprint. The bandwidth for reviews isn't very wide
either.

FWIW: So that you can consider this earlier...

Eventually I realized the query strings that you're formulating that
start with "associators of" - well I think you might be better of
creating a "generic function" rather than cut-n-paste a similar sequence
in every function.

So here's my suggestion create a common function now, then modify the
existing code to call/use that function.  Then modify each of the
subsequent patches to do the same for example:

(NOTE: Rename param1-4 to something better, it's my shorthand)

static Msvm_VirtualSystemSettingData *
hypervBuildQueryBuffer(const char *param1, const char *param2,
   const char *param3, const char *param4)
{
virBuffer query = VIR_BUFFER_INITIALIZER;

virBufferAddLit(, "associators of ");
virBufferAsprintf(, "{%s=\"%s\"} ", param1, param2);
virBufferAsprintf(, "where AssocClass = %s ", param3);
virBufferAsprintf(, "ResultClass = %s", param4);

if (virBufferCheckError() < 0)
return NULL;

return query;
}

...
Then also create constant shortcuts, such as:

#define WIN32_CS_NAME "Win32_ComputerSystem.Name"
#define WIN32_CSP "Win32_ComputerSystemProcessor"
#define WIN32_PROC "Win32_Processor"

So that calling would be (for example from existing source)

  if (!(query = hypervBuildQueryBuffer(WIN32_CS_NAME,
   computerSystem->data->Name,
   WIN32_CSP,
   WIN32_PROC)))
 goto cleanup/error
...

The rest I'll leave up to you, but doing some #define string
concatenation will make things look better. The painful looking on is
the "Msvm_ComputerSystem.CreationClassName=..."

*Anywhere* that it's possible to reuse code or reduce the cut-copy-paste
should be considered.

You may even want to consider making some sort of static struct to
"predefine" the lookup function to be called and the parameter,
considering the following a start:

typedef int (*hypervListFunc)(hypervPrivate *priv, virBufferPtr query,
  void **list);
struct _hypervList {
int type;
hypervListFunc func;
};
static const _hypervList hypervListTable[] = {

{ .type = HYPERV_LIST_WIN32_PROCESSORS,
  .func = hypervGetWin32ProcessorList,
},
{ .type = HYPERV_LIST_MSVM_VSSD,
  .func = hypervGetMsvmVirtualSystemSettingDataList,
},
...
};

Then the above QueryBuffer gets "expanded" a bit to pass in a "type" and

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-08 Thread Fernando Casas Schössow
Disregard my last email, it seems that while copying the patches from 
my browser some invisible chars got in. So I extracted the patches from 
the mailist txt archive.

Now they are all applied just fine.

Thanks.

On jue, sep 8, 2016 at 6:48 , Fernando Casas Schössow 
 wrote:

Hi Phil,

May I ask which libvirt version are you patching against?
I'm trying to apply this patches to libvirt 2.2.0 but some of them 
are failing (for example patch 7).


Thanks.

Fer

On jue, sep 8, 2016 at 12:28 , Philipp Heckel  
wrote:
We have a lot more implemented, but they're not cleaned up yet or 
properly tested. We'll submit them in the following weeks (ideally 
next week).


Again, if you need test infrastructure, contact me or Jason.

Here's what we have so far:

2012

hypervHypervisorDriver.connectGetCapabilities = 
hypervConnectGetCapabilities; /* 2008 & 2012 */
hypervHypervisorDriver.connectGetHostname = 
hypervConnectGetHostname; /* 2008 & 2012 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 
2008 & 2012 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 
2008 & 2012 */
hypervHypervisorDriver.connectListAllDomains = 
hypervConnectListAllDomains2012;
hypervHypervisorDriver.connectListDefinedDomains = 
hypervConnectListDefinedDomains2012;
hypervHypervisorDriver.connectListDomains = 
hypervConnectListDomains2012;
hypervHypervisorDriver.connectNumOfDefinedDomains = 
hypervConnectNumOfDefinedDomains2012;
hypervHypervisorDriver.connectNumOfDomains = 
hypervConnectNumOfDomains2012;

hypervHypervisorDriver.domainCreate = hypervDomainCreate2012;
hypervHypervisorDriver.domainCreateWithFlags = 
hypervDomainCreateWithFlags2012;

hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML2012;
hypervHypervisorDriver.domainDestroyFlags = 
hypervDomainDestroyFlags2012;

hypervHypervisorDriver.domainDestroy = hypervDomainDestroy2012;
hypervHypervisorDriver.domainGetInfo = hypervDomainGetInfo2012;
hypervHypervisorDriver.domainGetState = hypervDomainGetState2012;
hypervHypervisorDriver.domainGetXMLDesc = hypervDomainGetXMLDesc2012;
hypervHypervisorDriver.domainIsActive = hypervDomainIsActive2012;
hypervHypervisorDriver.domainLookupByID = hypervDomainLookupByID2012;
hypervHypervisorDriver.domainLookupByName = 
hypervDomainLookupByName2012;
hypervHypervisorDriver.domainLookupByUUID = 
hypervDomainLookupByUUID2012;

hypervHypervisorDriver.domainReboot = hypervDomainReboot2012;
hypervHypervisorDriver.domainSendKey = hypervDomainSendKey2012;
hypervHypervisorDriver.domainSetMemoryFlags = 
hypervDomainSetMemoryFlags2012;

hypervHypervisorDriver.domainSetMemory = hypervDomainSetMemory2012;
hypervHypervisorDriver.domainShutdownFlags = 
hypervDomainShutdownFlags2012;

hypervHypervisorDriver.domainShutdown = hypervDomainShutdown2012;
hypervHypervisorDriver.domainUndefineFlags = 
hypervDomainUndefineFlags2012;

hypervHypervisorDriver.domainUndefine = hypervDomainUndefine2012;
hypervHypervisorDriver.nodeGetFreeMemory = hypervNodeGetFreeMemory; 
/* 2008 & 2012 */
hypervHypervisorDriver.nodeGetInfo = hypervNodeGetInfo; /* 2008 & 
2012 */


2008

hypervHypervisorDriver.connectGetCapabilities = 
hypervConnectGetCapabilities; /* 1.2.10 */
hypervHypervisorDriver.connectGetHostname = 
hypervConnectGetHostname; /* 0.9.5 */
hypervHypervisorDriver.connectGetMaxVcpus = 
hypervConnectGetMaxVcpus; /* 1.2.10 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 
0.9.5 */
hypervHypervisorDriver.connectGetVersion = hypervConnectGetVersion; 
/* 1.2.10 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 
0.9.8 */
hypervHypervisorDriver.connectIsEncrypted = 
hypervConnectIsEncrypted; /* 0.9.5 */
hypervHypervisorDriver.connectIsSecure = hypervConnectIsSecure; /* 
0.9.5 */
hypervHypervisorDriver.connectListAllDomains = 
hypervConnectListAllDomains; /* 0.10.2 */
hypervHypervisorDriver.connectListDefinedDomains = 
hypervConnectListDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectListDomains = 
hypervConnectListDomains; /* 0.9.5 */
hypervHypervisorDriver.connectNumOfDefinedDomains = 
hypervConnectNumOfDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectNumOfDomains = 
hypervConnectNumOfDomains; /* 0.9.5 */
hypervHypervisorDriver.domainAttachDeviceFlags = 
hypervDomainAttachDeviceFlags; /* 1.2.10 */
hypervHypervisorDriver.domainAttachDevice = 
hypervDomainAttachDevice; /* 1.2.10 */

hypervHypervisorDriver.domainCreate = hypervDomainCreate; /* 0.9.5 */
hypervHypervisorDriver.domainCreateWithFlags = 
hypervDomainCreateWithFlags; /* 0.9.5 */
hypervHypervisorDriver.domainCreateXML = hypervDomainCreateXML; /* 
1.2.10 */
hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML; /* 
1.2.10 */
hypervHypervisorDriver.domainDestroyFlags = 
hypervDomainDestroyFlags; /* 0.9.5 */
hypervHypervisorDriver.domainDestroy = hypervDomainDestroy; /* 0.9.5 
*/
hypervHypervisorDriver.domainGetAutostart = 
hypervDomainGetAutostart; /* 1.2.10 */

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-08 Thread Fernando Casas Schössow

Hi Phil,

May I ask which libvirt version are you patching against?
I'm trying to apply this patches to libvirt 2.2.0 but some of them are 
failing (for example patch 7).


Thanks.

Fer

On jue, sep 8, 2016 at 12:28 , Philipp Heckel  wrote:
We have a lot more implemented, but they're not cleaned up yet or 
properly tested. We'll submit them in the following weeks (ideally 
next week).


Again, if you need test infrastructure, contact me or Jason.

Here's what we have so far:

2012

hypervHypervisorDriver.connectGetCapabilities = 
hypervConnectGetCapabilities; /* 2008 & 2012 */
hypervHypervisorDriver.connectGetHostname = hypervConnectGetHostname; 
/* 2008 & 2012 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 2008 
& 2012 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 2008 
& 2012 */
hypervHypervisorDriver.connectListAllDomains = 
hypervConnectListAllDomains2012;
hypervHypervisorDriver.connectListDefinedDomains = 
hypervConnectListDefinedDomains2012;
hypervHypervisorDriver.connectListDomains = 
hypervConnectListDomains2012;
hypervHypervisorDriver.connectNumOfDefinedDomains = 
hypervConnectNumOfDefinedDomains2012;
hypervHypervisorDriver.connectNumOfDomains = 
hypervConnectNumOfDomains2012;

hypervHypervisorDriver.domainCreate = hypervDomainCreate2012;
hypervHypervisorDriver.domainCreateWithFlags = 
hypervDomainCreateWithFlags2012;

hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML2012;
hypervHypervisorDriver.domainDestroyFlags = 
hypervDomainDestroyFlags2012;

hypervHypervisorDriver.domainDestroy = hypervDomainDestroy2012;
hypervHypervisorDriver.domainGetInfo = hypervDomainGetInfo2012;
hypervHypervisorDriver.domainGetState = hypervDomainGetState2012;
hypervHypervisorDriver.domainGetXMLDesc = hypervDomainGetXMLDesc2012;
hypervHypervisorDriver.domainIsActive = hypervDomainIsActive2012;
hypervHypervisorDriver.domainLookupByID = hypervDomainLookupByID2012;
hypervHypervisorDriver.domainLookupByName = 
hypervDomainLookupByName2012;
hypervHypervisorDriver.domainLookupByUUID = 
hypervDomainLookupByUUID2012;

hypervHypervisorDriver.domainReboot = hypervDomainReboot2012;
hypervHypervisorDriver.domainSendKey = hypervDomainSendKey2012;
hypervHypervisorDriver.domainSetMemoryFlags = 
hypervDomainSetMemoryFlags2012;

hypervHypervisorDriver.domainSetMemory = hypervDomainSetMemory2012;
hypervHypervisorDriver.domainShutdownFlags = 
hypervDomainShutdownFlags2012;

hypervHypervisorDriver.domainShutdown = hypervDomainShutdown2012;
hypervHypervisorDriver.domainUndefineFlags = 
hypervDomainUndefineFlags2012;

hypervHypervisorDriver.domainUndefine = hypervDomainUndefine2012;
hypervHypervisorDriver.nodeGetFreeMemory = hypervNodeGetFreeMemory; 
/* 2008 & 2012 */
hypervHypervisorDriver.nodeGetInfo = hypervNodeGetInfo; /* 2008 & 
2012 */


2008

hypervHypervisorDriver.connectGetCapabilities = 
hypervConnectGetCapabilities; /* 1.2.10 */
hypervHypervisorDriver.connectGetHostname = hypervConnectGetHostname; 
/* 0.9.5 */
hypervHypervisorDriver.connectGetMaxVcpus = hypervConnectGetMaxVcpus; 
/* 1.2.10 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 
0.9.5 */
hypervHypervisorDriver.connectGetVersion = hypervConnectGetVersion; 
/* 1.2.10 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 
0.9.8 */
hypervHypervisorDriver.connectIsEncrypted = hypervConnectIsEncrypted; 
/* 0.9.5 */
hypervHypervisorDriver.connectIsSecure = hypervConnectIsSecure; /* 
0.9.5 */
hypervHypervisorDriver.connectListAllDomains = 
hypervConnectListAllDomains; /* 0.10.2 */
hypervHypervisorDriver.connectListDefinedDomains = 
hypervConnectListDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectListDomains = hypervConnectListDomains; 
/* 0.9.5 */
hypervHypervisorDriver.connectNumOfDefinedDomains = 
hypervConnectNumOfDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectNumOfDomains = 
hypervConnectNumOfDomains; /* 0.9.5 */
hypervHypervisorDriver.domainAttachDeviceFlags = 
hypervDomainAttachDeviceFlags; /* 1.2.10 */
hypervHypervisorDriver.domainAttachDevice = hypervDomainAttachDevice; 
/* 1.2.10 */

hypervHypervisorDriver.domainCreate = hypervDomainCreate; /* 0.9.5 */
hypervHypervisorDriver.domainCreateWithFlags = 
hypervDomainCreateWithFlags; /* 0.9.5 */
hypervHypervisorDriver.domainCreateXML = hypervDomainCreateXML; /* 
1.2.10 */
hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML; /* 
1.2.10 */
hypervHypervisorDriver.domainDestroyFlags = hypervDomainDestroyFlags; 
/* 0.9.5 */
hypervHypervisorDriver.domainDestroy = hypervDomainDestroy; /* 0.9.5 
*/
hypervHypervisorDriver.domainGetAutostart = hypervDomainGetAutostart; 
/* 1.2.10 */
hypervHypervisorDriver.domainGetInfo = hypervDomainGetInfo; /* 0.9.5 
*/
hypervHypervisorDriver.domainGetMaxVcpus = hypervDomainGetMaxVcpus; 
/* 1.2.10 */
hypervHypervisorDriver.domainGetOSType = hypervDomainGetOSType; /* 
0.9.5 */
hypervHypervisorDriver.domainGetSchedulerParametersFlags = 

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Philipp Heckel
We have a lot more implemented, but they're not cleaned up yet or properly
tested. We'll submit them in the following weeks (ideally next week).

Again, if you need test infrastructure, contact me or Jason.

Here's what we have so far:

2012

hypervHypervisorDriver.connectGetCapabilities =
hypervConnectGetCapabilities; /* 2008 & 2012 */
hypervHypervisorDriver.connectGetHostname = hypervConnectGetHostname; /*
2008 & 2012 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 2008 &
2012 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 2008 &
2012 */
hypervHypervisorDriver.connectListAllDomains =
hypervConnectListAllDomains2012;
hypervHypervisorDriver.connectListDefinedDomains =
hypervConnectListDefinedDomains2012;
hypervHypervisorDriver.connectListDomains = hypervConnectListDomains2012;
hypervHypervisorDriver.connectNumOfDefinedDomains =
hypervConnectNumOfDefinedDomains2012;
hypervHypervisorDriver.connectNumOfDomains = hypervConnectNumOfDomains2012;
hypervHypervisorDriver.domainCreate = hypervDomainCreate2012;
hypervHypervisorDriver.domainCreateWithFlags =
hypervDomainCreateWithFlags2012;
hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML2012;
hypervHypervisorDriver.domainDestroyFlags = hypervDomainDestroyFlags2012;
hypervHypervisorDriver.domainDestroy = hypervDomainDestroy2012;
hypervHypervisorDriver.domainGetInfo = hypervDomainGetInfo2012;
hypervHypervisorDriver.domainGetState = hypervDomainGetState2012;
hypervHypervisorDriver.domainGetXMLDesc = hypervDomainGetXMLDesc2012;
hypervHypervisorDriver.domainIsActive = hypervDomainIsActive2012;
hypervHypervisorDriver.domainLookupByID = hypervDomainLookupByID2012;
hypervHypervisorDriver.domainLookupByName = hypervDomainLookupByName2012;
hypervHypervisorDriver.domainLookupByUUID = hypervDomainLookupByUUID2012;
hypervHypervisorDriver.domainReboot = hypervDomainReboot2012;
hypervHypervisorDriver.domainSendKey = hypervDomainSendKey2012;
hypervHypervisorDriver.domainSetMemoryFlags =
hypervDomainSetMemoryFlags2012;
hypervHypervisorDriver.domainSetMemory = hypervDomainSetMemory2012;
hypervHypervisorDriver.domainShutdownFlags = hypervDomainShutdownFlags2012;
hypervHypervisorDriver.domainShutdown = hypervDomainShutdown2012;
hypervHypervisorDriver.domainUndefineFlags = hypervDomainUndefineFlags2012;
hypervHypervisorDriver.domainUndefine = hypervDomainUndefine2012;
hypervHypervisorDriver.nodeGetFreeMemory = hypervNodeGetFreeMemory; /* 2008
& 2012 */
hypervHypervisorDriver.nodeGetInfo = hypervNodeGetInfo; /* 2008 & 2012 */

2008

hypervHypervisorDriver.connectGetCapabilities =
hypervConnectGetCapabilities; /* 1.2.10 */
hypervHypervisorDriver.connectGetHostname = hypervConnectGetHostname; /*
0.9.5 */
hypervHypervisorDriver.connectGetMaxVcpus = hypervConnectGetMaxVcpus; /*
1.2.10 */
hypervHypervisorDriver.connectGetType = hypervConnectGetType; /* 0.9.5 */
hypervHypervisorDriver.connectGetVersion = hypervConnectGetVersion; /*
1.2.10 */
hypervHypervisorDriver.connectIsAlive = hypervConnectIsAlive; /* 0.9.8 */
hypervHypervisorDriver.connectIsEncrypted = hypervConnectIsEncrypted; /*
0.9.5 */
hypervHypervisorDriver.connectIsSecure = hypervConnectIsSecure; /* 0.9.5 */
hypervHypervisorDriver.connectListAllDomains = hypervConnectListAllDomains;
/* 0.10.2 */
hypervHypervisorDriver.connectListDefinedDomains =
hypervConnectListDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectListDomains = hypervConnectListDomains; /*
0.9.5 */
hypervHypervisorDriver.connectNumOfDefinedDomains =
hypervConnectNumOfDefinedDomains; /* 0.9.5 */
hypervHypervisorDriver.connectNumOfDomains = hypervConnectNumOfDomains; /*
0.9.5 */
hypervHypervisorDriver.domainAttachDeviceFlags =
hypervDomainAttachDeviceFlags; /* 1.2.10 */
hypervHypervisorDriver.domainAttachDevice = hypervDomainAttachDevice; /*
1.2.10 */
hypervHypervisorDriver.domainCreate = hypervDomainCreate; /* 0.9.5 */
hypervHypervisorDriver.domainCreateWithFlags = hypervDomainCreateWithFlags;
/* 0.9.5 */
hypervHypervisorDriver.domainCreateXML = hypervDomainCreateXML; /* 1.2.10 */
hypervHypervisorDriver.domainDefineXML = hypervDomainDefineXML; /* 1.2.10 */
hypervHypervisorDriver.domainDestroyFlags = hypervDomainDestroyFlags; /*
0.9.5 */
hypervHypervisorDriver.domainDestroy = hypervDomainDestroy; /* 0.9.5 */
hypervHypervisorDriver.domainGetAutostart = hypervDomainGetAutostart; /*
1.2.10 */
hypervHypervisorDriver.domainGetInfo = hypervDomainGetInfo; /* 0.9.5 */
hypervHypervisorDriver.domainGetMaxVcpus = hypervDomainGetMaxVcpus; /*
1.2.10 */
hypervHypervisorDriver.domainGetOSType = hypervDomainGetOSType; /* 0.9.5 */
hypervHypervisorDriver.domainGetSchedulerParametersFlags =
hypervDomainGetSchedulerParametersFlags; /* 1.2.10 */
hypervHypervisorDriver.domainGetSchedulerParameters =
hypervDomainGetSchedulerParameters; /* 1.2.10 */
hypervHypervisorDriver.domainGetSchedulerType =
hypervDomainGetSchedulerType; /* 1.2.10 */
hypervHypervisorDriver.domainGetState = hypervDomainGetState; /* 0.9.5 */

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Philipp Heckel
Hi,


> I was wondering if any of these patches actually made it into libvirt code.
> I'm really looking forward hyper-v support improvement and features like
> shutdown VM (not destroy/turn off but clean shutdown) implemented.
> Especially interested in 2012/2012 R2 since 2008 is getting old and 2016
> is right around the corner.
>

Unfortunately they have not made it in or received enough of a review (yet)
-- my guess is that this is because Hyper-V hosts/clusters are not wide
spread and devs cannot test the patches.

@libvirt-devs, if that is the case, we (Datto) would be happy to provide
test servers for you so you can play around with the patches. Just contact
me or Jason M (see previous mails) directly and we'll talk about it.

We are also working on additional patches to provide a more extensive
support. The patches that Jason submitted are just the beginning and
provide very basic support.

Best,
Phil
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Matthias Bolte
2016-09-07 23:14 GMT+02:00 Fernando Casas Schössow :
> Hi there,
>
> I was wondering if any of these patches actually made it into libvirt code.
> I'm really looking forward hyper-v support improvement and features like
> shutdown VM (not destroy/turn off but clean shutdown) implemented.
> Especially interested in 2012/2012 R2 since 2008 is getting old and 2016 is
> right around the corner.
>
> I'm already using libvirt 2.1.0 with some patches I found in
> https://github.com/vikhyath/libvirt-hyperv-r2-2012 but it would be great to
> have the code reviewed and merged into libvirt releases.
>
> Thanks.
>
> Fer
>
> The following patches include work originally done by Yves Vinter back
> in 2014. The last patch introduces support for Hyper-V 2012, while still
> supporting 2008. I am not sure that the method I used to include the 2012
> support is the best approach, mainly due to code duplication, but I am
> open to suggestions on how to do this better.
>
> Jason Miesionczek (16):
>   hyperv: additional server 2008 wmi classes
>   hyperv: add cim types support to code generator
>   hyperv: add get capabilities
>   hyperv: implement connectGetVersion
>   hyperv: implement vcpu functions
>   hyperv: implement nodeGetFreeMemory
>   hyperv: implement ability to send xml soap requests
>   hyperv: introduce basic network driver
>   hyperv: add domain shutdown function
>   hyperv: add get scheduler functions
>   hyperv: add set memory functions
>   hyperv: set vpcu functions
>   hyperv: domain undefine functions
>   hyperv: domain define and associated functions
>   hyperv: network list functions
>   hyperv: introduce 2012 support

I had a quick look at these patches a while ago, but didn't get around
to review them in detail yet.

Adding 2012 support while keeping 2008 supported is a bit tricky but
doable I think.

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Fernando Casas Schössow

Thanks for the reply Phil.
These are brilliant news, hopefully libvirt support for Hyper-V will 
see some improvements soon and these patches are a great starting point.


Regards.

Fer

On mié, sep 7, 2016 at 11:46 , Philipp Heckel  
wrote:

Hi,

I was wondering if any of these patches actually made it into 
libvirt code.
I'm really looking forward hyper-v support improvement and features 
like shutdown VM (not destroy/turn off but clean shutdown) 
implemented.
Especially interested in 2012/2012 R2 since 2008 is getting old and 
2016 is right around the corner.


Unfortunately they have not made it in or received enough of a review 
(yet) -- my guess is that this is because Hyper-V hosts/clusters are 
not wide spread and devs cannot test the patches.


@libvirt-devs, if that is the case, we (Datto) would be happy to 
provide test servers for you so you can play around with the patches. 
Just contact me or Jason M (see previous mails) directly and we'll 
talk about it.


We are also working on additional patches to provide a more extensive 
support. The patches that Jason submitted are just the beginning and 
provide very basic support.


Best,
Phil
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Fernando Casas Schössow

Thanks for the reply Phil.
These are brilliant news, hopefully libvirt support for Hyper-V will 
see some improvements soon and these patches are a great starting point.


Regards.

Fer

On mié, sep 7, 2016 at 11:46 , Philipp Heckel  
wrote:

Hi,

I was wondering if any of these patches actually made it into 
libvirt code.
I'm really looking forward hyper-v support improvement and features 
like shutdown VM (not destroy/turn off but clean shutdown) 
implemented.
Especially interested in 2012/2012 R2 since 2008 is getting old and 
2016 is right around the corner.


Unfortunately they have not made it in or received enough of a review 
(yet) -- my guess is that this is because Hyper-V hosts/clusters are 
not wide spread and devs cannot test the patches.


@libvirt-devs, if that is the case, we (Datto) would be happy to 
provide test servers for you so you can play around with the patches. 
Just contact me or Jason M (see previous mails) directly and we'll 
talk about it.


We are also working on additional patches to provide a more extensive 
support. The patches that Jason submitted are just the beginning and 
provide very basic support.


Best,
Phil
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/16] Hyper-V: Improve 2008, Introduce 2012

2016-09-07 Thread Fernando Casas Schössow

Hi there,

I was wondering if any of these patches actually made it into libvirt 
code.
I'm really looking forward hyper-v support improvement and features 
like shutdown VM (not destroy/turn off but clean shutdown) implemented.
Especially interested in 2012/2012 R2 since 2008 is getting old and 
2016 is right around the corner.


I'm already using libvirt 2.1.0 with some patches I found in 
https://github.com/vikhyath/libvirt-hyperv-r2-2012 but it would be 
great to have the code reviewed and merged into libvirt releases.


Thanks.

Fer


The following patches include work originally done by Yves Vinter back
in 2014. The last patch introduces support for Hyper-V 2012, while 
still
supporting 2008. I am not sure that the method I used to include the 
2012

support is the best approach, mainly due to code duplication, but I am
open to suggestions on how to do this better.

Jason Miesionczek (16):
  hyperv: additional server 2008 wmi classes
  hyperv: add cim types support to code generator
  hyperv: add get capabilities
  hyperv: implement connectGetVersion
  hyperv: implement vcpu functions
  hyperv: implement nodeGetFreeMemory
  hyperv: implement ability to send xml soap requests
  hyperv: introduce basic network driver
  hyperv: add domain shutdown function
  hyperv: add get scheduler functions
  hyperv: add set memory functions
  hyperv: set vpcu functions
  hyperv: domain undefine functions
  hyperv: domain define and associated functions
  hyperv: network list functions
  hyperv: introduce 2012 support

 src/Makefile.am | 2 +
 src/hyperv/hyperv_driver.c | 1989 -
 src/hyperv/hyperv_driver_2012.c | 299 +
 src/hyperv/hyperv_driver_2012.h | 55 +
 src/hyperv/hyperv_network_driver.c | 280 +
 src/hyperv/hyperv_network_driver.h | 30 +
 src/hyperv/hyperv_private.h | 8 +
 src/hyperv/hyperv_wmi.c | 709 +++-
 src/hyperv/hyperv_wmi.h | 78 ++
 src/hyperv/hyperv_wmi_generator.input | 518 -
 src/hyperv/hyperv_wmi_generator.py | 68 +-
 src/hyperv/openwsman.h | 4 +
 12 files changed, 3989 insertions(+), 51 deletions(-)
 create mode 100644 src/hyperv/hyperv_driver_2012.c
 create mode 100644 src/hyperv/hyperv_driver_2012.h
 create mode 100644 src/hyperv/hyperv_network_driver.c
 create mode 100644 src/hyperv/hyperv_network_driver.h
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list