Re: [libvirt] [PATCH 2/2] esx:Fix esxDomainGetMaxVcpus to return correct vcpus

2018-08-13 Thread Matthias Bolte
+ > +/* as maxSupportedVcpus is optional, check also for > maxHostSupportedVcpus */ > +priv->maxVcpus = supportedVcpus ? supportedVcpus->value : > hostVcpus->value; > + > + cleanup: > +esxVI_String_Free(); > +esxVI_ObjectContent_Free(); > +esxVI_Int_Free(); >

Re: [libvirt] [PATCH 1/2] esx: Make esxDomainGetVcpusFlags return vcpus again

2018-08-13 Thread Matthias Bolte
If the flag is present then the function should return the maximum vCPU Count. If the flag is absent then it should return the current vCPU count. -- 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 v2 0/2] ESX: Fixing SetAutoStart

2018-08-05 Thread Matthias Bolte
2018-08-02 18:16 GMT+02:00 John Ferlan : > > > On 08/02/2018 12:11 PM, Marcos Paulo de Souza wrote: >> On Thu, Aug 02, 2018 at 05:37:46PM +0200, Matthias Bolte wrote: >>> 2018-08-02 16:45 GMT+02:00 John Ferlan : >>>> >>>> >>>> On 08/02

Re: [libvirt] [PATCH v2 0/2] ESX: Fixing SetAutoStart

2018-08-02 Thread Matthias Bolte
2018-08-02 16:45 GMT+02:00 John Ferlan : > > > On 08/02/2018 10:07 AM, Matthias Bolte wrote: >> 2018-08-02 15:20 GMT+02:00 John Ferlan : >>> >>> >>> On 08/02/2018 05:04 AM, Matthias Bolte wrote: >>>> 2018-08-01 18:09 GMT+02:00 Marcos Paulo de S

Re: [libvirt] [PATCH v2 0/2] ESX: Fixing SetAutoStart

2018-08-02 Thread Matthias Bolte
2018-08-02 15:20 GMT+02:00 John Ferlan : > > > On 08/02/2018 05:04 AM, Matthias Bolte wrote: >> 2018-08-01 18:09 GMT+02:00 Marcos Paulo de Souza >> : >>> This is a new version from the last patchset sent yesterday, but now using >>> VIR_STRNDUP

Re: [libvirt] [PATCH v2 0/2] ESX: Fixing SetAutoStart

2018-08-02 Thread Matthias Bolte
oid double freeing and freeing static strings. The problem is that commit ae83e02f3dd7fe99fed5d8159a35b666fafeafd5 by John Frelan broke this logic, by setting newPowerInfo to NULL in the success path, to silence Coverity. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-l

Re: [libvirt] [RFC PATCH 0/4] Add new macro to check for existent server

2018-07-08 Thread Matthias Bolte
this concept and adding a remoteOnly flag to the virConnectDriver struct. Instead of checking the URI server part in the driver's own open function let virConnectOpenInternal do this check based on the remoteOnly flag. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libv

Re: [libvirt] [PATCH 0/2] esx: Couple of fixes

2018-07-03 Thread Matthias Bolte
_vi.c | 5 - > 2 files changed, 5 insertions(+), 7 deletions(-) > ACK for both patches. -- 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 2/3] esx: Add esxVI_checkArgList macro

2018-07-03 Thread Matthias Bolte
of esxVI_checkArgList. Because at the moment the ESX code makes a clear distinction between macros and functions in their spelling. I'd like to keep it that way, even if the rest of the code base is no consistent about this. -- 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 1/3] esx_vi.c: Simplify error handling in MachineByName

2018-07-03 Thread Matthias Bolte
at the caller checks for virtualMachine == NULL anyway. But no error is overwritten here because esxVI_LookupVirtualMachineByName doesn't report an error with occurrence OptionalItem. The actual point that could be made here is that esxDomainLookupByName should actually use occurrence Requ

Re: [libvirt] VMX parser: limitation of numvcpus

2018-06-01 Thread Matthias Bolte
well what the actual problem was. It seems that you have an ESX server at hand. So you could just test if the vSphere Client allows you to set the numvcpus to an odd value. It seems that you already did that, that's how you got in this situation. If the vSphere Client allows you to set the num

Re: [libvirt] [PATCH] hyperv: Reduce usage of libxml API functions

2017-08-07 Thread Matthias Bolte
> functionality. > --- > src/hyperv/hyperv_wmi.c | 65 > - > 1 file changed, 16 insertions(+), 49 deletions(-) ACK and pushed, thanks. I adjusted the commit message to emphasis that this commit is about the clang alignment warni

Re: [libvirt] [PATCH] hyperv: Correct number of milliseconds in five minutes

2017-08-07 Thread Matthias Bolte
rv/hyperv_wmi.c > +++ b/src/hyperv/hyperv_wmi.c > @@ -42,7 +42,7 @@ > > #define VIR_FROM_THIS VIR_FROM_HYPERV > > -#define HYPERV_JOB_TIMEOUT_MS 5000 > +#define HYPERV_JOB_TIMEOUT_MS 30 > > VIR_LOG_INIT("hyperv.hyperv_wmi"); ACK and pushed, thanks. -- Ma

Re: [libvirt] [PATCH v7 3/6] hyperv: add hypervInvokeMethod

