1. 05 10月, 2015 1 次提交
  2. 26 9月, 2015 2 次提交
    • J
      conf: Fix virtType check · 5e06a4f0
      John Ferlan 提交于
      Commit id '7383b8cc' changed virDomainDef 'virtType' to an enum, that
      caused a build failure on some archs due to comparing an unsigned value
      to < 0.  Adjust the fetch of 'type' to be into temporary 'int virtType'
      and then assign that virtType to the def->virtType
      5e06a4f0
    • S
      conf: Add new VIR_DOMAIN_VIRT_NONE enum · 62569e45
      Shivangi Dhir 提交于
      Introduce VIR_DOMAIN_VIRT_NONE to give domaintype the default value of zero.
      This is specially helpful in constructing better error messages
      when we don't want to look up the default emulator by virtType.
      
      The test data in vircapstest.c is also modified to reflect this change.
      62569e45
  3. 24 9月, 2015 1 次提交
    • J
      domain: Fix migratable XML with graphics/@listen · c0806dc3
      Jiri Denemark 提交于
      As of commit 69929941, we set graphics/@listen attribute according to the
      first listen child element even if that element is of type='network'.
      This was done for backward compatibility with applications which only
      support the original listen attribute. However, by doing so we broke
      migration to older libvirt which tried to check that the listen
      attribute matches one of the listen child elements but which did not
      take type='network' elements into account.
      
      We are not concerned about compatibility with old applications when
      formatting domain XML for migration for two reasons. The XML is consumed
      only by libvirtd and the IP address associated with type='network'
      listen address on the source host is just useless on the destination
      host. Thus, we can safely avoid propagating the type='network' IP
      address to graphics/@listen attribute when creating migratable XML.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1265111Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      c0806dc3
  4. 23 9月, 2015 1 次提交
  5. 22 9月, 2015 6 次提交
    • P
      conf: Don't always recalculate initial memory size from NUMA size totals · 0fed5a7b
      Peter Krempa 提交于
      When implementing memory hotplug I've opted to recalculate the initial
      memory size (contents of the <memory> element) as a sum of the sizes of
      NUMA nodes when NUMA was enabled. This was based on an assumption that
      qemu did not allow starting when the NUMA node size total didn't equal
      to the initial memory size. Unfortunately the check was introduced to
      qemu just lately.
      
      This patch uses the new XML parser flag to decide whether it's safe to
      update the memory size total from the NUMA cell sizes or not.
      
      As an additional improvement we now report an error in case when the
      size of hotplug memory would exceed the total memory size.
      
      The rest of the changes assures that the function is called with correct
      flags.
      0fed5a7b
    • P
      conf: Pre-calculate initial memory size instead of always calculating it · 403e8606
      Peter Krempa 提交于
      Add 'initial_memory' member to struct virDomainMemtune so that the
      memory size can be pre-calculated once instead of inferring it always
      again and again.
      
      Separating of the fields will also allow finer granularity of decisions
      in later patches where it will allow to keep the old initial memory
      value in cases where we are handling incomming migration from older
      versions that did not always update the size from NUMA as the code did
      previously.
      
      The change also requires modification of the qemu memory alignment
      function since at the point where we are modifying the size of NUMA
      nodes the total size needs to be recalculated too.
      
      The refactoring done in this patch also fixes a crash in the hyperv
      driver that did not properly initialize def->numa and thus
      virDomainNumaGetMemorySize(def->numa) crashed.
      
      In summary this patch should have no functional impact at this point.
      403e8606
    • P
      conf: Rename max_balloon to total_memory · 8059a990
      Peter Krempa 提交于
      The name of the variable was misleading. Rename it and it's setting
      accessor before other fixes.
      8059a990
    • P
      conf: Split memory related post parse stuff into separate function · 849b5fc4
      Peter Krempa 提交于
      The post parse func is growing rather large. Since later patches will
      introduce more logic in the memory post parse code, split it into a
      separate handler.
      849b5fc4
    • P
      conf: Drop VIR_DOMAIN_DEF_PARSE_CLOCK_ADJUST flag · ed94ad9e
      Peter Krempa 提交于
      The flag was used only for formatting the XML and once the parser and
      formatter flags were split in 0ecd6851
      it doesn't make sense any more to have it.
      ed94ad9e
    • P
      conf: Add helper to determine whether memory hotplug is enabled for a vm · 1891cad5
      Peter Krempa 提交于
      Add a simple helper so that the code doesn't have to rewrite the same
      condition multiple times.
      1891cad5
  6. 18 9月, 2015 1 次提交
  7. 05 9月, 2015 1 次提交
  8. 04 9月, 2015 1 次提交
  9. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  10. 21 8月, 2015 1 次提交
    • J
      conf: Check for attach disk usage of iothread=0 · cb5d0193
      John Ferlan 提交于
      Since iothreadid = 0 is invalid, we need to check for it when attempting
      to add a disk; otherwise, someone would think/believe their attempt to
      add an IOThread to the disk would succeed. Luckily other code ignored
      things when ->iothread == 0...
      cb5d0193
  11. 14 8月, 2015 1 次提交
  12. 13 8月, 2015 5 次提交
  13. 12 8月, 2015 1 次提交
    • C
      domain: Fix crash if trying to live update disk <serial> · c7790408
      Cole Robinson 提交于
      If you pass <disk><serial> XML to UpdateDevice, and the original device
      didn't have a <serial> block, libvirtd crashes trying to read the original
      NULL serial string.
      
      Use _NULLABLE string comparisons to avoid the crash. A couple other
      properties needed the change too.
      c7790408
  14. 10 8月, 2015 6 次提交
    • M
      conf: Add ioeventfd option for controllers · 35eecdde
      Martin Kletzander 提交于
      This will be used with a virtio-scsi controller later on.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      35eecdde
    • L
      conf: new pcie-controller model "pcie-switch-downstream-port" · 76379a6e
      Laine Stump 提交于
      This controller can be connected only to a port on a
      pcie-switch-upstream-port. It provides a single hotpluggable port that
      will accept any PCI or PCIe device, as well as any device requiring a
      pcie-*-port (the only current example of such a device is the
      pcie-switch-upstream-port).
      76379a6e
    • L
      conf: new pci controller model "pcie-switch-upstream-port" · 38ea9515
      Laine Stump 提交于
      This controller can be connected only to a pcie-root-port or a
      pcie-switch-downstream-port (which will be added in a later patch),
      which is the reason for the new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_PORT. A pcie-switch-upstream-port provides
      32 ports (slot=0 to slot=31) on the downstream side, which can only
      have pci controllers of model "pcie-switch-downstream-port" plugged
      into them, which is the reason for the other new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_SWITCH.
      38ea9515
    • L
      conf: new pci controller model "pcie-root-port" · dce3b8be
      Laine Stump 提交于
      This controller can be connected (at domain startup time only - not
      hotpluggable) only to a port on the pcie root complex ("pcie-root" in
      libvirt config), hence the new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_ROOT. It provides a hotpluggable port that
      will accept any PCI or PCIe device.
      
      New attributes must be added to the controller <target> subelement for
      this - chassis and port are guest-visible option values that will be
      set by libvirt with values derived from the controller's index and pci
      address information.
      dce3b8be
    • L
      conf: add new <target> subelement with chassisNr attribute to <controller> · 8dc88aee
      Laine Stump 提交于
      There are some configuration options to some types of pci controllers
      that are currently automatically derived from other parts of the
      controller's configuration. For example, in qemu a pci-bridge
      controller has an option that is called "chassis_nr"; up until now
      libvirt has always set chassis_nr to the index of the pci-bridge. So
      this:
      
        <controller type='pci' model='pci-bridge' index='2'/>
      
      will always result in:
      
        -device pci-bridge,chassis_nr=2,...
      
      on the qemu commandline. In the future we may decide there is a better
      way to derive that option, but even in that case we will need for
      existing domains to retain the same chassis_nr they were using in the
      past - that is something that is visible to the guest so it is part of
      the guest ABI and changing it would lead to problems for migrating
      guests (or just guests with very picky OSes).
      
      The <target> subelement has been added as a place to put the new
      "chassisNr" attribute that will be filled in by libvirt when it
      auto-generates the chassisNr; it will be saved in the config, then
      reused any time the domain is started:
      
        <controller type='pci' model='pci-bridge' index='2'>
          <model type='pci-bridge'/>
          <target chassisNr='2'/>
        </controller>
      
      The one oddity of all this is that if the controller configuration
      is changed (for example to change the index or the pci address
      where the controller is plugged in), the items in <target> will
      *not* be re-generated, which might lead to conflict. I can't
      really see any way around this, but fortunately if there is a
      material conflict qemu will let us know and we will pass that on
      to the user.
      8dc88aee
    • L
      conf: add new <model> subelement with name attribute to <controller> · bf202510
      Laine Stump 提交于
      This new subelement is used in PCI controllers: the toplevel
      *attribute* "model" of a controller denotes what kind of PCI
      controller is being described, e.g. a "dmi-to-pci-bridge",
      "pci-bridge", or "pci-root". But in the future there will be different
      implementations of some of those types of PCI controllers, which
      behave similarly from libvirt's point of view (and so should have the
      same model), but use a different device in qemu (and present
      themselves as a different piece of hardware in the guest). In an ideal
      world we (i.e. "I") would have thought of that back when the pci
      controllers were added, and used some sort of type/class/model
      notation (where class was used in the way we are now using model, and
      model was used for the actual manufacturer's model number of a
      particular family of PCI controller), but that opportunity is long
      past, so as an alternative, this patch allows selecting a particular
      implementation of a pci controller with the "name" attribute of the
      <model> subelement, e.g.:
      
        <controller type='pci' model='dmi-to-pci-bridge' index='1'>
          <model name='i82801b11-bridge'/>
        </controller>
      
      In this case, "dmi-to-pci-bridge" is the kind of controller (one that
      has a single PCIe port upstream, and 32 standard PCI ports downstream,
      which are not hotpluggable), and the qemu device to be used to
      implement this kind of controller is named "i82801b11-bridge".
      
      Implementing the above now will allow us in the future to add a new
      kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
      device, but instead uses something else (which doesn't yet exist, but
      qemu people have been discussing it), all without breaking existing
      configs.
      
      (note that for the existing "pci-bridge" type of PCI controller, both
      the model attribute and <model> name are 'pci-bridge'. This is just a
      coincidence, since it turns out that in this case the device name in
      qemu really is a generic 'pci-bridge' rather than being the name of
      some real-world chip)
      bf202510
  15. 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
  16. 07 8月, 2015 1 次提交
  17. 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
  18. 04 8月, 2015 8 次提交