1. 27 8月, 2019 4 次提交
  2. 26 8月, 2019 29 次提交
  3. 23 8月, 2019 7 次提交
    • M
      storage_driver: Don't crash in storagePoolCreateXML · 9935b435
      Michal Privoznik 提交于
      In my recent patches I've introduced
      virStoragePoolObjIsStarting() which is then used to protect
      storage pool definition when the pool object is locked and
      unlocked during long running jobs. Well, my patches did not
      anticipate that @obj can be NULL under 'cleanup' label in
      storagePoolCreateXML() (for instance when parsing XML fails).
      This imperfection is causing libvirtd to crash then.
      
      Fixes: 13284a6b storage_driver: Protect pool def during startup and build
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      9935b435
    • R
      tools: console: Relax stream EOF handling · 277c8c4c
      Roman Bolshakov 提交于
      Regular VM shutdown triggers the error for existing session of virsh
      console and it returns with non-zero exit code:
        error: internal error: console stream EOF
      
      The message and status code are misleading because there's no real
      error. virStreamRecv returns 0 correctly when EOF is reached.
      
      Existing implementations of esx, fd, and remote streams behave the same
      for virStreamFinish and virStreamAbort: they close the stream. So, we
      can continue to use virStreamAbort to handle EOF and errors from
      virStreamRecv but additonally we can report error if virStreamAbort
      fails.
      
      Fixes: 29f2b524 ("tools: console: pass stream/fd errors to user")
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      277c8c4c
    • R
      tests: Make references to global symbols indirect in test drivers · f6d6086d
      Roman Bolshakov 提交于
      A library has to be built with -flat_namespace to get all references to
      global symbols indirected. That can also be achieved with two-level
      namespace interposition but we're not using explicit symbol
      interposition since it's more verbose and requires massive changes to
      the mocks.
      
      This provides a way to interpose a mock for virQEMUCapsProbeHostCPU from
      qemucpumock and fixes domaincapstest on macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      f6d6086d
    • R
      tests: Avoid gnulib replacements in mocks · 0ae6f5ce
      Roman Bolshakov 提交于
      gnulib headers change stat, lstat and open to replacement functions,
      even for function definitions. This effectively disables standard
      library overrides in virfilewrapper and virmockstathelpers since they
      are never reached.
      
      Rename the functions and provide a declartion that uses correct
      assembler name for the mocks.
      
      This fixes firmware lookup in domaincapstest on macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      0ae6f5ce
    • R
      tests: Use flat namespace on macOS · fefc4ff4
      Roman Bolshakov 提交于
      Test executables and mocks have assumption that any symbol can be
      replaced with LD_PRELOAD. That's not a case for macOS unless flat
      namespace is used, because every external symbol reference records the
      library to be looked up. And the symbols cannot be replaced unless dyld
      interposing is used.
      
      Setting DYLD_FORCE_FLAT_NAMESPACE changes symbol lookup behaviour to be
      similar to Linux dynamic linker. It's more lightweight solution than
      explicitly decorating all mock symbols as interpositions and building
      libvirt as interposable dynamic library.
      
      This fixes vircryptotest and allows to proceed other tests that rely on
      mocks a little bit further.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      fefc4ff4
    • R
      tests: Lookup extended stat/lstat in mocks · d6b17edd
      Roman Bolshakov 提交于
      macOS syscall interface (/usr/lib/system/libsystem_kernel.dylib) has
      three kinds of stat but only one of them can be used to fill
      "struct stat": stat$INODE64.
      
      virmockstathelpers looks up regular stat instead of stat$INODE64.  That
      causes a failure in qemufirmwaretest because "struct stat" is laid out
      differently from the values returned by stat.
      
      Introduce VIR_MOCK_REAL_INIT_ALIASED that can be used to lookup
      stat$INODE64 and lstat$INODE64 and use it to setup real functions on
      macOS.
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      d6b17edd
    • R
      build: Use flat namespace for libvirt on macOS · 740f181c
      Roman Bolshakov 提交于
      >From ld(1):
      
        By default all references resolved to a dynamic library record the
        library to which they were resolved. At runtime, dyld uses that
        information to directly resolve symbols. The alternative is to use the
        -flat_namespace option.  With flat namespace, the library is not
        recorded.  At runtime, dyld will search each dynamic library in load
        order when resolving symbols. This is slower, but more like how other
        operating systems resolve symbols.
      
      That fixes the set of tests that preload a mock library to replace
      library symbols:
        qemublocktest
        qemumonitorjsontest
        viriscsitest
        virmacmaptest
        virnetserverclienttest
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      740f181c