[libvirt] [PATCH 0/2] Revert use of weak symbols

Daniel P. Berrange posted 2 patches 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170712101416.8496-1-berrange@redhat.com
build-aux/mock-noinline.pl      |  2 +-
src/check-symfile.pl            |  2 +-
src/internal.h                  | 27 +++++----------------------
src/qemu/qemu_capspriv.h        |  2 +-
src/rpc/virnetsocket.h          |  4 ++--
src/util/vircommand.h           |  2 +-
src/util/vircrypto.h            |  2 +-
src/util/virfile.h              |  2 +-
src/util/virhostcpu.h           |  4 ++--
src/util/virmacaddr.h           |  2 +-
src/util/virnetdev.h            |  8 ++++----
src/util/virnetdevip.h          |  2 +-
src/util/virnetdevopenvswitch.h |  2 +-
src/util/virnetdevtap.h         |  6 +++---
src/util/virnuma.h              | 16 ++++++++--------
src/util/virrandom.h            |  6 +++---
src/util/virscsi.h              |  2 +-
src/util/virscsivhost.h         |  2 +-
src/util/virtpm.h               |  2 +-
src/util/virutil.h              | 10 +++++-----
src/util/viruuid.h              |  2 +-
21 files changed, 45 insertions(+), 62 deletions(-)
[libvirt] [PATCH 0/2] Revert use of weak symbols
Posted by Daniel P. Berrange 6 years, 8 months ago
This series reverts the use of the __weak__ attribute which we did
to fix the test suite with CLang. It cause unintended problems
elsewhere which are not practical to fix. See the second patch
for details.

Daniel P. Berrange (2):
  Revert "internal: don't use weak symbols for Win32 platform"
  Revert "Prevent more compiler optimization of mockable functions"

 build-aux/mock-noinline.pl      |  2 +-
 src/check-symfile.pl            |  2 +-
 src/internal.h                  | 27 +++++----------------------
 src/qemu/qemu_capspriv.h        |  2 +-
 src/rpc/virnetsocket.h          |  4 ++--
 src/util/vircommand.h           |  2 +-
 src/util/vircrypto.h            |  2 +-
 src/util/virfile.h              |  2 +-
 src/util/virhostcpu.h           |  4 ++--
 src/util/virmacaddr.h           |  2 +-
 src/util/virnetdev.h            |  8 ++++----
 src/util/virnetdevip.h          |  2 +-
 src/util/virnetdevopenvswitch.h |  2 +-
 src/util/virnetdevtap.h         |  6 +++---
 src/util/virnuma.h              | 16 ++++++++--------
 src/util/virrandom.h            |  6 +++---
 src/util/virscsi.h              |  2 +-
 src/util/virscsivhost.h         |  2 +-
 src/util/virtpm.h               |  2 +-
 src/util/virutil.h              | 10 +++++-----
 src/util/viruuid.h              |  2 +-
 21 files changed, 45 insertions(+), 62 deletions(-)

-- 
2.9.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/2] Revert use of weak symbols
Posted by Michal Privoznik 6 years, 8 months ago
On 07/12/2017 12:14 PM, Daniel P. Berrange wrote:
> This series reverts the use of the __weak__ attribute which we did
> to fix the test suite with CLang. It cause unintended problems
> elsewhere which are not practical to fix. See the second patch
> for details.
> 
> Daniel P. Berrange (2):
>   Revert "internal: don't use weak symbols for Win32 platform"
>   Revert "Prevent more compiler optimization of mockable functions"
> 

So I thought about this too and I guess my question is - why are we not
dynamically linking with the mock libraries? What we do is use
LD_PRELOAD at runtime. However, if say virpcitest would link with
virpcimock at compile time (dynamically), we can throw away LD_PRELOAD
handling code.

On the other hand, this look trivial enough so I bet others have thought
of it. And since we don't use it there has to be catch that I'm missing. Or?

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/2] Revert use of weak symbols
Posted by Daniel P. Berrange 6 years, 8 months ago
On Thu, Jul 13, 2017 at 10:13:25AM +0200, Michal Privoznik wrote:
> On 07/12/2017 12:14 PM, Daniel P. Berrange wrote:
> > This series reverts the use of the __weak__ attribute which we did
> > to fix the test suite with CLang. It cause unintended problems
> > elsewhere which are not practical to fix. See the second patch
> > for details.
> > 
> > Daniel P. Berrange (2):
> >   Revert "internal: don't use weak symbols for Win32 platform"
> >   Revert "Prevent more compiler optimization of mockable functions"
> > 
> 
> So I thought about this too and I guess my question is - why are we not
> dynamically linking with the mock libraries? What we do is use
> LD_PRELOAD at runtime. However, if say virpcitest would link with
> virpcimock at compile time (dynamically), we can throw away LD_PRELOAD
> handling code.

Basically yes, however, that's tangential to this bug & patch.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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