1. 31 8月, 2013 1 次提交
    • C
      qemu: Only setup vhost if virtType == "kvm" · d962318c
      Cole Robinson 提交于
      vhost only works in KVM mode at the moment, and is infact compiled
      out if the emulator is built for non-native architecture. While it
      may work at some point in the future for plain qemu, for now it's
      just noise on the command line (and which contributes to arm cli
      breakage).
      d962318c
  2. 30 8月, 2013 4 次提交
    • G
      Process virtlockd.conf instead of libvirtd.conf · 3e325448
      Guido Günther 提交于
      3e325448
    • D
      Change way we fake dbus method calls · dbd2bc8c
      Daniel P. Berrange 提交于
      Ubuntu libdbus.so links with -Bsymbolic-functions, which means
      that we can only LD_PRELOAD functions that we directly call.
      Functions which libdbus.so calls internally can not be replaced.
      Thus we cannot use dbus_message_new_error or dbus_message_new_method_return
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dbd2bc8c
    • E
      random: don't mix RAND_MAX with random_r · dd3688e4
      Eric Blake 提交于
      FreeBSD 10 recently changed their definition of RAND_MAX, to try
      and cover the fact that their evenly distributed results of rand()
      really are a smaller range than a full power of 2.  As a result,
      I did some investigation, and learned:
      
      1. POSIX requires random() to be evenly distributed across exactly
      31 bits.  glibc also guarantees this for rand(), but the two are
      unrelated, and POSIX only associates RAND_MAX with rand().
      Avoiding RAND_MAX altogether thus avoids a build failure on
      FreeBSD 10.
      
      2. Concatenating random bits from a PRNG will NOT provide uniform
      coverage over the larger value UNLESS the period of the original
      PRNG is at least as large as the number of bits being concatenated.
      Simple example: suppose that RAND_MAX were 1 with a period of 2**1
      (which means that the PRNG merely alternates between 0 and 1).
      Concatenating two successive rand() calls would then invariably
      result in 01 or 10, which is a rather non-uniform distribution
      (00 and 11 are impossible) and an even worse period (2**0, since
      our second attempt will get the same number as our first attempt).
      But a RAND_MAX of 1 with a period of 2**2 (alternating between
      0, 1, 1, 0) provides sane coverage of all four values, if properly
      tempered.  (Back-to-back calls would still only see half the values
      if we don't do some tempering).  We therefore want to guarantee a
      period of at least 2**64, preferably larger (as a tempering factor);
      POSIX only makes this guarantee for random() with 256 bytes of info.
      
      * src/util/virrandom.c (virRandomBits): Use constants that are
      accurate for the PRNG we are using, not an unrelated PRNG.
      (randomState): Ensure the period of our PRNG exceeds our usage.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      dd3688e4
    • P
      8c725cc1
  3. 29 8月, 2013 19 次提交
  4. 28 8月, 2013 9 次提交
    • J
      virt-sanlock-cleanup; Fix augtool usage · 74c5156f
      Jiri Denemark 提交于
      Surprisingly, augtool get (or print) returns "path = value" while we are
      only interested in the value. We need to remove the "path = " part from
      the augtool's output. The following is an example of the augtool command
      as used in virt-sanlock-cleanup script:
      
      $ augtool get /files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir
      /files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir = /var/lib/libvirt/sanlock
      74c5156f
    • M
      virsh: Fix debugging · ac43da70
      Martin Kletzander 提交于
      Commit a0b6a36f "fixed" what abfff210 broke (URI precedence), but
      there was still one more thing missing to fix.  When using virsh
      parameters to setup debugging, those weren't honored, because at the
      time debugging was initializing, arguments weren't parsed yet.  To
      make ewerything work as expected, we need to initialize the debugging
      twice, once before debugging (so we can debug option parsing properly)
      and then again after these options are parsed.
      
      As a side effect, this patch also fixes a leak when virsh is ran with
      multiple '-l' parameters.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      ac43da70
    • M
      virsh-pool.c: Don't jump over variable declaration · 2ab0948d
      Michal Privoznik 提交于
      Since 785ff34b we are using the outputStr variable in cleanup label.
      However, there is a possibility to jump to the label before the variable
      has been declared:
      
      virsh-pool.c: In function 'cmdPoolList':
      virsh-pool.c:1121:25: error: jump skips variable initialization [-Werror=jump-misses-init]
                               goto asprintf_failure;
                               ^
      virsh-pool.c:1308:1: note: label 'asprintf_failure' defined here
       asprintf_failure:
       ^
      virsh-pool.c:1267:11: note: 'outputStr' declared here
           char *outputStr = NULL;
      2ab0948d
    • J
      virsh: free the caps list properly if one of them is invalid · 14d53286
      Ján Tomko 提交于
      VIR_FREE(caps) is not enough to free an array allocated
      by vshStringToArray.
      
      ==17== 4 bytes in 1 blocks are definitely lost in loss record 4 of 728
      ==17==    by 0x4EFFC44: virStrdup (virstring.c:554)
      ==17==    by 0x128B10: _vshStrdup (virsh.c:125)
      ==17==    by 0x129164: vshStringToArray (virsh.c:218)
      ==17==    by 0x157BB3: cmdNodeListDevices (virsh-nodedev.c:409)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1001536
      14d53286
    • J
      virsh: free the formatting string when listing pool details · 785ff34b
      Ján Tomko 提交于
      ==23== 41 bytes in 1 blocks are definitely lost in loss record 626 of 727
      ==23==    by 0x4F0099F: virAsprintfInternal (virstring.c:358)
      ==23==    by 0x15D2C9: cmdPoolList (virsh-pool.c:1268)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1001536
      785ff34b
    • J
      virsh: free the list from ListAll APIs even for 0 items · f733eac0
      Ján Tomko 提交于
      virsh secret-list leak when no secrets are defined:
      
      ==27== 8 bytes in 1 blocks are definitely lost in loss record 6 of 726
      ==27==    by 0x4E941DD: virAllocN (viralloc.c:183)
      ==27==    by 0x5037F1A: remoteConnectListAllSecrets (remote_driver.c:3076)
      ==27==    by 0x5004EC6: virConnectListAllSecrets (libvirt.c:16298)
      ==27==    by 0x15F813: vshSecretListCollect (virsh-secret.c:397)
      ==27==    by 0x15F0E1: cmdSecretList (virsh-secret.c:532)
      
      And so do some other *-list commands.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1001536
      f733eac0
    • J
      virsh: free messages after logging them to a file · 66d124b4
      Ján Tomko 提交于
      The messages were only freed on error.
      
      ==12== 1,100 bytes in 1 blocks are definitely lost in loss record 698 of 729
      ==12==    by 0x4E98C22: virBufferAsprintf (virbuffer.c:294)
      ==12==    by 0x12C950: vshOutputLogFile (virsh.c:2440)
      ==12==    by 0x12880B: vshError (virsh.c:2254)
      ==12==    by 0x131957: vshCommandOptDomainBy (virsh-domain.c:109)
      ==12==    by 0x14253E: cmdStart (virsh-domain.c:3333)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1001536
      66d124b4
    • J
      Test network update XML parsing · 2d9185a9
      Ján Tomko 提交于
      Add checks for updating sections of network definition via
      virNetworkDefUpdateSection.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=989569
      2d9185a9
    • J
      Remove the space before the slash in network XML · d8bd24a9
      Ján Tomko 提交于
      This matches the style we use elsewhere and allows
      nat-network-dns-srv-record{,-minimal}.xml to be tested in
      network XML -> XML test.
      d8bd24a9
  5. 27 8月, 2013 7 次提交