2017-07-19 Thread Matthias Bolte
does not crash virsh) against Hyper-V 2012. I'm > away from my usual setup atm (on vacation), so I can help look into > this further next week when I'm back. > > On Wed, Jul 19, 2017 at 1:21 AM, Matthias Bolte > <matthias.bo...@googlemail.com> wrote: >> 2017-07-

Re: [libvirt] [PATCH v7 3/6] hyperv: add hypervInvokeMethod

2017-07-18 Thread Matthias Bolte
ock. A hack for this last offender is to cast to a void pointer first, instead of a direct cast. See attached patch for a quick fix, compile-tested only. Another possibility is to do all the XML building using direct libxml2 calls, format the XML document and reparse it with the openwsman wrapper.

Re: [libvirt] [PATCH v7 0/6] Hyper-V method invocation

2017-07-08 Thread Matthias Bolte
h| 4 + > 8 files changed, 1399 insertions(+), 2 deletions(-) ACK to the whole series. I've pushed it now, thanks! -- 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 v6 0/5] Hyper-V method invocation

2017-06-27 Thread Matthias Bolte
h| 4 + > 7 files changed, 1394 insertions(+), 2 deletions(-) This series is still missing a patch for the docs/news.xml file. -- 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 v5 0/5] Hyper-V method invocation

2017-06-18 Thread Matthias Bolte
nformation. > hyperv: add hypervInvokeMethod > hyperv: support virDomainSendKey > hyperv: Add support for virDomainSetMemory This series is missing a patch for the docs/news.xml announcing the two new driver functions. -- Matthias Bolte http://photron.blogspot.com -- libvir-list

Re: [libvirt] [PATCH v5 1/5] hyperv: Functions to work with invocation parameters.

2017-06-18 Thread Matthias Bolte
79 ++- > 2 files changed, 340 insertions(+), 1 deletion(-) This one looks okay. -- 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 v5 2/5] hyperv: Generate object property type information.

2017-06-18 Thread Matthias Bolte
*name; > const char *type; > bool isArray; > }; > --- > src/hyperv/hyperv_wmi_classes.h| 19 +++ > src/hyperv/hyperv_wmi_generator.py | 15 ++- > 2 files changed, 33 insertions(+), 1 deletion(-) Looks okay. -- Matthias Bolte http:/

Re: [libvirt] [PATCH v5 3/5] hyperv: add hypervInvokeMethod

2017-06-18 Thread Matthias Bolte
vWmiClassInfoListPtr info) > for (i = 0; typeinfo[i].name != NULL; i++) {} > count = i; > > +count = i + 1; This second assignment is wrong and has to be removed. > table = virHashCreate(count, NULL); > if (table == NULL) > goto error; -- 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 v5 4/5] hyperv: support virDomainSendKey

2017-06-18 Thread Matthias Bolte
+ > +if (hypervAddSimpleParam(params, "keyCode", keycodeStr) < 0) If hypervAddSimpleParam fails then params will be leaked here. Add a call to hypervFreeInvokeParams here. > +goto cleanup; > + > +if (hypervInvokeMethod(priv, params, NULL) < 0) { > +virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not release key > %s"), > +keycodeStr); > +goto cleanup; > +} > +} > + > +result = 0; > + > + cleanup: > +VIR_FREE(translatedKeycodes); > +VIR_FREE(selector); > +hypervFreeObject(priv, (hypervObject *) keyboard); > +hypervFreeObject(priv, (hypervObject *) computerSystem); > +virBufferFreeAndReset(); > +return result; > +} -- 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 v5 5/5] hyperv: Add support for virDomainSetMemory

2017-06-18 Thread Matthias Bolte
double-free. That's why memResource needs to be set to NULL before calling hypervInvokeMethod, not afterwards. > +if (hypervInvokeMethod(priv, params, NULL) < 0) { > +virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not set > memory")); > +goto

Re: [libvirt] [PATCH v4 0/5] Hyperv-method invocation

2017-05-31 Thread Matthias Bolte
s changed, 1340 insertions(+), 2 deletions(-) This series is missing a patch for the docs/news.xml announcing the two new driver functions. -- 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 v4 4/5] hyperv: support virDomainSendKey

2017-05-28 Thread Matthias Bolte
string Status > +uint16 HealthState > +uint16 CommunicationStatus > +uint16 DetailedStatus > +uint16 OperatingStatus > +uint16 PrimaryStatus > +uint16 EnabledState > + string OtherEnabledState > +uint16 RequestedState > +uint16 Enab

Re: [libvirt] [PATCH v4 5/5] hyperv: Add support for virDomainSetMemory

2017-05-28 Thread Matthias Bolte
> > +class v2/Msvm_VirtualSystemManagementService > +string InstanceID > +string Caption > +string Description > +string ElementName > +datetime InstallDate > +string Name > +uint16 OperationalStatus[] > +string StatusDescriptions[] > +string Status > +uint16 HealthState > +uint16 CommunicationStatus > +uint16 DetailedStatus > +uint16 OperatingStatus > +uint16 PrimaryStatus > +uint16 EnabledState > +string OtherEnabledState > +uint16 RequestedState > +uint16 EnabledDefault > +datetime TimeOfLastStateChange > +uint16 AvailableRequestedStates[] > +uint16 TransitioningToState > +string SystemCreationClassName > +string SystemName > +string CreationClassName > +string PrimaryOwnerName > +string PrimaryOwnerContact > +string StartMode > +boolean Started > +end > > class Msvm_VirtualSystemGlobalSettingData > string Caption > -- > 2.9.4 > > -- > libvir-list mailing list > libvir-list@redhat.com > https://www.redhat.com/mailman/listinfo/libvir-list -- 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 v4 1/5] hyperv: Functions to work with invocation parameters.

