1. 24 8月, 2012 10 次提交
    • 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
    • P
      xen-xs: fix uuid of renamed domain · fbe7a883
      Philipp Hahn 提交于
      When the XenStore tdb lives persistently and is not cleared between host
      reboots, Xend (version 3.4 and 4.1) re-creates the domain information
      located in XenStore below /vm/$UUID. (According to the xen-3.2-commit
      hg265950e3df69 to fix a problem when locally migrating a domain to the
      host itself.)
      
      When doing so a version number is added to the UUID separated by one
      dash, which confuses xenStoreDomainIntroduced(): It iterates over all
      domains and tries to lookup all inactive domains using
      xenStoreDomainGetUUID(), which fails if the running domain is renamed:
      virUUIDParse() fails to parse the versioned UUID and the domain is
      flagged as missing. When this happens the function delays .2s and
      re-tries 20 times again, multiplied by the number of renamed VMs.
        14:48:38.878: 4285: debug : xenStoreDomainIntroduced:1354 : Some domains were missing, trying again
      
      This adds a significant delay:
        # time virsh list >/dev/null
        real    0m6.529s
        # xenstore-list /vm
        00000000-0000-0000-0000-000000000000
        00000000-0000-0000-0000-000000000000-1
        00000000-0000-0000-0000-000000000000-2
        00000000-0000-0000-0000-000000000000-3
        00000000-0000-0000-0000-000000000000-4
        00000000-0000-0000-0000-000000000000-5
        7c06121e-90c3-93d4-0126-50481d485cca
        00000000-0000-0000-0000-000000000000-6
        00000000-0000-0000-0000-000000000000-7
        144ad19d-dfb4-2f80-8045-09196bb8784f
        00000000-0000-0000-0000-000000000000-8
        144ad19d-dfb4-2f80-8045-09196bb8784f-1
        00000000-0000-0000-0000-000000000000-9
        00000000-0000-0000-0000-000000000000-10
        00000000-0000-0000-0000-000000000000-11
        00000000-0000-0000-0000-000000000000-12
        00000000-0000-0000-0000-000000000000-13
        00000000-0000-0000-0000-000000000000-14
        144ad19d-dfb4-2f80-8045-09196bb8784f-2
        00000000-0000-0000-0000-000000000000-15
        144ad19d-dfb4-2f80-8045-09196bb8784f-3
        00000000-0000-0000-0000-000000000000-16
      
      The patch adds truncation of the UUID as read from the XenStore path
      before passing it to virUUIDParse().
      
      The same issue is reported at
      <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666135>
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      fbe7a883
    • M
      conf: Don't always require security/@model · 0ee655f5
      Michal Privoznik 提交于
      Only parse model, if static labelling, or
      a base label is set, or doing active XML.
      0ee655f5
    • M
      security: Add DAC to security_drivers · 9f9b7b85
      Michal Privoznik 提交于
      Currently, if users set 'security_driver="dac"' in qemu.conf libvirtd
      fails to initialize as DAC driver is not found because it is missing
      in our security drivers array.
      9f9b7b85
    • P
      libssh2_transport: Add docs to remote.html · 239c5d71
      Peter Krempa 提交于
      Describe the existence of the transport driver and document the
      configurable options.
      239c5d71
    • L
      nwfilter: don't log error if firewalld is disabled, improve diagnostics · e1602a76
      Laine Stump 提交于
      The original patch to support firewalld in nwfilter wasn't personally
      checking the exit status of firewall-cmd, but was instead sending NULL
      in the *exitstatus arg, which meant that virCommandWait would log an
      error just for the exit status being non-0 (and a "more scary than
      useful" error at that).
      
      We don't want to treat this as an error, though, just as a reason to
      use standard (ip|eb)tables commands instead of firewall-cmd.
      
      This patch modifies the virCommandRun in the nwfilter code to request
      status back from the caller. This avoids virCommandWait logging an
      error message, and allows the caller to do as it likes after examining
      the status.
      
      The VIR_DEBUG() logged when firewalld is enabled has also been
      reworded and changed to a VIR_INFO, and a similar VIR_INFO has been
      added in the case that firewalld is *not* found+enabled.
      e1602a76
    • L
      openvz: check the exitstatus of vzlist · 46dc6432
      Laine Stump 提交于
      I noticed this while auditing all calls to virCommandRun that request
      an exit status from virCommandRun. Two functions in the openvz driver
      
        openvzDomainGetBarrierLimit
        openvzDomainSetBarrierLimit
      
      request an exit status from virCommandRun (thus assuring that
      virCommandRun won't log any errors just due to a non-0 exit status),
      but then fail to examine that exit status. This could result in the
      functions believing that the call to "vzlist" was successful, even
      though it may have encountered an error.
      46dc6432
    • E
      qemu-agent: available in 0.10.0 · 352cbae8
      Eric Blake 提交于
      The recent virDomainQemuAgentCommand addition is part of 0.10.0;
      also, grouping all libvirt-qemu.so callbacks together makes them
      easier to identify.
      
      * src/libvirt_qemu.syms: Fix release symbol.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/driver.h (_virDriver): Group qemu-specific callbacks.
      352cbae8
    • L
      network: fix virtual network bridge delay setting · ddf1ccb7
      Laine Stump 提交于
      libvirt's network config documents that a bridge's STP "forward delay"
      (called "delay" in the XML) should be specified in seconds, but
      virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
      milliseconds (although the comment at the top of the function
      incorrectly says "seconds".
      
      This fixes the comment, and converts the delay to milliseconds before
      calling virNetDevBridgeSetSTPDelay().
      ddf1ccb7
  2. 23 8月, 2012 13 次提交
  3. 22 8月, 2012 17 次提交