[libvirt] [PATCH 1/2] ESX: Allow method calls for VI version 2.5

2014-03-27 Thread Dawid Zamirski
Currently, ESX driver can only issue VI method calls available in version 2.5. To send method calls available in newer versions, a SOAPAction header needs to be set in the following format: 'SOAPAction: urn:vim25/version_number' This patch modifies the Python code generator to optionally read

[libvirt] [PATCH 2/2] ESX: Implement virDomainScreenshot

2014-03-27 Thread Dawid Zamirski
This patch implements virDomainScreenshot support for ESX versions newer than 4.0. It adds CreateScreenshot_Task (apiVersion 4.0) and DeleteDatastoreFile_Task (v2.5) then uses those to implement esxDomainScreenshot function. The DeleteDatastoreFile_Task is used to remove the screenshot file that

[libvirt] [PATCH 0/2] ESX: Implement virDomainScreenshot

2014-03-27 Thread Dawid Zamirski
token to the method header definition in the .input file. If it is not specified, 2.5 will be used so existing VI calls will work as is without any code updates. Regards, Dawid Zamirski (2): ESX: Allow method calls for VI version 2.5 ESX: Implement virDomainScreenshot src/esx/esx_driver.c

[libvirt] [PATCH] ESX: Add support for virtualHW version 10

2014-03-27 Thread Dawid Zamirski
This follows the same pattern when v8 and v9 were added. I've tested this with my ESX 5.5 and seems to work fine. --- src/vmx/vmx.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 32ddd05..5dc9925 100644 --- a/src/vmx/vmx.c +++

Re: [libvirt] [PATCH 0/2] esx: Add libcurl based stream driver and implement virDomainScreenshot

2014-04-25 Thread Dawid Zamirski
no ESX test system at hand for the last year or so. Dawid Zamirski posted some patches [1] to implement virDomainScreenshot for ESX. So I finally managed to set up some ESX test system again this weekend and get my old code dusted up. His implementation has two disadvantages, namely storing

[libvirt] [PATCH] ESX: add virStorageVolGetInfo in iSCSI backend.

2014-04-25 Thread Dawid Zamirski
Since the ESX storage implements VMFS and iSCSI storage backends and chooses relevant backend dynamically at runtime, there was a segfault when issuing vol-info on iSCSI volume due to unimplemented virStorageGetInfo function. This patch implements that function that was missing in iSCSI backend

[libvirt] [PATCH] php: implement libvirt_node_get_free_memory.

2014-05-01 Thread Dawid Zamirski
This patch adds support for virNodeGetFreeMemory which is available in libvirt since v0.3.3. While the php bindings alredy provide libvirt_node_get_mem_stats from which such info could be obtained, not all hypervisors support it, e.g. vbox and esx driver don't have it but they do implement

Re: [libvirt] [PATCH] php: implement libvirt_node_get_free_memory.

2014-05-01 Thread Dawid Zamirski
On Thu, 2014-05-01 at 12:55 -0600, Eric Blake wrote: [meta-comment] I'm not a PHP expert, so I'll let others review the patch itself. But when contributing patches to libvirt-php.git, it helps if you do: git config format.subjectprefix php PATCH to make it obvious which repo you are

[libvirt] [php PATCH] Use long variable type for zend_parse_parameters.

2014-06-18 Thread Dawid Zamirski
This patch fixes a bug where zend_parse_parameters would segfault on certain PHP version (spotted on PHP 5.3.2 64bit) where type specifier is long l and variable reference is int or unsigned int. Changing the variable type from int or unsigned int to long fixes the problem for me and is a known

[libvirt] [php PATCH] Fix compiler warnings after int to long conversion

2014-06-18 Thread Dawid Zamirski
The previous patch [1] caused compiler warnings after variable types were changed from int to long and this patch fixes this. [1] https://www.redhat.com/archives/libvir-list/2014-June/msg00835.html --- src/libvirt-php.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [libvirt] [php PATCH] Fix compiler warnings after int to long conversion

2014-06-18 Thread Dawid Zamirski
. Sorry for the noise with such a simple patch... Regards, Dawid 2014-06-18 22:05 GMT+02:00 Dawid Zamirski dzamir...@dattobackup.com: Ugh, now I know what happened - my local master branch has commits I have not sent pull requests for yet so it wasn't in 100

[libvirt] [RFC PATCH 1/2] vbox: Register IKeyboard with the unified API.

2015-03-19 Thread Dawid Zamirski
The IKeyboard COM object is needed to implement virDomainSendKey and is available in all supported VBOX versions. --- src/vbox/vbox_tmpl.c | 27 +++ src/vbox/vbox_uniformed_api.h | 8 2 files changed, 35 insertions(+) diff --git a/src/vbox/vbox_tmpl.c

[libvirt] [RFC PATCH 2/2] vbox: Implement virDomainSendKey