2017-05-28 Thread Matthias Bolte
related functions and structures for > * managing Microsoft Hyper-V hosts > * > + * Copyright (C) 2017 Datto Inc > * Copyright (C) 2014 Red Hat, Inc. > * Copyright (C) 2011 Matthias Bolte <matthias.bo...@googlemail.com> > * Copyright (C) 2009 Michael Sievers &

Re: [libvirt] [PATCH v4 2/5] hyperv: Generate object property type information.

2017-05-28 Thread Matthias Bolte
*name; > const char *type; > bool isArray; > }; > --- > src/hyperv/hyperv_wmi_classes.h| 19 +++ > src/hyperv/hyperv_wmi_generator.py | 15 ++- > 2 files changed, 33 insertions(+), 1 deletion(-) This one looks okay. -- Matthias Bolt

Re: [libvirt] [PATCH v4 3/5] hyperv: add hypervInvokeMethod

2017-05-28 Thread Matthias Bolte
job = NULL; > +usleep(100 * 1000); /* sleep 100 ms */ > +timeout -= 100; > +continue; > +case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: > + completed = true; > +break; >

Re: [libvirt] [PATCH v3 3/5] hyperv: add hypervInvokeMethod

2017-05-16 Thread Matthias Bolte
2017-05-05 22:24 GMT+02:00 <sramanu...@datto.com>: > On Tue, 2017-05-02 at 00:26 +0200, Matthias Bolte wrote: >> 2017-04-24 20:19 GMT+02:00 Sri Ramanujam <sramanu...@datto.com>: >> > This commit adds support for invoking methods on remote objects >> > via

Re: [libvirt] [PATCH v3 5/5] hyperv: Add support for virDomainSetMemory

2017-05-01 Thread Matthias Bolte
p; > +} > + > +if (hypervInvokeMethod(priv, params, NULL) < 0) { > +virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not set > memory")); > +goto cleanup; > +} > + > +result = 0; > + cleanup: > +if (memory_str) VIR_FREE(memory_str); VIR_FREE is fine being called with NULL. Actually "make syntax-check" should have told you. > +hypervFreeObject(priv, (hypervObject *) vssd); > +hypervFreeObject(priv, (hypervObject *) memsd); > +return result; > +} -- 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 v3 4/5] hyperv: support virDomainSendKey

2017-05-01 Thread Matthias Bolte
; +if (hypervInvokeMethod(priv, params, NULL) < 0) { > +virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not press key > %d"), > + translatedKeycodes[i]); > +goto cleanup; > +} This is not correct. If

Re: [libvirt] [PATCH v3 1/5] hyperv: Functions to work with invocation parameters.

2017-05-01 Thread Matthias Bolte
> +goto cleanup; ... and here. > +p = >params[params->nbParams]; > +p->type = HYPERV_EMBEDDED_PARAM; > +p->embedded.name = name; > +p->embedded.table = table; > +p->embedded.info = classInfo; > +params->nbParams++

Re: [libvirt] [PATCH v3 3/5] hyperv: add hypervInvokeMethod

2017-05-01 Thread Matthias Bolte
ERNAL_ERROR, > + _("Could not get instance ID for %s invocation"), > + params->method); > +goto cleanup; > +} > + > +/* Poll every 100 ms until the job completes or fails */ > +while (!completed) { > +virBufferAddLit(, MSVM_CONCRETEJOB_WQL_SELECT); > +virBufferAsprintf(, "where InstanceID = \"%s\"", > instanceID); > + > +if (hypervGetMsvmConcreteJobList(priv, , ) < 0 > +|| job == NULL) > +goto cleanup; > + > +jobState = job->data.common->JobState; > +switch (jobState) { > +case MSVM_CONCRETEJOB_JOBSTATE_NEW: > +case MSVM_CONCRETEJOB_JOBSTATE_STARTING: > +case MSVM_CONCRETEJOB_JOBSTATE_RUNNING: > +case MSVM_CONCRETEJOB_JOBSTATE_SHUTTING_DOWN: > +hypervFreeObject(priv, (hypervObject *) job); > +job = NULL; > +usleep(100 * 1000); /* sleep 100 ms */ > +continue; > +case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: > +completed = true; > +break; > +case MSVM_CONCRETEJOB_JOBSTATE_TERMINATED: > +case MSVM_CONCRETEJOB_JOBSTATE_KILLED: > +case MSVM_CONCRETEJOB_JOBSTATE_EXCEPTION: > +case MSVM_CONCRETEJOB_JOBSTATE_SERVICE: > +goto cleanup; > +default: > +virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > + _("Unknown invocation state")); > +goto cleanup; > +} > +} How do you avoid waiting forever for a job to finish? > +} else if (returnCode != CIM_RETURNCODE_COMPLETED_WITH_NO_ERROR) { > +virReportError(VIR_ERR_INTERNAL_ERROR, _("Invocation of %s returned > an error: %s (%d)"), > +params->method, hypervReturnCodeToString(returnCode), > +returnCode); > +goto cleanup; > +} > + > +if (res != NULL) Your pointer checking style is inconsistent. libvirt favors the short form "if (ptr)" and "if (!ptr)" for new code over the long format "if (ptr != NULL)" and "if (ptr == NULL)". > +*res = response; > + > +result = 0; > + > + cleanup: > +if (options) > +wsmc_options_destroy(options); > +if (response && (res == NULL)) > +ws_xml_destroy_doc(response); > +if (paramsDocRoot) > +ws_xml_destroy_doc(paramsDocRoot); > +VIR_FREE(returnValue_xpath); > +VIR_FREE(jobcode_instance_xpath); > +VIR_FREE(returnValue); > +VIR_FREE(instanceID); > +virBufferFreeAndReset(); > +hypervFreeObject(priv, (hypervObject *) job); > +hypervFreeInvokeParams(params); > +return result; > +} -- 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 v2 5/5] hyperv: Add support for virDomainSetMemory

