1. 14 1月, 2015 1 次提交
    • D
      Decouple CPU XML formatting from domain XML public API flags · e34473c1
      Daniel P. Berrange 提交于
      The virCPUDefFormat* methods were relying on the VIR_DOMAIN_XML_*
      flag definitions. It is not desirable for low level internal
      functions to be coupled to flags for the public API, since they
      may need to be called from several different contexts where the
      flags would not be appropriate.
      e34473c1
  2. 13 1月, 2015 2 次提交
  3. 12 1月, 2015 1 次提交
  4. 08 1月, 2015 2 次提交
    • G
      vmx: Fix a VMX parsing problem · bb072e8a
      Geoff Hickey 提交于
      VMware ESX does not always set the "serialX.fileType" tag in VMX files. The
      default value for this tag is "device", and when adding a new serial port
      of this type VMware will omit the fileType tag. This caused libvirt to
      fail to parse the VMX file. Fixed by making this tag optional and using
      "device" as a default value. Also updated vmx2xmltest to test for this
      case.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bb072e8a
    • S
      nwfilter: Add support for icmpv6 filtering · 3a3b3691
      Stefan Berger 提交于
      Make use of the ebtables functionality to be able to filter certain
      parameters of icmpv6 packets. Extend the XML parser for icmpv6 types,
      type ranges, codes, and code ranges. Extend the nwfilter documentation,
      schema, and test cases.
      
      Being able to filter icmpv6 types and codes helps extending the DHCP
      snooper for IPv6 and filtering at least some parameters of IPv6's NDP
      (Neighbor Discovery Protocol) packets. However, the filtering will not
      be as good as the filtering of ARP packets since we cannot
      check on IP addresses in the payload of the NDP packets.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      3a3b3691
  5. 06 1月, 2015 6 次提交
  6. 05 1月, 2015 1 次提交
    • C
      Add tests to xmconfigtest · 262d913f
      Chunyan Liu 提交于
      Add tests to testing HVM default features (pae, acpi, apic)
      conversion from xm config to libvirt xml. If no pae|acpi|apic
      specified in xm config, after conversion, libvirt xml should
      by default include:
       <features>
         <pae/>
         <apic/>
         <acpi/>
       </features>
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      262d913f
  7. 04 1月, 2015 1 次提交
  8. 25 12月, 2014 1 次提交
  9. 23 12月, 2014 2 次提交
  10. 19 12月, 2014 1 次提交
    • M
      qemu: Create memory-backend-{ram,file} iff needed · f309db1f
      Michal Privoznik 提交于
      Libvirt BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1175397
      QEMU BZ:    https://bugzilla.redhat.com/show_bug.cgi?id=1170093
      
      In qemu there are two interesting arguments:
      
      1) -numa to create a guest NUMA node
      2) -object memory-backend-{ram,file} to tell qemu which memory
      region on which host's NUMA node it should allocate the guest
      memory from.
      
      Combining these two together we can instruct qemu to create a
      guest NUMA node that is tied to a host NUMA node. And it works
      just fine. However, depending on machine type used, there might
      be some issued during migration when OVMF is enabled (see QEMU
      BZ). While this truly is a QEMU bug, we can help avoiding it. The
      problem lies within the memory backend objects somewhere. Having
      said that, fix on our side consists on putting those objects on
      the command line if and only if needed. For instance, while
      previously we would construct this (in all ways correct) command
      line:
      
          -object memory-backend-ram,size=256M,id=ram-node0 \
          -numa node,nodeid=0,cpus=0,memdev=ram-node0
      
      now we create just:
      
          -numa node,nodeid=0,cpus=0,mem=256
      
      because the backend object is obviously not tied to any specific
      host NUMA node.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f309db1f
  11. 16 12月, 2014 1 次提交
    • M
      storage: unify permission formatting · d2632d60
      Martin Kletzander 提交于
      Volume and pool formatting functions took different approaches to
      unspecified uids/gids.  When unknown, it is always parsed as -1, but one
      of the functions formatted it as unsigned int (wrong) and one as
      int (better).  Due to that, our two of our XML files from tests cannot
      be parsed on 32-bit machines.
      
      RNG schema needs to be modified as well, but because both
      storagepool.rng and storagevol.rng need same schema for permission
      element, save some space by moving it to storagecommon.rng.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d2632d60
  12. 15 12月, 2014 2 次提交
    • M
      qemu: Allow system pages to <memoryBacking/> · 311b4a67
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1173507
      
      It occurred to me that OpenStack uses the following XML when not using
      regular huge pages:
      
        <memoryBacking>
          <hugepages>
            <page size='4' unit='KiB'/>
          </hugepages>
        </memoryBacking>
      
      However, since we are expecting to see huge pages only, we fail to
      startup the domain with following error:
      
        libvirtError: internal error: Unable to find any usable hugetlbfs
        mount for 4 KiB
      
      While regular system pages are not huge pages technically, our code is
      prepared for that and if it helps OpenStack (or other management
      applications) we should cope with that.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      311b4a67
    • M
      virconf: Introduce VIR_CONF_ULONG · ca4f9518
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160995
      
      In our config files users are expected to pass several integer values
      for different configuration knobs. However, majority of them expect a
      nonnegative number and only a few of them accept a negative number too
      (notably keepalive_interval in libvirtd.conf).
      Therefore, a new type to config value is introduced: VIR_CONF_ULONG
      that is set whenever an integer is positive or zero. With this
      approach knobs accepting VIR_CONF_LONG should accept VIR_CONF_ULONG
      too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ca4f9518
  13. 11 12月, 2014 1 次提交
  14. 09 12月, 2014 2 次提交
    • J
      tests: Fix sharable typo · 048237e3
      John Ferlan 提交于
      048237e3
    • L
      conf: new network bridge device attribute macTableManager · 40961978
      Laine Stump 提交于
      The macTableManager attribute of a network's bridge subelement tells
      libvirt how the bridge's MAC address table (used to determine the
      egress port for packets) is managed. In the default mode, "kernel",
      management is left to the kernel, which usually determines entries in
      part by turning on promiscuous mode on all ports of the bridge,
      flooding packets to all ports when the correct destination is unknown,
      and adding/removing entries to the fdb as it sees incoming traffic
      from particular MAC addresses.  In "libvirt" mode, libvirt turns off
      learning and flooding on all the bridge ports connected to guest
      domain interfaces, and adds/removes entries according to the MAC
      addresses in the domain interface configurations. A side effect of
      turning off learning and unicast_flood on the ports of a bridge is
      that (with Linux kernel 3.17 and newer), the kernel can automatically
      turn off promiscuous mode on one or more of the bridge's ports
      (usually only the one interface that is used to connect the bridge to
      the physical network). The result is better performance (because
      packets aren't being flooded to all ports, and can be dropped earlier
      when they are of no interest) and slightly better security (a guest
      can still send out packets with a spoofed source MAC address, but will
      only receive traffic intended for the guest interface's configured MAC
      address).
      
      The attribute looks like this in the configuration:
      
        <network>
          <name>test</name>
          <bridge name='br0' macTableManager='libvirt'/>
          ...
      
      This patch only adds the config knob, documentation, and test
      cases. The functionality behind this knob is added in later patches.
      40961978
  15. 05 12月, 2014 1 次提交
    • D
      Report original error when QMP probing fails with new QEMU · 25bf888a
      Daniel P. Berrange 提交于
      If probing capabilities via QMP fails, we now have a check
      that prevents us falling back to -help parsing. Unfortunately
      the error message
      
        "Failed to probe capabilities for /usr/bin/qemu-kvm:
         unsupported configuration: QEMU 2.1.2 is too new for help parsing"
      
      is proving rather unhelpful to the user. We need to be telling
      them why QMP failed (the root cause), rather than they can't
      use -help (the side effect).
      
      To do this we should capture stderr during QMP probing, and
      if -help parsing then sees a new QEMU version, we know that
      QMP should have worked, and so we can show the messages from
      stderr. The message thus becomes
      
        "Failed to probe capabilities for /usr/bin/qemu-kvm:
         internal error: QEMU / QMP failed: Could not access
         KVM kernel module: No such file or directory
         failed to initialize KVM: No such file or directory"
      25bf888a
  16. 04 12月, 2014 1 次提交
  17. 03 12月, 2014 1 次提交
  18. 27 11月, 2014 1 次提交
  19. 25 11月, 2014 7 次提交
    • E
      dbus: fix arrays of bools · 96e0d677
      Eric Blake 提交于
      Commit 2aa167ca tried to fix the DBus interaction code to allow
      callers to use native types instead of 4-byte bools.  But in
      fixing the issue, I missed the case of an arrayref; Conrad Meyer
      shows the following valid complaint issued by clang:
      
        CC       util/libvirt_util_la-virdbus.lo
      util/virdbus.c:956:13: error: cast from 'bool *' to 'dbus_bool_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
                  GET_NEXT_VAL(dbus_bool_t, bool_val, bool, "%d");
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      util/virdbus.c:858:17: note: expanded from macro 'GET_NEXT_VAL'
                  x = (dbustype *)(*xptrptr + (*narrayptr - 1));              \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
      
      But fixing that points out that we have NEVER supported arrayrefs
      of sub-int types (byte, i16, u16, and now bool).  Again, while raw
      types promote, arrays do not; so the macros HAVE to deal with both
      size possibilities rather than assuming that an arrayref uses the
      same sizing as the promoted raw type.
      
      Obviously, our testsuite wasn't covering as much as it should have.
      
      * src/util/virdbus.c (GET_NEXT_VAL): Also fix array cases.
      (SET_NEXT_VAL): Fix uses of sub-int arrays.
      * tests/virdbustest.c (testMessageArray, testMessageArrayRef):
      Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      96e0d677
    • P
      qemu-command: introduce new vgamem attribute for QXL video device · 742d49fa
      Pavel Hrdina 提交于
      Add attribute to set vgamem_mb parameter of QXL device for QEMU. This
      value sets the size of VGA framebuffer for QXL device. Default value in
      QEMU is 8MB so reuse it also in libvirt to not break things.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      742d49fa
    • P
      qemu-command: use vram attribute for all video devices · 24c6ca86
      Pavel Hrdina 提交于
      So far we didn't have any option to set video memory size for qemu video
      devices. There was only the vram (ram for QXL) attribute but it was valid
      only for the QXL video device.
      
      To provide this feature to users QEMU has a dedicated device attribute
      called 'vgamem_mb' to set the video memory size. We will use the 'vram'
      attribute for setting video memory size for other QEMU video devices.
      
      For the cirrus device we will ignore the vram value because it has
      hardcoded video size in QEMU.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      24c6ca86
    • P
      caps: introduce new QEMU capability for vgamem_mb device property · f480a87a
      Pavel Hrdina 提交于
      Allow setting vgamem size for video devices.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      f480a87a
    • P
      QXL: fix setting ram and vram values for QEMU QXL device · c32cfc6d
      Pavel Hrdina 提交于
      QEMU has two different type of QXL display device. The first "qxl-vga"
      is for primary video device and second "qxl" is for secondary video
      device.
      
      There are also two different ways how to specify those devices on qemu
      command line, the first one and obsolete is using "-vga" option and the
      current new one is using "-device" option. The "-vga" could be used only
      to setup primary video device, so the "-vga qxl" equal to
      "-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting
      additional parameters for the device and "-global" option must be used
      for this purpose. It's mandatory to use "-global qxl-vga...." to set the
      parameters of primary video device previously defined with "-vga qxl".
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      c32cfc6d
    • P
      video: cleanup usage of vram attribute and update documentation · 81ba2298
      Pavel Hrdina 提交于
      The vram attribute was introduced to set the video memory but it is
      usable only for few hypervisors excluding QEMU/KVM and the old XEN
      driver. Only in case of QEMU the vram was used for QXL.
      
      This patch updates the documentation to reflect current code in libvirt
      and also changes the cases when we will set the default vram attribute.
      It also fixes existing strange default value for VGA devices 9MB to 16MB
      because the video ram should be rounded to power of two.
      
      The change of default value could affect migrations but I found out that
      QEMU always round the video ram to power of two internally so it's safe
      to change the default value to the next closest power of two and also
      silently correct every domain XML definition. And it's also safe because
      we don't pass the value to QEMU.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      81ba2298
    • P
      internal: add macro to round value to the next closest power of 2 · ff28ebf1
      Pavel Hrdina 提交于
      There are two special cases, if the input number is 0 or the number is
      larger then 2^31 (for 32bit unsigned int). For the special cases the
      return value is 0 because they cannot be rounded.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      ff28ebf1
  20. 24 11月, 2014 2 次提交
    • T
      qemu: add test for qemuAgentGetFSInfo · 733b56a4
      Tomoki Sekiyama 提交于
      Add test cases for qemuAgentGetFSInfo, with a sample agent response for
      the qemu-get-fsinfo command and a configuration xml.
      Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com>
      733b56a4
    • P
      qemu: chardev: Extract more information about character devices · 4d7eb903
      Peter Krempa 提交于
      Improve the monitor function to also retrieve the guest state of
      character device (if provided) so that we can refresh the state of
      virtio-serial channels and perhaps react to changes in the state in
      future patches.
      
      This patch changes the returned data from qemuMonitorGetChardevInfo to
      return a structure containing the pty path and the state for all the
      character devices.
      
      The change to the testsuite makes sure that the data is parsed
      correctly.
      4d7eb903
  21. 21 11月, 2014 3 次提交