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

Martin Kletzander mkletzan at redhat.com
Tue Oct 11 13:47:23 UTC 2016


On Wed, Sep 28, 2016 at 01:41:34PM -0400, Dawid Zamirski wrote:
>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 for the patch series.
>---
> src/vbox/vbox_common.c        | 164 +++++++++++++++++++++---------------------
> src/vbox/vbox_network.c       |  24 +++----
> src/vbox/vbox_storage.c       |  20 +++---
> src/vbox/vbox_tmpl.c          | 146 ++++++++++++++++++-------------------
> src/vbox/vbox_uniformed_api.h |  54 +++++++-------
> 5 files changed, 204 insertions(+), 204 deletions(-)
>
>diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
>index 23f63f9..13869eb 100644
>--- a/src/vbox/vbox_tmpl.c
>+++ b/src/vbox/vbox_tmpl.c
>@@ -206,12 +206,12 @@ static vboxGlobalData *g_pVBoxGlobalData;

So the g_pVBoxGlobalData is still pointer to vboxGlobalData, but ...

>@@ -1312,7 +1312,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
>                           IMachine *machine,
>                           ISnapshot *snapshot)
> {
>-    vboxGlobalData *data = dom->conn->privateData;
>+    vboxPrivate *data = dom->conn->privateData;

in all cases you change here, like this...

> # if VBOX_API_VERSION < 5000000
>     IConsole *console = NULL;
> # endif /*VBOX_API_VERSION < 5000000*/
>@@ -1422,7 +1422,7 @@ vboxCallbackOnMachineStateChange(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED,
>     int event = 0;
>     int detail = 0;
>
>-    vboxDriverLock(g_pVBoxGlobalData);
>+    vboxDriverLock((vboxPrivate *) g_pVBoxGlobalData);
>

and this (and others) you *just* cast it to different struct.  That's
not good.  I'm guessing this is still just a differently separated
commit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161011/7cb0a154/attachment-0001.sig>


More information about the libvir-list mailing list