2017-04-23 Thread Matthias Bolte
is no need to free it here again. > + > +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * > + * Msvm_MemorySettingData > + */ > + > +int > +hypervGetMsvmMemorySettingDataFromVSSD(hypervPrivate *priv, > +const char *vssd_instan

Re: [libvirt] [PATCH v2 1/5] hyperv: Functions to work with invocation parameters.

2017-04-23 Thread Matthias Bolte
_t nbAvailParams; > +}; > +typedef struct _hypervInvokeParamsList hypervInvokeParamsList; > +typedef hypervInvokeParamsList *hypervInvokeParamsListPtr; > + > + > +hypervInvokeParamsListPtr hypervInitInvokeParamsList(hypervPrivate *priv, > + const char *method, const char *selector, hypervWmiClassIn

Re: [libvirt] [PATCH v3] hyperv: recognize array property as distinct type.

2017-04-18 Thread Matthias Bolte
* but if there's more than 1, separate by double new line */ > +if (virBufferUse() > 0) > +virBufferAddLit(, "\n\n"); > + > +virBufferAdd(, *notes, -1); > +notes++; > +} > + > +if (virBufferCheckError())

Re: [libvirt] [PATCH 5/6] util: add virNumToStr

2017-04-18 Thread Matthias Bolte
turn -1; > + > +snprintf(*dst, sz + 1, "%lu", num); > +return 0; > +} > + What's the gain of if (virNumToStr_ul(memory_mb, _str) < 0) goto cleanup; over if (virAsprintf(_str, "%lu", memory_mb) < 0) goto cleanup; ? I think those two new functions are not necessary at all. -- 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 v2] hyperv: recognize array property as distinct type.

2017-04-18 Thread Matthias Bolte
ontentAndReset will silently return NULL if an error (e.g. OOM) occurred while building the buffer content. You current code will silently set description to NULL instead of properly reporting an error. Use virBufferCheckError as shown here: http://libvirt.org/hacking.html#strbuf virBufferCheckError will re

Re: [libvirt] [PATCH] hyperv: recognize array property as distinct type.

2017-04-11 Thread Matthias Bolte
es the pointer by one item. This will add the first item of the notes array count times to the buffer instead of adding each item to the buffer once. I think you need to move the "notes = (char **) virtualSystemSettingData->data.v2->Notes.data;" line before the for loop to make this work correctly. -- 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 v4 04/12] hyperv: add hypervWqlQuery struct.

2017-04-08 Thread Matthias Bolte
; > }; > > +typedef struct _hypervWqlQuery hypervWqlQuery; > +typedef hypervWqlQuery *hypervWqlQueryPtr; > +struct _hypervWqlQuery { > +virBuffer query; > +hypervWmiClassInfoListPtr info; > +}; My suggestion to use a virBuffer instead of a virBufferPtr here wasn't well though

Re: [libvirt] [PATCH v4 05/12] hyperv: make hypervEnumAndPull use hypervWqlQuery

