1. 25 3月, 2015 4 次提交
    • P
      tests: qemuxml2xml: Test status XML formatting and parsing · 02f0f1cc
      Peter Krempa 提交于
      Recently we've fixed a bug where the status XML could not be parsed as
      the parser used absolute path XPath queries. This test enhancement tests
      all XML files used in the qemu-xml-2-xml test as a part of a status XML
      snippet to see whether they are parsed correctly. The status XML-2-XML is
      currently tested in 223 cases with this patch.
      02f0f1cc
    • P
      util: buffer: Add support for adding text blocks with indentation · 6ff59cbc
      Peter Krempa 提交于
      The current auto-indentation buffer code applies indentation only on
      complete strings. To allow adding a string containing newlines and
      having it properly indented this patch adds virBufferAddStr.
      6ff59cbc
    • P
      tests: qemuxml2xml: Refactor the qemuxml2xml test · 785fd9fa
      Peter Krempa 提交于
      To allow adding more tests, refactor the XML-2-XML test so that the
      files are not reloaded always and clarify the control flow.
      
      Result of this changes is that the active and inactive portions of the
      XML are tested in separate steps rather than one test step.
      785fd9fa
    • P
      qemucaps2xmltest: fix test to successfully run without kvm support · 49bf09d1
      Pavel Hrdina 提交于
      Function virQEMUCapsInitGuestFromBinary detect kvm support by testing
      whether /dev/kvm exists or whether we pass path to kvmbin.  Provide the
      path we are testing via kvmbin for testing purpose instead of detecting
      presence of /dev/kvm to successfully run the tests on all hosts.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      49bf09d1
  2. 24 3月, 2015 1 次提交
  3. 23 3月, 2015 5 次提交
    • P
      qemu: add support for memory devices · 8b54bffb
      Peter Krempa 提交于
      Add support to start qemu instance with 'pc-dimm' device. Thanks to the
      refactors we are able to reuse the existing function to determine the
      parameters.
      8b54bffb
    • P
      conf: Add interface to parse and format memory device information · 3e4230d2
      Peter Krempa 提交于
      This patch adds code that parses and formats configuration for memory
      devices.
      
      A simple configuration would be:
      <memory model='dimm'>
        <target>
          <size unit='KiB'>524287</size>
          <node>0</node>
        </target>
      </memory>
      
      A complete configuration of a memory device:
      <memory model='dimm'>
        <source>
          <pagesize unit='KiB'>4096</pagesize>
          <nodemask>1-3</nodemask>
        </source>
        <target>
          <size unit='KiB'>524287</size>
          <node>1</node>
        </target>
      </memory>
      
      This patch preemptively forbids use of the <memory> device in individual
      drivers so the users are warned right away that the device is not
      supported.
      3e4230d2
    • P
      qemu: Implement setup of memory hotplug parameters · a41185d8
      Peter Krempa 提交于
      To enable memory hotplug the maximum memory size and slot count need to
      be specified. As qemu supports now other units than mebibytes when
      specifying memory, use the new interface in this case.
      a41185d8
    • P
      conf: Add support for parsing and formatting max memory and slot count · bffb9163
      Peter Krempa 提交于
      Add a XML element that will allow to specify maximum supportable memory
      and the count of memory slots to use with memory hotplug.
      
      To avoid possible confusion and misuse of the new element this patch
      also explicitly forbids the use of the maxMemory setting in individual
      drivers's post parse callbacks. This limitation will be lifted when the
      support is implemented.
      bffb9163
    • M
      objecteventtest: Check for virNetwork* return values · cbbb9baa
      Michal Privoznik 提交于
      Lets not give a bad example and check for return values of
      virNetwork* APIs called within the test. Even though it's
      unlikely that any API will fail, it can happen. We're connected
      to the test driver after all, and our API sequence is correct. So
      test driver should fail only in case of bug or OOM.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cbbb9baa
  4. 18 3月, 2015 3 次提交
  5. 17 3月, 2015 2 次提交
    • N
      domifaddr: Implement the API for qemu · 0977b8aa
      Nehal J Wani 提交于
      By querying the qemu guest agent with the QMP command
      "guest-network-get-interfaces" and converting the received JSON
      output to structured objects.
      
      Although "ifconfig" is deprecated, IP aliases created by "ifconfig"
      are supported by this API. The legacy syntax of an IP alias is:
      "<ifname>:<alias-name>". Since we want all aliases to be clubbed
      under parent interface, simply stripping ":<alias-name>" suffices.
      Note that IP aliases formed by "ip" aren't visible to "ifconfig",
      and aliases created by "ip" do not have any specific name. But
      we are lucky, as qemu guest agent detects aliases created by both.
      
      src/qemu/qemu_agent.h:
        * Define qemuAgentGetInterfaces
      
      src/qemu/qemu_agent.c:
        * Implement qemuAgentGetInterface
      
      src/qemu/qemu_driver.c:
        * New function qemuGetDHCPInterfaces
        * New function qemuDomainInterfaceAddresses
      
      src/remote_protocol-sructs:
        * Define new structs
      
      tests/qemuagenttest.c:
        * Add new test: testQemuAgentGetInterfaces
          Test cases for IP aliases, 0 or multiple ipv4/ipv6 address(es)
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      0977b8aa
    • M
      conf: Reorder elements inside memballoon · 02ce97bc
      Martin Kletzander 提交于
      All the devices we have format their address as its last sub-element, so
      let's change memballoon to follow suit.  Also adjust RNG to allow any
      order of them so 'virsh edit' doesn't shout at us.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      02ce97bc
  6. 16 3月, 2015 2 次提交
    • P
      conf: Make specifying <memory> optional · 4bca6192
      Peter Krempa 提交于
      Now that the size of guest's memory can be inferred from the NUMA
      configuration (if present) make it optional to specify <memory>
      explicitly.
      
      To make sure that memory is specified add a check that some form of
      memory size was specified. One side effect of this change is that it is
      no longer possible to specify 0KiB as memory size for the VM, but I
      don't think it would be any useful to do so. (I can imagine embedded
      systems without memory, just registers, but that's far from what libvirt
      is usually doing).
      
      Forbidding 0 memory for guests also fixes a few corner cases where 0 was
      not interpreted correctly and caused failures. (Arguments for numad when
      using automatic placement, size of the balloon). This fixes problems
      described in https://bugzilla.redhat.com/show_bug.cgi?id=1161461
      
      Test case changes are added to verify that the schema change and code
      behave correctly.
      4bca6192
    • P
      conf: Automatically use NUMA memory size in case NUMA is enabled · caf88a3c
      Peter Krempa 提交于
      Use the NUMA total instead of the configured size both in XML and for
      uses in the code once NUMA is enabled for a domain.
      
      One test case change is necessary as the rounding of the individual cell
      sizes was not matching the rounding of the total size.
      caf88a3c
  7. 14 3月, 2015 2 次提交
  8. 11 3月, 2015 6 次提交
  9. 10 3月, 2015 1 次提交
  10. 09 3月, 2015 3 次提交
  11. 06 3月, 2015 2 次提交
    • M
      domain_conf: Format <pvpanic/> without address correctly · b39b1397
      Michal Privoznik 提交于
      We have something like pvpanic device. However, in some cases it does
      not have any address assigned, in which case we produce this ugly XML
      (still valid though):
      
        <devices>
          <emulator>/usr/bin/qemu</emulator>
          ...
          <panic>
          </panic>
        </devices>
      
      Lets format "<panic/>" instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b39b1397
    • P
      memtune: change the way how we store unlimited value · cf521fc8
      Pavel Hrdina 提交于
      There was a mess in the way how we store unlimited value for memory
      limits and how we handled values provided by user.  Internally there
      were two possible ways how to store unlimited value: as 0 value or as
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
      limits as unsigned long long, we cannot use -1 to represent unlimited.
      It's much easier for us to say that everything greater than
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
      value despite that it makes no sense to set limit to 0.
      
      Remove unnecessary function virCompareLimitUlong.  The update of test
      is to prevent the 0 to be miss-used as unlimited in future.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cf521fc8
  12. 05 3月, 2015 3 次提交
  13. 04 3月, 2015 2 次提交
  14. 03 3月, 2015 3 次提交
    • P
      8672a1e4
    • P
      schema: Fix interface link state schema · 8eb907b8
      Peter Krempa 提交于
      In commit edd1295e I've introduced an
      XML element that allows to configure state of the network interface
      link. Somehow the RNG schema hunk ended up in a weird place in the
      network schema definition. Move it to the right place and add a test
      case.
      
      Note that the link state is set up via the monitor at VM startup so I
      originally didn't think of adding a test case.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1173468
      8eb907b8
    • J
      disk: Disallow duplicated target 'dev' values · e0e29055
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1142631
      
      This patch resolves a situation where the same "<target dev='$name'...>"
      can be used for multiple disks in the domain.
      
      While the $name is "mostly" advisory regarding the expected order that
      the disk is added to the domain and not guaranteed to map to the device
      name in the guest OS, it still should be unique enough such that other
      domblk* type operations can be performed.
      
      Without the patch, the domblklist will list the same Target twice:
      
      $ virsh domblklist $dom
      Target     Source
      ------------------------------------------------
      sda        /var/lib/libvirt/images/file.qcow2
      sda        /var/lib/libvirt/images/file.img
      
      Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
      type calls will not be able to reference the second target.
      
      Fortunately, hotplug disallows adding a "third" sda value:
      
      $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
      error: Failed to attach disk
      error: operation failed: target sda already exists
      
      $
      
      BUT, it since 'sdb' doesn't exist one would get the following on the same
      hotplug attempt, but changing to use 'sdb' instead of 'sda'
      
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
      error: Failed to attach disk
      error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
      
      $
      
      Since we cannot fix this issue at parsing time, the best that can be done so
      as to not "lose" a domain is to make the check prior to starting the guest
      with the results as follows:
      
      $ virsh start $dom
      error: Failed to start domain $dom
      error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
      
      $
      
      Running 'make check' found a few more instances in the tests where this
      duplicated target dev value was being used. These also exhibited some
      duplicated 'id=' values (negating the uniqueness argument of aliases) in
      the corresponding .args file and of course the *xmlout version of a few
      input XML files.
      e0e29055
  15. 02 3月, 2015 1 次提交