1. 09 8月, 2015 1 次提交
    • L
      conf: more useful error message when pci function is out of range · f8fe8f03
      Laine Stump 提交于
      If a pci address had a function number out of range, the error message
      would be:
      
        Insufficient specification for PCI address
      
      which is logged by virDevicePCIAddressParseXML() after
      virDevicePCIAddressIsValid returns a failure.
      
      This patch enhances virDevicePCIAddressIsValid() to optionally report
      the error itself (since it is the place that decides which part of the
      address is "invalid"), and uses that feature when calling from
      virDevicePCIAddressParseXML(), so that the error will be more useful,
      e.g.:
      
        Invalid PCI address function=0x8, must be <= 7
      
      Previously, virDevicePCIAddressIsValid didn't check for the
      theoretical limits of domain or bus, only for slot or function. While
      adding log messages, we also correct that ommission. (The RNG for PCI
      addresses already enforces this limit, which by the way means that we
      can't add any negative tests for this - as far as I know our
      domainschematest has no provisions for passing XML that is supposed to
      fail).
      
      Note that virDevicePCIAddressIsValid() can only check against the
      absolute maximum attribute values for *any* possible PCI controller,
      not for the actual maximums of the specific controller that this
      device is attaching to; fortunately there is later more specific
      validation for guest-side PCI addresses when building the set of
      assigned PCI addresses. For host-side PCI addresses (e.g. for
      <hostdev> and for network device pools), we rely on the error that
      will be logged when it is found that the device doesn't actually
      exist.
      
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1004596
      f8fe8f03
  2. 07 8月, 2015 1 次提交
  3. 05 8月, 2015 1 次提交
    • J
      conf: Resolve Coverity FORWARD_NULL · a16871fe
      John Ferlan 提交于
      The recent changes to perform SCSI device address checks during the
      post parse callbacks ran afoul of the Coverity checker since the changes
      assumed that the 'xmlopt' parameter to virDomainDeviceDefPostParse
      would be non NULL (commit id 'ca2cf74e'); however, what was missed
      is there was an "if (xmlopt &&" check being made, so Coverity believed
      that it could be possible for a NULL 'xmlopt'.
      
      Checking the various calling paths seemingly disproves that. If called
      from virDomainDeviceDefParse, there were two other possible calls that
      would end up dereffing, so that path could not be NULL. If called via
      virDomainDefPostParseDeviceIterator via virDomainDefPostParse there
      are two callers (virDomainDefParseXML and qemuParseCommandLine)
      which deref xmlopt either directly or through another call.
      
      So I'm removing the check for non-NULL xmlopt.
      a16871fe
  4. 04 8月, 2015 10 次提交
  5. 25 7月, 2015 1 次提交
    • L
      conf: add virDomainControllerDefNew() · e1431072
      Laine Stump 提交于
      There are some non-0 default values in virDomainControllerDef (and
      will soon be more) that are easier to not forget if the remembering is
      done by a single initializer function (rather than inline code after
      allocating the obejct with generic VIR_ALLOC().
      e1431072
  6. 20 7月, 2015 1 次提交
    • M
      qemu: Reject updating unsupported disk information · 717c99f3
      Martin Kletzander 提交于
      If one calls update-device with information that is not updatable,
      libvirt reports success even though no data were updated.  The example
      used in the bug linked below uses updating device with <boot order='2'/>
      which, in my opinion, is a valid thing to request from user's
      perspective.  Mainly since we properly error out if user wants to update
      such data on a network device for example.
      
      And since there are many things that might happen (update-device on disk
      basically knows just how to change removable media), check for what's
      changing and moreover, since the function might be usable in other
      drivers (updating only disk path is a valid possibility) let's abstract
      it for any two disks.
      
      We can't possibly check for everything since for many fields our code
      does not properly differentiate between default and unspecified values.
      Even though this could be changed, I don't feel like it's worth the
      complexity so it's not the aim of this patch.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1007228
      717c99f3
  7. 10 7月, 2015 3 次提交
  8. 09 7月, 2015 1 次提交
  9. 08 7月, 2015 1 次提交
  10. 01 7月, 2015 1 次提交
    • P
      conf: qemu: Taint VMs using custom device tree blob · 4b48ba4a
      Peter Krempa 提交于
      Using a custom device tree image may cause unexpected behavior in
      architectures that use this approach to detect platform devices. Since
      usually the device tree is generated by qemu and thus it's not normally
      used let's taint VMs using it to make it obvious as a possible source of
      problems.
      4b48ba4a
  11. 30 6月, 2015 1 次提交
    • J
      conf: Validate disk lun using correct types · c79ebf53
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1201143
      
      The formatdomain.html description for <disk> device 'lun' indicates that
      it must be either a type 'block' or type 'network' with protocol 'iscsi';
      however, we did not make that check until domain startup.
      
      This caused issues for virt-manager which had an unexpected failure at
      run time rather config time.
      
      This patch adds a check in post part disk device checking for the specific
      and supported lun types as well as adjusting the test failure to be for
      parse config rather than run time.
      c79ebf53
  12. 26 6月, 2015 1 次提交
  13. 24 6月, 2015 5 次提交
  14. 23 6月, 2015 3 次提交
  15. 19 6月, 2015 2 次提交
  16. 18 6月, 2015 5 次提交
  17. 15 6月, 2015 1 次提交
    • J
      storage: Need to set secrettype for direct iscsi disk volume · 1feaccf0
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1200206
      
      Commit id '1b4eaa61' added the ability to have a mode='direct' for
      an iscsi disk volume.  It relied on virStorageTranslateDiskSourcePool
      in order to copy any disk source pool authentication information to
      the direct disk volume, but it neglected to also copy the 'secrettype'
      field which ends up being used in the domain volume formatting code.
      Adding a secrettype for this case will allow for proper formatting later
      and allow disk snapshotting to work properly
      
      Additionally libvirtd restart processing would fail to find the domain
      since the translation processing code is run after domain xml processing,
      so handle the the case where the authdef could have an empty secrettype
      field when processing the auth and additionally ignore performing the
      actual and expected auth secret type checks for a DISK_VOLUME since that
      data will be reassembled later during translation processing of the
      running domain.
      1feaccf0
  18. 12 6月, 2015 1 次提交
    • M
      virsysinfo: s/system/sysdef/ · c1dff918
      Michal Privoznik 提交于
      A variable can't be named system, obviously. Well, it can if the
      compiler is new enough to distinguish a variable named system and a
      function call system(). And some older systems, don't have wise
      compiler.
      
        CC     util/libvirt_util_la-virsysinfo.lo
      cc1: warnings being treated as errors
      ../../src/util/virsysinfo.c: In function 'virSysinfoParseSystem':
      ../../src/util/virsysinfo.c:649: error: declaration of 'system' shadows a global declaration [-Wshadow]
      /usr/include/stdlib.h:717: error: shadowed declaration is here [-Wshadow]
      make[3]: *** [util/libvirt_util_la-virsysinfo.lo] Error 1
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c1dff918