1. 24 2月, 2017 12 次提交
  2. 23 2月, 2017 13 次提交
    • M
      qemu: Fix incorrect jump labels in error paths · eca76884
      Marc Hartmayer 提交于
      Fix incorrect jump labels in error paths as the stop jump is only
      needed if the driver has already changed the state. For example
      'virAtomicIntInc(&driver->nactive)' will be 'reverted' in the
      qemuProcessStop call.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      eca76884
    • M
      qemu_cgroup: Only try to allow devices if devices CGroup's available · 3cddd63a
      Michal Privoznik 提交于
      When a domain needs an access to some device (be it a disk, RNG,
      chardev, whatever), we have to allow it in the devices CGroup (if
      it is available), because by default we disallow all the devices.
      But some of the functions that are responsible for setting up
      devices CGroup are lacking check whether there is any CGroup
      available. Thus users might be unable to hotplug some devices:
      
        virsh # attach-device fedora rng.xml
        error: Failed to attach device from rng.xml
        error: internal error: Controller 'devices' is not mounted
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3cddd63a
    • D
      Add ATTRIBUTE_FALLTHROUGH for switch cases without break · 5d84f596
      Daniel P. Berrange 提交于
      In GCC 7 there is a new warning triggered when a switch
      case has a conditional statement (eg if ... else...) and
      some of the code paths fallthrough to the next switch
      statement. e.g.
      
      conf/domain_conf.c: In function 'virDomainChrEquals':
      conf/domain_conf.c:14926:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (src->targetTypeAttr != tgt->targetTypeAttr)
                  ^
      conf/domain_conf.c:14928:5: note: here
           case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
           ^~~~
      conf/domain_conf.c: In function 'virDomainChrDefFormat':
      conf/domain_conf.c:22143:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (def->targetTypeAttr) {
                  ^
      conf/domain_conf.c:22151:5: note: here
           default:
           ^~~~~~~
      
      GCC introduced a __attribute__((fallthrough)) to let you
      indicate that this is intentionale behaviour rather than
      a bug.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5d84f596
    • D
      qemu: add missing break in qemuDomainDeviceCalculatePCIConnectFlags · fb52faf8
      Daniel P. Berrange 提交于
      One of the conditions in qemuDomainDeviceCalculatePCIConnectFlags
      was missing a break that could result it in falling through to
      an incorrect codepath.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fb52faf8
    • D
      libxl: fix empty string check for channel path · dd08d9ff
      Daniel P. Berrange 提交于
      The libxl code was checking that a 'char *' was != '\0', instead
      of checking the first element in the string
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dd08d9ff
    • D
      Use explicit boolean comparison in OOM check · 09db97d3
      Daniel P. Berrange 提交于
      GCC 7 gets upset by
      
         if (!tmp && (size * count))
      
      warning
      
        util/viralloc.c: In function 'virReallocN':
        util/viralloc.c:246:23: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
           if (!tmp && (size * count)) {
                       ~~~~~~^~~~~~~~
      
      Keep it happy by adding != 0 to the right hand expression
      so it realizes we really are wanting to treat the result
      of the arithmetic expression as a boolean
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      09db97d3
    • N
      vz: make more accurate closing connection to sdk · 0518aae3
      Nikolay Shirokovskiy 提交于
      Current code for example can call unsubscribe if connection
      succeeds but subscribing fails. This will probabaly lead
      only to spurious error messages without any actual inconsistencies
      but nevertheless.
      0518aae3
    • J
      virsh: Alter formatting a bit for output of domstats fields · ff029e44
      John Ferlan 提交于
      Alter the formatting of each line to not give the appearance of
      one long run-on sentence and to be consistent between the various
      elements of collected/displayed data. The formatting should fit
      within the 80 character display. This removes the need for commas
      at the end of each line.
      ff029e44
    • A
      qemu: Allow multiple bridges when pci-bridges is not available · 011d5465
      Andrea Bolognani 提交于
      qemuDomainAssignPCIAddresses() hardcoded the assumption
      that the only way to support devices on a non-zero bus is
      to add one or more pci-bridges; however, since we now
      support a large selection of PCI controllers that can be
      used instead, the assumption is no longer true.
      
      Moreover, this check was always redundant, because the
      only sensible time to check for the availability of
      pci-bridge is when building the QEMU command line, and
      such a check is of course already in place.
      
      In fact, there were *two* such checks, but since one of
      the two was relying on the incorrect assumption explained
      above, and it was redundant anyway, it has been dropped.
      011d5465
    • A
      tests: Reduce usage of legacy PCI controllers on PCIe machines · d4393c42
      Andrea Bolognani 提交于
      Up until a while ago, libvirt would automatically add a legacy
      PCI controllers combo (dmi-to-pci-bridge + pci-bridge) to any
      PCIe machine type (x86_64/q35 and aarch64/virt).
      
      As a result, a number of input and output files in the test
      suite ended up containing the legacy PCI controllers, even
      though they are not needed or in any way relevant to the
      feature being tested.
      
      Get rid of most of the occurrences. Most of the time, this
      just means removing the controllers from the input file and
      regenerating the output files; in a few instances, some
      minor tweaking is performed on the input file, most notably
      removing the memory balloon: as memory balloon support was
      not the scope of the test being changed, there is no loss
      of test coverage from doing so.
      
      Several occurrences of the legacy PCI controllers remain in
      the test suite, both because removing their usage would have
      required even more tweaking, and because we still want to
      have coverage of this perfectly valid combination.
      d4393c42
    • A
      conf: Make switch statements more strict · 77edbf51
      Andrea Bolognani 提交于
      When switching over the values in the virDomainControllerModelPCI
      enumeration, make sure the proper cast is in place so that the
      compiler can warn us when the coverage is not exaustive.
      
      For the same reason, remove the 'default' case from one of the
      existing switch statements.
      77edbf51
    • A
      qemu: Make switch statements more strict · 50d35953
      Andrea Bolognani 提交于
      When switching over the values in the virDomainControllerModelPCI
      enumeration, make sure the proper cast is in place so that the
      compiler can warn us when the coverage is not exaustive.
      
      For the same reason, fold some unstructured checks (performed by
      comparing directly against some values in the enumeration) inside
      an existing switch statement.
      50d35953
    • A
      conf: Remove dead code · c6a0fb8e
      Andrea Bolognani 提交于
      The switch in virDomainPCIControllerModelToConnectType()
      had some code that, while techically part of the
      _PCIE_SWITCH_DOWNSTREAM_PORT case, was in fact dead due
      to the early return.
      
      Get rid of the dead code, and fix the inaccurate function
      description while at it.
      c6a0fb8e
  3. 22 2月, 2017 15 次提交