1. 15 5月, 2013 1 次提交
    • O
      qemu: New XML to disable memory merge at guest startup · 77b54b96
      Osier Yang 提交于
      QEMU introduced command line "-mem-merge=on|off" (defaults to on) to
      enable/disable the memory merge (KSM) at guest startup. This exposes
      it by new XML:
        <memoryBacking>
          <nosharepages/>
        </memoryBacking>
      
      The XML tag is same with what we used internally for old RHEL.
      77b54b96
  2. 13 5月, 2013 3 次提交
    • O
      Introduce <readonly> for hostdev · f4bb7b48
      Osier Yang 提交于
      Since it's generic enough to be used by other types in future, I
      put it in <hostdev> as sub-element, though now it's only used by
      scsi host device.
      f4bb7b48
    • H
      qemu: Build qemu command line for scsi host device · 0d70656a
      Han Cheng 提交于
      Except the scsi host device's controller is "lsilogic", mapping
      between the libvirt attributes and scsi-generic properties is:
      
        libvirt     qemu
      -----------------------------------------
        controller  bus ($libvirt_controller.0)
        bus         channel
        target      scsi-id
        unit        lun
      
      For scsi host device with "lsilogic" controller, the mapping is:
      ('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
      must <= 7).
      
        libvirt            qemu
      ----------------------------------------------------------
        controller && bus  bus ($libvirt_controller.$libvirt_bus)
        unit               scsi-id
      
      It's not good to hardcode/hard-check limits of these attributes,
      and even worse, these limits are not documented, one has to find
      out by either testing or reading the qemu code, I'm looking forward
      to qemu expose limits like these one day). For example, exposing
      "max_target", "max_lun" for megasas:
      
      static const struct SCSIBusInfo megasas_scsi_info = {
          .tcq = true,
          .max_target = MFI_MAX_LD,
          .max_lun = 255,
      
          .transfer_data = megasas_xfer_complete,
          .get_sg_list = megasas_get_sg_list,
          .complete = megasas_command_complete,
          .cancel = megasas_command_cancel,
      };
      
      Example of the qemu command line (lsilogic controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,scsi-id=8,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      
      Example of the qemu command line (virtio-scsi controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      0d70656a
    • H
      conf: Generic XMLs for scsi hostdev · 5c811dce
      Han Cheng 提交于
      An example of the scsi hostdev XML:
      
          <hostdev mode='subsystem' type='scsi'>
            <source>
              <adapter name='scsi_host0'/>
              <address bus='0' target='0' unit='0'/>
            </source>
            <address type='drive' controller='0' bus='0' target='4' unit='8'/>
          </hostdev>
      
      Controller is implicitly added for scsi hostdev, though the scsi
      controller's model defaults to "lsilogic", which might be not what
      the user wants (same problem exists for virtio-scsi disk). It's
      the existing problem, will be addressed later.
      
      The device address must be specified manually. Later patch will let
      libvirt generate it automatically.
      
      This only introduces the generic XMLs for scsi hostdev, later patches
      will add other elements, e.g. <readonly>, <shareable>.
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      5c811dce
  3. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  4. 26 4月, 2013 1 次提交
    • L
      qemu: use vfio-pci on commandline when appropriate · 731b0f36
      Laine Stump 提交于
      The device option for vfio-pci is nearly identical to that for
      pci-assign - only the configfd parameter isn't supported (or needed).
      
      Checking for presence of the bootindex parameter is done separately
      from constructing the commandline, similar to how it is done for
      pci-assign.
      
      This patch contains tests to check for proper commandline
      construction. It also includes tests for parser-formatter-parser
      roundtrips (xml2xml), because those tests use the same data files, and
      would have failed had they been included before now.
      
      qemu: xml/args tests for VFIO hostdev and <interface type='hostdev'/>
      
      These should be squashed in with the patch that adds commandline
      handling of vfio (they would fail at any earlier time).
      731b0f36
  5. 25 4月, 2013 2 次提交
  6. 17 4月, 2013 1 次提交
  7. 13 4月, 2013 1 次提交
  8. 08 4月, 2013 1 次提交
    • O
      Introduce new XMLs to specify disk source using libvirt storage · 4bc331c8
      Osier Yang 提交于
      With this patch, one can specify the disk source using libvirt
      storage like:
      
        <disk type='volume' device='disk'>
          <driver name='qemu' type='raw' cache='none'/>
          <source pool='default' volume='fc18.img'/>
          <target dev='vdb' bus='virtio'/>
        </disk>
      
      "seclabels" and "startupPolicy" are not supported for this new
      disk type ("volume"). They will be supported in later patches.
      
      docs/formatdomain.html.in:
        * Add documents for new XMLs
      docs/schemas/domaincommon.rng:
        * Add rng for new XMLs;
      src/conf/domain_conf.h:
        * New struct for 'volume' type disk source (virDomainDiskSourcePoolDef)
        * Add VIR_DOMAIN_DISK_TYPE_VOLUME for enum virDomainDiskType
      src/conf/domain_conf.c:
        * New helper virDomainDiskSourcePoolDefParse to parse the 'volume'
          type disk source.
        * New helper virDomainDiskSourcePoolDefFree to free the source def
          if 'volume' type disk.
      tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml:
      tests/qemuxml2xmltest.c:
        * New test
      4bc331c8
  9. 06 4月, 2013 1 次提交
    • O
      qemu: Support multiple queue virtio-scsi · d4bf0a93
      Osier Yang 提交于
      This introduce a new attribute "num_queues" (same with the good name
      QEMU uses) for virtio-scsi controller. An example of the XML:
      
      <controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/>
      
      The corresponding QEMU command line:
      
      -device virtio-scsi-pci,id=scsi0,num_queues=8,bus=pci.0,addr=0x3 \
      d4bf0a93
  10. 05 4月, 2013 3 次提交
  11. 22 3月, 2013 2 次提交
  12. 21 3月, 2013 1 次提交
  13. 16 3月, 2013 4 次提交
  14. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  15. 25 2月, 2013 1 次提交
  16. 08 2月, 2013 1 次提交
  17. 07 1月, 2013 1 次提交
    • O
      conf: Parse and format the new XML · 535aed56
      Osier Yang 提交于
      Like "rawio", "sgio" is only allowed for block disk of device
      type "lun".
      
      It doesn't default disk->sgio to "filtered" when parsing, as
      it won't be able to distinguish explicitly requested "filtered"
      and a default "filtered" in driver then. We have to error out for
      explicit request when the kernel doesn't support the new sysfs
      knob "unpriv_sgio", however, for defaulted "filtered", we can
      just ignore it if the kernel doesn't support "unpriv_sgio".
      535aed56
  18. 07 12月, 2012 1 次提交
  19. 29 11月, 2012 1 次提交
  20. 18 10月, 2012 1 次提交
  21. 20 9月, 2012 2 次提交
  22. 14 9月, 2012 1 次提交
    • M
      qemu: Add support for EOI with APIC · fbf9aa12
      Martin Kletzander 提交于
      This patch adds full support for EOI setting for domains. Because this
      is CPU feature (flag), the model needs to be added even when it's not
      specified. Fortunately this problem was already solved with kvmclock,
      so this patch simply abuses that.
      
      And due to the size of the patch (17 lines) I dared to include the tests.
      fbf9aa12
  23. 03 9月, 2012 1 次提交
  24. 16 8月, 2012 1 次提交
    • L
      conf: add <vlan> element to network and domain interface elements · 3f9274a5
      Laine Stump 提交于
      The following config elements now support a <vlan> subelements:
      
      within a domain: <interface>, and the <actual> subelement of <interface>
      within a network: the toplevel, as well as any <portgroup>
      
      Each vlan element must have one or more <tag id='n'/> subelements.  If
      there is more than one tag, it is assumed that vlan trunking is being
      requested. If trunking is required with only a single tag, the
      attribute "trunk='yes'" should be added to the toplevel <vlan>
      element.
      
      Some examples:
      
        <interface type='hostdev'/>
          <vlan>
            <tag id='42'/>
          </vlan>
          <mac address='52:54:00:12:34:56'/>
          ...
        </interface>
      
        <network>
          <name>vlan-net</name>
          <vlan trunk='yes'>
            <tag id='30'/>
          </vlan>
          <virtualport type='openvswitch'/>
        </network>
      
        <interface type='network'/>
          <source network='vlan-net'/>
          ...
        </interface>
      
        <network>
          <name>trunk-vlan</name>
          <vlan>
            <tag id='42'/>
            <tag id='43'/>
          </vlan>
          ...
        </network>
      
        <network>
          <name>multi</name>
          ...
          <portgroup name='production'/>
            <vlan>
              <tag id='42'/>
            </vlan>
          </portgroup>
          <portgroup name='test'/>
            <vlan>
              <tag id='666'/>
            </vlan>
          </portgroup>
        </network>
      
        <interface type='network'/>
          <source network='multi' portgroup='test'/>
          ...
        </interface>
      
      IMPORTANT NOTE: As of this patch there is no backend support for the
      vlan element for *any* network device type. When support is added in
      later patches, it will only be for those select network types that
      support setting up a vlan on the host side, without the guest's
      involvement. (For example, it will be possible to configure a vlan for
      a guest connected to an openvswitch bridge, but it won't be possible
      to do that for one that is connected to a standard Linux host bridge.)
      3f9274a5
  25. 18 5月, 2012 1 次提交
  26. 16 5月, 2012 1 次提交
    • D
      Fix logic for assigning PCI addresses to USB2 companion controllers · 1ebd52cb
      Daniel P. Berrange 提交于
      Currently each USB2 companion controller gets put on a separate
      PCI slot. Not only is this wasteful of PCI slots, but it is not
      in compliance with the spec for USB2 controllers. The master
      echi1 and all companion controllers should be in the same slot,
      with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.
      
      * src/qemu/qemu_command.c: Special case handling of USB2 controllers
        to apply correct pci slot assignment
      * tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
        tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
        test to cover automatic slot assignment
      1ebd52cb
  27. 09 5月, 2012 2 次提交
    • O
      numad: Copy 'placement' of <numatune> to <vcpu> by default · 8d26a7fd
      Osier Yang 提交于
      With this patch, one can also fully drive numad by:
      
        <vcpu>2</vcpu>
        <numatune>
          <memory placement='auto'/>
        </numatune>
      
      New tests are added.
      8d26a7fd
    • O
      numad: Set memory policy from numad advisory nodeset · 97010eb1
      Osier Yang 提交于
      Though numad will manage the memory allocation of task dynamically,
      it wants management application (libvirt) to pre-set the memory
      policy according to the advisory nodeset returned from querying numad,
      (just like pre-bind CPU nodeset for domain process), and thus the
      performance could benefit much more from it.
      
      This patch introduces new XML tag 'placement', value 'auto' indicates
      whether to set the memory policy with the advisory nodeset from numad,
      and its value defaults to the value of <vcpu> placement, or 'static'
      if 'nodeset' is specified. Example of the new XML tag's usage:
      
        <numatune>
          <memory placement='auto' mode='interleave'/>
        </numatune>
      
      Just like what current "numatune" does, the 'auto' numa memory policy
      setting uses libnuma's API too.
      
      If <vcpu> "placement" is "auto", and <numatune> is not specified
      explicitly, a default <numatume> will be added with "placement"
      set as "auto", and "mode" set as "strict".
      
      The following XML can now fully drive numad:
      
      1) <vcpu> placement is 'auto', no <numatune> is specified.
      
         <vcpu placement='auto'>10</vcpu>
      
      2) <vcpu> placement is 'auto', no 'placement' is specified for
         <numatune>.
      
         <vcpu placement='auto'>10</vcpu>
         <numatune>
           <memory mode='interleave'/>
         </numatune>
      
      And it's also able to control the CPU placement and memory policy
      independently. e.g.
      
      1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
      
         <vcpu placement='auto'>10</vcpu>
         <numatune>
           <memory mode='strict' nodeset='0-10,^7'/>
         </numatune>
      
      2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
      
         <vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
         <numatune>
           <memory mode='interleave' placement='auto'/>
         </numatume>
      
      A follow up patch will change the XML formatting codes to always output
      'placement' for <vcpu>, even it's 'static'.
      97010eb1
  28. 23 4月, 2012 1 次提交
    • E
      blockjob: enhance xml to track mirrors across libvirtd restart · ae6aa8c3
      Eric Blake 提交于
      In order to track a block copy job across libvirtd restarts, we
      need to save internal XML that tracks the name of the file
      holding the mirror.  Displaying this name in dumpxml might also
      be useful to the user, even if we don't yet have a way to (re-)
      start a domain with mirroring enabled up front.  This is done
      with a new <mirror> sub-element to <disk>, as in:
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/original.img'/>
            <mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
            ...
          </disk>
      
      For now, the element is output-only, in live domains; it is ignored
      when defining a domain or hot-plugging a disk (since those contexts
      use VIR_DOMAIN_XML_INACTIVE in parsing).  The 'ready' attribute appears
      when libvirt knows that the job has changed from the initial pulling
      phase over to the mirroring phase, although absence of the attribute
      is not a sure indicator of the current phase.  If we come up with a way
      to make qemu start with mirroring enabled, we can relax the xml
      restriction, and allow <mirror> (but not attribute 'ready') on input.
      Testing active-only XML meant tweaking the testsuite slightly, but it
      was worth it.
      
      * docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): New members.
      * src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
      (virDomainDiskDefParseXML): Parse them, but only internally.
      (virDomainDiskDefFormat): Output them.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
      * tests/qemuxml2xmltest.c (testInfo): Alter members.
      (testCompareXMLToXMLHelper): Allow more test control.
      (mymain): Run new test.
      ae6aa8c3
  29. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f