2015-03-19 Thread Dawid Zamirski
Since the holdtime is not supported by VBOX SDK, it's being simulated by sleeping before sending the key-up codes. The key-up codes are auto-generated based on XT codeset rules (adding of 0x80 to key-down) which results in the same behavior as for QEMU implementation. --- src/vbox/vbox_common.c |

[libvirt] [RFC PATCH 0/2] Vbox: Add support for virDomainSendKey

2015-03-19 Thread Dawid Zamirski
. Dawid Zamirski (2): vbox: Register IKeyboard with the unified API. vbox: Implement virDomainSendKey src/vbox/vbox_common.c| 107 ++ src/vbox/vbox_common.h| 1 + src/vbox/vbox_tmpl.c | 27 +++ src/vbox

[libvirt] [PATCH] vbox: use user cache dir when screenshotting.

2015-03-09 Thread Dawid Zamirski
For VBOX it's most likely that the connection is vbox:///session and it runs with local non-root account. This caused permission denied when LOCALSTATEDIR was used to create temp file. This patch makes use of the virGetUserCacheDirectory to address this problem for non-root users. ---

[libvirt] [PATCH] vmx: add e1000e to supported NIC models.

2015-03-09 Thread Dawid Zamirski
From: Dawid Zamirski dzamir...@dattobackup.com This NIC model is supported on hardware version 8 and newer and libvirt ESX driver does support those. --- src/vmx/vmx.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index ac2542a

[libvirt] [PATCH 2/2] esx: esxNodeGetFreeMemory return info from host.

2015-03-09 Thread Dawid Zamirski
Before this patch, when connected via vCenter, the free memory returned was from the resorcePool (usually a cluster). This is in conflict with e.g esxNodeGetInfo which always pulls info from the ESX host. Since libvirt ESX driver works primarily with ESX hosts, this patch changes

[libvirt] [PATCH 0/2] esx: Make esxNodeGetFreeMemory always use ESX host.

2015-03-09 Thread Dawid Zamirski
is mandatory, even for vpx connections) so to make this consitent, these patches make virNodeGetFreeMemory always return info from the ESX host. Dawid Zamirski (2): esx: add esxVI_GetInt esx: esxNodeGetFreeMemory return info from host. src/esx/esx_driver.c | 53

[libvirt] [PATCH 1/2] esx: add esxVI_GetInt

2015-03-09 Thread Dawid Zamirski
Modeled after the already existing esxVI_GetLong. --- src/esx/esx_vi.c | 32 src/esx/esx_vi.h | 3 +++ src/esx/esx_vi_types.c | 3 +++ src/esx/esx_vi_types.h | 1 + 4 files changed, 39 insertions(+) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c

[libvirt] [PATCHv2 0/2] vbox: Add support for virDomainSendKey

2015-04-07 Thread Dawid Zamirski
://www.redhat.com/archives/libvir-list/2015-March/msg01028.html v2: - add virReportError in all potentially failing code paths - coding style adjustment - mark for 1.2.15 Dawid Zamirski (2): vbox: Register IKeyboard with the unified API. vbox: Implement virDomainSendKey src/vbox/vbox_common.c

[libvirt] [PATCHv2 2/2] vbox: Implement virDomainSendKey

2015-04-07 Thread Dawid Zamirski
Since the holdtime is not supported by VBOX SDK, it's being simulated by sleeping before sending the key-up codes. The key-up codes are auto-generated based on XT codeset rules (adding of 0x80 to key-down) which results in the same behavior as for QEMU implementation. --- src/vbox/vbox_common.c |

[libvirt] [PATCHv2 1/2] vbox: Register IKeyboard with the unified API.

2015-04-07 Thread Dawid Zamirski
The IKeyboard COM object is needed to implement virDomainSendKey and is available in all supported VBOX versions. --- src/vbox/vbox_tmpl.c | 27 +++ src/vbox/vbox_uniformed_api.h | 8 2 files changed, 35 insertions(+) diff --git a/src/vbox/vbox_tmpl.c

Re: [libvirt] [RFC PATCH 2/2] vbox: Implement virDomainSendKey

2015-04-07 Thread Dawid Zamirski
On Tue, 2015-04-07 at 12:27 +0200, Ján Tomko wrote: On Thu, Mar 19, 2015 at 05:43:57PM -0400, Dawid Zamirski wrote: Since the holdtime is not supported by VBOX SDK, it's being simulated by sleeping before sending the key-up codes. The key-up codes are auto-generated based on XT codeset

Re: [libvirt] [PATCH] esx: do not store escaped password in esxVI_Context.

2016-05-25 Thread Dawid Zamirski
Hi Michal, Thanks for reviewing. I'll send v2 soon to handle EnsureSession as well. Regards, Dawid On Wed, 2016-05-25 at 14:33 +0200, Michal Privoznik wrote: > On 23.05.2016 23:32, Dawid Zamirski wrote: > > This patch fixes an issue where screenshot API call was failing > > w

