1. 04 5月, 2014 1 次提交
    • R
      bhyve: improve bhyve_command.c testability · 07e371fc
      Roman Bogorodskiy 提交于
      * bhyve_command.c (bhyveBuildNetArgStr, virBhyveProcessBuildBhyveCmd):
        add dryRun mode which doesn't create any devices when enabled
      * bhyve_command.c (virBhyveProcessBuildBhyveCmd,
        virBhyveProcessBuildDestroyCmd, virBhyveProcessBuildLoadCmd): accept
        virDomainDefPtr instead of virDomainObjPtr.
      07e371fc
  2. 03 5月, 2014 2 次提交
    • G
      Explicitly link virfirewalltest and virsystemdtest against dbus · 4bdb5037
      Guido Günther 提交于
      This fixes link failures like:
      
        CCLD     virfirewalltest
        /usr/bin/ld: virfirewalltest-virfirewalltest.o: undefined reference to
        symbol 'dbus_message_iter_init_append'
      4bdb5037
    • G
      qemuxml2argvtest: Don't use privileged mode upfront · 3cee4c05
      Guido Günther 提交于
      When building packages in a clean chroot the QEMU_USER and QEMU_GROUP
      don't exist making VirQemuDriverConfigNew fail with privileged=true.
      
      Avoid that by not requiring privileged mode upfront but setting it later
      so we skip the user/group existence check.
      
      This solution was suggested by Daniel P. Berrange and tested by Martin
      Kletzander.
      3cee4c05
  3. 02 5月, 2014 4 次提交
    • R
      tests: skip virfirewalltest on non-Linux systems · 064f49a0
      Roman Bogorodskiy 提交于
      Currently firewalling is supported on Linux only, so skip the
      virfirewalltest on other platforms.
      064f49a0
    • M
      tests: don't fail with newer gnutls · 4cbc15d0
      Martin Kletzander 提交于
      gnutls-3.3.0 and newer leaves 2 FDs open in order to be backwards
      compatible when it comes to chrooted binaries [1].  Linking
      commandhelper with gnutls then leaves these two FDs open and
      commandtest fails thanks to that.  This patch does not link
      commandhelper with libvirt.la, but rather only the utilities making
      the test pass.
      
      Based on suggestion from Daniel [2].
      
      [1] http://lists.gnutls.org/pipermail/gnutls-help/2014-April/003429.html
      [2] https://www.redhat.com/archives/libvir-list/2014-April/msg01119.htmlSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
      4cbc15d0
    • E
      util: new stricter unsigned int parsing · 7b045c8c
      Eric Blake 提交于
      strtoul() is required to parse negative numbers as their
      twos-complement positive counterpart.  But sometimes we want
      to reject negative numbers.  Add new functions to do this.
      The 'p' suffix is a mnemonic for 'positive' (technically it
      also parses 0, but 'non-negative' doesn't lend itself to a
      nice one-letter suffix).
      
      * src/util/virstring.h (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New prototypes.
      * src/util/virstring.c (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New functions.
      * src/libvirt_private.syms (virstring.h): Export them.
      * tests/virstringtest.c (testStringToLong): Test them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7b045c8c
    • E
      util: fix uint parsing on 64-bit platforms · f18c02ec
      Eric Blake 提交于
      Commit f22b7899 called to light a long-standing latent bug: the
      behavior of virStrToLong_ui was different on 32-bit platforms
      than on 64-bit platforms.  Curse you, C type promotion and
      narrowing rules, and strtoul specification.  POSIX says that for
      a 32-bit long, strtol handles only 2^32 values [LONG_MIN to
      LONG_MAX] while strtoul handles 2^33 - 1 values [-ULONG_MAX to
      ULONG_MAX] with twos-complement wraparound for negatives.  Thus,
      parsing -1 as unsigned long produces ULONG_MAX, rather than a
      range error.  We WANT[1] this same shortcut for turning -1 into
      UINT_MAX when parsing to int; and get it for free with 32-bit
      long.  But with 64-bit long, ULONG_MAX is outside the range
      of int and we were rejecting it as invalid; meanwhile, we were
      silently treating -18446744073709551615 as 1 even though it
      textually exceeds INT_MIN.  Too bad there's not a strtoui() in
      libc that does guaranteed parsing to int, regardless of the size
      of long.
      
      The bug has been latent since 2007, introduced by Jim Meyering
      in commit 5d254191 in the attempt to eradicate unsafe use of
      strto[u]l when parsing ints and longs.  How embarrassing that we
      are only discovering it now - so I'm adding a testsuite to ensure
      that it covers all the corner cases we care about.
      
      [1] Ideally, we really want the caller to be able to choose whether
      to allow negative numbers to wrap around to their 2s-complement
      counterpart, as in strtoul, or to force a stricter input range
      of [0 to UINT_MAX] by rejecting negative signs; this will be added
      in a later patch for all three int types.
      
      This patch is tested on both 32- and 64-bit; the enhanced
      virstringtest passes on both platforms, while virstoragetest now
      reliably fails on both platforms instead of just 32-bit platforms.
      That test will be fixed later.
      
      * src/util/virstring.c (virStrToLong_ui): Ensure same behavior
      regardless of platform long size.
      * tests/virstringtest.c (testStringToLong): New function.
      (mymain): Comprehensively test string to long parsing.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f18c02ec
  4. 01 5月, 2014 1 次提交
  5. 30 4月, 2014 1 次提交
  6. 29 4月, 2014 1 次提交
  7. 26 4月, 2014 1 次提交
  8. 25 4月, 2014 18 次提交
  9. 24 4月, 2014 11 次提交
    • J
      1445f34b
    • J
      tests: More output options for xml2xml tests · 022ccd3d
      Jiri Denemark 提交于
      So far, qemuxml2xml test was only able to check if the result matches
      the original or the appropriate XML in qemuxml2xmloutdata regardless on
      flags used to format the XML. Since the result can be different
      depending on VIR_DOMAIN_XML_INACTIVE flag being used or not, this patch
      adds support for qemuxml2xmlout-%s-active.xml and
      qemuxml2xmlout-%s-inactive.xml output files. If the file specific to the
      flag used exists, it is used in preference to the generic
      qemuxml2xmlout-%s.xml file when reading the expected output.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      022ccd3d
    • J
      conf: Format and parse backing chains in domain XML · 546154e3
      Jiri Denemark 提交于
      This patch implements formating and parsing code for the backing store
      schema defined and documented by the previous patch.
      
      This patch does not aim at providing full persistent storage of disk
      backing chains yet. The formatter is supposed to provide the backing
      chain detected when starting a domain and thus it is not formatted into
      an inactive domain XML. The parser is implemented mainly for the purpose
      of testing the XML generated by the formatter and thus it does not
      distinguish between no backingStore element and an empty backingStore
      element. This will have to change once we fully implement support for
      user-supplied backing chains.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      546154e3
    • J
      conf: Output disk backing store details in domain XML · a2e369bc
      Jiri Denemark 提交于
      The XML for quite a longish backing chain is shown below:
      
        <disk type='network' device='disk'>
          <driver name='qemu' type='qcow2'/>
          <source protocol='nbd' name='bar'>
            <host transport='unix' socket='/var/run/nbdsock'/>
          </source>
          <backingStore type='block' index='1'>
            <format type='qcow2'/>
            <source dev='/dev/HostVG/QEMUGuest1'/>
            <backingStore type='file' index='2'>
              <format type='qcow2'/>
              <source file='/tmp/image2.qcow'/>
              <backingStore type='file' index='3'>
                <format type='qcow2'/>
                <source file='/tmp/image3.qcow'/>
                <backingStore type='file' index='4'>
                  <format type='qcow2'/>
                  <source file='/tmp/image4.qcow'/>
                  <backingStore type='file' index='5'>
                    <format type='qcow2'/>
                    <source file='/tmp/image5.qcow'/>
                    <backingStore type='file' index='6'>
                      <format type='raw'/>
                      <source file='/tmp/Fedora-17-x86_64-Live-KDE.iso'/>
                      <backingStore/>
                    </backingStore>
                  </backingStore>
                </backingStore>
              </backingStore>
            </backingStore>
          </backingStore>
          <target dev='vdb' bus='virtio'/>
        </disk>
      
      Various disk types and formats can be mixed in one chain. The
      <backingStore/> empty element marks the end of the backing chain and it
      is there mostly for future support of parsing the chain provided by a
      user. If it's missing, we are supposed to probe for the rest of the
      chain ourselves, otherwise complete chain was provided by the user. The
      index attributes of backingStore elements can be used to unambiguously
      identify a specific part of the image chain.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      a2e369bc
    • P
      util: storage: Invert the way recursive metadata retrieval works · 8823272d
      Peter Krempa 提交于
      To avoid having the root of a backing chain present twice in the list we
      need to invert the working of virStorageFileGetMetadataRecurse.
      
      Until now the recursive worker created a new backing chain element from
      the name and other information passed as arguments. This required us to
      pass the data of the parent in a deconstructed way and the worker
      created a new entry for the parent.
      
      This patch converts this function so that it just fills in metadata
      about the parent and creates a backing chain element from those. This
      removes the duplication of the first element.
      
      To avoid breaking the test suite, virstoragetest now calls a wrapper
      that creates the parent structure explicitly and pre-fills it with the
      test data with same function signature as previously used.
      8823272d
    • P
      util: virstoragefile: Don't mangle data stored about directories · cc92ee32
      Peter Krempa 提交于
      Don't remove detected metadata about directory based storage volumes.
      cc92ee32
    • P
      util: virstoragefile: Rename backingMeta to backingStore · b627b8fd
      Peter Krempa 提交于
      To conform with the naming of the planned XML output rename the metadata
      variable name.
      
      s/backingMeta/backingStore/g
      b627b8fd
    • P
      maint: Switch over from struct virStorageFileMetadata to virStorageSource · d64d9ff9
      Peter Krempa 提交于
      Replace the old structure with the new one. This change is a trivial
      name change operation (along with change of the freeing function).
      d64d9ff9
    • P
      virstoragefile: Kill "backingStore" field from virStorageFileMetadata · 39c5aa4e
      Peter Krempa 提交于
      Remove the obsolete field replaced by data in "path".
      
      The testsuite requires tweaking as the name of the backing file is now
      stored one layer deeper in the backing chain linked list.
      39c5aa4e
    • P
      util: storagefile: Rename "canonPath" to "path" in virStorageFileMetadata · 05bc536c
      Peter Krempa 提交于
      As for the previous patch, this change is needed to achieve
      compatibility with all the existing code, where we expect a fully
      qualified path of local files to be present.
      05bc536c
    • P
      util: storage: Rename "path" to "relPath" in virStorageFileMetadata · f34b8296
      Peter Krempa 提交于
      To allow future change of virStorageFileMetadata to virStorageSource we
      need to store a full path in the "path" variable as rest of the code
      expects it to be a full path. Rename the "path" field to "relPath" to
      keep tracking the info but allowing a real "path" field.
      f34b8296