1. 18 9月, 2012 2 次提交
  2. 14 9月, 2012 1 次提交
    • M
      Add support for EOI with APIC · 4a8b7cba
      Martin Kletzander 提交于
      New options is added to support EOI (End of Interrupt) exposure for
      guests. As it makes sense only when APIC is enabled, I added this into
      the <apic> element in <features> because this should be tri-state
      option (cannot be handled as standalone feature).
      4a8b7cba
  3. 13 9月, 2012 1 次提交
    • G
      qemu: define and parse USB redirection filter XML · 5b35cc53
      Guannan Ren 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=795929
      http://git.qemu.org/?p=qemu.git;a=commitdiff;h=6af165892cf900291046f1d25f95416f379504c2
      
      This patch define and parse the input XML of USB redirection filter.
      <devices>
      ...
        <redirdev bus='usb' type='spicevmc'>
          <address type='usb' bus='0' port='4'/>
        </redirdev>
        <redirfilter>
          <usbdev class='0x08' vendor='0x1234' product='0xbeef' \
                  version='2.00' allow='yes'/>
          <usbdev allow='no'/>
        </redirfilter>
      ...
      </devices>
      
      There is no 1:1 mapping between ports and redirected devices and
      qemu and spicy client couldn't decide into which usbredir ports
      the client can 'plug' redirected devices. So it make sense to apply
      all of filter rules global to all existing usb redirection devices.
      class attribute is USB Class codes. version is bcdDevice value
      of USB device. vendor and product is USB vendorId and productId.
      -1 can be used to allow any value for a field. Except allow attribute
      the other four are optional, default value is -1.
      5b35cc53
  4. 04 9月, 2012 1 次提交
    • V
      Rename iolimit to blockio. · 72f1f220
      Viktor Mihajlovski 提交于
      After discussion with DB we decided to rename the new iolimit
      element as it creates the impression it would be there to
      limit (i.e. throttle) I/O instead of specifying immutable
      characteristics of a block device.
      This is also backed by the fact that the term I/O Limits has
      vanished from newer storage admin documentation.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      72f1f220
  5. 03 9月, 2012 1 次提交
    • M
      Add per-guest S3/S4 state configuration · 09cd8f2d
      Martin Kletzander 提交于
      There is a new <pm/> element implemented that can control what ACPI
      sleeping states will be advertised by BIOS and allowed to be switched
      to by libvirt. The default keeps defaults on hypervisor, otherwise
      forces chosen setting.
      The documentation of the pm element is added as well.
      09cd8f2d
  6. 01 9月, 2012 1 次提交
  7. 31 8月, 2012 1 次提交
  8. 30 8月, 2012 1 次提交
    • P
      vcpupin: Fix returning of arrays from virDomainVcpuPinAdd · 077e7bf5
      Peter Krempa 提交于
      virDomainVcpuPinAdd does a realloc on vcpupin_list if the new vcpu pin
      definition doesn't fit into the array. The list is an array of pointers
      but the function definition didn't support returning the changed pointer
      to the caller if it was realloced. This caused segfaults if realloc
      would change the base pointer.
      077e7bf5
  9. 24 8月, 2012 3 次提交
    • E
      snapshot: rename an enum · 1385c9cd
      Eric Blake 提交于
      The name 'virDomainDiskSnapshot' didn't fit in with our normal
      conventions of using a prefix hinting that it is related to a
      virDomainSnapshotPtr.  Also, a future patch will reuse the
      enum for declaring where the VM memory is stored.
      
      * src/conf/snapshot_conf.h (virDomainDiskSnapshot): Rename...
      (virDomainSnapshotLocation): ...to this.
      (_virDomainSnapshotDiskDef): Update clients.
      * src/conf/domain_conf.h (_virDomainDiskDef): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Likewise.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Likewise.
      * src/conf/snapshot_conf.c: (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDefFormat):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotCreateDiskActive, qemuDomainSnapshotCreateXML):
      Likewise.
      1385c9cd
    • E
      snapshot: split snapshot conf code into own file · 6478ec16
      Eric Blake 提交于
      This has several benefits:
      1. Future snapshot-related code has a definite place to go (and I
      _will_ be adding some)
      2. Snapshot errors now use the VIR_FROM_DOMAIN_SNAPSHOT error
      classification, which has been underutilized (previously only in
      libvirt.c)
      
      * src/conf/domain_conf.h, domain_conf.c: Split...
      * src/conf/snapshot_conf.h, snapshot_conf.c: ...into new files.
      * src/Makefile.am (DOMAIN_CONF_SOURCES): Build new files.
      * po/POTFILES.in: Mark new file for translation.
      * src/vbox/vbox_tmpl.c: Update caller.
      * src/esx/esx_driver.c: Likewise.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_domain.h: Likewise.
      6478ec16
    • E
      snapshot: make virDomainSnapshotObjList opaque · 3211deba
      Eric Blake 提交于
      We were failing to react to allocation failure when initializing
      a snapshot object list.  Changing things to store a pointer
      instead of a complete object adds one more possible point of
      allocation failure, but at the same time, will make it easier to
      react to failure now, as well as making it easier for a future
      patch to split all virDomainSnapshotPtr handling into a separate
      file, as I continue to add even more snapshot code.
      
      Luckily, there was only one client outside of domain_conf.c that
      was actually peeking inside the object, and a new wrapper function
      was easy.
      
      * src/conf/domain_conf.h (_virDomainObj): Use a pointer.
      (virDomainSnapshotObjListInit): Rename.
      (virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
      declarations.
      (_virDomainSnapshotObjList): Move definitions...
      * src/conf/domain_conf.c: ...here.
      (virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
      Rename...
      (virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
      these.
      (virDomainSnapshotForEach): New function.
      (virDomainObjDispose, virDomainListPopulate): Adjust callers.
      * src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
      (qemuDomainSnapshotDiscardAllMetadata): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
      (qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainListAllSnapshots)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren)
      (qemuDomainSnapshotListAllChildren)
      (qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
      (qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
      (qemuDomainSnapshotDelete): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      3211deba
  10. 22 8月, 2012 6 次提交
  11. 21 8月, 2012 2 次提交
  12. 18 8月, 2012 1 次提交
  13. 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
  14. 15 8月, 2012 1 次提交
    • L
      conf: move virtPortProfile out of unions in virDomainNetDef · 1d174428
      Laine Stump 提交于
      virtPortProfile is now used by 4 different types of network devices
      (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to
      replicate so much code in 4 different places just because each type
      has the virtPortProfile in a slightly different place. This patch puts
      a single virtPortProfile in a common place (outside the type-specific
      union) in both virDomainNetDef and virDomainActualNetDef, and adjusts
      the parse and format code (and the few other places where it is used)
      accordingly.
      
      Note that when a <virtualport> element is found, the parse functions
      verify that the interface is of a type that supports one, otherwise an
      error is generated (CONFIG_UNSUPPORTED in the case of <interface>, and
      INTERNAL in the case of <actual>, since the contents of <actual> are
      always generated by libvirt itself).
      1d174428
  15. 14 8月, 2012 1 次提交
    • O
      Destroy virdomainlist.[ch] · bb705e25
      Osier Yang 提交于
      As the consensus in:
      https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html,
      this patch is to destroy conf/virdomainlist.[ch], folding the
      helpers into conf/domain_conf.[ch].
      
      * src/Makefile.am:
        - Various indention fixes incidentally
        - Add macro DATATYPES_SOURCES (datatypes.[ch])
        - Link datatypes.[ch] for libvirt_lxc
      
      * src/conf/domain_conf.c:
        - Move all the stuffs from virdomainlist.c into it
        - Use virUnrefDomain and virUnrefDomainSnapshot instead of
          virDomainFree and virDomainSnapshotFree, which are defined
          in libvirt.c, and we don't want to link to it.
        - Remove "if" before "free" the object, as virObjectUnref
          is in the list "useless_free_options".
      
      * src/conf/domain_conf.h:
        - Move all the stuffs from virdomainlist.h into it
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
      
      * src/libxl/libxl_driver.c:
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
        - no (include "virdomainlist.h")
      
      * src/libxl/libxl_driver.c: Likewise
      
      * src/lxc/lxc_driver.c: Likewise
      
      * src/openvz/openvz_driver.c: Likewise
      
      * src/parallels/parallels_driver.c: Likewise
      
      * src/qemu/qemu_driver.c: Likewise
      
      * src/test/test_driver.c: Likewise
      
      * src/uml/uml_driver.c: Likewise
      
      * src/vbox/vbox_tmpl.c: Likewise
      
      * src/vmware/vmware_driver.c: Likewise
      
      * tools/virsh-domain-monitor.c: Likewise
      
      * tools/virsh.c: Likewise
      bb705e25
  16. 07 8月, 2012 1 次提交
  17. 03 8月, 2012 1 次提交
    • O
      qemu: Allow to attach/detach controller device persistently · ed1e711b
      Osier Yang 提交于
      * src/conf/domain_conf.c:
        - Add virDomainControllerFind to find controller device by type
          and index.
        - Add virDomainControllerRemove to remove the controller device
          from maintained controler list.
      
      * src/conf/domain_conf.h:
        - Declare the two new helpers.
      
      * src/libvirt_private.syms:
        - Expose private symbols for the two new helpers.
      
      * src/qemu/qemu_driver.c:
        - Support attach/detach controller device persistently
      
      * src/qemu/qemu_hotplug.c:
        - Use the two helpers to simplify the codes.
      ed1e711b
  18. 02 8月, 2012 2 次提交
    • P
      domain_conf: Add helpers to verify if device configuration is valid · 317badb2
      Peter Krempa 提交于
      This patch adds helpers that validate domain's device configuration.
      This will be needed later on to verify devices being hot-plugged to
      guests. If the guest has no USB bus, then it's not valid to plug a USB
      device to that guest.
      317badb2
    • P
      domain_conf: Add USB controler model "none" · 09251897
      Peter Krempa 提交于
      Libvirt adds a USB controller to the guest even if the user does not
      specify any in the XML. This is due to back-compat reasons.
      
      To allow disabling USB for a guest this patch adds a new USB controller
      type "none" that disables USB support for the guest.
      09251897
  19. 01 8月, 2012 1 次提交
  20. 25 7月, 2012 1 次提交
  21. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  22. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  23. 11 7月, 2012 1 次提交
  24. 25 6月, 2012 2 次提交
    • D
      Add support for guest bind mounts with LXC · 3b1ddec1
      Daniel P. Berrange 提交于
      Currently you can configure LXC to bind a host directory to
      a guest directory, but not to bind a guest directory to a
      guest directory. While the guest container init could do
      this itself, allowing it in the libvirt XML means a stricter
      SELinux policy can be written
      3b1ddec1
    • D
      Add support for RAM filesystems for LXC · 76b644c3
      Daniel P. Berrange 提交于
      Introduce a new syntax for filesystems to allow use of a RAM
      filesystem
      
         <filesystem type='ram'>
            <source usage='10' units='MiB'/>
            <target dir='/mnt'/>
         </filesystem>
      
      The usage units default to KiB to limit consumption of host memory.
      
      * docs/formatdomain.html.in: Document new syntax
      * docs/schemas/domaincommon.rng: Add new attributes
      * src/conf/domain_conf.c: Parsing/formatting of RAM filesystems
      * src/lxc/lxc_container.c: Mounting of RAM filesystems
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      76b644c3
  25. 21 6月, 2012 1 次提交
  26. 20 6月, 2012 1 次提交
    • M
      domain_conf: fix possible memory leak · 830d035f
      Martin Kletzander 提交于
      Until now, it was possible to crash libvirtd when defining domain with
      channel device with missing source element.
      
      When creating new virDomainChrDef, target.port is set to -1, but
      unfortunately it is an union with addresses that virDomainChrDefFree
      tries to free in case the deviceType is channel. Having the port set
      to -1 is intended, however the cleanest way to get around the problems
      with the crash seems to be renumbering the VIR_DOMAIN_CHR_CHANNEL_
      target types to cover new NONE type (with value 0) being the default
      (no target type yet).
      830d035f
  27. 19 6月, 2012 3 次提交
    • E
      snapshot: merge domain and snapshot computation · 7e111c6f
      Eric Blake 提交于
      Now that domain listing is a thin wrapper around child listing,
      it's easier to have a common entry point.  This restores the
      hashForEach optimization lost in the previous patch when there
      are no snapshots being filtered out of the entire list.
      
      * src/conf/domain_conf.h (virDomainSnapshotObjListGetNames)
      (virDomainSnapshotObjListNum): Add parameter.
      (virDomainSnapshotObjListGetNamesFrom)
      (virDomainSnapshotObjListNumFrom): Delete.
      * src/libvirt_private.syms (domain_conf.h): Drop deleted functions.
      * src/conf/domain_conf.c (virDomainSnapshotObjListGetNames):
      Merge, and (re)add an optimization.
      * src/qemu/qemu_driver.c (qemuDomainUndefineFlags)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren): Update callers.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/conf/virdomainlist.c (virDomainListPopulate): Likewise.
      7e111c6f
    • E
      snapshot: use metaroot node to simplify management · 06d4a1e4
      Eric Blake 提交于
      This idea was first suggested by Daniel Veillard here:
      https://www.redhat.com/archives/libvir-list/2011-October/msg00353.html
      
      Now that I am about to add more complexity to snapshot listing, it
      makes sense to avoid code duplication and special casing for domain
      listing (all snapshots) vs. snapshot listing (descendants); adding
      a metaroot reduces the number of code lines by having the domain
      listing turn into a descendant listing of the metaroot.
      
      Note that this has one minor pessimization - if we are going to list
      ALL snapshots without filtering, then virHashForeach is more efficient
      than recursing through the child relationships; restoring that minor
      optimization will occur in the next patch.
      
      * src/conf/domain_conf.h (_virDomainSnapshotObj)
      (_virDomainSnapshotObjList): Repurpose some fields.
      (virDomainSnapshotDropParent): Drop unused parameter.
      * src/conf/domain_conf.c (virDomainSnapshotObjListGetNames)
      (virDomainSnapshotObjListCount): Simplify.
      (virDomainSnapshotFindByName, virDomainSnapshotSetRelations)
      (virDomainSnapshotDropParent): Match new field semantics.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete):
      Adjust clients.
      06d4a1e4
    • P
      conf: Store managed save image existence in virDomainObj · bc8e1559
      Peter Krempa 提交于
      This patch stores existence of the image in the object. At start of the
      daemon the state is checked and then updated in key moments in domain
      lifecycle.
      bc8e1559