[libvirt] [PATCH v2] esx: do not store escaped password in esxVI_Context.

2016-05-26 Thread Dawid Zamirski
This patch fixes an issue where screenshot API call was failing when the esx/vcenter password contains special characters such as apostrophee. The reason for failures was that passwords were escaped for XML and stored in esxVI_Context which was then passed to raw CURL API calls where the password

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

2016-05-23 Thread Dawid Zamirski
When a SCSI controller is present, ESX adds several pciBridge devices to vmx file. This fixes an error message where it refuses to create VM due to not enough PCI devices available. This applies only to virtualHW version >= 7. --- src/vmx/vmx.c | 25

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

2016-05-23 Thread Dawid Zamirski
This is because there's a known issue where ESX will refuse to attach drives bigger than 4TB when virtualHW < 9. Therefore, to avoid that use the higher virtualHW for hosts that support it. --- https://kb.vmware.com/selfservice/microsites/search.do?language=en_US=displayKC=2054952

[libvirt] [PATCH 2/3] esx: Add VMCI device for virtualHW >= 7

2016-05-23 Thread Dawid Zamirski
This patch fixes an issue where vMotion fails when VMCI device is not present in the vmx file. --- src/vmx/vmx.c | 2 ++ tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx | 1 + tests/xml2vmxdata/xml2vmx-serial-network-client.vmx | 1 +

[libvirt] [PATCH 0/3] esx: improve virtualHW > 7 handling.

2016-05-23 Thread Dawid Zamirski
size limit and vMotion compatibility. Dawid Zamirski (3): esx: add pciBridge devices when SCSI is used esx: Add VMCI device for virtualHW >= 7 esx: use newer virtualHW version for 5.1+ hosts src/esx/esx_vi.c | 17 ++ src/vmx/vm

[libvirt] [PATCH] esx: do not store escaped password in esxVI_Context.

2016-05-23 Thread Dawid Zamirski
This patch fixes an issue where screenshot API call was failing when the esx/vcenter password contains special characters such as apostrophee. The reason for failures was that passwords were escaped for XML and stored in esxVI_Context which was then passed to raw CURL API calls where the password

[libvirt] [PATCH] esx: use lsilogic adapter type in vol create.

2016-05-23 Thread Dawid Zamirski
ESX will refuse to attach VMDKS that have buslogic adatper type to 64bit VMs whereas lsilogic works fine both 32bit and 64bit VMs. --- src/esx/esx_storage_backend_vmfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esx/esx_storage_backend_vmfs.c

[libvirt] [libvirt-php PATCH 3/3] use VIRT_FOREACH macros everywhere.

