1. 03 7月, 2014 9 次提交
  2. 02 7月, 2014 5 次提交
  3. 01 7月, 2014 1 次提交
    • P
      qemu: copy: Accept 'format' parameter when copying to a non-existing img · 42619ed0
      Peter Krempa 提交于
      We have the following matrix of possible arguments handled by the logic
      statement touched by this patch:
             | flags & _REUSE_EXT | !(flags & _REUSE_EXT)
      -------+--------------------+----------------------
       format| (1)                | (2)
      -------+--------------------+----------------------
      !format| (3)                | (4)
      -------+--------------------+----------------------
      
      In cases 1 and 2 the user provided a format, in cases 3 and 4 not. The
      user requests to use a pre-existing image in 1 and 3 and libvirt will
      create a new image in 2 and 4.
      
      The difference between cases 3 and 4 is that for 3 the format is probed
      from the user-provided image, whereas in 4 we just use the existing disk
      format.
      
      The current code would treat cases 1,3 and 4 correctly but in case 2 the
      format provided by the user would be ignored.
      
      The particular piece of code was broken in commit 35c7701c
      but since it was introduced a few commits before that it was never
      released as working.
      42619ed0
  4. 30 6月, 2014 1 次提交
    • P
      qemu: snapshot: Save persistent domain config when taking external snapshot · 9036b31a
      Peter Krempa 提交于
      Commit 55bbb011 introduced a regression
      where we forgot to save the persistent domain configuration after an
      external snapshot. This would make libvirt forget the snapshots and
      effectively revert to the previous state in the following scenario:
      
      1) Start VM
      2) Take snapshot
      3) Destroy VM
      4) Restart libvirtd
      
      Also fix spurious blank line added by patch mentioned above.
      9036b31a
  5. 26 6月, 2014 8 次提交
  6. 25 6月, 2014 1 次提交
    • J
      qemu: enum cleanups in "src/qemu/*" · aa990efe
      Julio Faracco 提交于
      As we are doing with the enum structures, a cleanup in "src/qemu/"
      directory was done now. All the enums that were defined in the
      header files were converted to typedefs in this directory. This
      patch includes all the adjustments to remove conflicts when you do
      this kind of change. "Enum-to-typedef"'s conversions were made in
      "src/qemu/qemu_{capabilities, domain, migration, hotplug}.h".
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      aa990efe
  7. 24 6月, 2014 1 次提交
  8. 23 6月, 2014 1 次提交
    • L
      qemu: parse -device virtio-balloon · ef016226
      Laine Stump 提交于
      There are no options to parse here other than the name of the device,
      and all three possible device names have the same prefix
      ("virtio-balloon" with "-ccw", "-pci", or "-device" appended), so the
      code is fairly simple. It has been implemented such that it will be
      easier to add handling for other -device entries that aren't otherwise
      recognized - just add another "else if (STRPREFIX(opts, ....)" clause.
      
      qemuParseCommandLineString() previously would always add a <memballoon
      model='virtio'/> to every result (the comments erroneously say that it
      is adding a <memballoon model='none'/>) This has been changed to add
      model='none', and 84 test case xml's updated accordingly (so that
      qemuxml2argvtest won't fail).
      
      Now that the memballoon device is properly parsed, we can safely add a
      test for properly ignoring -nodefconfig and -nodefaults. Rather than
      adding an entire new test case for this (and memballoon), we just
      randomly pick the clock-utc test and modify it slightly to fulfill the
      purpose.
      ef016226
  9. 21 6月, 2014 1 次提交
  10. 20 6月, 2014 3 次提交
  11. 19 6月, 2014 4 次提交
    • M
      nodeinfo: Implement nodeGetFreePages · 38fa03f4
      Michal Privoznik 提交于
      And add stubs to other drivers like: lxc, qemu, uml and vbox.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      38fa03f4
    • M
      virCaps: expose pages info · 02129b7c
      Michal Privoznik 提交于
      There are two places where you'll find info on page sizes. The first
      one is under <cpu/> element, where all supported pages sizes are
      listed. Then the second one is under each <cell/> element which refers
      to concrete NUMA node. At this place, the size of page's pool is
      reported. So the capabilities XML looks something like this:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Westmere</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            ...
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          ...
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4054408</memory>
                <pages unit='KiB' size='4'>1013602</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4071072</memory>
                <pages unit='KiB' size='4'>1017768</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
          ...
        </host>
      
        <guest/>
      
      </capabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      02129b7c
    • M
      nodeinfo: Rename nodeGetFreeMemory to nodeGetMemory · 99a63aed
      Michal Privoznik 提交于
      For future work we want to get info for not only the free memory
      but overall memory size too. That's why the function must have
      new signature too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      99a63aed
    • E
      blockjob: use stable disk string in job event · 1bfe73a1
      Eric Blake 提交于
      When the block job event was first added, it was for block pull,
      where the active layer of the disk remains the same name.  It was
      also in a day where we only cared about local files, and so we
      always had a canonical absolute file name.  But two things have
      changed since then: we now have network disks, where determining
      a single absolute string does not really make sense; and we have
      two-phase jobs (copy and active commit) where the name of the
      active layer changes between the first event (ready, on the old
      name) and second (complete, on the pivoted name).
      
      Adam Litke reported that having an unstable string between events
      makes life harder for clients.  Furthermore, all of our API that
      operate on a particular disk of a domain accept multiple strings:
      not only the absolute name of the active layer, but also the
      destination device name (such as 'vda').  As this latter name is
      stable, even for network sources, it serves as a better string
      to supply in block job events.
      
      But backwards-compatibility demands that we should not change the
      name handed to users unless they explicitly request it.  Therefore,
      this patch adds a new event, BLOCK_JOB_2 (alas, I couldn't think of
      any nicer name - but at least Migrate2 and Migrate3 are precedent
      for a number suffix).  We must double up on emitting both old-style
      and new-style events according to what clients have registered for
      (see also how IOError and IOErrorReason emits double events, but
      there the difference was a larger struct rather than changed
      meaning of one of the struct members).
      
      Unfortunately, adding a new event isn't something that can easily
      be broken into pieces, so the commit is rather large.
      
      * include/libvirt/libvirt.h.in (virDomainEventID): Add a new id
      for VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2.
      (virConnectDomainEventBlockJobCallback): Document new semantics.
      * src/conf/domain_event.c (_virDomainEventBlockJob): Rename field,
      to ensure we catch all clients.
      (virDomainEventBlockJobNew): Add parameter.
      (virDomainEventBlockJobDispose)
      (virDomainEventBlockJobNewFromObj)
      (virDomainEventBlockJobNewFromDom)
      (virDomainEventDispatchDefaultFunc): Adjust clients.
      (virDomainEventBlockJob2NewFromObj)
      (virDomainEventBlockJob2NewFromDom): New functions.
      * src/conf/domain_event.h: Add new prototypes.
      * src/libvirt_private.syms (domain_event.h): Export new functions.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Generate two
      different events.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Likewise.
      * src/remote/remote_protocol.x
      (remote_domain_event_block_job_2_msg): New struct.
      (REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2): New RPC.
      * src/remote/remote_driver.c
      (remoteDomainBuildEventBlockJob2): New handler.
      (remoteEvents): Register new event.
      * daemon/remote.c (remoteRelayDomainEventBlockJob2): New handler.
      (domainEventCallbacks): Register new event.
      * tools/virsh-domain.c (vshEventCallbacks): Likewise.
      (vshEventBlockJobPrint): Adjust client.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bfe73a1
  12. 16 6月, 2014 2 次提交
    • E
      blockcommit: require base below top · 3e3c6ff1
      Eric Blake 提交于
      The block commit code looks for an explicit base file relative
      to the discovered top file; so for a chain of:
        base <- snap1 <- snap2 <- snap3
      and a command of:
        virsh blockcommit $dom vda --base snap2 --top snap1
      we got a sane message (here from libvirt 1.0.5):
      error: invalid argument: could not find base 'snap2' below 'snap1' in chain for 'vda'
      
      Meanwhile, recent refactoring has slightly reduced the quality of the
      libvirt error messages, by losing the phrase 'below xyz':
      error: invalid argument: could not find image 'snap2' in chain for 'snap3'
      
      But we had a one-off, where we were not excluding the top file
      itself in searching for the base; thankfully qemu still reports
      the error, but the quality is worse:
        virsh blockcommit $dom vda --base snap2 --top snap2
      error: internal error unable to execute QEMU command 'block-commit': Base '/snap2' not found
      
      Fix the one-off in blockcommit by changing the semantics of name
      lookup - if a starting point is specified, then the result must
      be below that point, rather than including that point.  The only
      other call to chain lookup was blockpull code, which was already
      forcing the lookup to omit the active layer and only needs a
      tweak to use the new semantics.
      
      This also fixes the bug exposed in the testsuite, where when doing
      a lookup pinned to an intermediate point in the chain, we were
      unable to return the name of the parent also in the chain.
      
      * src/util/virstoragefile.c (virStorageFileChainLookup): Change
      semantics for non-NULL startFrom.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Adjust caller,
      to keep existing semantics.
      * tests/virstoragetest.c (mymain): Adjust to expose new semantics.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3e3c6ff1
    • P
      qemu: snapshot: Don't mark all block disks for metadata reuse · b77d3d9b
      Peter Krempa 提交于
      For block devices used as snapshot source the new snapshot code would
      set the reuse flag. This inhibits to take snapshot without specially
      preparing the block image before taking the snapshot.
      
      Fortunately this is not a regression as only the new way of specifying
      snapshot source is affected.
      
      For the followin snapshot XML:
       <domainsnapshot>
         <disks>
           <disk name='vda' type='block'>
             <driver type='qcow2'/>
             <source dev="/dev/andariel/testsnap" />
           </disk>
         </disks>
       </domainsnapshot>
      
      You'd get:
      error: internal error: unable to execute QEMU command 'transaction': Image is not in qcow2 format
      
      After this patch the snapshot is created successfully.
      b77d3d9b
  13. 13 6月, 2014 1 次提交
    • E
      blockcommit: update error messages related to block jobs · 278c51af
      Eric Blake 提交于
      A future patch will add two-phase block commit jobs; as the
      mechanism for managing them is similar to managing a block copy
      job, existing errors should be made generic enough to occur
      for either job type.
      
      * src/conf/domain_conf.c (virDomainHasDiskMirror): Update
      comment.
      * src/qemu/qemu_driver.c (qemuDomainDefineXML)
      (qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
      (qemuDomainBlockJobImpl, qemuDomainBlockCopy): Update error
      message.
      * src/qemu/qemu_hotplug.c (qemuDomainDetachDiskDevice): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      278c51af
  14. 12 6月, 2014 2 次提交