1. 05 12月, 2012 7 次提交
    • O
      qemu: Simplify the code · 9ee809d6
      Osier Yang 提交于
      "disk" is initialized to "dev->data.disk" in the beginning of the
      function.
      9ee809d6
    • O
      storage: Remove the redundant white lines · 8f218fbd
      Osier Yang 提交于
      Pushed under trivial rule.
      8f218fbd
    • E
      qemu: improve error for failed JSON commands · 149fa591
      Eric Blake 提交于
      Only one error in qemu_monitor was already using the relatively
      new OPERATION_UNSUPPORTED error, even though it is a better fit
      for all of the messages related to options that are unsupported
      due to the version of qemu in use rather than due to a user's
      XML or .conf file choice.  Suggested by Osier Yang.
      
      * src/qemu/qemu_monitor.c (qemuMonitorSendFileHandle)
      (qemuMonitorAddHostNetwork, qemuMonitorRemoveHostNetwork)
      (qemuMonitorAttachDrive, qemuMonitorDiskSnapshot)
      (qemuMonitorDriveMirror, qemuMonitorTransaction)
      (qemuMonitorBlockCommit, qemuMonitorDrivePivot)
      (qemuMonitorBlockJob, qemuMonitorSystemWakeup)
      (qemuMonitorGetVersion, qemuMonitorGetMachines)
      (qemuMonitorGetCPUDefinitions, qemuMonitorGetCommands)
      (qemuMonitorGetEvents, qemuMonitorGetKVMState)
      (qemuMonitorGetObjectTypes, qemuMonitorGetObjectProps)
      (qemuMonitorGetTargetArch): Use better error category.
      149fa591
    • E
      qemu: nicer error message if live disk snapshot unsupported · 3bef4adf
      Eric Blake 提交于
      Without this patch, attempts to create a disk snapshot when qemu
      is too old results in a cryptic message:
      
      virsh # snapshot-create 23 --disk-only
      error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev'
      
      Now it reports:
      
      virsh # snapshot-create 23 --disk-only
      error: unsupported configuration: live disk snapshot not supported with this QEMU binary
      
      All versions of qemu that support live disk snapshot also support
      QMP (basically upstream qemu 1.1 and later, and backports to RHEL 6.2).
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_DISK_SNAPSHOT): New
      capability.
      * src/qemu/qemu_capabilities.c (qemuCaps): Track it.
      (qemuCapsProbeQMPCommands): Set it.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Use
      it.
      * src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): Simplify.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot):
      Likewise.
      * src/qemu/qemu_monitor_text.h (qemuMonitorTextDiskSnapshot):
      Delete.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot):
      Likewise.
      3bef4adf
    • E
      rpc: fix build failure with older dbus · 2215befc
      Eric Blake 提交于
      RHEL 6.3 uses dbus-devel-1.2.24, which lacked support for the
      DBUS_TYPE_UNIX_FD define (contrast with Fedora 18 using 1.6.8).
      But since it is an older dbus, it also lacks support for shutdown
      inhibitions as provided by newer systemd.
      
      Compilation failure introduced in commit 31330926.
      
      * src/rpc/virnetserver.c (virNetServerAddShutdownInhibition):
      Compile out if dbus is too old.
      2215befc
    • J
      Fix memory leak introduced by commit 501bfad1 · cab0cfd5
      Jim Fehlig 提交于
      501bfad1 missed freeing priv->saveDir when opening the Xen unified
      driver failed.
      cab0cfd5
    • B
      implement managedsave in libvirt xen legacy driver · 501bfad1
      Bamvor Jian Zhang 提交于
      Implement the domainManagedSave, domainHasManagedSaveImage, and
      domainManagedSaveRemove functions in the libvirt legacy xen driver.
      
      domainHasManagedSaveImage check the managedsave image from filesystem
      everytime. This is different from qemu and libxl driver. In qemu or
      libxl driver, there is a hasManagesSave flag in virDomainObjPtr which
      is not used in xen legacy driver. This flag could not add into xen
      driver ptr either, because the driver ptr will be released at the end of
      every libvirt api call. Meanwhile, AFAIK, xen store all the flags in
      xen not in libvirt xen driver. There is no need to add this flag in xen.
      Signed-off-by: NBamvor Jian Zhang <bjzhang@suse.com>
      501bfad1
  2. 04 12月, 2012 13 次提交
    • O
      Fix the indention · ba06c182
      Osier Yang 提交于
      Introduced by commit 1465876a, pushed under build-breaker &&
      trivial rule.
      ba06c182
    • O
      Do not export symbol virStateActive anymore · 090eb35c
      Osier Yang 提交于
      Commit 79b8a569 removes virStateActive, however it forgot to
      remove the symbol together. Pushed under build-breaker rule.
      090eb35c
    • D
      Bind connection close callback APIs to python binding · 1465876a
      Daniel P. Berrange 提交于
      Add code in the python binding to cope with the new APIs
      virConnectRegisterCloseCallback and
      virConnectUnregisterCloseCallback. Also demonstrate their
      use in the python domain events demo
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1465876a
    • A
      Shut down session libvirtd cleanly on host shutdown/user logout · b88b1717
      Alexander Larsson 提交于
      When the session dies or when the system is going to be shut down
      we issue a virStateStop() call to instruct drivers to prepare to
      be stopped. This will remove any previously acquire inhibitions.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b88b1717
    • D
      Inhibit desktop shutdown while any virtual machines are running · 31330926
      Daniel P. Berrange 提交于
      Use the freedesktop inhibition DBus service to prevent host
      shutdown or session logout while any VMs are running.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      31330926
    • D
      Replace polling for active VMs with signalling by drivers · 79b8a569
      Daniel P. Berrange 提交于
      Currently to deal with auto-shutdown libvirtd must periodically
      poll all stateful drivers. Thus sucks because it requires
      acquiring both the driver lock and locks on every single virtual
      machine. Instead pass in a "inhibit" callback to virStateInitialize
      which drivers can invoke whenever they want to inhibit shutdown
      due to existance of active VMs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      79b8a569
    • D
      Only let VM drivers block libvirtd timed shutdown · ae2163f8
      Daniel P. Berrange 提交于
      The only important state that should prevent libvirtd shutdown
      is from running VMs. Networks, host devices, network filters
      and storage pools are all long lived resources that have no
      significant in-memory state. They should not block shutdown.
      ae2163f8
    • D
      Make QEMU perform managed save of all VMs on stop of libvirtd · 8f9a6931
      Daniel P. Berrange 提交于
      When the virStateStop() method is invoked, perform a managed
      save of all VMs currently running
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8f9a6931
    • E
      build: fix incremental autogen.sh when no AUTHORS is present · 55dc872b
      Eric Blake 提交于
      Commit 71d12562 tried to fix a problem where rebasing an old
      branch on top of newer libvirt.git resulted in automake failing
      because of a missing AUTHORS file.  However, while the fix
      worked for an incremental 'make', it did not work for someone
      that directly reran './autogen.sh'.  Reported by Laine Stump.
      
      * autogen.sh (autoreconf): Check for same conditions as cfg.mk.
      * cfg.mk (_update_required): Add comments.
      55dc872b
    • A
      Add iSCSI backend storage driver for ESX · 60f0f55e
      Ata E Husain Bohra 提交于
      The patch adds the backend driver to support iSCSI format storage pools
      and volumes for ESX host. The mapping of ESX iSCSI specifics to Libvirt
      is as follows:
      
      1. ESX static iSCSI target <------> Libvirt Storage Pools
      2. ESX iSCSI LUNs          <------> Libvirt Storage Volumes.
      
      The above understanding is based on http://libvirt.org/storage.html.
      
      The operation supported on iSCSI pools includes:
      
      1. List storage pools & volumes.
      2. Get XML descriptor operaion on pools & volumes.
      3. Lookup operation on pools & volumes by name, UUID and path (if applicable).
      
      iSCSI pools does not support operations such as: Create / remove pools
      and volumes.
      60f0f55e
    • L
      qemu: support live update of an interface's filter · 258fb278
      Laine Stump 提交于
      Since we can't (currently) rely on the ability to provide blanket
      support for all possible network changes by calling the toplevel
      netdev hostside disconnect/connect functions (due to qemu only
      supporting a lockstep between initialization of host side and guest
      side of devices), in order to support live change of an interface's
      nwfilter we need to make a special purpose function to only call the
      nwfilter teardown and setup functions if the filter for an interface
      (or its parameters) changes. The pattern is nearly identical to that
      used to change the bridge that an interface is connected to.
      
      This patch was inspired by a request from Guido Winkelmann
      <guido@sagersystems.de>, who tested an earlier version.
      258fb278
    • S
      nwfilter: utility function virNWFilterVarValueEqual · ab4139a4
      Stefan Berger 提交于
      To detect if an interface's nwfilter has changed, we need to also
      compare the filterparams, which is a hashtable of virNWFilterVarValue.
      virHashEqual can do this nicely, but requires a pointer to a function
      that will compare two of the items being stored in the hashes.
      ab4139a4
    • L
      conf: fix virDomainNetGetActualDirect*() and BridgeName() · 3738cf41
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=881480
      
      These three functions:
      
        virDomainNetGetActualBridgeName
        virDomainNetGetActualDirectDev
        virDomainNetGetActualDirectMode
      
      return attributes that are in a union whose contents are interpreted
      differently depending on the actual->type and so they should only
      return non-0 when actual->type is 'bridge' (in the first case) or
      'direct' (in the other two cases, but I had neglected to do that, so
      ...DirectDev() was returning bridge.brname (which happens to share the
      same spot in the union with direct.linkdev) if actual->type was
      'bridge', and ...BridgeName was returning direct.linkdev when
      actual->type was 'direct'.
      
      How does this involve Bug 881480 (which was about the inability to
      switch between two networks that both have "<forward mode='bridge'/>
      <bridge name='xxx'/>"? Whenever the return value of
      virDomainNetGetActualDirectDev() for the new and old network
      definitions doesn't match, qemuDomainChangeNet() requires a "complete
      reconnect" of the device, which qemu currently doesn't
      support. ...DirectDev() *should* have been returning NULL for old and
      new, but was instead returning the old and new bridge names, which
      differ.
      
      (The other two functions weren't causing any behavioral problems in
      virDomainChangeNet(), but their problem and fix was identical, so I
      included them in this same patch).
      3738cf41
  3. 03 12月, 2012 5 次提交
    • P
      virsh: Report errors if arguments of the schedinfo command are incorrect · bf720959
      Peter Krempa 提交于
      Libvirt's helper API's when called directly don't raise the error so
      that virsh remembers it. Subsequent calls to libvirt API's might reset
      the error.
      
      In case of schedinfo virDomainFree() in the cleanup section resets the
      error when virTypedParameterAssignFromStr() fails.
      
      This patch adds function vshSaveLibvirtError() that can be called after
      calling libvirt helper APIs to ensure the error is remembered.
      bf720959
    • P
      maint: Misc whitespace cleanups · 83124357
      Peter Krempa 提交于
      83124357
    • J
      conf: prevent crash with no uuid in cephx auth secret · bc680e13
      Ján Tomko 提交于
      Fix the null pointer access when UUID is not specified.
      Introduce a bool 'uuidUsable' to virStoragePoolAuthCephx that indicates
      if uuid was specified or not and use it instead of the pointless
      comparison of the static UUID array to NULL.
      Add an error message if both uuid and usage are specified.
      
      Fixes:
      Error: FORWARD_NULL (CWE-476):
      libvirt-0.10.2/src/conf/storage_conf.c:461: var_deref_model: Passing
          null pointer "uuid" to function "virUUIDParse(char const *, unsigned
          char *)", which dereferences it. (The dereference is assumed on the
          basis of the 'nonnull' parameter attribute.)
      Error: NO_EFFECT (CWE-398):
          libvirt-0.10.2/src/conf/storage_conf.c:979: array_null: Comparing an
          array to null is not useful: "src->auth.cephx.secret.uuid != NULL".
      bc680e13
    • O
      Fix the coding style · 05858b27
      Osier Yang 提交于
      Fix the "if ... else" coding style, and indentions problem.
      05858b27
    • O
      Fix indentions · cc3548ab
      Osier Yang 提交于
      cc3548ab
  4. 01 12月, 2012 15 次提交