1. 25 2月, 2014 12 次提交
    • L
      conf: clarify what is returned for actual bandwidth and vlan · 6d4ffae4
      Laine Stump 提交于
      In practice, if a virDomainNetDef has a virDomainActualNetDef
      allocated, the ActualNetDef will *always* contain the bandwidth and
      vlan data from the NetDef (unless there was also a portgroup involved
      - see networkAllocateActualDevice()).
      
      However, virDomainNetGetActual(Bandwidth|Vlan)() were coded to make it
      appear as if it might be possible to have a valid bandwidth/vlan in
      the NetDef, but a NULL in the ActualNetDef. Believing this un-truth
      could lead to writing unnecessarily defensive code when dealing with
      the virDomainGetActual*() functions, so this patch makes it more
      obvious:
      
         If there is an ActualNetDef, it will always have a copy of the
         various appropriate bits from its parent NetDef, and the
         virDomainGetActual* function will *always* return the data from the
         ActualNetDef, not from the NetDef.
      
      The reason for this effective-NOP patch is that a subsequent patch to
      change virDomainNetDefFormat will rely on the above rule.
      6d4ffae4
    • W
      rbd: Set timeout options for librados · 60f70542
      Wido den Hollander 提交于
      These timeout values make librados/librbd return -ETIMEDOUT when a
      operation is blocking due to a failing/unreachable Ceph cluster.
      
      By having the operations time out libvirt will not block.
      60f70542
    • W
      rbd: Include return statuses from librados/librbd in logging · 761491eb
      Wido den Hollander 提交于
      With this information it's easier for the user to debug what is
      going wrong.
      761491eb
    • J
      virsh: mark CPU usage field names as translatable · 723e2f84
      Ján Tomko 提交于
      My commit ac758012 removed the translation markers when
      moving the field names into an array.
      723e2f84
    • C
      virsh: initialize str to NULL to solve a build issue · 7a8d7af6
      Chen Hanxiao 提交于
      Fix a -Werror=maybe-uninitialized issue.
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      7a8d7af6
    • E
      virsh: kill over-engineered asprintf failure recovery · 50f7960d
      Eric Blake 提交于
      I noticed this while shortening switch statements via VIR_ENUM.
      Basically, the only ways virAsprintf can fail are if we pass a
      bogus format string (but we're not THAT bad) or if we run out
      of memory (but it already warns on our behalf in that case).
      Throw away the cruft that tries too hard to diagnose a printf
      failure.
      
      * tools/virsh-volume.c (cmdVolList): Simplify.
      * tools/virsh-pool.c (cmdPoolList): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      50f7960d
    • E
      virsh: use more compact VIR_ENUM_IMPL · 466b12ab
      Eric Blake 提交于
      Dan Berrange suggested that using VIR_ENUM_IMPL is more compact
      than open-coding switch statements, and still just as forceful
      at making us remember to update lists if we add enum values
      in the future.  Make this change throughout virsh.
      
      Sure enough, doing this change caught that we missed at least
      VIR_STORAGE_VOL_NETDIR.
      
      * tools/virsh-domain-monitor.c (vshDomainIOErrorToString)
      (vshDomainControlStateToString, vshDomainStateToString)
      (vshDomainStateReasonToString): Change switch to enum lookup.
      (cmdDomControl, cmdDominfo): Update caller.
      * tools/virsh-domain.c (vshDomainVcpuStateToString)
      (vshDomainEventToString, vshDomainEventDetailToString): Change
      switch to enum lookup.
      (vshDomainBlockJobToString, vshDomainJobToString): New functions.
      (cmdVcpuinfo, cmdBlockJob, cmdDomjobinfo, cmdEvent): Update
      callers.
      * tools/virsh-network.c (vshNetworkEventToString): Change switch
      to enum lookup.
      * tools/virsh-pool.c (vshStoragePoolStateToString): New function.
      (cmdPoolList, cmdPoolInfo): Update callers.
      * tools/virsh-volume.c (vshVolumeTypeToString): Change switch to
      enum lookup.
      (cmdVolInfo, cmdVolList): Update callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      466b12ab
    • J
      Document the keyboard as a valid input type · 19845402
      Ján Tomko 提交于
      Commit bc183733 added a new input type, but didn't change the
      documentation.
      19845402
    • J
      virsh: Don't leak buffer if GetFDs fails in cmdCreate · fe1b6e72
      Ján Tomko 提交于
      Change the logic of the function to return false by default
      and move the freeing of the buffer to the cleanup section.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1067338
      fe1b6e72
    • J
      libxl: handle on_crash coredump actions · cfad607b
      Jim Fehlig 提交于
      Add support for coredump-{destroy,restart} actions of <on_crash> event.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      cfad607b
    • J
      libxl: add dump dir to libxlDriverConfig object · c2de456e
      Jim Fehlig 提交于
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      c2de456e
    • J
      libxl: honor domain lifecycle event configuration · 51b9b391
      Jim Fehlig 提交于
      The libxl driver was ignoring the <on_*> domain event configuration,
      causing e.g. a domain to be rebooted even when on_reboot is set to
      destroy.
      
      This patch honors the <on_*> configuration in the shutdown event
      handler.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      51b9b391
  2. 24 2月, 2014 7 次提交
  3. 22 2月, 2014 2 次提交
  4. 21 2月, 2014 12 次提交
    • J
      Ignore additional fields in iscsiadm output · 57e17a74
      Ján Tomko 提交于
      There has been a new field introduced in iscsiadm --mode session
      output [1], but our regex only expects four fields. This breaks
      startup of iscsi pools:
      error: Failed to start pool iscsi
      error: internal error: cannot find session
      
      Fix this by ignoring anything after the fourth field.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1067173
      
      [1] https://github.com/mikechristie/open-iscsi/commit/181af9a
      57e17a74
    • J
      Add a stub for virCgroupGetDomainTotalCpuStats · abf1daf0
      Ján Tomko 提交于
      Commit 65158899 broke the build on FreeBSD:
      In function `qemuDomainGetCPUStats':
      /../../src/qemu/qemu_driver.c:16102:
      undefined reference to `virCgroupGetDomainTotalCpuStats'
      abf1daf0
    • E
      maint: update to latest gnulib · 96d947ce
      Eric Blake 提交于
      Among other things, gnulib now allows overriding of sed during
      'make syntax-check'.
      
      * .gnulib: Update to latest, for maint.mk improvements.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      96d947ce
    • E
      virsh: add net-event command · de87691f
      Eric Blake 提交于
      Add 'virsh net-event --list' and 'virsh net-event [net] --event=name
      [--loop] [--timeout]'.  Very similar to 'virsh event'.
      
      * tools/virsh.pod (net-event): Document new command.
      * tools/virsh-network.c (vshNetworkEventToString, vshNetEventData)
      (vshEventLifecyclePrint, cmdNetworkEvent): New struct and
      functions.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      de87691f
    • E
      virsh: add event command, for lifecycle events · 99fa96c3
      Eric Blake 提交于
      Add 'virsh event --list' and 'virsh event [dom] --event=name
      [--loop] [--timeout]'.  Borrows somewhat from event-test.c,
      but defaults to a one-shot notification, and takes advantage
      of the event loop integration to allow Ctrl-C to interrupt the
      wait for an event.  For now, this just does lifecycle events.
      
      * tools/virsh.pod (event): Document new command.
      * tools/virsh-domain.c (vshDomainEventToString)
      (vshDomainEventDetailToString, vshDomEventData)
      (vshEventLifecyclePrint, cmdEvent): New struct and functions.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      99fa96c3
    • E
      virsh: common code for waiting for an event · 4c29530d
      Eric Blake 提交于
      I plan to add 'virsh event' to virsh-domain.c and 'virsh
      net-event' to virsh-network.c; but as they will share quite
      a bit of common boilerplate, it's better to set that up now
      in virsh.c.
      
      * tools/virsh.h (_vshControl): Add fields.
      (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): New
      prototypes.
      * tools/virsh.c (vshEventFd, vshEventOldAction, vshEventInt)
      (vshEventTimeout): New helper variables and functions.
      (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup):
      Implement new functions.
      (vshInit, vshDeinit, main): Manage event timeout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4c29530d
    • E
      virsh: common code for parsing --seconds · 5093b047
      Eric Blake 提交于
      Several virsh commands ask for a --timeout parameter in
      seconds, then use it to control interfaces that operate on
      millisecond limits; I also plan on adding a 'virsh event'
      command that also does this.  Factor this into a common
      function.
      
      * tools/virsh.h (vshCommandOptTimeoutToMs): New prototype.
      * tools/virsh.c (vshCommandOptTimeoutToMs): New function.
      * tools/virsh-domain.c (cmdBlockCommit, cmdBlockCopy)
      (cmdBlockPull, cmdMigrate): Use it.
      (vshWatchJob): Adjust timeout scale.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5093b047
    • J
      libxl: queue shutdown event on domain shutdown · 84a6209d
      Jim Fehlig 提交于
      Emit libvirt shutdown event when receiving LIBXL_SHUTDOWN_REASON_POWEROFF
      event from libxl.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      84a6209d
    • J
      bandwidth: Adjust documentation · 7eb37a0d
      John Ferlan 提交于
      Recent autotest/virt-test testing on f20 discovered an anomaly in how
      the bandwidth options are documented and used. This was discovered due
      to a bug fix in the /sbin/tc utility found in iproute-3.11.0.1 (on f20)
      in which overflow was actually caught and returned as an error. The fix
      was first introduced in iproute-3.10 (search on iproute2 commit 'a303853e').
      
      The autotest/virt-test test for virsh domiftune was attempting to send
      the largest unsigned integer value (4294967295) for maximum value
      testing. The libvirt xml implementation was designed to manage values
      in kilobytes thus when this value was passed to /sbin/tc, it (now)
      properly rejected the 4294967295kbps value.
      
      Investigation of the problem discovered that formatdomain.html.in and
      formatnetwork.html.in described the elements and property types slightly
      differently, although they use the same code - virNetDevBandwidthParseRate()
      (shared by portgroups, domains, and networks xml parsers). Rather than
      have the descriptions in two places, this patch will combine and reword
      the description under formatnetwork.html.in and have formatdomain.html.in
      link to that description.
      
      This documentation faux pas was continued into the virsh man page where
      the bandwidth description for both 'attach-interface' and 'domiftune'
      did not indicate the format of each value, thus leading to the test using
      largest unsigned integer value assuming "bps" rather than "kbps", which
      ultimately was wrong.
      7eb37a0d
    • J
      libxl: always use libxlVmCleanupJob in shutdown thread · d716d942
      Jim Fehlig 提交于
      Commit e4a0e900 missed calling libxlVmCleanupJob in the shutdown
      handler when processing a reboot event.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d716d942
    • E
      qemu: adjust maxmem/maxvcpu computation · 60f7303c
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1038363
      
      If a domain has a different maximum for persistent and live maxmem
      or max vcpus, then it is possible to hit cases where libvirt
      refuses to adjust the current values or gets halfway through
      the adjustment before failing.  Better is to determine up front
      if the change is possible for all requested flags.
      
      Based on an idea by Geoff Franks.
      
      * src/qemu/qemu_driver.c (qemuDomainSetMemoryFlags): Compute
      correct maximum if both live and config are being set.
      (qemuDomainSetVcpusFlags): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      60f7303c
    • R
      Add Roman Bogorodskiy to the committers list · 2d2f29d2
      Roman Bogorodskiy 提交于
      2d2f29d2
  5. 20 2月, 2014 7 次提交
    • D
      Rename virDomainGetRootFilesystem to virDomainGetFilesystemForTarget · 432a3fee
      Daniel P. Berrange 提交于
      The virDomainGetRootFilesystem method can be generalized to allow
      any filesystem path to be obtained.
      
      While doing this, start a new test case for purpose of testing various
      helper methods in the domain_conf.{c,h} files, such as this one.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      432a3fee
    • D
      Introduce new OOM testing support · 590029f6
      Daniel P. Berrange 提交于
      The previous OOM testing support would re-run the entire "main"
      method each iteration, failing a different malloc each time.
      When a test suite has 'n' allocations, the number of repeats
      requires is  (n * (n + 1) ) / 2.  This gets very large, very
      quickly.
      
      This new OOM testing support instead integrates at the
      virtTestRun level, so each individual test case gets repeated,
      instead of the entire test suite. This means the values of
      'n' are orders of magnitude smaller.
      
      The simple usage is
      
         $ VIR_TEST_OOM=1 ./qemuxml2argvtest
         ...
         29) QEMU XML-2-ARGV clock-utc                                         ... OK
             Test OOM for nalloc=36 .................................... OK
         30) QEMU XML-2-ARGV clock-localtime                                   ... OK
             Test OOM for nalloc=36 .................................... OK
         31) QEMU XML-2-ARGV clock-france                                      ... OK
             Test OOM for nalloc=38 ...................................... OK
         ...
      
      the second lines reports how many mallocs have to be failed, and thus
      how many repeats of the test will be run.
      
      If it crashes, then running under valgrind will often show the problem
      
        $ VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When debugging problems it is also helpful to select an individual
      test case
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1 ../run valgrind ./qemuxml2argvtest
      
      When things get really tricky, it is possible to request that just
      specific allocs are failed. eg to fail allocs 5 -> 12, use
      
        $ VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-12 ../run valgrind ./qemuxml2argvtest
      
      In the worse case, you might want to know the stack trace of the
      alloc which was failed then VIR_TEST_OOM_TRACE can be set. If it
      is set to 1 then it will only print if it thinks a mistake happened.
      This is often not reliable, so setting it to 2 will make it print
      the stack trace for every alloc that is failed.
      
        $ VIR_TEST_OOM_TRACE=2 VIR_TEST_RANGE=30 VIR_TEST_OOM=1:5-5 ../run valgrind ./qemuxml2argvtest
        30) QEMU XML-2-ARGV clock-localtime                                   ... OK
            Test OOM for nalloc=36 !virAllocN
        /home/berrange/src/virt/libvirt/src/util/viralloc.c:180
        virHashCreateFull
        /home/berrange/src/virt/libvirt/src/util/virhash.c:144
        virDomainDefParseXML
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:11745
        virDomainDefParseNode
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12646
        virDomainDefParse
        /home/berrange/src/virt/libvirt/src/conf/domain_conf.c:12590
        testCompareXMLToArgvFiles
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:106
        virtTestRun
        /home/berrange/src/virt/libvirt/tests/testutils.c:250
        mymain
        /home/berrange/src/virt/libvirt/tests/qemuxml2argvtest.c:418 (discriminator 2)
        virtTestMain
        /home/berrange/src/virt/libvirt/tests/testutils.c:750
        ??
        ??:0
        _start
        ??:?
         FAILED
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      590029f6
    • D
      Fix multiple bugs in LXC domainMemoryStats driver · cb9b3bc2
      Daniel P. Berrange 提交于
      The virCgroupXXX APIs' return value must be checked for
      being less than 0, not equal to 0.
      
      An VIR_ERR_OPERATION_INVALID error must also be raised
      when the VM is not running to prevent a crash on NULL
      priv->cgroup field.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      cb9b3bc2
    • T
      Add unit test for virCgroupGetPercpuStats. · 5eb61e68
      Thorsten Behrens 提交于
      5eb61e68
    • T
      35aebf11
    • T
      Add unit test for virCgroupGetMemoryUsage. · 977a187a
      Thorsten Behrens 提交于
      977a187a
    • T
      Add unit test for virCgroupGetBlkioIo*Serviced · 9ce8a7c5
      Thorsten Behrens 提交于
      9ce8a7c5