1. 06 6月, 2014 2 次提交
  2. 05 6月, 2014 6 次提交
    • M
      formatcaps: Rework and add stubs to document · e9f4729a
      Michal Privoznik 提交于
      At the moment we are missing even basic documentation on our
      capabilities XML. Without demand on completeness, I'm
      reorganizing the document structure and adding very basic
      documentation to two major components of the capabilities XML.
      These stubs are intended to be enhanced in the future.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e9f4729a
    • M
      vircaps2xmltest: Introduce basic testing · 6af06232
      Michal Privoznik 提交于
      For now only one test is introduced. It's purpose in life
      is to check we don't break NUMA host distances XML format.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6af06232
    • J
      libxl: add migration support · 9b8d6e1e
      Jim Fehlig 提交于
      This patch adds initial migration support to the libxl driver,
      using the VIR_DRV_FEATURE_MIGRATION_PARAMS family of migration
      functions.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      9b8d6e1e
    • J
      libxl: introduce libxlDomainDefCheckABIStability · d9a099a4
      Jim Fehlig 提交于
      Introduce a simple libxlDomainDefCheckABIStability() function that
      can be used check ABI stability between two virDomainDef objects.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d9a099a4
    • E
      maint: detect VPATH builds when checking for gnulib update · 3cbd3b8e
      Eric Blake 提交于
      I accidentally typed 'make' in the srcdir of a VPATH build, and
      was surprised to see this:
      
      $ make
      /bin/sh: s/^[ +-]//;s/ .*//: No such file or directory
      INFO: gnulib update required; running ./autogen.sh first
      make: -n: Command not found
      ./autogen.sh
      I am going to run ./configure with no arguments - if you wish
      to pass any to it, please specify them on the ./autogen.sh command line.
      running bootstrap...
      ./bootstrap: Bootstrapping from checked-out libvirt sources...
      ./bootstrap: getting gnulib files...
      
      Oops - we're trying to execute some fairly bogus command names,
      and then trying to configure in-tree (which breaks all existing
      VPATH builds, since automake refuses to do a VPATH build if it
      detects an in-tree configure).  The third line (executing "-n")
      is fixed by updating to the latest gnulib; the rest of the problem
      is fixed by copying the same filtering in our cfg.mk as what
      gnulib just added, so that we avoid any $(shell) invocations which
      in turn depend on variables that are only populated by a working
      Makefile.  With that in place, we are back to the much nicer:
      
      $ make
      There seems to be no Makefile in this directory.
      You must run ./configure before running 'make'.
      make: *** [abort-due-to-no-makefile] Error 1
      
      Additionally, although harder to see - there was a trailing space in
      the message warning us that autogen would run an in-tree configure.
      
      * .gnulib: Update to latest, in part for maint.mk improvements.
      * cfg.mk (_update_required): Don't check for update in
      unconfigured directory.
      * autogen.sh (no_git): Drop trailing space.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3cbd3b8e
    • E
      maint: optimize locale.h syntax check · d804a58a
      Eric Blake 提交于
      Reusing the maint.mk code allows for a more efficient syntax check
      (fewer grep processes), and a more compact representation of what
      we are really checking for in commit 1919e355.
      
      * cfg.mk (sc_require_locale_h): Use maint.mk loop instead of
      rolling our own.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d804a58a
  3. 04 6月, 2014 5 次提交
    • M
      virnuma: Check for numa_bitmask_isbitset presence · 9e0cbcd8
      Michal Privoznik 提交于
      On some systems, libnuma can be present but it's so ancient that
      it misses some symbols that virNumaGetDistances() needs. To be
      more precise: numa_bitmask_isbitset() and numa_nodes_ptr are the
      symbols in question. Fortunately, they were both introduced in
      the same release so it's sufficient for us to check for only one
      of them. And the winner is numa_bitmask_isbitset().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9e0cbcd8
    • M
      cfg.mk: Introduce rule for setlocale() · 1919e355
      Michal Privoznik 提交于
      In the past we had some issues where setlocale() was called without
      corresponding include of locale.h. While on some systems this may
      work, on others the compilation failed. We should have a syntax-check
      rule for that to prevent this from happening again.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1919e355
    • M
      virnuma: Implement virNumaGetDistances stub for non-NUMA · 3289edd2
      Michal Privoznik 提交于
      In case the libvirt is built without numactl support, we're
      missing the virNumaGetDistances() stub so the linking fails:
      
        CCLD     libvirt_lxc
      libvirt_lxc-nodeinfo.o: In function `virNodeCapsGetSiblingInfo':
      /home/zippy/tmp/libvirt.git/src/nodeinfo.c:1763: undefined reference to `virNumaGetDistances'
      collect2: error: ld returned 1 exit status
      make[3]: *** [libvirt_lxc] Error 1
      
      The issue was introduced in 77c830d8.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3289edd2
    • M
      virCaps: Expose distance between host NUMA nodes · 8ba0a58f
      Michal Privoznik 提交于
      If user or management application wants to create a guest,
      it may be useful to know the cost of internode latencies
      before the guest resources are pinned. For example:
      
      <capabilities>
      
        <host>
          ...
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>4004132</memory>
                <distances>
                  <sibling id='0' value='10'/>
                  <sibling id='1' value='20'/>
                </distances>
                <cpus num='2'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                  <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4030064</memory>
                <distances>
                  <sibling id='0' value='20'/>
                  <sibling id='1' value='10'/>
                </distances>
                <cpus num='2'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                  <cpu id='3' socket_id='0' core_id='2' siblings='3'/>
                </cpus>
              </cell>
            </cells>
          </topology>
          ...
        </host>
        ...
      </capabilities>
      
      We can see the distance from node1 to node0 is 20 and within nodes 10.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8ba0a58f
    • M
      virnuma: Introduce virNumaGetDistances · 77c830d8
      Michal Privoznik 提交于
      The API gets a NUMA node and find distances to other nodes.  The
      distances are returned in an array. If an item X within the array
      equals to value of zero, then there's no such node as X.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      77c830d8
  4. 03 6月, 2014 27 次提交
    • P
      tests: monitor: json: Fix error message when returning json in json · 9046f910
      Peter Krempa 提交于
      The qemu JSON monitor test allows to test also expected command
      arguments. As the error from the monitor simulator is returned as a
      simulated qemu error (in JSON) all other JSON contained in the error
      message needs to be escaped. This will happen if the monitor command
      under test receives a JSON array as an argument.
      
      This will improve the error message from:
      libvirt:  error : internal error: cannot parse json { "error":  { "desc":
      "Invalid value of argument 'keys' of command 'send-key': expected 'ble'
      got '[{"type":"number","data":43},{"type":"number","data":26},
      {"type":"number","data":46},{"type":"number","data":32}]'",
      "class": "UnexpectedCommand" } }: lexical error: invalid string in json text.
      
      To:
      libvirt: QEMU Driver error : internal error: unable to execute QEMU
      command 'send-key': Invalid value of argument 'keys' of command
      'send-key': expected 'ble' got '[{"type":"number","data":43},
      {"type":"number","data":26},{"type":"number","data":46},
      {"type":"number","data":32}]'
      
      This improvement will not have any effect on tests executing as
      expected, but it will help test development.
      9046f910
    • P
      network: bridge: Avoid memory leak from networkBuildDhcpDaemonCommandLine · 23c2763b
      Peter Krempa 提交于
      If the leasehelper_path couldn't be found the code would leak the
      freshly constructed command structure. Re-arrange code to avoid the
      problem.
      
      Found by coverity, broken by baafe668.
      23c2763b
    • P
      tests: Build virstoragetest only when storage driver is compiled too · 835dc013
      Peter Krempa 提交于
      virstoragetest now requires parts of the storage driver to be built.
      Without this change the test can't be compiled on platforms that don't
      build the storage driver (mingw).
      
      make[2]: *** No rule to make target `../src/libvirt_driver_storage_impl.la', needed by `virstoragetest.exe'.  Stop.
      
      Broken by commit 713cc3b0
      835dc013
    • P
      qemu: monitor: Fix type of holdtime argument in qemuMonitorJSONSendKey · ce2107a9
      Peter Krempa 提交于
      qemuMonitorJSONSendKey declares the "holdtime" argument as unsigned int
      while the command was constructed in qemuMonitorJSONMakeCommand using
      the "P" modifier which took a unsigned long from the variable
      arguments which then made it possible to access uninitialized memory.
      
      This broke the qemumonitorjsontest on 32bit fedora 20:
      64) qemuMonitorJSONSendKey
      ... libvirt: QEMU Driver error : internal error: unsupported data type 'W' for arg 'WVSƒì ‹D$0è‘wÿÿÃAå' FAILED
      
      Uncovered by upstream commit f744b831.
      
      Additionally add test for the hold-time option.
      ce2107a9
    • D
      libxl: Avoid possible use of uninitialized mem in libxlDomainStart · 10a99a6d
      Daniel P. Berrange 提交于
      The 'libxl_domain_config' object is stack allocated which means its
      memory contents are undefined. The libxl_domain_config_dispose() call
      is only safe if the memory is initialized to a defined state. Not all
      code paths which reach libxl_domain_config_dispose() will ensure that
      libxl_domain_config_init() is called. Move the libxl_domain_config_init()
      call earlier in the function to ensure all codepaths have defined
      memory state.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10a99a6d
    • D
      libxl: Move virDomainXMLOptionNew into libxlCreateXMLConf · 3bab69c3
      Daniel P. Berrange 提交于
      To allow the test suite to creat the XML option object,
      move the virDomainXMLOptionNew call into a libxlCreateXMLConf
      method.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3bab69c3
    • D
      libxl: Don't pass libxlDriverPrivatePtr into libxlBuildDomainConfig · a6abdbf6
      Daniel P. Berrange 提交于
      To make it easier to test, change libxlBuildDomainConfig so
      that it takes a virPortAllocatorPtr instead of the larger
      libxlDriverPrivatePtr object.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a6abdbf6
    • D
      libxl: Don't pass virDomainObjPtr to libxlBuildDomainConfig · 5da28f24
      Daniel P. Berrange 提交于
      To make it easier to unit test, change libxlBuildDomainConfig
      so that it takes 'virDomainDefPtr' and 'libxl_ctx *' objects
      as separate parameters.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5da28f24
    • J
      qemu: Return in from qemuDomainRemove*Device · 5bf67032
      Jiri Denemark 提交于
      Some of the APIs already return int since they can produce errors that
      need to be propagated. For consistency reasons, this patch changes the
      rest of the APIs to also return int even though they do not fail or
      report any errors.
      5bf67032
    • J
      qemu: Remove character device backend only after frontend is gone · 55b21f9b
      Jiri Denemark 提交于
      In general, we should only remove a backend after seeing DEVICE_DELETED
      event for a corresponding frontend.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      55b21f9b
    • J
      qemu: Remove disk backend only after frontend is gone · 0635785b
      Jiri Denemark 提交于
      In general, we should only remove a backend after seeing DEVICE_DELETED
      event for a corresponding frontend. This doesn't make any difference for
      disks attached using -drive or drive_add since QEMU automatically
      removes their backends but it's still better to make our code
      consistent. And it may start making difference in case we switch to
      attaching disks using -blockdev.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      0635785b
    • J
      qemu: Remove interface backend only after frontend is gone · 81f76598
      Jiri Denemark 提交于
      [1] reported that we are removing network's backend too early. I didn't
      really get the reproducer but libvirt behaves strangely when a guest
      does not confirm the removal, e.g., it does not support PCI hotplug. In
      such case, detaching a network device leaves its frontend in place but
      removes the backend, which makes the device unusable for the guest.
      Moreover attaching the same device again succeeds and both the guest and
      libvirt will see two network interfaces attached but only one of them is
      actually working.
      
      I checked with Paolo Bonzini and he confirmed we should only remove a
      backend after seeing DEVICE_DELETED event for a corresponding frontend.
      
      [1] https://www.redhat.com/archives/libvir-list/2014-March/msg01740.htmlSigned-off-by: NJiri Denemark <jdenemar@redhat.com>
      81f76598
    • P
      tests: storagetest: Unify and reformat storage chain format string · 8ed19d8c
      Peter Krempa 提交于
      All the fields crammed into two lines weren't easy to parse by human
      eyes. Split up the format string into lines and put it into a central
      variable so that changes in two places aren't necessary.
      8ed19d8c
    • P
      qemu: json: Add format strings for optional command arguments · f744b831
      Peter Krempa 提交于
      This patch adds option to specify that a json qemu command argument is
      optional without the need to use if's or ternary operators to pass the
      list. Additionally all the modifier characters are documented to avoid
      user confusion.
      f744b831
    • P
      util: string: Return element count from virStringSplit · 68226749
      Peter Krempa 提交于
      To allow using the array manipulation macros on the arrays returned by
      virStringSplit we need to know the count of the elements in the array.
      Modify virStringSplit to return this value, rename it and add a helper
      with the old name so that we don't need to update all the code.
      68226749
    • P
      storage: Traverse backing chains of network disks · 1423ae29
      Peter Krempa 提交于
      Now we don't need to skip backing chain detection for remote disks.
      1423ae29
    • P
      storage: Change to new backing store parser · b225444e
      Peter Krempa 提交于
      Use the new backing store parser in the backing chain crawler. This
      change needs one test change where information about the NBD image are
      now parsed differently.
      b225444e
    • P
      storage: Add infrastructure to parse remote network backing names · ed68eb86
      Peter Krempa 提交于
      Add parsers for relative and absolute backing names for local and remote
      storage files.
      
      This parser parses relative paths as relative to their parents and
      absolute paths according to the protocol or local access.
      
      For remote storage volumes, all URI based backing file names are
      supported and for the qemu colon syntax the NBD protocol is supported.
      ed68eb86
    • P
      storage: Switch metadata crawler to use storage driver file access check · 6cdff20c
      Peter Krempa 提交于
      Use virStorageFileAccess() to to check whether the file is accessible in
      the main part of the metadata crawler.
      6cdff20c
    • P
      storage: Switch metadata crawler to use storage driver to read headers · 2bdb8b96
      Peter Krempa 提交于
      Use virStorageFileReadHeader() to read headers of storage files possibly
      on remote storage to retrieve the image metadata.
      
      The backend information is now parsed by
      virStorageFileGetMetadataInternal which is now exported from the util
      source and virStorageFileGetMetadataFromFDInternal now doesn't need to
      be exported.
      2bdb8b96
    • P
      storage: Switch metadata crawler to use storage driver to get unique path · 395171f8
      Peter Krempa 提交于
      Use the virStorageFileGetUniqueIdentifier() function to get a unique
      identifier regardless of the target storage type instead of relying on
      canonicalize_path().
      
      A new function that checks whether we support a given image is
      introduced to avoid errors for unimplemented backends.
      395171f8
    • P
      storage: backend: Add possibility to suppress errors from backend lookup · edfd6127
      Peter Krempa 提交于
      Add a new function wrapper and tweak the storage file backend lookup
      function so that it can be used without reporting error. This will be
      useful in the metadata crawler code where we need silently break if
      metadata retrieval is not supported for the current storage type.
      edfd6127
    • P
      test: storage: Initialize storage source to correct type · 29aabe73
      Peter Krempa 提交于
      Stat the path of the storage file being tested to set the correct type
      into the virStorageSource. This will avoid breaking the test suite when
      inquiring metadata of directory paths in the next patches.
      29aabe73
    • P
      storage: Determine the local storage type right away · d4c0ceae
      Peter Krempa 提交于
      When walking the backing chain we previously set the storage type to
      _FILE and let the virStorageFileGetMetadataFromFDInternal update it to
      the correct type later on.
      
      This patch moves the actual storage type determination to the place
      where we parse the backing store name so that the code can later be
      switched to use virStorageFileReadHeader() directly.
      d4c0ceae
    • P
      storage: Move virStorageFileGetMetadata to the storage driver · 713cc3b0
      Peter Krempa 提交于
      My future work will modify the metadata crawler function to use the
      storage driver file APIs to access the files instead of accessing them
      directly so that we will be able to request the metadata for remote
      files too. To avoid linking the storage driver to every helper file
      using the utils code, the backing chain traversal function needs to be
      moved to the storage driver source.
      
      Additionally the virt-aa-helper and virstoragetest programs need to be
      linked with the storage driver as a result of this change.
      713cc3b0
    • P
      storage: Add API to check accessibility of storage volumes · 4cb25055
      Peter Krempa 提交于
      Add a storage driver API equivalent of the access() function.
      Implementations for the filesystem and gluster backends are provided.
      4cb25055
    • P
      storage: backend: Add unique id retrieval API · 684ec651
      Peter Krempa 提交于
      Different protocols have different means to uniquely identify a storage
      file. This patch implements a storage driver API to retrieve a unique
      string describing a volume. The current implementation works for local
      storage only and returns the canonical path of the volume.
      
      To add caching support the local filesystem driver now has a private
      structure holding the cached string, which is created only when it's
      initially accessed.
      
      This patch provides the implementation for local files only for start.
      684ec651