1. 23 8月, 2019 1 次提交
    • R
      tests: Add lib- prefix to all mocks · fde36108
      Roman Bolshakov 提交于
      In preparation libtool "-module" flag removal, add lib prefix to all
      mock shared objects.
      
      While at it, introduce VIR_TEST_MOCK macros that makes path out of mock
      name to be used with VIR_TEST_PRELOAD or VIR_TEST_MAIN_PRELOAD.  That,
      hopefully, improves readability, reduces line length and allows to
      tailor VIR_TEST_MOCK for specific platform if it has shared library
      suffix different from ".so".
      Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
      fde36108
  2. 14 8月, 2019 1 次提交
  3. 13 8月, 2019 1 次提交
  4. 27 7月, 2019 3 次提交
    • E
      backup: Add virsh-checkpoints test · 43686f36
      Eric Blake 提交于
      Similar to virsh-snapshots. Provides decent coverage of the checkpoint
      API, the test driver implementation, and the virsh access to the API.
      A later patch will worry about testing that snapshots and checkpoints
      are mutually exclusive (in part so it is easier to revert that when we
      finally implement the interaction and lift that restriction).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      43686f36
    • E
      backup: Parse and output checkpoint XML · 1a4df34a
      Eric Blake 提交于
      Add a new file checkpoint_conf.c that performs the translation to and
      from new XML describing a checkpoint. The code shares a common base
      class with snapshots, since a checkpoint similarly represents the
      domain state at a moment in time. Add some basic testing of round trip
      XML handling through the new code.
      
      Of note - this code intentionally differs from snapshots in that XML
      schema validation is unconditional, rather than based on a public API
      flag.  We have many existing interfaces that still need to add a flag
      for opt-in schema validation, but those interfaces have existing
      clients that may not have been producing strictly-compliant XML, or we
      may still uncover bugs where our RNG grammar is inconsistent with our
      code (where omitting the opt-in flag allows existing apps to keep
      working while waiting for an RNG patch).  But since checkpoints are
      brand-new, it's easier to ensure the code matches the schema by always
      using the schema.  If needed, a later patch could extend the API and
      add a flag to turn on to request schema validation, rather than having
      it forced (possibly just the validation of the <domain> sub-element
      during REDEFINE) - but if a user encounters XML that looks like it
      should be good but fails to validate with our RNG schema, they would
      either have to upgrade to a new libvirt that adds the new flag, or
      upgrade to a new libvirt that fixes the RNG schema, which implies
      adding such a flag won't help much.
      
      Also, the redefine flag requires the <domain> sub-element to be
      present, rather than catering to historical back-compat to older
      versions.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1a4df34a
    • E
      backup: Document new XML for checkpoints · d85842cf
      Eric Blake 提交于
      Prepare for new checkpoint APIs by describing the XML that will
      represent a checkpoint.  The checkpoint XML is modeled heavily after
      virDomainSnapshotPtr. See the docs for more details.
      
      Add testsuite coverage for some minimal uses of the XML (bare minimum,
      the sample from html, and a full dumpxml, and some counter-examples
      that should fail schema validation). Although use of the REDEFINE flag
      will require the <domain> subelement to be present, it is easier for
      most of the tests to provide counterpart output produced with the
      NO_DOMAIN flag (particularly since synthesizing a valid <domain>
      during testing is not trivial).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d85842cf
  5. 18 7月, 2019 1 次提交
  6. 16 7月, 2019 1 次提交
  7. 09 7月, 2019 3 次提交
  8. 20 6月, 2019 1 次提交
  9. 17 6月, 2019 1 次提交
  10. 13 6月, 2019 3 次提交
    • A
      tests: Include LDADDS in qemu_LDADDS · 73cfc362
      Andrea Bolognani 提交于
      At this point, all test programs that use qemu_LDADDS also
      use LDADDS, so we can remove a bunch of repetition by simply
      including the latter in the former.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      73cfc362
    • A
      tests: Tweak vircapstest_LDADD · 6b8048b4
      Andrea Bolognani 提交于
      We optionally include QEMU and LXC support in this test and
      depending on which is enabled (if either is enabled at all) we
      need to link in different objects.
      
      Right now we implicitly depend on the fact that qemu_LDADDS is
      empty when QEMU is not enabled to get the correct set of objects,
      but it's better to be explicit about it.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      6b8048b4
    • A
      tests: Tweak cputest_LDADDS · 74d8909f
      Andrea Bolognani 提交于
      We want all test programs using qemu_LDADDS to also use LDADDS,
      and cputest is the only existing exception.
      
      We can't just replace GNULIB_LIBS with LDADDS though, even though
      the latter is a superset of the former, because that would result
      in a linking error due to including the same object twice:
      
        /usr/bin/ld:
        ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141:
        multiple definition of `libvirt_object_new_semaphore';
        ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141:
        first defined here
      
      To work around this, we include both qemu_LDADDS and LDADDS when
      QEMU support is enabled, and just LDADDS otherwise.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      74d8909f
  11. 04 6月, 2019 1 次提交
  12. 30 5月, 2019 1 次提交
    • J
      build: fix linking libqemutestdriver with LTO enabled · 76b420d0
      Jim Fehlig 提交于
      openSUSE Factory is in the process of enabling Link Time Optimization [0]
      and stumbled upon missing symbols when linking libqemutestdriver
      
      libtool: link: gcc -shared  -fPIC -DPIC  ../src/libvirt_qemu_probes.o  \
      -Wl,--whole-archive ../src/.libs/libvirt_driver_qemu_impl.a \
      ../src/.libs/libvirt_driver_network_impl.a \
      ../src/.libs/libvirt_driver_storage_impl.a -Wl,--no-whole-archive  \
      -lcap-ng -lgnutls -lnl-route-3 -lnl-3 -ldbus-1 -lselinux -lapparmor \
      /usr/lib/libxml2.so -ldl -lz -llzma -lm -lblkid -ltirpc  \
      -fstack-protector-strong -O2 -fstack-protector-strong -flto=16 -g -O2 \
      -fstack-protector-strong -flto=16 -g \
      -Wl,-soname -Wl,libqemutestdriver.so -o .libs/libqemutestdriver.so
      ...
      /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `mdir_name'
      /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_ioctl'
      /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_pipe2'
      /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `recvfd'
      /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `c_strcasecmp'
      
      The missing symbols are provided by GNUlib. Add it when linking
      libqemutestdriver.
      
      [0] https://en.opensuse.org/openSUSE:LTOSigned-off-by: NJim Fehlig <jfehlig@suse.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      76b420d0
  13. 10 4月, 2019 1 次提交
    • M
      domain capabilities: Expose firmware auto selection feature · 5b9819ee
      Michal Privoznik 提交于
      If a management application wants to use firmware auto selection
      feature it can't currently know if the libvirtd it's talking to
      support is or not. Moreover, it doesn't know which values that
      are accepted for the @firmware attribute of <os/> when parsing
      will allow successful start of the domain later, i.e. if the mgmt
      application wants to use 'bios' whether there exists a FW
      descriptor in the system that describes bios.
      
      This commit then adds 'firmware' enum to <os/> element in
      <domainCapabilities/> XML like this:
      
        <enum name='firmware'>
          <value>bios</value>
          <value>efi</value>
        </enum>
      
      We can see both 'bios' and 'efi' listed which means that there
      are descriptors for both found in the system (matched with the
      machine type and architecture reported in the domain capabilities
      earlier and not shown here).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      5b9819ee
  14. 03 4月, 2019 2 次提交
    • D
    • D
      tests: fix mocking of stat() / lstat() functions · ff376c62
      Daniel P. Berrangé 提交于
      Quite a few of the tests have a need to mock the stat() / lstat()
      functions and they are taking somewhat different & inconsistent
      approaches none of which are actually fully correct. This is shown
      by fact that 'make check' fails on 32-bit hosts. Investigation
      revealed that the code was calling into the native C library impl,
      not getting intercepted by our mocks.
      
      The POSIX stat() function might resolve to any number of different
      symbols in the C library.
      
      The may be an additional stat64() function exposed by the headers
      too.
      
      On 64-bit hosts the stat & stat64 functions are identical, always
      refering to the 64-bit ABI.
      
      On 32-bit hosts they refer to the 32-bit & 64-bit ABIs respectively.
      
      Libvirt uses _FILE_OFFSET_BITS=64 on 32-bit hosts, which causes the
      C library to transparently rewrite stat() calls to be stat64() calls.
      Libvirt will never see the 32-bit ABI from the traditional stat()
      call. We cannot assume this rewriting is done using a macro. It might
      be, but on GLibC it is done with a magic __asm__ statement to apply
      the rewrite at link time instead of at preprocessing.
      
      In GLibC there may be two additional functions exposed by the headers,
      __xstat() and __xstat64(). When these exist, stat() and stat64() are
      transparently rewritten to call __xstat() and __xstat64() respectively.
      The former symbols will not actally exist in the library at all, only
      the header. The leading "__" indicates the symbols are a private impl
      detail of the C library that applications should not care about.
      Unfortunately, because we are trying to mock replace the C library,
      we need to know about this internal impl detail.
      
      With all this in mind the list of functions we have to mock will depend
      on several factors
      
       - If _FILE_OFFSET_BITS is set, then we are on a 32-bit host, and we
         only need to mock stat64 and __xstat64. The other stat / __xstat
         functions exist, but we'll never call them so they can be ignored
         for mocking.
      
       - If _FILE_OFFSET_BITS is not set, then we are on a 64-bit host and
         we should mock stat, stat64, __xstat & __xstat64. Either may be
         called by app code.
      
       - If __xstat & __xstat64 exist, then stat & stat64 will not exist
         as symbols in the library, so the latter should not be mocked.
      
      The same all applies to lstat()
      
      These rules are complex enough that we don't want to duplicate them
      across every mock file, so this centralizes all the logic in a helper
      file virmockstathelper.c that should be #included when needed. The
      code merely need to provide a filename rewriting callback called
      virMockStatRedirect(). Optionally VIR_MOCK_STAT_HOOK can be defined
      as a macro if further processing is needed inline.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ff376c62
  15. 25 3月, 2019 1 次提交
    • E
      snapshot: Add tests of virsh -c test:///default snapshot* · 280a2b41
      Eric Blake 提交于
      Had this been in place earlier, I would have avoided the bugs in
      commit 0baf6945 and 55c2ab3e. Writing the test required me to extend
      the power of virsh - creating enough snapshots to cause fanout
      requires enough input in a single session that adding comments and
      markers makes it easier to check that output is correct. It's still a
      bit odd that with test:///default, reverting to a snapshot changes the
      domain from running to paused (possibly a bug in how the test driver
      copied from the qemu driver) - but the important part is that the test
      is reproducible, and any future tweaks we make to snapshot code have
      less chance of breaking successful command sequences.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      280a2b41
  16. 15 3月, 2019 1 次提交
  17. 14 3月, 2019 6 次提交
  18. 13 3月, 2019 1 次提交
  19. 12 3月, 2019 3 次提交
  20. 11 3月, 2019 1 次提交
  21. 07 3月, 2019 2 次提交
  22. 12 2月, 2019 2 次提交
  23. 08 2月, 2019 1 次提交
  24. 30 1月, 2019 1 次提交