2017-04-08 Thread Matthias Bolte
gt; -query_string = virBufferContentAndReset(query); > +query_string = virBufferContentAndReset(>query); > > if (list == NULL || *list != NULL) { > virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); > -VIR_FREE(qu

Re: [libvirt] [PATCH v4 00/12] hyperv: add support for Hyper-V 2012 and newer.

2017-04-08 Thread Matthias Bolte
| 30 +++ > src/hyperv/hyperv_wmi_generator.input | 239 ++--- > src/hyperv/hyperv_wmi_generator.py| 381 > +- > 10 files changed, 822 insertions(+), 247 deletions(-) ACK for the whole series. I made two minor changes to the series in patc

Re: [libvirt] [PATCH v3 12/12] news: update for Hyper-V 2012+ support.

2017-04-04 Thread Matthias Bolte
ocs/news.xml > @@ -37,6 +37,17 @@ > > > > + > + > + The libvirt Hyper-V driver now supports Hyper-V 2012 and newer. Maybe drop "libvirt" from this line, as it seems redundant to me. -- Matthias Bolte http://photron.blogspot.com -- libvir-li

Re: [libvirt] [PATCH v3 07/12] hyperv: update wmi code generator.

2017-04-04 Thread Matthias Bolte
gt; + > +def __init__(self, name, version, properties, uri_info): > +self.name = name > +self.version = version > +self.properties = properties > +self.uri_info = uri_info > > -return source > > > class Property: > @@ -155

Re: [libvirt] [PATCH v3 05/12] hyperv: make hypervEnumAndPull use hypervWqlQuery

2017-04-04 Thread Matthias Bolte
ndPull(hypervPrivate *priv, virBufferPtr > query, const char *root, > /* FIXME: ws_serializer_free_mem is broken in openwsman <= 2.2.6, > *see hypervFreeObject for a detailed explanation. */ > if (ws_serializer_free_mem(serializerContext, data, > - serializerInfo) < 0) { > + wmiInfo->serializerInfo) < 0) { > VIR_ERROR(_("Could not free deserialized data")); > } > #endif > } > > -VIR_FREE(query_string); > ws_xml_destroy_doc(response); > VIR_FREE(enumContext); > hypervFreeObject(priv, head); -- 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 v2 00/10] hyperv: add support for Hyper-V 2012 and newer.

2017-04-03 Thread Matthias Bolte
ing is a potential documentation update (see docs/drvhyperv.html.in) and an addition to the news file (see docs/news.xml) -- 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 v3 09/10] hyperv: port rest of the driver to new stucts.

2017-04-03 Thread Matthias Bolte
re for HYPERV_WMI_VERSION_V2 and change it to v2? No need to send a new patch version to fix this. I already have the patches 4-10 merged and ready to be pushed. I'll just incorporate any necessary change before pushing. -- 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 05/11] hyperv: add hypervWqlQuery struct.

2017-04-01 Thread Matthias Bolte
ot;v1"; > + > +for (i = 0; i < list->count; i++) { > + if (STRCASEEQ(list->objs[i]->version, version)) { > + *info = list->objs[i]; > + return 0; > + } > +} > + > +virReportError(VIR_ERR_INTERNAL_ERROR, > +

Re: [libvirt] [PATCH v3 08/11] hyperv: update wmi code generator.

2017-04-01 Thread Matthias Bolte
classes_source()) > +cls = wmi_classes_by_name[name] > +cls.prepare() > + > +classes_typedef.write(cls.generate_classes_typedef()) > +classes_header.write(cls.generate_classes_header()) > +classes_source.write(cls.generate_classes_source()) You're d

Re: [libvirt] [PATCH 03/11] hyperv: introduce hypervWmiClassInfo struct.

