1. 27 7月, 2016 6 次提交
    • P
      util: qemu: Add support for numbered array members · 74df83a9
      Peter Krempa 提交于
      Add support for converting objects nested in arrays with a numbering
      discriminator on the command line. This syntax is used for the
      object-based specification of disk source properties.
      74df83a9
    • P
      util: qemu: Allow for different approaches to format JSON arrays · b7eef33d
      Peter Krempa 提交于
      For use with memory hotplug virQEMUBuildCommandLineJSONRecurse attempted
      to format JSON arrays as bitmap on the command line. Make the formatter
      function configurable so that it can be reused with different syntaxes
      of arrays such as numbered arrays for use with disk sources.
      
      This patch extracts the code and adds a parameter for the function that
      will allow to plug in different formatters.
      b7eef33d
    • P
      util: qemu: Add wrapper for JSON -> commandline conversion · f0276c34
      Peter Krempa 提交于
      Refactor the command line generator by adding a wrapper (with
      documentation) that will handle the outermost object iteration.
      
      This patch also renames the functions and tweaks the error message for
      nested arrays to be more universal.
      
      The new function is then reused to simplify qemucommandutiltest.
      f0276c34
    • P
      tests: Add testing of backing store string parser · 4e3dbfa2
      Peter Krempa 提交于
      As we already test that the extraction of the backing store string works
      well additional tests for the backing store string parser can be made
      simpler.
      
      Export virStorageSourceNewFromBackingAbsolute and use it to parse the
      backing store strings, format them using virDomainDiskSourceFormat and
      match them against expected XMLs.
      4e3dbfa2
    • J
      Remove unnecessary virDomainDefClearDeviceAliases · fc0378a9
      John Ferlan 提交于
      Nothing in the code path after the removed call has needs/uses the alias
      anyway (as would be the case for command line building or talking to monitor).
      The alias is VIR_FREE'd in virDomainDeviceInfoClear which is called for any
      device that needs/uses an alias via virDomainDeviceDefFree or virDomainDefFree
      as well as during virDomainDeviceInfoFree for host devices.
      
      For persistent domains, the domain definition (including aliases) gets
      freed a few screens later when it's replaced with newDef.
      
      For transient domains, the definition is freed/unref'd along with the
      virDomainObj a few moments later.
      fc0378a9
    • J
      conf: Remove CCW,PCI clear address helpers · d95f5beb
      John Ferlan 提交于
      Since commit id 'fb063500' these are no longer called, so remove them
      d95f5beb
  2. 26 7月, 2016 1 次提交
    • T
      add virDomainVirtioSerialAddrSetCreateFromDomain · 40c284f0
      Tomasz Flendrich 提交于
      The address sets (pci, ccw, virtio serial) are currently cached
      in qemu private data, but all the information required to recreate
      these sets is in the domain definition. Therefore I am removing
      the redundant data and adding a way to recalculate these sets.
      
      Add a function that calculates the virtio serial address set
      from the domain definition.
      
      Credit goes to Cole Robinson.
      40c284f0
  3. 21 7月, 2016 6 次提交
    • J
      Auto-add one hub if there are too many USB devices · 815d98ac
      Ján Tomko 提交于
      When parsing a command line with USB devices that have
      no address specified, QEMU automatically adds a USB hub
      if the device would fill up all the available USB ports.
      
      To help most of the users, add one hub if there are more
      USB devices than available ports. For wilder configurations,
      expect the user to provide us with more hubs and/or controllers.
      815d98ac
    • J
      Assign addresses on USB device hotplug · f2a781ce
      Ján Tomko 提交于
      USB disks, redirected devices, host devices and serial devices
      are supported.
      f2a781ce
    • J
      Assign addresses to USB devices · bf182078
      Ján Tomko 提交于
      Automatically assign addresses to USB devices.
      
      Just like reserving, this is only done for newly defined domains.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1215968
      bf182078
    • J
      Reserve existing USB addresses · ddd31fd7
      Ján Tomko 提交于
      Check if they fit on the USB controllers the domain has,
      and error out if two devices try to use the same address.
      ddd31fd7
    • J
      Add functions for adding USB controllers to addrs · 6b3e4e2b
      Ján Tomko 提交于
      Walk through all the usb controllers in the domain definition
      and create the corresponding structures in the virDomainUSBAddressSet.
      6b3e4e2b
    • J
      Introduce virDomainUSBAddressSet · 82c142b3
      Ján Tomko 提交于
      A new type to track USB addresses.
      
      Every <controller type='usb' index='i'/> is represented by an
      object of type virDomainUSBAddressHub located at buses[i].
      
      Each of these hubs has up to 'nports' ports.
      If a port is occupied, it has the corresponding bit set in
      the 'ports' bitmap, e.g. port 1 would have the 0th bit set.
      If there is a hub on this port, then hubs[i] will point
      to this hub.
      82c142b3
  4. 19 7月, 2016 3 次提交
  5. 18 7月, 2016 1 次提交
    • J
      Store USB port path as an array of integers · f820d5bf
      Ján Tomko 提交于
      In preparation to tracking which USB addresses are occupied.
      Introduce two helper functions for printing the port path
      as a string and appending it to a virBuffer.
      f820d5bf
  6. 12 7月, 2016 2 次提交
  7. 07 7月, 2016 1 次提交
  8. 04 7月, 2016 3 次提交
  9. 02 7月, 2016 2 次提交
    • L
      util: new function virNetDevIPInfoAddToDev · 95309424
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      
      (This patch had been pushed earlier in commit
      f1e0d0da, but was reverted in commit
      05eab475 because it had been
      accidentally pushed during the freeze for release 2.0.0)
      95309424
    • L
      util: new function virXMLNodeSanitizeNamespaces() · b874f26b
      Laine Stump 提交于
      This is a generic version of virDomainDefMetadataSanitize() - the same
      functionality is now needed for network metadata.
      b874f26b
  10. 01 7月, 2016 1 次提交
    • J
      Introduce virDomainUSBDeviceDefForeach · 492b3bfd
      Ján Tomko 提交于
      A helper that will execute a callback on every USB device
      in the domain definition.
      
      With an ability to skip USB hubs, since we will want to treat
      them differently in some cases.
      492b3bfd
  11. 27 6月, 2016 9 次提交
    • J
      Revert "util: new function virNetDevIPInfoAddToDev" · 05eab475
      Ján Tomko 提交于
      This reverts commit f1e0d0da.
      
      This feature was accidentally pushed in the feature freeze.
      05eab475
    • L
      util: new function virNetDevIPInfoAddToDev · f1e0d0da
      Laine Stump 提交于
      This patch takes the code out of
      lxcContainerRenameAndEnableInterfaces() that adds all IP addresses and
      IP routes to the interface, and puts it into a utility function
      virNetDevIPInfoAddToDev() in virnetdevip.c so that it can be used by
      anyone.
      
      One small change in functionality -
      lxcContainerRenameAndEnableInterfaces() previously would add all IP
      addresses to the interface while it was still offline, then set the
      interface online, and then add the routes. Because I don't want the
      utility function to set the interface online, I've moved this up so
      the interface is first set online, then IP addresses and routes are
      added. This is the same order that the network service from
      initscripts (in ifup-ether) does it, so it shouldn't pose any problem
      (and hasn't, in the tests that I've run).
      f1e0d0da
    • L
      conf: single object containing list of IP addresses, list of routes · 9911562a
      Laine Stump 提交于
      There are currently two places in the domain where this combination is
      used, and there is about to be another. This patch puts them together
      for brevity and uniformity.
      
      As with the newly-renamed virNetDevIPAddr and virNetDevIPRoute
      objects, the new virNetDevIPInfo object will need to be accessed by a
      utility function that calls low level Netlink functions (so we don't
      want it to be in the conf directory) and will be called from multiple
      hypervisor drivers (so it can't be in any hypervisor directory); the
      most appropriate place is thus once again the util directory.
      
      The parse and format functions are in conf/domain_conf.c because only
      the domain XML (i.e. *not* the network XML) has this exact combination
      of IP addresses plus routes. Note that virDomainNetIPInfoFormat() will
      end up being the only caller to virDomainNetRoutesFormat() and
      virDomainNetIPsFormat(), so it will just subsume those functions in a
      later patch, but we can't do that until they are no longer called.
      
      (It would have been nice to include the interface name within the
      virNetDevIPInfo object (with a slight name change), but that can't
      be done cleanly, because in each case the interface name is provided
      in a different place in the XML relative to the routes and IP
      addresses, so putting it in this object would actually make the code
      more confused rather than simpler).
      9911562a
    • L
      util: move IP route & address object-related functions to virnetdevip.c · fa18e814
      Laine Stump 提交于
      These functions all need to be called from a utility function that
      must be located in the util directory, so we move them all into
      util/virnetdevip.[ch] now that it exists.
      
      Function and struct names were appropriately changed for the new
      location, but all code is unchanged aside from motion and renaming.
      fa18e814
    • L
      util: new files virnetdevip.[ch] for IP-related netdev functions · cf0568b0
      Laine Stump 提交于
      This patch splits virnetdev.[ch] into multiple files, with the new
      virnetdevip.[ch] containing all the functions related to setting and
      retrieving IP-related info for a device (both addresses and routes).
      cf0568b0
    • L
      conf: new function virDomainNetDefClear · 7cfbaad1
      Laine Stump 提交于
      We need to clear these out without freeing the object completely.
      7cfbaad1
    • L
      global: consistently use IP rather than Ip in identifiers · 22a6873a
      Laine Stump 提交于
      I'm tired of mistyping this all the time, so let's do it the same all
      the time (similar to how we changed all "Pci" to "PCI" awhile back).
      
      (NB: I've left alone some things in the esx and vbox drivers because
      I'm unable to compile them and they weren't obviously *not* a part of
      some API. I also didn't change a couple of variables named,
      e.g. "somethingIptables", because they were derived from the name of
      the "iptables" command)
      22a6873a
    • L
      util: move virInterface(State|Link)/virNetDevFeature from conf to util · 638c6e5b
      Laine Stump 提交于
      These had been declared in conf/device_conf.h, but then used in
      util/virnetdev.c, meaning that we had to #include conf/device_conf.h
      in virnetdev.c (which we have for a long time said shouldn't be done.
      
      This caused a bigger problem when I tried to #include util/virnetdev.h
      in a file in src/conf (which is allowed) - for some reason the
      "device_conf.h: File not found" error.
      
      The solution is to move the data types and functions used in util
      sources from conf to util. Some names were adjusted during the move
      ("virInterface" --> "virNetDevIf", and "VIR_INTERFACE" -->
      "VIR_NETDEV_IF")
      638c6e5b
    • L
      util: move virNetDevLinkDump to virnetlink.c · 943a400c
      Laine Stump 提交于
      virNetDevLinkDump should have been in virnetlink.c, but that file
      didn't exist yet when the function was created. It didn't really
      matter until now - I found that having virnetlink.h included by
      virnetdev.h caused build problems when trying to #include virnetdev.h
      in a .c file in src/conf (due to missing directory in -I). Rather than
      fix that to further institutionalize the incorrect placement of this
      one function, this patch moves the function.
      943a400c
  12. 26 6月, 2016 1 次提交
  13. 25 6月, 2016 2 次提交
  14. 24 6月, 2016 2 次提交