[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] PATCH: 3/25: Remove use of macros from remote driver



On Wed, Jan 14, 2009 at 01:23:28PM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange redhat com> wrote:
> > THis patch removes use of macros for accessing the privateDtaa
> > on a connection because they obscure data access making it harder
> > to visually validate correct thread locking
> 
> However, some of the transformations seem not
> to have worked out properly:

No, they are all correct AFAIK. The *existing* code was buggy using
the wrong macros in many places.

> Here are a few of them:
> 
> > -    GET_NETWORK_PRIVATE (vol->conn, NULL);
> > +    struct private_data *priv = vol->conn->storagePrivateData;
>                                               ^^^^^^^
>                                         should be ->networkPrivateData

It should be storagePrivateData, since this is from the method
remoteStorageVolGetPath 

> 
> > -    GET_STORAGE_PRIVATE (conn, -1);
> > +    struct private_data *priv = conn->devMonPrivateData;
>                                          ^^^^^^
>                                          storagePrivateData
> 
> > -    GET_STORAGE_PRIVATE (conn, -1);
> > +    struct private_data *priv = conn->devMonPrivateData;
> 
> > -    GET_STORAGE_PRIVATE (conn, -1);
> > +    struct private_data *priv = conn->devMonPrivateData;
> 
> and a few more.

You need to compare with the function context shown in the patch, rather 
than assume the original code was correct :-)

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]