1. 04 7月, 2014 5 次提交
    • J
      Utilize virDomainDiskAuth for storage pools · 97e3397c
      John Ferlan 提交于
      Replace the authType, chap, and cephx unions in virStoragePoolSource
      with a single pointer to a virStorageAuthDefPtr.  Adjust all users of
      the previous chap/cephx and secret unions with the source->auth data.
      97e3397c
    • J
      Utilize virDomainDiskAuth for domain disk · 6887af39
      John Ferlan 提交于
      Replace the inline "auth" struct in virStorageSource with a pointer
      to a virStorageAuthDefPtr and utilize between the domain_conf, qemu_conf,
      and qemu_command sources for finding the auth data for a domain disk
      6887af39
    • J
      virstorage: Introduce virStorageAuthDef · 1c36b944
      John Ferlan 提交于
      Introduce virStorageAuthDef and friends.  Future patches will merge/utilize
      their view of storage source/pool auth/secret definitions.
      
      New API's include:
          virStorageAuthDefParse:  Parse the "<auth/>" XML data for either the
                                   domain disk or storage pool returning a
                                   virStorageAuthDefPtr
          virStorageAuthDefCopy:   Copy a virStorageAuthDefPtr - to be used by
                                   the qemuTranslateDiskSourcePoolAuth when it
                                   copies storage pool auth data into domain
                                   disk auth data
          virStorageAuthDefFormat: Common output of the "<auth" in the domain
                                   disk or storage pool XML
          virStorageAuthDefFree:   Free memory associated with virStorageAuthDef
      
      Subsequent patches will utilize the new functions for the domain disk and
      storage pools.
      
      Future work in the hostdev pass through can then make use of common data
      structures and code.
      1c36b944
    • E
      blockjob: turn on qemu capability bit for active commit · 40ad7160
      Eric Blake 提交于
      Use the probing functionality added in the last patch to turn on
      a capability bit when active commit is present, and gate active
      commit on that capability.
      
      For my own reference: the difference between BLOCKJOB_SYNC and
      BLOCKJOB_ASYNC is whether qemu generated an event at the
      conclusion of blockpull; basically, RHEL 6.2 was the only release
      of qemu that has the sync semantics and lacks the event.  RHEL
      6.3 added blockcopy, but also picked up on the upstream style
      of qemu generating events.  As no one is likely to backport
      active commit to RHEL 6.2, it's safe for blockcommit to always
      require async blockjob support.
      
      Modifying qemucapabilitiestest is painful; the .replies files would
      be so much easier if they had comments correlating which command
      generated the given reply.  Maybe I'll fix that up later...
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_ACTIVE_COMMIT): New
      capability.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Use the new bit
      * src/qemu/qemu_capabilities.c (virQEMUCaps): Name the new bit.
      (virQEMUCapsProbeQMPCommands): Set it.
      * tests/qemucapabilitiesdata/caps_1.3.1-1.replies: Update.
      * tests/qemucapabilitiesdata/caps_1.4.2-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.5.3-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.6.0-1.replies: Likewise.
      * tests/qemucapabilitiesdata/caps_1.6.50-1.replies: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      40ad7160
    • E
      blockjob: allow omitted arguments to QMP block-commit · 47549d5a
      Eric Blake 提交于
      We are about to turn on support for active block commit.  Although
      qemu 2.0 was the first version to mostly support it, that version
      mis-handles 0-length files, and doesn't have anything available for
      easy probing.  But qemu 2.1 fixed bugs, and made life simpler by
      letting the 'top' argument be optional.  Unless someone begs for
      active commit with qemu 2.0, for now we are just going to enable
      it only by probing for qemu 2.1 behavior (anyone backporting active
      commit can also backport the optional argument behavior).  This
      requires qemu.git commit 7676e2c597000eff3a7233b40cca768b358f9bc9.
      
      Although all our actual uses of block-commit supply arguments for
      both base and top, we can omit both arguments and use a bogus
      device string to trigger an interesting behavior in qemu.  All QMP
      commands first do argument validation, failing with GenericError
      if a mandatory argument is missing.  Once that passes, the code
      in the specific command gets to do further checking, and the qemu
      developers made sure that if device is the only supplied argument,
      then the block-commit code will look up the device first, with a
      failure of DeviceNotFound, before attempting any further argument
      validation (most other validations fail with GenericError).  Thus,
      the category of error class can reliably be used to decipher
      whether the top argument was optional, which in turn implies a
      working active commit.  Since we expect our bogus device string to
      trigger an error either way, the code is written to return a
      distinct return value without spamming the logs.
      
      * src/qemu/qemu_monitor.h (qemuMonitorSupportsActiveCommit): New
      prototype.
      * src/qemu/qemu_monitor.c (qemuMonitorSupportsActiveCommit):
      Implement it.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
      Allow NULL for top and base, for probing purposes.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
      Likewise, implementing the probe.
      * tests/qemumonitorjsontest.c (mymain): Enable...
      (testQemuMonitorJSONqemuMonitorSupportsActiveCommit): ...a new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      47549d5a
  2. 03 7月, 2014 19 次提交
  3. 02 7月, 2014 7 次提交
  4. 01 7月, 2014 9 次提交
    • P
      qemu: copy: Accept 'format' parameter when copying to a non-existing img · 42619ed0
      Peter Krempa 提交于
      We have the following matrix of possible arguments handled by the logic
      statement touched by this patch:
             | flags & _REUSE_EXT | !(flags & _REUSE_EXT)
      -------+--------------------+----------------------
       format| (1)                | (2)
      -------+--------------------+----------------------
      !format| (3)                | (4)
      -------+--------------------+----------------------
      
      In cases 1 and 2 the user provided a format, in cases 3 and 4 not. The
      user requests to use a pre-existing image in 1 and 3 and libvirt will
      create a new image in 2 and 4.
      
      The difference between cases 3 and 4 is that for 3 the format is probed
      from the user-provided image, whereas in 4 we just use the existing disk
      format.
      
      The current code would treat cases 1,3 and 4 correctly but in case 2 the
      format provided by the user would be ignored.
      
      The particular piece of code was broken in commit 35c7701c
      but since it was introduced a few commits before that it was never
      released as working.
      42619ed0
    • P
      storage: gluster: Fix header reader function · f412fc9f
      Peter Krempa 提交于
      Advance the right pointer to actually append to the buffer. We were
      lucky that all reads were completed in one try.
      f412fc9f
    • P
      conf: storage: Add volume feature formatter for gluster pools · 88f3f7c3
      Peter Krempa 提交于
      Libvirt didn't output feature flags for images stored on native gluster.
      Fix this trivially by adding a feature formatter callback.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1095035
      88f3f7c3
    • M
      build: link libvirt_conf with libxml · fb62d311
      Martin Kletzander 提交于
      Since there is code using functions from the libxml library,
      libvirt_conf should have that in LIBADD so it can be linked against
      even without libvirt_util (which usually deals with the error itself,
      since libvirt_util has libxml in LIBADD).  The same applies to
      storage_backend.c.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      fb62d311
    • J
      Report one error less when getting net dev speed · 1c7601f5
      Ján Tomko 提交于
      virFileReadAll already logs an error. If reading the 'speed' file
      fails with EINVAL, we log an error even though we ignore it. If it
      fails with other errors, we log two errors.
      
      Use virFileReadAllQuiet - ignore EINVAL and report just one error
      in other cases.
      
      Fixes this error on libvirtd startup:
      2014-06-30 12:47:14.583+0000: 20971: error : virFileReadAll:1297 :
      Failed to read file '/sys/class/net/wlan0/speed': Invalid argument
      1c7601f5
    • J
      Introduce virFileReadAllQuiet · f638c13e
      Ján Tomko 提交于
      Just like virFileReadAll, but returns -errno instead
      of reporting errors. Useful for ignoring some errors.
      f638c13e
    • J
      Only detect PCI Express devices as root in udev nodedev driver · 5de9b502
      Ján Tomko 提交于
      This stops the error message spam when running unprivileged
      libvirtd:
      2014-06-30 12:38:47.990+0000: 631: error : virPCIDeviceConfigOpen:300 :
      Failed to open config space file
      '/sys/bus/pci/devices/0000:00:00.0/config': Permission denied
      
      Reported by Daniel Berrange:
      https://www.redhat.com/archives/libvir-list/2014-June/msg01082.html
      5de9b502
    • J
      Track privileged state in udev nodedev driver · 1229ef49
      Ján Tomko 提交于
      Remember if libvirtd is running as root or not.
      1229ef49
    • J
      libxl: add PV console if not explicitly specified · ec7b9225
      Jim Fehlig 提交于
      Xen PV domains always have a PV console, so add one to the domain
      config via post-parse callback if not explicitly specified in
      the XML.  The legacy Xen driver behaves similarly, causing a
      regression when switching to the new Xen toolstack.  I.e.
      
        virsh console pv-domain
      
      will no longer work after upgrading a xm/xend stack to xl/libxl.
      ec7b9225