1. 24 3月, 2012 8 次提交
    • E
      snapshot: add support for qemu transaction command · 64d5e815
      Eric Blake 提交于
      QEmu 1.1 is adding a 'transaction' command to the JSON monitor.
      Each element of a transaction corresponds to a top-level command,
      with the additional guarantee that the transaction flushes all
      pending I/O, then guarantees that all actions will be successful
      as a group or that failure will roll back the state to what it
      was before the monitor command.  The difference between a
      top-level command:
      
      { "execute": "blockdev-snapshot-sync", "arguments":
        { "device": "virtio0", ... } }
      
      and a transaction:
      
      { "execute": "transaction", "arguments":
        { "actions": [
          { "type": "blockdev-snapshot-sync", "data":
            { "device": "virtio0", ... } } ] } }
      
      is just a couple of changed key names and nesting the shorter
      command inside a JSON array to the longer command.  This patch
      just adds the framework; the next patch will actually use a
      transaction.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMakeCommand): Move
      guts...
      (qemuMonitorJSONMakeCommandRaw): ...into new helper.  Add support
      for array element.
      (qemuMonitorJSONTransaction): New command.
      (qemuMonitorJSONDiskSnapshot): Support use in a transaction.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot): Add
      argument.
      (qemuMonitorJSONTransaction): New declaration.
      * src/qemu/qemu_monitor.h (qemuMonitorTransaction): Likewise.
      (qemuMonitorDiskSnapshot): Add argument.
      * src/qemu/qemu_monitor.c (qemuMonitorTransaction): New wrapper.
      (qemuMonitorDiskSnapshot): Pass argument on.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive): Update caller.
      64d5e815
    • E
      snapshot: rudimentary qemu support for atomic disk snapshot · 4c4cc1b9
      Eric Blake 提交于
      Taking an external snapshot of just one disk is atomic, without having
      to pause and resume the VM.  This also paves the way for later patches
      to interact with the new qemu 'transaction' monitor command.
      
      The various scenarios when requesting atomic are:
      online, 1 disk, old qemu - safe, allowed by this patch
      online, more than 1 disk, old qemu - failure, this patch
      offline snapshot - safe, once a future patch implements offline disk snapshot
      online, 1 or more disks, new qemu - safe, once future patch uses transaction
      
      Taking an online system checkpoint snapshot is atomic, since it is
      done via a single 'savevm' monitor command.  Taking an offline system
      checkpoint snapshot is atomic, thanks to the previous patch.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
      new flag for single-disk setups.
      (qemuDomainSnapshotDiskPrepare): Check for atomic here.
      (qemuDomainSnapshotCreateDiskActive): Skip pausing the VM when
      atomic supported.
      (qemuDomainSnapshotIsAllowed): Use bool instead of int.
      4c4cc1b9
    • E
      snapshot: make offline qemu snapshots atomic · 922d498e
      Eric Blake 提交于
      Offline internal snapshots can be rolled back with just a little
      bit of refactoring, meaning that we are now automatically atomic.
      
      * src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Move
      guts...
      (qemuDomainSnapshotForEachQcow2Raw): ...to new helper, to allow
      rollbacks.
      922d498e
    • E
      snapshot: add atomic create flag · 4d5533ca
      Eric Blake 提交于
      Right now, it is appallingly easy to cause qemu disk snapshots
      to alter a domain then fail; for example, by requesting a two-disk
      snapshot where the second disk name resides on read-only storage.
      In this failure scenario, libvirt reports failure, but modifies
      the live domain XML in-place to record that the first disk snapshot
      was taken; and places a difficult burden on the management app
      to grab the XML and reparse it to see which disks, if any, were
      altered by the partial snapshot.
      
      This patch adds a new flag where implementations can request that
      the hypervisor make snapshots atomically; either no changes to
      XML occur, or all disks were altered as a group.  If you request
      the flag, you either get outright failure up front, or you take
      advantage of hypervisor abilities to make an atomic snapshot. Of
      course, drivers should prefer the atomic means even without the
      flag explicitly requested.
      
      There's no way to make snapshots 100% bulletproof - even if the
      hypervisor does it perfectly atomic, we could run out of memory
      during the followup tasks of updating our in-memory XML, and report
      a failure.  However, these sorts of catastrophic failures are rare
      and unlikely, and it is still nicer to know that either all
      snapshots happened or none of them, as that is an easier state to
      recover from.
      
      * include/libvirt/libvirt.h.in
      (VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC): New flag.
      * src/libvirt.c (virDomainSnapshotCreateXML): Document it.
      * tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Expose it.
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Document
      it.
      4d5533ca
    • E
      snapshot: add qemu capability for 'transaction' command · 311357d9
      Eric Blake 提交于
      We need a capability bit to gracefully error out if some of the
      additions in future patches can't be implemented by the running qemu.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name it.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      it.
      311357d9
    • E
      build: drop obsolete qparams test · 98ada9ab
      Eric Blake 提交于
      Otherwise, 'make check' breaks since commit bc1ff160 deleted
      qparams.h.  A later patch will ensure that viruri takes over
      what qparams used to do.
      
      * tests/qparamtest.c (mymain): Delete, now that we have viruri.
      * tests/Makefile.am (check_PROGRAMS, TESTS, qparamtest_SOURCES):
      Delete old test.
      * .gitignore: Add recent test additions.
      98ada9ab
    • E
      build: fix incorrect enum declaration · 9b6860f5
      Eric Blake 提交于
      Recent changes have caused build failures on systems where pdwtags works:
      commit a26a1969 mistakenly exported a public variable
      commits a26a1969, 57ddcc23, 487c0633 all had copy-paste bugs in
      hand-updating the golden API rather than rerunning pdwtags
      
      * include/libvirt/libvirt.h.in (virDomainEventTrayChangeReason):
      Make this a typedef, not external storage.
      * src/remote_protocol-structs (remote_procedure): Fix spelling.
      9b6860f5
    • L
      Add qemu support for ppc64 on FC16 or above for rpm packaging · 81203257
      Li Zhang 提交于
      On Fedora16 or above, qemu is supported now. So it is added
      in rpm packaging.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      81203257
  2. 23 3月, 2012 30 次提交
  3. 22 3月, 2012 2 次提交