2016-07-06 Thread Dawid Zamirski
This results in cleaner code and fixes other potential bugs, e.g. in get_next_free_numeric_value --- src/libvirt-php.c | 141 ++ 1 file changed, 25 insertions(+), 116 deletions(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index

[libvirt] [libvirt-php PATCH 2/3] libvirt_connect: use loop macros to read cred info.

2016-07-06 Thread Dawid Zamirski
Since addition of PHP7 the libvirt_connect regressed on PHP5 where it was no longer reading out credential info from the php hash table properly. This patch makes use of the loop macros that handle both PHP versions correctly and consequently fix this issue. --- src/libvirt-php.c | 33

[libvirt] [libvirt-php PATCH 1/3] Define macros for looping php hash tables.

2016-07-06 Thread Dawid Zamirski
Since PHP5 and 7 differ slightly on how looping over php hash tables is done, those macros were added to abstract away those differences and avoid using ifdefs for each php version. --- src/libvirt-php.c | 31 +++ src/libvirt-php.h | 6 ++ 2 files changed, 37

[libvirt] [libvirt-php PATCH 0/3] Fix PHP5 compatibilty issues.

2016-07-06 Thread Dawid Zamirski
and the remaining commits make use of that. Dawid Zamirski (3): Define macros for looping php hash tables. libvirt_connect: use loop macros to read cred info. use VIRT_FOREACH macros everywhere. src/libvirt-php.c | 205 +- src/libvirt-php.h | 6 ++ 2

Re: [libvirt] [PATCH 03/16] hyperv: add get capabilities

2016-08-09 Thread Dawid Zamirski
On Tue, 2016-08-09 at 12:39 +, Jason Miesionczek wrote: > --- >  src/hyperv/hyperv_driver.c  | 106 > +++- >  src/hyperv/hyperv_private.h |   2 + >  2 files changed, 107 insertions(+), 1 deletion(-) > >  It seems that there was initial review [1] done

Re: [libvirt] [PATCH 04/16] hyperv: implement connectGetVersion

2016-08-09 Thread Dawid Zamirski
On Tue, 2016-08-09 at 12:39 +, Jason Miesionczek wrote: > --- >  src/hyperv/hyperv_driver.c | 52 > ++ >  1 file changed, 52 insertions(+) > > diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c > index 4a5e80d..b2d1abf 100644 > ---

[libvirt] [libvirt-php PATCH 1/4] implement libvirt_node_get_free_memory

2016-06-29 Thread Dawid Zamirski
From: Dawid Zamirski <dzamir...@dattobackup.com> This patch adds support for virNodeGetFreeMemory which is available in libvirt since v0.3.3. While the php bindings alredy provide libvirt_node_get_mem_stats from which such info could be obtained, not all hypervisors support it, e.g. vbox a

[libvirt] [libvirt-php PATCH 2/4] implement xml_to_native and xml_from_native

2016-06-29 Thread Dawid Zamirski
From: Dawid Zamirski <dzamir...@dattobackup.com> This patch implements virConnectDomainXMLFromNative and virConnectDomainXMLToNative in libvirt PHP bindings. The PHP functions are called libvirt_domain_xml_from_native and libvirt_domain_xml_to_native respectively. --- src/libvirt-php.

[libvirt] [libvirt-php PATCH 4/4] implement bindings for attaching/detaching devices

2016-06-29 Thread Dawid Zamirski
Provides PHP bindings to libvirt's virDomainAttachDeviceFlags and virDomainDetachDeviceFlags APIs. --- src/libvirt-php.c | 70 --- src/libvirt-php.h | 2 ++ 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/libvirt-php.c

[libvirt] [libvirt-php PATCH 3/4] implement libvirt_domain_send_key_api

2016-06-29 Thread Dawid Zamirski
This patch adds libvirt_domain_send_key_api which calls to virDomainSendKey libvirt API function to send key press events to a domain. The PHP bindings already have libvirt_domain_send_keys function which uses VNC to provide similar functionality but that has limited use cases and depends on a

[libvirt] [libvirt-php PATCH 0/4] Add more API bindings.

2016-06-29 Thread Dawid Zamirski
This patch series adds more libvirt API bindings to libvirt-php. The first patch in the series is a repost of: https://www.redhat.com/archives/libvir-list/2014-May/msg00021.html Dawid Zamirski (4): implement libvirt_node_get_free_memory implement xml_to_native and xml_from_native implement

[libvirt] [PATCH 4/4] vbox: update rest of the code to for prior changes.

2016-09-28 Thread Dawid Zamirski
This commit should be squashed to previous one. Keeping it separate for code-review purposes only as it's mostly noise due to changes of the struct definitions in previous patch: * vboxPrivate (aka old vboxGlobalData *data argument) no longer needs to be passed around as g_pVBoxGlobalData is

[libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-09-28 Thread Dawid Zamirski
Since VBOX API initialization method (pfnComInitialize) is not thread-safe and must be called from the primary thread, calling it in every vboxConnectOpen (as we used to do) leads to segmentation faults when multiple connections are in use. Therefore the initalization and unitialization logic has

[libvirt] [PATCH 2/4] vbox: replace vboxGlobalData with vboxPrivate.

2016-09-28 Thread Dawid Zamirski
Since those stucts are identical at the moment, this patch basically does s/vboxGlobalData \*data/vboxPrivate *data/ with type casts in vboxDriverLock/Unlock calls to keep the code working and take care of unavoidable diff noise to set the stage for further commits that actually address the issue

[libvirt] [PATCH 0/4] vbox: address thread-safety issues.

2016-09-28 Thread Dawid Zamirski
be squashed into 3 as it was kept separate only for code-review purposes and 3rd patch won't compile without 4 applied on top. [1] https://www.redhat.com/archives/libvirt-users/2012-April/msg00122.html [2] https://www.redhat.com/archives/libvirt-users/2012-April/msg00125.htmlgq Dawid Zamirski (4

[libvirt] [PATCH 1/4] vbox: add vboxPrivate struct.

2016-09-28 Thread Dawid Zamirski
To be passed as per-connection context info instead of using vboxGlobalData that it will eventually replace in most cases. --- src/vbox/vbox_uniformed_api.h | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/vbox/vbox_uniformed_api.h

Re: [libvirt] [PATCH 0/4] vbox: address thread-safety issues.

2016-09-29 Thread Dawid Zamirski
On Wed, 2016-09-28 at 13:41 -0400, Dawid Zamirski wrote: > This patch series solves (at least in my testing) vbox driver > thread-safety issues that were also outlined on libvirt-users ML [1] > and I was affected with.  Just to give a more practical context on the issue I'm trying

[libvirt] [PATCH 0/2] vbox: add support for 5.1.x

2016-11-07 Thread Dawid Zamirski
With VBox 5.1.x release new SDK header needs to be added to libvirt sources. Sending as attachments due to the size of the first patch being a large header file taken from VBOX SDK. Dawid Zamirski (2): vbox: add vbox 5.1 C API header file. vbox: hookup the 5.1 C API to the unified driver

[libvirt] [PATCH 2/2] vbox: hookup the 5.1 C API to the unified driver.

2016-11-07 Thread Dawid Zamirski
simply follow the same pattern as other versions did. --- src/Makefile.am | 1 + src/vbox/vbox_V5_1.c | 13 + src/vbox/vbox_common.h| 2 ++ src/vbox/vbox_storage.c | 2 ++ src/vbox/vbox_tmpl.c | 2 ++ src/vbox/vbox_uniformed_api.h |

[libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-07 Thread Dawid Zamirski
* add vboxDriver object to serve as a singleton global object that holds references to IVirtualBox and ISession to be shared among multiple connections. The vbox_driver is instantiated only once in the first call vboxGetDriverConnection function that is guarded by a mutex. * call vbox API

[libvirt] [PATCH v2 0/2] vbox: address thread-safety issues

2016-11-07 Thread Dawid Zamirski
ion starts a new thread, so I guess this is not doeable right now :-/ [1] https://www.redhat.com/archives/libvir-list/2016-September/msg01306.html [2] https://github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/master/src/VBox/Main/glue/initterm.cpp#L376 Dawid Zamirski (2): vbox: change ho

Re: [libvirt] [PATCH 1/2] vbox: add vbox 5.1 C API header file.

2016-11-07 Thread Dawid Zamirski
On Mon, 2016-11-07 at 15:16 -0600, Eric Blake wrote: > On 11/07/2016 03:03 PM, Dawid Zamirski wrote: > > > > extracted from VirutalBox SDK and reindented with cppi. > > --- > >  src/vbox/vbox_CAPI_v5_1.h | 26117 > > ++

[libvirt] [PATCH v2 2/2] vbox: get rid of g_pVBoxGlobalData

2016-11-07 Thread Dawid Zamirski
now that we have a new global vboxDriver object, remove the old vboxGlobalData struct and all references to it. --- src/vbox/vbox_common.c| 168 +-- src/vbox/vbox_common.h| 2 +- src/vbox/vbox_network.c | 24 +-- src/vbox/vbox_storage.c | 20 +--

Re: [libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
On Wed, 2016-11-23 at 11:00 -0500, Dawid Zamirski wrote: > On Wed, 2016-11-23 at 08:55 -0500, John Ferlan wrote: > > [...] > > > + > > > +static vboxDriverPtr > > > +vboxGetDriverConnection(void) > > > +{ > > > +virMutex

Re: [libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
On Wed, 2016-11-23 at 08:55 -0500, John Ferlan wrote: > [...] > > + > > +static vboxDriverPtr > > +vboxGetDriverConnection(void) > > +{ > > +virMutexLock(_driver_lock); > > + > > +if (vbox_driver) { > > +virObjectRef(vbox_driver); > > +} else { > > +vbox_driver =

Re: [libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
On Wed, 2016-11-23 at 14:00 +, Daniel P. Berrange wrote: > On Wed, Nov 23, 2016 at 08:55:03AM -0500, John Ferlan wrote: > > Beyond that - both patches seem fine Given recent discussion > > about > > removing an older Xen driver from libvirt: > > > >

Re: [libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
On Wed, 2016-11-23 at 11:53 -0500, John Ferlan wrote: > > On 11/23/2016 11:48 AM, Dawid Zamirski wrote: > > Seems our responses crossed paths...  Maybe it'd be best to send a > v3... > > A couple of other nits I noted were the 2nd-4th arguments to > virClassNew > for

Re: [libvirt] [PATCH v2 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
On Wed, 2016-11-23 at 11:33 -0500, Dawid Zamirski wrote: > On Wed, 2016-11-23 at 11:00 -0500, Dawid Zamirski wrote: > > On Wed, 2016-11-23 at 08:55 -0500, John Ferlan wrote: > > > [...] > > > > + > > > > +static vboxDrive

[libvirt] [PATCH v3 2/2] vbox: get rid of g_pVBoxGlobalData

2016-11-23 Thread Dawid Zamirski
now that we have a new global vboxDriver object, remove the old vboxGlobalData struct and all references to it. --- src/vbox/vbox_common.c| 168 +-- src/vbox/vbox_common.h| 2 +- src/vbox/vbox_network.c | 24 +-- src/vbox/vbox_storage.c | 20 +--

[libvirt] [PATCH v3 0/2] vbox: address thread-safety issues

2016-11-23 Thread Dawid Zamirski
libvir-list/2016-November/msg01132.html Dawid Zamirski (2): vbox: change how vbox API is initialized. vbox: get rid of g_pVBoxGlobalData src/vbox/vbox_common.c| 565 +++--- src/vbox/vbox_common.h| 2 +- src/vbox/vbox_driver.c|

[libvirt] [PATCH v3 1/2] vbox: change how vbox API is initialized.

2016-11-23 Thread Dawid Zamirski
* add vboxDriver object to serve as a singleton global object that holds references to IVirtualBox and ISession to be shared among multiple connections. The vbox_driver is instantiated only once in the first call vboxGetDriverConnection function that is guarded by a mutex. * call vbox API

Re: [libvirt] [PATCH 0/2] vbox: add support for 5.1.x

2016-11-18 Thread Dawid Zamirski
On Fri, 2016-11-18 at 11:16 -0500, Dawid Zamirski wrote: > > Hi Andrea, > > Sure, in this case those patches simply enable support of VirtualBox > 5.1.x series in libvirt (prior to that libvirt supported vbox 2.x.x > to > 5.0.x)- and as such it does not affect any previous v

Re: [libvirt] [PATCH 0/2] vbox: add support for 5.1.x

2016-11-18 Thread Dawid Zamirski
On Fri, 2016-11-18 at 16:47 +0100, Andrea Bolognani wrote: > Would you mind drafting one or two short sentences to describe > the impact of these changes for users? If everything goes > according to plans[1], they will be added to the NEWS file. > > Thanks! > > > [1] Which it often doesn't :) >

[libvirt] [Fwd: Re: [PATCH 2/4] vbox: replace vboxGlobalData with vboxPrivate.]

2016-10-11 Thread Dawid Zamirski
Sorry, forgot to CC the ML in my last reply. Forwarded Message From: Dawid Zamirski <dzamir...@datto.com> To: Martin Kletzander <mklet...@redhat.com> Subject: Re: [libvirt] [PATCH 2/4] vbox: replace vboxGlobalData with vboxPrivate. Date: Tue, 11 Oct 2016 10:43:23 -

Re: [libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-10-11 Thread Dawid Zamirski
On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote: > On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote: > > The allocation is not guarded by any lock, so there's still a > race.  I > think there should be a global struct that has only some lock in it > and

Re: [libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-10-11 Thread Dawid Zamirski
On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote: > On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote: > > > > * _pfnUnitilalize decrements connectionCount in g_pVBoxGlobalData > > and > >  once it is down to 0, it calls pfnComUnitialize and >

Re: [libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-10-11 Thread Dawid Zamirski
On Tue, 2016-10-11 at 10:58 -0400, Dawid Zamirski wrote: > On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote: > > On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote: > >  > > > I don't understand how vbox works, but if initializing > > g_pVBoxGl

Re: [libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-10-13 Thread Dawid Zamirski
On Thu, 2016-10-13 at 12:04 +0200, Martin Kletzander wrote: > On Wed, Oct 12, 2016 at 04:00:52PM -0400, Dawid Zamirski wrote: > > > > So after my initial attempts at handling this as suggested (create > > vboxDriver struct and initialize in VIR_ONCE_GLOBAL_INIT), I

Re: [libvirt] [PATCH 3/4] vbox: change API (un)initialization logic.

2016-10-12 Thread Dawid Zamirski
On Tue, 2016-10-11 at 10:58 -0400, Dawid Zamirski wrote: > On Tue, 2016-10-11 at 16:22 +0200, Martin Kletzander wrote: > > On Wed, Sep 28, 2016 at 01:41:35PM -0400, Dawid Zamirski wrote: > > > > The allocation is not guarded by any lock, so there's still a > > race

Re: [libvirt] [PATCH 00/12] vbox: remove support for vbox 3.x and older.

2017-01-10 Thread Dawid Zamirski
On Tue, 2017-01-10 at 11:50 -0500, John Ferlan wrote: > > Seems reasonable - it builds for me ;-).  I did take a cursory scan > through the changes - they all seem valid. > > ACK series and can push everything before the release once/if the > news > patches series on list can come to a

[libvirt] [PATCH 00/12] vbox: remove support for vbox 3.x and older.

2016-12-29 Thread Dawid Zamirski
ML message size limit. [1] https://www.redhat.com/archives/libvir-list/2016-November/msg01133.html Regards, Dawid Dawid Zamirski (12): vbox: remove SDK header files for vbox 3 and older. vbox: remove calls to *InstallUniformedAPI macros. vbox: remove code for old API versions. vbox

[libvirt] [PATCH 03/12] vbox: remove code for old API versions.

2016-12-29 Thread Dawid Zamirski
This removes most of the code wrapped in VBOX_API_VERSION < 400 preprocessor checks. Those are the ones that can be safely removed without needing to update driver code to accomodate it. --- src/vbox/vbox_tmpl.c | 1390 +++--- 1 file changed, 57

[libvirt] [PATCH 06/12] vbox: remove getMachineForSession flag.

2016-12-29 Thread Dawid Zamirski
* the getMachineForSession is always true for 4.0+. This also means that checkflag argument in openSessionForMachine no longer has any meaning because it was or'ed with getMachineForSession (always true) * remove supportScreenshot flag - vbox 4.0+ supports it * remove detachDevicesExplicitly

[libvirt] [PATCH 08/12] vbox: remove code dealing with oldMediumInterface

2016-12-29 Thread Dawid Zamirski
* removed oldMediumInterface flag and related code that was used for vbox 2.x * remove accelerate2DVideo and networkRemoveInterface flags which were also conditionals for handling legacy vbox versions. --- src/vbox/vbox_common.c| 66 --

[libvirt] [PATCH 10/12] vbox: fix _displayTakeScreenShotPNGToArray

2016-12-29 Thread Dawid Zamirski
This function was not implemented for vbox 5+ which removed TakeScreenShotPNGToArray but provides TakeScreenShotToArray with BitmapFormat_PNG argument which is the same thing. --- src/vbox/vbox_tmpl.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git

[libvirt] [PATCH 05/12] vbox: do not use IHardDisk anymore.

2016-12-29 Thread Dawid Zamirski
VirtualBox 4.0+ uses IMedium and IHardDisk is no longer used, so * remove typef IMedium IHardDisk * merge UIHardDisk into UIMedium * update all references accordingly --- src/vbox/vbox_common.h| 1 - src/vbox/vbox_storage.c | 32 +++ src/vbox/vbox_tmpl.c | 91

[libvirt] [PATCH 07/12] vbox: remove domain events support.

2016-12-29 Thread Dawid Zamirski
this was implemented only for vbox 3 series and was mostly stubs anyway. --- src/vbox/vbox_common.c| 20 -- src/vbox/vbox_tmpl.c | 648 -- src/vbox/vbox_uniformed_api.h | 22 +- 3 files changed, 2 insertions(+), 688 deletions(-) diff

[libvirt] [PATCH 04/12] vbox: remove _vboxAttachDrivesOld

2016-12-29 Thread Dawid Zamirski
and fold vboxAttachDrivesNew into vboxAttachDrives --- src/vbox/vbox_common.c| 45 +--- src/vbox/vbox_tmpl.c | 487 -- src/vbox/vbox_uniformed_api.h | 1 - 3 files changed, 1 insertion(+), 532 deletions(-) diff --git

[libvirt] [PATCH 02/12] vbox: remove calls to *InstallUniformedAPI macros.

2016-12-29 Thread Dawid Zamirski
That is, for versions older than 4.0. Also do not try to include headers for those old versions. --- src/vbox/vbox_common.h| 10 +- src/vbox/vbox_storage.c | 10 +- src/vbox/vbox_uniformed_api.h | 4 3 files changed, 2 insertions(+), 22 deletions(-) diff --git

[libvirt] [PATCH 12/12] docs: add news entry in improvements section.

2016-12-29 Thread Dawid Zamirski
--- docs/news.html.in | 8 1 file changed, 8 insertions(+) diff --git a/docs/news.html.in b/docs/news.html.in index e544cfa..2c01f00 100644 --- a/docs/news.html.in +++ b/docs/news.html.in @@ -53,6 +53,14 @@ Add a display of the physical size of a disk volume in the

[libvirt] [PATCH 01/12] vbox: remove SDK header files for vbox 3 and older.

2016-12-29 Thread Dawid Zamirski
The patch itself is attached as compressed archive due to its size. * delete SDK header files for vbox older than 4.0 * delete .c files for vbox older than 4.0 * update vbox_XPCOMCGlue to use oldest supported header file, that is 4.0   going forward. * remove deleted files from Makefile.am ---  

[libvirt] [PATCH 11/12] vbox: consolidate vbox IID structures.

2016-12-29 Thread Dawid Zamirski
* remove _vboxIID_v2_x and _vboxIID_v3_x structs and repalce with one _vboxIID as all supprted vbox versions have the same IID structure. * remove vboxIIDUnion that was used to abstract version depended IID differences. * remove IID_MEMBER macro and use the new vboxIID directly. ---

[libvirt] [PATCH 09/12] vbox: IVRDxServer to IVRDEServer.

2016-12-29 Thread Dawid Zamirski
The IVRDxServer was used because vbox < 4 used to have IVRDPServer whereas vbox >= 4 has IVRDEServer. Now that support for legacy versions is being removed, we can use IVRDEServer. --- src/vbox/vbox_common.c| 36 +-- src/vbox/vbox_common.h| 2 +-

[libvirt] [PATCH v2 8/11] hyperv: update wmi code generator.

2017-03-30 Thread Dawid Zamirski
This patch updates the code generator that outputs C headers and code for WMI classes. It has been updated to handle multiple versions (or namespaces) of the same class which were introduced with Hyperv 2012+ --- changes in v2: * make it pass "make syntax-check"

[libvirt] [PATCH 01/11] hyperv: fixed typo in function name.

2017-03-30 Thread Dawid Zamirski
that is: s/hyperyVerifyresponse/hypervVerifyResponse/ --- src/hyperv/hyperv_wmi.c | 8 src/hyperv/hyperv_wmi.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 13acd09..947101f 100644 ---

[libvirt] [PATCH 11/11] hyperv: add hypervInitConnection.

2017-03-30 Thread Dawid Zamirski
This function detects hyperv version by issuing a simple query using "v2" namespace and falling back to "v1". --- src/hyperv/hyperv_driver.c | 92 -- 1 file changed, 56 insertions(+), 36 deletions(-) diff --git a/src/hyperv/hyperv_driver.c

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

2017-03-30 Thread Dawid Zamirski
This patch updates the code generator that outputs C headers and code for WMI classes. It has been updated to handle multiple versions (or namespaces) of the same class which were introduced with Hyperv 2012+ --- src/hyperv/hyperv_wmi_generator.py | 409 + 1

[libvirt] [PATCH 06/11] hyperv: make hypervEnumAndPull use hypervWqlQuery

2017-03-30 Thread Dawid Zamirski
This enables this function to handle "v1" and "v2" WMI requests. Since this commit is where complilation breakage starts: * commits that follow should be squashed into this one * rename hypervObjectUnified -> hypervObject as we've already broken compilation here so there's no point in keeping

[libvirt] [PATCH 09/11] hyperv: add helper for getting WMI class lists.

2017-03-30 Thread Dawid Zamirski
Those used to be auto-generated and are hand-written now intead. The reason being that those are not very useful and better replacements are in order once the driver itself implements more of the API and common patterns start to emerge. --- src/Makefile.am | 2 -

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

2017-03-30 Thread Dawid Zamirski
d */ goto cleanup; } /* works with v1 and v2 */ char *vmName = list->data.common->Name; /* access property that is in v2 only */ if (priv->wmiVersion == HYPERV_WMI_VERSION_V2) char *foo = list->data.v2->V2Property; else char *foo = list-&

[libvirt] [PATCH 05/11] hyperv: add hypervWqlQuery struct.

2017-03-30 Thread Dawid Zamirski
This struct is to be passed to enumerate-and-pull wsman request (to run "Select" queries) and provides the hypervWmiClassInfoListPtr instance from which we can extract the version specific info using the new hypervGetWmiClassInfo function (currently unused) --- src/hyperv/hyperv_wmi.c | 35

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

2017-03-30 Thread Dawid Zamirski
On Thu, 2017-03-30 at 12:47 -0400, Dawid Zamirski wrote: > Hello, > > The following patch series reworks the hyper-v driver structs and the > code generator to provide seamless support for both Hyper-V 2008 and > 2012 or newer. This does not implement any new libvirt APIs, i

[libvirt] [PATCH 02/11] hyperv: store WMI version in hypervPrivate.

2017-03-30 Thread Dawid Zamirski
Hyper-V 2012+ uses a new "v2" version of Msvm_* WMI classes so we will store that info in hypervPrivate so that it is easily accessbile in the driver API callbacks and handled accordingly. --- src/hyperv/hyperv_private.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 07/11] hyperv: update generator input file.

2017-03-30 Thread Dawid Zamirski
Adds defintiions for "v2" WMI class variants that are needed by the driver to handle both hyperv 2008 and 2012+ --- src/hyperv/hyperv_wmi_generator.input | 239 +- 1 file changed, 206 insertions(+), 33 deletions(-) diff --git

[libvirt] [PATCH 10/11] hyperv: port rest of the driver to new stucts.

2017-03-30 Thread Dawid Zamirski
basically s/data->/data.common->/ Because the data member of hypervObject is a union, get the data via the "common" member everywhere - existing driver does not require special handling for v1 vs v2 separately. --- src/hyperv/hyperv_driver.c | 76 +++---

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

2017-03-30 Thread Dawid Zamirski
This struct is to be used to carry all the information necessary to issue wsman requests for given WMI class. Those will be defined by the generator code (as lists) so that they are handy for the driver code to "extract" needed info depending on which hyper-v we're connected to. For example:

[libvirt] [PATCH 04/11] hyperv: update hypervObject struct.

2017-03-30 Thread Dawid Zamirski
Currently named as hypervObjecUnified to keep code compilable/functional until all bits are in place. This struct is a result of unserializing WMI request response. Therefore, it needs to be able to deal with different "versions" of the same WMI class. To accomplish this, the "data" member was

Re: [libvirt] [PATCH v2 8/11] hyperv: update wmi code generator.

2017-03-30 Thread Dawid Zamirski
On Thu, 2017-03-30 at 16:24 -0400, Dawid Zamirski wrote: > On Thu, 2017-03-30 at 16:07 -0400, Neal Gompa wrote: > > On Thu, Mar 30, 2017 at 2:00 PM, Dawid Zamirski <dzamir...@datto.co > > m> > > > > > b/src/hyperv/hyperv_wmi_generator.py > > > old m

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

2017-03-30 Thread Dawid Zamirski
This patch updates the code generator that outputs C headers and code for WMI classes. It has been updated to handle multiple versions (or namespaces) of the same class which were introduced with Hyperv 2012+ --- changes in v3: * do not change file mode * restore accidentally deleted copyright

  1   2   3   >