2017-04-01 Thread Matthias Bolte
an/1/wmi/root/virtualization/*; > > #define VIR_FROM_THIS VIR_FROM_HYPERV > > - > - > int > hypervVerifyResponse(WsManClient *client, WsXmlDocH response, > const char *detail) Unnecessary whitespace change. Also this will not pass make syntax-check. I'll drop this complete hunk before pushing it. -- 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 01/11] hyperv: fixed typo in function name.

2017-03-31 Thread Matthias Bolte
tter part of the evening getting my Linux machine up-to-date again. I'll probably continue the review tomorrow. -- 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/11] hyperv: add support for Hyper-V 2012 and newer.

2017-03-30 Thread Matthias Bolte
generator > so that it's "aware" of possibility of multiple versions of the same WMI > class and produce C code accordingly. I took a quick look at the series. Overall it looks very good and I like the underlying approach. I'll do a detailed review of it tomorrow. -- Matthias Bolte h

Re: [libvirt] [PATCH v2a] HyperV: Improve 2008, introduce 2012

2016-09-16 Thread Matthias Bolte
2016-09-16 21:06 GMT+02:00 Matthias Bolte <matthias.bo...@googlemail.com>: > [please don't top-post] > > 2016-09-16 20:11 GMT+02:00 Jason Miesionczek <jmiesionc...@datto.com>: >> Not sure I understand what you mean by ‘not adding the string table’. Could >&

Re: [libvirt] [PATCH v2a] HyperV: Improve 2008, introduce 2012

2016-09-16 Thread Matthias Bolte
enum/index stuff? I’m not sure I follow what you are suggesting. > > Thanks! > >> On Sep 16, 2016, at 2:02 PM, Matthias Bolte <matthias.bo...@googlemail.com> >> wrote: >> >> 2016-09-16 18:35 GMT+02:00 Jason Miesionczek <jmiesionc...@datto.com>: >>>

Re: [libvirt] [PATCH v2a] HyperV: Improve 2008, introduce 2012

2016-09-16 Thread Matthias Bolte
ter each commit. For example the first commit adds some new types. The second commit uses these new types. But those two commits would not add the string table. This would either be a separate commit or be part of the commit add the gen general code the uses the string table. -- Matt

Re: [libvirt] [PATCH 07/16] hyperv: implement ability to send xml soap requests

2016-09-16 Thread Matthias Bolte
ion"; > +(*tab_props).val = autostart ? "2" : "0"; > +(*(tab_props+1)).name = "InstanceID"; > +(*(tab_props+1)).val = virtualSystemSettingData->data->InstanceID; Why do you do a VIR_ALLOC_N here? You know the number of elements at compile time an

Re: [libvirt] [PATCH] hyperv: add new WMI classes and improve generator

2016-09-16 Thread Matthias Bolte
onse to patch 7, I think the string based lookup inefficient and unnecessary. The generator has all the information to make this a 2-level index based lookup. Therefore, NACK. -- 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 02/16] hyperv: add cim types support to code generator

2016-09-15 Thread Matthias Bolte
2016-09-14 23:38 GMT+02:00 Matthias Bolte <matthias.bo...@googlemail.com>: > 2016-09-14 23:16 GMT+02:00 John Ferlan <jfer...@redhat.com>: >> >> >> On 08/09/2016 08:39 AM, Jason Miesionczek wrote: >>> --- &g

Re: [libvirt] [PATCH 01/16] hyperv: additional server 2008 wmi classes

2016-09-15 Thread Matthias Bolte
2016-09-14 23:34 GMT+02:00 Matthias Bolte <matthias.bo...@googlemail.com>: > 2016-09-14 23:00 GMT+02:00 John Ferlan <jfer...@redhat.com>: >> >> >> On 08/09/2016 08:39 AM, Jason Miesionczek wrote: >>> --- >&g

Re: [libvirt] [PATCH 02/16] hyperv: add cim types support to code generator

2016-09-14 Thread Matthias Bolte
tch 7 at runtime. I don't think that that is the right approach for this. John, thanks for looking at these patches. -- 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 01/16] hyperv: additional server 2008 wmi classes

2016-09-14 Thread Matthias Bolte
an what > appears to be 2 spaces and a > > As for the "details" of each structure, I'll defer to other reviewers > and specifically Matthias' ACK > > You should do the clean up and post a v2 once I've gone through these. No need for a v2 here. I've this fixed loca

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

2016-09-07 Thread Matthias Bolte
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] [libvirt-php][PATCH] libvirt_list_active_domains: Don't free domain before strduping its name

2016-09-07 Thread Matthias Bolte
free(ids); You need to call virDomainFree here as well. Otherwise the domain objects leaks if virDomainGetName fails. > RETURN_FALSE; > } > > VIRT_ADD_NEXT_INDEX_STRING(return_value, name); > + > +if (virDomainFree(domain)) > + resource_c

Re: [libvirt] [libvirt-php] libvirt_list_active_domains returns garbage querying a Hyper-V host

2016-09-07 Thread Matthias Bolte
ain object using virDomainFree (this also frees the domain name) and afterwards tries to use the already freed domain name. libvirt_list_active_domains needs to add the domian name to the result list and then free the domain. For example, libvirt_list_domains does it in the correct order. -- 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 01/16] hyperv: additional server 2008 wmi classes

2016-08-19 Thread Matthias Bolte
entation. I assume that you tested this and that it works. ACK. I'll add a comment explaining the "boolean PortableOperatingSystem" situation and cleanup the white space before pushing it. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-list@redhat.com ht

Re: [libvirt] [PATCH 01/16] hyperv: additional server 2008 wmi classes

2016-08-19 Thread Matthias Bolte
t; + string SerialNumber >>> + uint16 ServicePackMajorVersion >>> + uint16 ServicePackMinorVersion >>> + uint64 SizeStoredInPagingFiles >>> + string Status >>> + uint32 SuiteMask >>> + string

Re: [libvirt] [PATCH 3/3] esx: use newer virtualHW version for 5.1+ hosts

2016-05-26 Thread Matthias Bolte
> https://kb.vmware.com/selfservice/microsites/search.do?language=en_US=displayKC=2054952 ACK and pushed. -- 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 2/3] esx: Add VMCI device for virtualHW >= 7

2016-05-26 Thread Matthias Bolte
ufferAddLit(, "pciBridge7.virtualDev = > \"pcieRootPort\"\n"); > virBufferAddLit(, "pciBridge7.functions = \"8\"\n"); > } > + > +virBufferAddLit(, "vmci0.present = \"true\"\n"); > }

Re: [libvirt] [PATCH 1/3] esx: add pciBridge devices when SCSI is used

2016-05-26 Thread Matthias Bolte
t; > +pciBridge6.virtualDev = "pcieRootPort" > +pciBridge6.functions = "8" > +pciBridge7.present = "true" > +pciBridge7.virtualDev = "pcieRootPort" > +pciBridge7.functions = "8" Matches what we already have in some vmx2xml in-the-wild files. ACK and pushed with the listed changes. -- 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] esx: do not store escaped password in esxVI_Context.

2016-05-26 Thread Matthias Bolte
ction(ctx) < 0) { But you need to free it here > return -1; > } and here, otherwise you'll leak memory. And as Michal already mentioned, you missed the login call in esxVI_EnsureSession. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] VMware driver: SessionIsActive API / Sessions.ValidateSession permission

2016-02-18 Thread Matthias Bolte
2016-02-16 16:13 GMT+01:00 Richard W.M. Jones <rjo...@redhat.com>: > On Mon, Feb 15, 2016 at 11:22:27PM +0100, Matthias Bolte wrote: >> 2016-02-11 12:59 GMT+01:00 Richard W.M. Jones <rjo...@redhat.com>: >> > Is calling SessionIsActive necessary? From my (very limited

Re: [libvirt] VMware driver: SessionIsActive API / Sessions.ValidateSession permission

2016-02-15 Thread Matthias Bolte
s. Do you have the option to test this in an actual setup? -- Matthias Bolte http://photron.blogspot.com From d94afccfdee014ee97ecbf01f1108e17014b2017 Mon Sep 17 00:00:00 2001 From: Matthias Bolte <matthias.bo...@googlemail.com> Date: Mon, 15 Feb 2016 21:17:49 +0100 Subject: [PATCH] esx: Avoid

Re: [libvirt] [PATCH v2] vmx: Adapt to emptyBackingString for cdrom-image

2016-01-24 Thread Matthias Bolte
;emptyBackingString" > diff --git a/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml > b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml > new file mode 100644 > index 000..f2e4c75 > --- /dev/null > +++ b/tests/vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml > @@ -0,0 +1,23 @

Re: [libvirt] [PATCH] vmx: Adapt to emptyBackingString for cdrom-image

2016-01-11 Thread Matthias Bolte
uotes)) > Shouldn't hurt > > ACK This patch is missing a test case and a corresponding addition to the format function to allow for proper round-trip. I'll propose an improve version later today. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] VMware: Map vpx:// to dcPath

2015-09-17 Thread Matthias Bolte
2015-09-16 10:47 GMT+02:00 Richard W.M. Jones <rjo...@redhat.com>: > On Fri, Sep 11, 2015 at 03:55:03PM +0200, Matthias Bolte wrote: >> 2015-09-07 22:04 GMT+02:00 Richard W.M. Jones <rjo...@redhat.com>: >> > On Mon, Sep 07, 2015 at 02:29:22PM +0200, Matth

Re: [libvirt] VMware: Map vpx:// to dcPath

2015-09-11 Thread Matthias Bolte
2015-09-07 22:04 GMT+02:00 Richard W.M. Jones <rjo...@redhat.com>: > On Mon, Sep 07, 2015 at 02:29:22PM +0200, Matthias Bolte wrote: >> I think the datacenter path could be exposed >> as part of the domain XML as >> /path/to/dc similar to >> the way works. B

Re: [libvirt] [PATCH 0/3] vmx: Add handling for CDROM devices with SCSI passthru and other minor fixes

2015-09-07 Thread Matthias Bolte
2015-09-02 13:00 GMT+02:00 Michal Privoznik <mpriv...@redhat.com>: > On 01.09.2015 16:52, Matthias Bolte wrote: >> This patch series addresses this bug report: >> >> https://bugzilla.redhat.com/show_bug.cgi?id=1172544 >> >> It's mean as a replacement for t

Re: [libvirt] [PATCH 2/3] vmx: The virVMXParseDisk deviceType can be NULL, add some missing checks

2015-09-07 Thread Matthias Bolte
2015-09-07 8:28 GMT+02:00 Michal Privoznik <mpriv...@redhat.com>: > On 05.09.2015 16:29, Matthias Bolte wrote: >> 2015-09-02 13:00 GMT+02:00 Michal Privoznik <mpriv...@redhat.com>: >>> On 01.09.2015 16:52, Matthias Bolte wrote: >>>> --- >>>>

Re: [libvirt] VMware: Map vpx:// to dcPath

2015-09-07 Thread Matthias Bolte
e way works. But it would be ignored on parsing. Would that work for you? If yes, I can propose a patch that does this. -- 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 2/3] vmx: The virVMXParseDisk deviceType can be NULL, add some missing checks

2015-09-05 Thread Matthias Bolte
2015-09-02 13:00 GMT+02:00 Michal Privoznik <mpriv...@redhat.com>: > On 01.09.2015 16:52, Matthias Bolte wrote: >> --- >> src/vmx/vmx.c | 22 +++--- >> 1 file changed, 11 insertions(+), 11 deletions(-) >> >> diff --git a/src/vmx/vmx.c b/

Re: [libvirt] [PATCH] virVMXParseDisk: Recognize scsi-passthru

2015-09-01 Thread Matthias Bolte
Ok here's my patch for this: https://www.redhat.com/archives/libvir-list/2015-September/msg5.html Regards, Matthias 2015-08-28 12:08 GMT+02:00 Matthias Bolte <matthias.bo...@googlemail.com>: > 2015-08-28 11:36 GMT+02:00 Michal Privoznik <mpriv...@redhat.com>: >> https:

[libvirt] [PATCH 0/3] vmx: Add handling for CDROM devices with SCSI passthru and other minor fixes

2015-09-01 Thread Matthias Bolte
This patch series addresses this bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1172544 It's mean as a replacement for this patch: https://www.redhat.com/archives/libvir-list/2015-August/msg00970.html Matthias Bolte (3): vmx: Some whitespace cleanup vmx: The virVMXParseDisk

[libvirt] [PATCH 2/3] vmx: The virVMXParseDisk deviceType can be NULL, add some missing checks

2015-09-01 Thread Matthias Bolte
--- src/vmx/vmx.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index ba4d046..9d1574f 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2178,8 +2178,9 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr

[libvirt] [PATCH 1/3] vmx: Some whitespace cleanup

2015-09-01 Thread Matthias Bolte
* * Copyright (C) 2010-2014 Red Hat, Inc. - * Copyright (C) 2009-2010 Matthias Bolte <matthias.bo...@googlemail.com> + * Copyright (C) 2009-2011, 2014-2015 Matthias Bolte <matthias.bo...@googlemail.com> * * This library is free software; you can redistribute it and/or * modify it und

[libvirt] [PATCH 3/3] vmx: Add handling for CDROM devices with SCSI passthru

2015-09-01 Thread Matthias Bolte
https://bugzilla.redhat.com/show_bug.cgi?id=1172544 --- src/vmx/vmx.c | 36 -- tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx | 6 ++ tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml | 24 +++ tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx |

Re: [libvirt] [PATCH] virVMXParseDisk: Recognize scsi-passthru

2015-08-28 Thread Matthias Bolte
a more detailed look at the reported issue. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Building libvirt under Windows

2015-04-16 Thread Matthias Bolte
haven't update them in the last two years, so they might not work out-of-the-box anymore. But it might still be helpful to look at them and see how I did things. Regarding XDR: I used portablexdr. It worked for me, I can't remember if I had to patch it or not. -- Matthias Bolte http

Re: [libvirt] [PATCH v2] esx: Simplify VI (vSphere) API and VMware product version handling

2014-11-08 Thread Matthias Bolte
2014-10-24 20:09 GMT+02:00 Eric Blake ebl...@redhat.com: On 10/18/2014 04:08 PM, Matthias Bolte wrote: Store version numbers in this format version = 100 * major + 1000 * minor + micro produced by virParseVersionString instead of dedicated enums. Split the complex esxVI_ProductVersion

[libvirt] [PATCH] esx: Simplify VI (vSphere) API and VMware product version handling

2014-10-18 Thread Matthias Bolte
Store version numbers in this format version = 100 * major + 1000 * minor + micro produces by virParseVersionString instead of dedicated enums. Split the complex esxVI_ProductVersion enum into a simpler sxVI_ProductLine enum and a product version number. Relax API and product version

[libvirt] [PATCH v2] esx: Simplify VI (vSphere) API and VMware product version handling

2014-10-18 Thread Matthias Bolte
Store version numbers in this format version = 100 * major + 1000 * minor + micro produced by virParseVersionString instead of dedicated enums. Split the complex esxVI_ProductVersion enum into a simpler esxVI_ProductLine enum and a product version number. Relax API and product version

Re: [libvirt] [PATCH] esx: Simplify VI (vSphere) API and VMware product version handling

2014-10-18 Thread Matthias Bolte
2014-10-18 23:11 GMT+02:00 Matthias Bolte matthias.bo...@googlemail.com: Store version numbers in this format version = 100 * major + 1000 * minor + micro produces by virParseVersionString instead of dedicated enums. Split the complex esxVI_ProductVersion enum into a simpler

Re: [libvirt] [PATCH v3 repost] esx: Add the actual product version to the error message.

2014-10-18 Thread Matthias Bolte
'v2v-vcenter' to be a ESX(i) host but found a vCenter/VPX host -- 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] Fix build with older libcurl

2014-10-08 Thread Matthias Bolte
yesterday. Sorry and thanks for fixing this. -- Matthias Bolte http://photron.blogspot.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Features - virDomainOpenConsole

2014-10-08 Thread Matthias Bolte
and to pay them for their efforts. About which VMware products are you talking here? vSphere/ESX or Workstation/Player/Fusion? -- 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 1/2] esx: Add libcurl based stream driver

2014-10-07 Thread Matthias Bolte
2014-03-31 15:46 GMT+02:00 Michal Privoznik mpriv...@redhat.com: On 30.03.2014 21:03, Matthias Bolte wrote: This allows to implement libvirt functions that use streams, such as virDoaminScreenshot, without the need to store the downloaded data in a temporary file first. The stream driver

Re: [libvirt] [PATCH 2/2] esx: Implement virDomainScreenshot using libcurl stream driver

2014-10-07 Thread Matthias Bolte
2014-03-31 15:46 GMT+02:00 Michal Privoznik mpriv...@redhat.com: On 30.03.2014 21:03, Matthias Bolte wrote: This implementation uses the https://esx-server/screen?id=id way to get a screenshot of a running domain. Compared to the CreateScreenshot_Task way this works since ESX 2.5 while

Re: [libvirt] [PATCH] esx: Fix a comment about VSphere versions

2014-07-17 Thread Matthias Bolte
2014-07-17 0:25 GMT+02:00 Geoff Hickey ghic...@datagravity.com: Update the VSphere version comment in esx_vi.c for ESX 5.1 and 5.5. --- src/esx/esx_vi.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) ACK and pushed! -- Matthias Bolte http://photron.blogspot.com

[libvirt] [PATCH] conf: Fix possible NULL dereference in virStorageVolTargetDefFormat

2014-07-11 Thread Matthias Bolte
Commit dae1568c6c6455091e8cd9bc2e90a22af3d3880c converted the perms member of the virStorageVolTarget struct into a pointer to make it optional. But virStorageVolTargetDefFormat did not check perms for NULL before dereferencing it. --- src/conf/storage_conf.c | 26 ++ 1

Re: [libvirt] [PATCH] vmx: Relax virtualHW.version check

2014-06-07 Thread Matthias Bolte
2014-05-11 12:08 GMT+02:00 Martin Kletzander mklet...@redhat.com: On Sat, May 10, 2014 at 04:41:16PM +0200, Matthias Bolte wrote: The original implementation of the VMX config parser assumed that the virtualHW.version would have more influence on the content of the VMX file than it actually

  1   2   3   4   5   6   7   8   9   10   >