1. 18 1月, 2017 1 次提交
  2. 17 1月, 2017 5 次提交
  3. 14 1月, 2017 3 次提交
    • J
      storage: Alter error message in probe/empty checks · 40ec4ff6
      John Ferlan 提交于
      For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to
      avoid using the virsh like --overwrite syntax. Additionally provide
      a different error message when not writing the label to avoid confusion.
      40ec4ff6
    • J
      storage: Clean up return value checking · f462f9ad
      John Ferlan 提交于
      Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after
      calling virStorageBackendBLKIDFindPart, just allow the switch statement
      handle setting ret = -2.
      f462f9ad
    • J
      storage: Alter logic when both BLKID and PARTED unavailable · d1f5dfc4
      John Ferlan 提交于
      If neither BLKID or PARTED is available and we're not writing, then
      just return 0 which allows the underlying storage pool to generate
      a failure. If both are unavailable and we're writing, then generate
      a more generic error message.
      d1f5dfc4
  4. 13 1月, 2017 5 次提交
    • C
      qemu-capabilities: Fix query-cpu-model-expansion on s390 with older kernel · e8a43f19
      Collin L. Walling 提交于
      When running on s390 with a kernel that does not support cpu model checking and
      with a Qemu new enough to support query-cpu-model-expansion, the gathering of qemu
      capabilities will fail. Qemu responds to the query-cpu-model-expansion qmp
      command with an error because the needed kernel ioct does not exist. When this
      happens a guest cannot even be defined due to missing qemu capabilities data.
      
      This patch fixes the problem by silently ignoring generic errors stemming from
      calls to query-cpu-model-expansion.
      Reported-by: NFarhan Ali <alifm@linux.vnet.ibm.com>
      Signed-off-by: NCollin L. Walling <walling@linux.vnet.ibm.com>
      Signed-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com>
      e8a43f19
    • M
      qemu: Copy SELinux labels for namespace too · 93a062c3
      Michal Privoznik 提交于
      When creating new /dev/* for qemu, we do chown() and copy ACLs to
      create the exact copy from the original /dev. I though that
      copying SELinux labels is not necessary as SELinux will chose the
      sane defaults. Surprisingly, it does not leaving namespace with
      the following labels:
      
      crw-rw-rw-. root root system_u:object_r:tmpfs_t:s0     random
      crw-------. root root system_u:object_r:tmpfs_t:s0     rtc0
      drwxrwxrwt. root root system_u:object_r:tmpfs_t:s0     shm
      crw-rw-rw-. root root system_u:object_r:tmpfs_t:s0     urandom
      
      As a result, domain is unable to start:
      
      error: internal error: process exited while connecting to monitor: Error in GnuTLS initialization: Failed to acquire random data.
      qemu-kvm: cannot initialize crypto: Unable to initialize GNUTLS library: Failed to acquire random data.
      
      The solution is to copy the SELinux labels as well.
      Reported-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      93a062c3
    • P
      Revert "storage: Validate the device formats at logical startup" · a80957c5
      Peter Krempa 提交于
      The check is pointless since LVM is capable to detect it's own members
      and the check is flawed as it would fail if neither libblkid nor parted
      is installed.
      
      We don't really need to babysit LVM in this way.
      
      This reverts commit cb38b6cb.
      a80957c5
    • P
      Revert "storage: For FS pool check for properly formatted target volume" · 9538dff9
      Peter Krempa 提交于
      The check does not work properly (crashes) with netfs filesystems and
      also checking that a device is not empty when attempting to mount a
      filesystem is not very usefull since the mount will fail anyways.
      
      As the code would improve only a very minor corner case I don't really
      see a reason to have this code at all.
      
      This code would also fail if libvirt is compiled without support for
      blkid and without parted.
      
      This reverts commit a11fd697.
      9538dff9
    • J
      libxl: always enable pae for x86_64 HVM · ecb587e4
      Jim Fehlig 提交于
      For HVM domains, pae is only set in libxl_domain_build_info when
      explicitly specified in the hypervisor <features> config. This is
      fine for i686 machines, but is incorrect behavior for x86_64 machines
      where pae must always be enabled. See the following discussion for
      additional details
      
      https://www.redhat.com/archives/libvir-list/2017-January/msg00254.html
      ecb587e4
  5. 12 1月, 2017 9 次提交
  6. 11 1月, 2017 17 次提交
    • P
      remote: do not check for an existing config dir · 1a5de3fe
      Pino Toscano 提交于
      When composing the path to the default known_hosts file (for the libssh
      and libssh2 drivers), do not check whether the configuration directory
      (determined by virGetUserConfigDirectory()) exists: both the drivers can
      handle non-existing files, and are able to create them (and their
      directories) in that case.
      
      This adds a small behaviour change: before, the key for an unknown host,
      and manually accepted, was saved only if the configuration directory
      existed -- a bit incoherent behaviour though.
      1a5de3fe
    • P
      remote: fix logic for known_hosts and keyfile checks · 45c4a70c
      Pino Toscano 提交于
      If any of them is specified for the libssh and libssh2 drivers, there is
      no need to depend on checks based on other paths: in particular, a
      specified path for known_hosts was ignored if the local config directory
      could not be determined, and the path for keyfile was ignored if the
      home could not be determined.
      
      Instead, lazily determine and use these two paths only in case they are
      needed.
      45c4a70c
    • P
      rpc: libssh: allow a NULL known_hosts file · 408a1ce5
      Pino Toscano 提交于
      Make sure that virNetLibsshSessionSetHostKeyVerification accepts a NULL
      value for the path to the known_hosts file:
      - call ssh_options_set(SSH_OPTIONS_KNOWNHOSTS) anyway, using /dev/null,
        otherwise libssh will use its default path
      - do not call ssh_write_knownhost when no known hosts file was set
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1406457
      408a1ce5
    • L
      conf: eliminate virDomainPCIAddressReleaseSlot() in favor of ...Addr() · 5949b53a
      Laine Stump 提交于
      Surprisingly there was a virDomainPCIAddressReleaseAddr() function
      already, but it was completely unused. Since we don't reserve entire
      slots at once any more, there is no need to release entire slots
      either, so we just replace the single call to
      virDomainPCIAddressReleaseSlot() with a call to
      virDomainPCIAddressReleaseAddr() and remove the now unused function.
      
      The keen observer may be concerned that ...Addr() doesn't call
      virDomainPCIAddressValidate(), as ...Slot() did. But really the
      validation was pointless anyway - if the device hadn't been suitable
      to be connected at that address, it would have failed validation
      before every being reserved in the first place, so by definition it
      will pass validation when it is being unplugged. (And anyway, even if
      something "bad" happened and we managed to have a device incorrectly
      at the given address, we would still want to be able to free it up for
      use by a device that *did* validate properly).
      5949b53a
    • L
      qemu: rename qemuDomainPCIAddressReserveNextSlot() to ...Addr() · 6cc20142
      Laine Stump 提交于
      This function doesn't actually reserve an entire slot any more, it
      reserves a single PCI address, so this name is more appropriate.
      6cc20142
    • L
      qemu: remove qemuDomainPCIAddressReserveNextAddr() · c5aea19d
      Laine Stump 提交于
      This function is only called in two places, and the function itself is
      just adding a single argument and calling
      virDomainPCIAddressReserveNextAddr(), so we can remove it and instead
      call virDomainPCIAddressReserveNextAddr() directly. (The main
      motivation for doing this is to free up the name so that
      qemuDomainPCIAddressReserveNextSlot() can be renamed in the next
      patch, as its current name is now inaccurate and misleading).
      c5aea19d
    • L
      conf: rename virDomainPCIAddressReserveSlot() to ...Addr() · 27b0f971
      Laine Stump 提交于
      This function doesn't actually reserve an entire slot any more, it
      reserves a single PCI address, so this name is more appropriate.
      27b0f971
    • L
      conf: rename virDomainPCIAddressReserveAddr() to ...Internal() · 640ce186
      Laine Stump 提交于
      This is in preparation for renaming virDomainPCIAddressReserveSlot()
      to virDomainPCIAddressReserveAddr(), which is a better description of
      what it does.
      640ce186
    • L
      conf: make virDomainPCIAddressReserveAddr() a static function · 24c8c472
      Laine Stump 提交于
      It is now only used in domain_addr.c.
      24c8c472
    • L
      qemu: replace virDomainPCIAddressReserveAddr with virDomainPCIAddressReserveSlot · 905859a6
      Laine Stump 提交于
      All occurences of the former use fromConfig=true, and that's exactly
      how virDomainPCIAddressReserveSlot() calls
      virDomainPCIaddressReserveAddr(), so just use *Slot() so that *Addr()
      can be made static to conf/domain_addr.c (both functions will be
      renamed in upcoming patches).
      905859a6
    • L
      conf: eliminate virDomainPCIAddressReserveNextSlot() · 43f81477
      Laine Stump 提交于
      Since we don't actually reserve an entire slot at a time anymore, the
      name of this function is just confusing, and it's almost identical in
      operation to virDomainPCIAddressReserveNextAddr() anyway, so remove
      the *Slot() function and replace calls to it with calls to *Addr(...,
      -1).
      43f81477
    • L
      conf: rename virDomainPCIAddressGetNextSlot() to ...GetNextAddr() · e97fab26
      Laine Stump 提交于
      With the advent of VIR_PCI_CONNECT_AGGREGATE_SLOT, the new name is
      more appropriate, since the address returned may be another address
      on the same slot as last time, not necessarily a new slot.
      e97fab26
    • L
      conf: fix fromConfig argument to virDomainPCIAddressValidate() · b59bbdba
      Laine Stump 提交于
      fromConfig should be true if the caller wants
      virDomainPCIAddressValidate() to loosen restrictions on its
      interpretation of the pciConnectFlags. In particular, either
      PCI_DEVICE or PCIE_DEVICE will be counted as equivalent to both, and
      HOTPLUG will be ignored. In a few cases where libvirt was manually
      overriding automatic address assignment, it was setting fromConfig to
      false when validating the hardcoded manual override. This patch
      changes those to fromConfig=true as a preemptive strike against any
      future bugs that might otherwise surface.
      b59bbdba
    • L
      conf: fix fromConfig argument to virDomainPCIAddressReserveAddr() · 79901543
      Laine Stump 提交于
      Although setting virDomainPCIAddressReserveAddr()'s fromConfig=true is
      correct when a PCI addres is coming from a domain's config, the *true*
      purpose of the fromConfig argument is to lower restrictions on what
      kind of device can plug into what kind of controller - if fromConfig
      is true, then a PCIE_DEVICE can plug into a slot that is marked as
      only compatible with PCI_DEVICE (and vice versa), and the HOTPLUG flag
      is ignored.
      
      For a long time there have been several calls to
      virDomainPCIAddressReserveAddr() that have fromConfig incorrectly set
      to false - it's correct that the addresses aren't coming from user
      config, but they are coming from hardcoded exceptions in libvirt that
      should, if anything, pay *even less* attention to following the
      pciConnectFlags (under the assumption that the libvirt programmer knew
      what they were doing).
      
      See commit b87703cf for an example of an actual bug caused by the
      incorrect setting of the "fromConfig" argument to
      virDomainPCIAddressReserveAddr(). Although they haven't resulted in
      any reported bugs, this patch corrects all the other incorrect
      settings of fromConfig in calls to virDomainPCIAddressReserveAddr().
      79901543
    • L
      conf: aggregate multiple pcie-root-ports onto a single slot · 147ebe6d
      Laine Stump 提交于
      Set the VIR_PCI_CONNECT_AGGREGATE_SLOT flag for pcie-root-ports so
      that they will be assigned to all the functions on a slot.
      
      Some qemu test case outputs had to be adjusted due to the
      pcie-root-ports now being put on multiple functions.
      147ebe6d
    • L
      conf: aggregate multiple devices on a slot when assigning PCI addresses · 48d39cf9
      Laine Stump 提交于
      If a PCI device has VIR_PCI_CONNECT_AGGREGATE_SLOT set in its
      pciConnectFlags, then during address assignment we allow multiple
      instances of this type of device to be auto-assigned to multiple
      functions on the same device. A slot is used for aggregating multiple
      devices only if the first device assigned to that slot had
      VIR_PCI_CONNECT_AGGREGATE_SLOT set. but any device types that have
      AGGREGATE_SLOT set might be mix/matched on the same slot.
      
      (NB: libvirt should never set the AGGREGATE_SLOT flag for a device
      type that might need to be hotplugged. Currently it is only planned
      for pcie-root-port and possibly other PCI controller types, and none
      of those are hotpluggable anyway)
      
      There aren't yet any devices that use this flag. That will be in a
      later patch.
      48d39cf9
    • L
      qemu: use virDomainPCIAddressSetAllMulti() to set multi when needed · 8f400871
      Laine Stump 提交于
      If there are multiple devices assigned to the different functions of a
      single PCI slot, they will not work properly if the device at function
      0 doesn't have its "multi" attribute turned on, so it makes sense for
      libvirt to turn it on during PCI address assignment. Setting multi
      then assures that the new setting is stored in the config (so it will
      be used next time the domain is started), preventing any potential
      problems in the case that a future change in the configuration
      eliminates the devices on all non-0 functions (multi will still be set
      for function 0 even though it is the only function in use on the slot,
      which has no useful purpose, but also doesn't cause any problems).
      
      (NB: If we were to instead just decide on the setting for
      multifunction at runtime, a later removal of the non-0 functions of a
      slot would result in a silent change in the guest ABI for the
      remaining device on function 0 (although it may seem like an
      inconsequential guest ABI change, it *is* a guest ABI change to turn
      off the multi bit).)
      8f400871