1. 13 12月, 2012 1 次提交
  2. 12 12月, 2012 10 次提交
  3. 11 12月, 2012 6 次提交
    • P
      qemu: snapshot: Remove memory image if external checkpoint fails · a912977a
      Peter Krempa 提交于
      When the disk snapshot part of an external system checkpoint fails the
      memory image is retained. This patch adds code to remove the image in
      such case.
      a912977a
    • P
      qemu: snapshot: Don't leak XML definition if restarting of CPUs fails · d5b28287
      Peter Krempa 提交于
      In case the snapshot code isn't able to restart CPUs after an external
      checkpoint we would leak a copy of the domains XML definition. This
      patch fixes the cleanup path.
      d5b28287
    • J
      qemu: fix uninitialized variable warning in doPeer2PeerMigrate · 07b64de5
      Ján Tomko 提交于
      False positive, but it breaks the build with gcc-4.6.3.
      
      qemu/qemu_migration.c:2931:37: error: 'offline' may be used
      uninitialized in this function [-Werror=uninitialized]
      qemu/qemu_migration.c:2887:10: note: 'offline' was declared here
      07b64de5
    • P
      qemu: Restart CPUs with valid async job type when doing external snapshots · 46b0c933
      Peter Krempa 提交于
      When restarting CPUs after an external snapshot, the restarting function
      was called without the appropriate async job type. This caused that a
      new sync job wasn't created and allowed races in the monitor.
      46b0c933
    • L
      Add support for offline migration · 8b9bf787
      liguang 提交于
      Offline migration transfers inactive definition of a domain (which may
      or may not be active). After successful completion, the domain remains
      in its current state on source host and is defined but inactive on
      destination host. It's a bit more clever than virDomainGetXMLDesc() on
      source host followed by virDomainDefineXML() on destination host, as
      offline migration will run pre-migration hook to update the domain XML
      on destination host. Currently, copying non-shared storage is not
      supported during offline migration.
      
      Offline migration can be requested with a new migration flag called
      VIR_MIGRATE_OFFLINE (which has to be combined with
      VIR_MIGRATE_PERSIST_DEST flag).
      8b9bf787
    • L
      qemu: eliminate bogus error log when changing netdev's bridge · e5577872
      Laine Stump 提交于
      This fixes a problem that showed up during testing of:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=881480
      
      Due to a logic error in the function that gets the name of the bridge
      an interface connects to, any time a bridge was specified directly
      (type='bridge') rather than indirectly (type='network'), An error
      would be logged (although the operation would then complete
      successfully):
      
         Network type 6 is not supported
      
      The final virReportError() in the function
      qemuDomainNetGetBridgeName() was apparently avoided in the past with a
      "goto cleanup" at the end of each case, but the case of bridge somehow
      no longer has that final goto cleanup.
      
      The proper solution is anyway to not rely on goto's, but put the error
      log inside an else {} clause, so that it's executed only if the type
      is neither bridge nor network (in reality, this function should only
      ever be called for those two types, that's why this is an internal
      error).
      
      While making this change, the error message was also tuned to be more
      correct (since it's not really the type of the network, but the type
      of the interface, and it *is* otherwise supported, it's just that the
      interface type in question doesn't *have* a bridge device associated
      with it, or at least we don't know how to get it).
      e5577872
  4. 10 12月, 2012 1 次提交
  5. 08 12月, 2012 1 次提交
  6. 07 12月, 2012 1 次提交
  7. 05 12月, 2012 6 次提交
    • J
      qemu: Fix memory (and FD) leak on PCI device detach · 69103187
      Jiri Denemark 提交于
      Unmanaged PCI devices were only leaked if pciDeviceListAdd failed but
      managed devices were always leaked. And leaking PCI device is likely to
      leave PCI config file descriptor open. This patch fixes
      qemuReattachPciDevice to either free the PCI device or add it to the
      inactivePciHostdevs list.
      69103187
    • J
      qemu: Don't free PCI device if adding it to activePciHostdevs fails · ea1a9b5f
      Jiri Denemark 提交于
      The device is still referenced from pcidevs and freeing it would leave
      an invalid pointer there.
      ea1a9b5f
    • J
      qemu: Fix error code when attaching existing device · 935550c6
      Jiri Denemark 提交于
      An attempt to attach device that is already attached to a domain results
      in the following error:
      
      virsh # attach-device rhel6 pci2 --persistent
      error: Failed to attach device from pci2
      error: invalid argument: device is already in the domain configuration
      
      The "invalid argument" error code looks wrong, we usually use "operation
      invalid" when the action cannot be done in current state.
      935550c6
    • O
      qemu: Simplify the code · 9ee809d6
      Osier Yang 提交于
      "disk" is initialized to "dev->data.disk" in the beginning of the
      function.
      9ee809d6
    • 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
  8. 04 12月, 2012 3 次提交
    • 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
      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
    • 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
  9. 01 12月, 2012 4 次提交
    • D
      Move reboot/shutdown flags combination check into QEMU driver · dff4a753
      Daniel P. Berrange 提交于
      The fact that only the guest agent, or ACPI flag can be used
      when requesting reboot/shutdown is merely a limitation of the
      QEMU driver impl at this time. Thus it should not be in
      libvirt.c code
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dff4a753
    • V
      qemu: Fix up the default machine type for QMP probing · 3c465728
      Viktor Mihajlovski 提交于
      The default machine type must be stored in the first element of
      the caps->machineTypes array. This was done for help output
      parsing but not for QMP probing.
      
      Added a helper function qemuSetDefaultMachine to apply the same
      fix up for both probing methods.
      
      Further, it was necessary to set caps->nmachineTypes after QMP
      probing.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      3c465728
    • G
    • E
      qemu: don't attempt undefined QMP commands · 3d7f6649
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=872292
      
      Libvirt should not attempt to call a QMP command that has not been
      documented in qemu.git - if future qemu introduces a command by the
      same name but with subtly different semantics, then libvirt will be
      broken when trying to use that command.
      
      We also had some code that could never be reached - some of our
      commands have an alternate for new vs. old qemu HMP commands; but
      if we are new enough to support QMP, we only need a fallback to
      the new HMP counterpart, and don't need to try for a QMP counterpart
      for the old HMP version.
      
      See also this attempt to convert the three snapshot commands to QMP:
      https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg01597.html
      although it looks like that will still not happen before qemu 1.3.
      That thread eventually decided that qemu would use the name
      'save-vm' rather than 'savevm', which mitigates the fact that
      libvirt's attempt to use a QMP 'savevm' would be broken, but we
      might not be as lucky on the other commands.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONSetCPU)
      (qemuMonitorJSONAddDrive, qemuMonitorJSONDriveDel)
      (qemuMonitorJSONCreateSnapshot, qemuMonitorJSONLoadSnapshot)
      (qemuMonitorJSONDeleteSnapshot): Use only HMP fallback for now.
      (qemuMonitorJSONAddHostNetwork, qemuMonitorJSONRemoveHostNetwork)
      (qemuMonitorJSONAttachDrive, qemuMonitorJSONGetGuestDriveAddress):
      Delete; QMP implies QEMU_CAPS_DEVICE, which prefers AddNetdev,
      RemoveNetdev, and AddDrive anyways (qemu_hotplug.c has all callers).
      * src/qemu/qemu_monitor.c (qemuMonitorAddHostNetwork)
      (qemuMonitorRemoveHostNetwork, qemuMonitorAttachDrive): Reflect
      deleted commands.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONAddHostNetwork)
      (qemuMonitorJSONRemoveHostNetwork, qemuMonitorJSONAttachDrive):
      Likewise.
      3d7f6649
  10. 30 11月, 2012 4 次提交
  11. 29 11月, 2012 3 次提交