1. 11 1月, 2017 37 次提交
    • 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
    • L
      conf: new function virDomainPCIAddressSetAllMulti() · 3c1a0fc2
      Laine Stump 提交于
      This utility function iterates through all devices looking for any
      with a PCI address that has function != 0 (which implies that multiple
      functions are in use on that slot), then uses an inner iterator to
      find the device that's on function 0 of that same slot and sets the
      "multi" in its virDomainDeviceInfo (as long as it hasn't already been
      set explicitly by someone who presumably has better information than
      we do).
      
      It isn't yet called from anywhere, so will have no functional effect.
      3c1a0fc2
    • L
      conf: start search for next unused PCI address at same slot as previous find · 66e0b08d
      Laine Stump 提交于
      There is a very slight time advantage to beginning the search for the
      next unused PCI address at the slot *after* the previous find (which
      is now used), but if we do that, we will miss allocating the other
      functions of the same slot (when we implement a
      VIR_PCI_CONNECT_AGGREGATE_SLOT flag to support that).
      66e0b08d
    • L
      conf: eliminate repetitive code in virDomainPCIAddressGetNextSlot() · 99bf66f3
      Laine Stump 提交于
      virDomainPCIAddressGetNextSlot() starts searching from the last
      allocated address and goes to the end of all the buses, then goes back
      to the first bus and searches from there up to the starting point (in
      case any address has been freed since the last time an address was
      allocated. The loops for these two are almost, but not exactly, the
      same, so they have remained as separate loops with the same code
      inside the loop. To lessen maintenance headaches, the identical code
      has been moved out into the function
      virDomainPCIAddressFindUnusedFunctionOnBus(), which is called in place
      of the loop contents.
      99bf66f3
    • L
      conf: eliminate concept of "reserveEntireSlot" · 9ff9d9f5
      Laine Stump 提交于
      setting reserveEntireSlot really accomplishes nothing - instead of
      going to the trouble of computing the value for reserveEntireSlot and
      then possibly setting *all* functions of the slot as in-use, we can
      just set the in-use bit only for the specific function being used by a
      device.  Later we will know from the context (the PCI connect flags,
      and whether we are reserving a specific address or asking for "the
      next available") whether or not it is okay to allocate other functions
      on the same slot.
      
      Although it's not used yet, we allow specifying "-1" for the function
      number when looking for the "next available slot" - this is going to
      end up meaning "return the lowest available function in the slot, but
      since we currently only provide a function from an otherwise unused
      slot, "-1" ends up meaning "0".
      9ff9d9f5
    • L
      conf: use struct instead of int for each slot in virDomainPCIAddressBus · 9838cad9
      Laine Stump 提交于
      When keeping track of which functions of which slots are allocated, we
      will need to have more information than just the current bitmap with a
      bit for each function that is currently stored for each slot in a
      virDomainPCIAddressBus. To prepare for adding more per-slot info, this
      patch changes "uint8_t slots" into "virDomainPCIAddressSlot slot", which
      currently has a single member named "functions" that serves the same
      purpose previously served directly by "slots".
      9838cad9
    • C
      libxl: define a per-domain logger. · a30b08b7
      Cédric Bosdonnat 提交于
      libxl doesn't provide a way to write one log for each domain. Thus
      we need to demux the messages. If our logger doesn't know to which
      domain to attribute a message, then it will write it to the default
      log file.
      
      Starting with Xen 4.9 (commit f9858025 and following), libxl will
      write the domain ID in an easy to grab manner. The logger introduced
      by this commit will use it to demux the libxl log messages.
      
      Thanks to the default log file, this logger will also work with older
      versions of Xen.
      a30b08b7
    • C
      virsh: pool-info: introduce option --bytes · b29f7528
      Chen Hanxiao 提交于
      By default, pool-info will convert sizes to human friendly units.
      
      This patch will introduce option [--bytes].
      If specified, the raw sizes will be in the output.
      Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
      b29f7528
    • D
      docs: add news entry in improvements section. · ccdf108c
      Dawid Zamirski 提交于
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      ccdf108c
    • D
      vbox: consolidate vbox IID structures. · 73c6f16b
      Dawid Zamirski 提交于
      * remove _vboxIID_v2_x and _vboxIID_v3_x structs and repalce with one
        _vboxIID as all supprted vbox versions have the same IID structure.
      * remove vboxIIDUnion that was used to abstract version depended IID
        differences.
      * remove IID_MEMBER macro and use the new vboxIID directly.
      73c6f16b
    • D
      vbox: fix _displayTakeScreenShotPNGToArray · 36288917
      Dawid Zamirski 提交于
      This function was not implemented for vbox 5+ which removed
      TakeScreenShotPNGToArray but provides TakeScreenShotToArray with
      BitmapFormat_PNG argument which is the same thing.
      36288917
    • D
      vbox: IVRDxServer to IVRDEServer. · 5a5c6de3
      Dawid Zamirski 提交于
      The IVRDxServer was used because vbox < 4 used to have IVRDPServer
      whereas vbox >= 4 has IVRDEServer. Now that support for legacy
      versions is being removed, we can use IVRDEServer.
      5a5c6de3
    • D
      vbox: remove code dealing with oldMediumInterface · f2f70c21
      Dawid Zamirski 提交于
      * removed oldMediumInterface flag and related code that was used for
        vbox 2.x
      * remove accelerate2DVideo and networkRemoveInterface flags which were
        also conditionals for handling legacy vbox versions.
      f2f70c21
    • D
      vbox: remove domain events support. · 1d963578
      Dawid Zamirski 提交于
      this was implemented only for vbox 3 series and was mostly stubs
      anyway.
      1d963578
    • D
      vbox: remove getMachineForSession flag. · 374422ea
      Dawid Zamirski 提交于
      * the getMachineForSession is always true for 4.0+. This also means that
        checkflag argument in openSessionForMachine no longer has any meaning
        because it was or'ed with getMachineForSession (always true)
      * remove supportScreenshot flag - vbox 4.0+ supports it
      * remove detachDevicesExplicitly flag only relevant for < 4.0
      374422ea
    • D
      vbox: do not use IHardDisk anymore. · d7f369b5
      Dawid Zamirski 提交于
      VirtualBox 4.0+ uses IMedium and IHardDisk is no longer used, so
      
      * remove typef IMedium IHardDisk
      * merge UIHardDisk into UIMedium
      * update all references accordingly
      d7f369b5
    • D
      vbox: remove _vboxAttachDrivesOld · c7c286c6
      Dawid Zamirski 提交于
      and fold vboxAttachDrivesNew into vboxAttachDrives
      c7c286c6
    • D
      vbox: remove code for old API versions. · c8d7e90f
      Dawid Zamirski 提交于
      This removes most of the code wrapped in VBOX_API_VERSION < 4000000
      preprocessor checks. Those are the ones that can be safely removed
      without needing to update driver code to accomodate it.
      c8d7e90f
    • D
      vbox: remove calls to *InstallUniformedAPI macros. · 655a99f1
      Dawid Zamirski 提交于
      That is, for versions older than 4.0. Also do not try to include
      headers for those old versions.
      655a99f1
    • D
      vbox: remove SDK header files for vbox 3 and older. · 7f10ac33
      Dawid Zamirski 提交于
      * delete SDK header files for vbox older than 4.0
      * delete .c files for vbox older than 4.0
      * update vbox_XPCOMCGlue to use oldest supported header file, that is 4.0
        going forward.
      * remove deleted files from Makefile.am
      7f10ac33
    • E
      maint: update to latest gnulib · 40c8b89c
      Eric Blake 提交于
      Among other recent changes, this includes a workaround to avoid
      Clang compiler bug https://llvm.org/bugs/show_bug.cgi?id=16404
      having spurious link failures.
      
      * .gnulib: Update.
      * bootstrap: Synchronize to upstream.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      40c8b89c
    • A
      docs: Document the release notes process for contributors · 605e308c
      Andrea Bolognani 提交于
      Now that we have built a fairly solid process for dealing with
      release notes, we should start pushing for contributors to
      provide the relevant information along with their code:
      documenting the process is clearly a requirement for this to
      happen.
      605e308c
    • A
      NEWS: Reformat at generation time · 6a5b3127
      Andrea Bolognani 提交于
      Instead of encoding formatting information inside the
      corresponding XSLT stylesheet, use a Python script to reformat
      the text appropriately based on a few simple markers.
      
      Splitting the task between the XSLT stylesheet and the Python
      script allows us to keep both parts very simple.
      6a5b3127
    • A
      NEWS: Improve building pipeline · be36ea4b
      Andrea Bolognani 提交于
      Currently, building the NEWS file involves using a XSLT stylesheet
      to extract information from the same HTML file that's used on the
      libvirt website.
      
      The process works, but it's quite fiddly in that it requires the
      source HTML to be formatted in a very precise way, and a single
      missing newline can mess up the resulting plain text considerably.
      
      Moreover, the XSLT stylesheet itself encodes a lot of the details
      of converting to plain text in a way that's not necessarily easy
      to understand, tweak or fix.
      
      To improve the process, move all existing entries to a new XML
      file that contains exactly the information we care about in a
      simple structured format, and start generating both the HTML and
      plain text versions of the release notes using XSLT stylesheets
      that can now afford to be almost trivial.
      be36ea4b
    • M
      virSecuritySELinuxSetFileconHelper: Fix build with broken selinux.h · 3027bacf
      Michal Privoznik 提交于
      There are still some systems out there that have broken
      setfilecon*() prototypes. Instead of taking 'const char *tcon' it
      is taking 'char *tcon'. The function should just set the context,
      not modify it.
      
      We had been bitten with this problem before which resulted in
      292d3f2d and subsequently b109c097. However, with one my latest
      commits (4674fc6a) I've changed the type of @tcon variable to
      'const char *' which results in build failure on the systems from
      above.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3027bacf
    • M
      qemu_domain: Move qemuDomainGetPreservedMounts · 26958914
      Michal Privoznik 提交于
      This function is used only from code compiled on Linux. Therefore
      on non-Linux platforms it triggers compilation error:
      
      ../../src/qemu/qemu_domain.c:209:1: error: unused function 'qemuDomainGetPreservedMounts' [-Werror,-Wunused-function]
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      26958914
    • P
      qemu: blockjob: Fix locking of block copy/active block commit · b4698538
      Peter Krempa 提交于
      For the blockjobs, where libvirt is able to track the state internally
      we can fix locking of images we can remove the appropriate locks.
      
      Also when doing a pivoting operation we should not acquire the lock on
      any of those images since both are actually locked already.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1302168
      b4698538
    • P
      qemu: snapshot: Properly handle image locking · f61e4061
      Peter Krempa 提交于
      Images that became the backing chain of the current image due to the
      snapshot need to be unlocked in the lock manager. Also if qemu was
      paused during the snapshot the current top level images need to be
      released until qemu is resumed so that they can be acquired properly.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1191901
      f61e4061
    • P
      qemu: snapshot: Refactor snapshot rollback on failure · cbb4d229
      Peter Krempa 提交于
      The code at first changed the definition and then rolled it back in case
      of failure. This was ridiculous. Refactor the code so that the image in
      the definition is changed only when the snapshot is successful.
      
      The refactor will also simplify further fix of image locking when doing
      snapshots.
      cbb4d229
    • P
      qemu: snapshot: Don't redetect backing chain after snapshot · 7456c4f5
      Peter Krempa 提交于
      Libvirt is able to properly model what happens to the backing chain
      after a snapshot so there's no real need to redetect the data.
      Additionally with the _REUSE_EXT flag this might end up in redetecting
      wrong data if the user puts wrong backing chain reference into the
      snapshot image.
      7456c4f5
    • J
      libxl: implement virDomainGetMaxVcpus · a05e2570
      Jim Fehlig 提交于
      The libxl driver already supports getting maximum vcpu count via
      libxlDomainGetVcpusFlags, allowing to trivially implement
      virDomainGetMaxVcpus.
      a05e2570
  2. 10 1月, 2017 3 次提交