1. 16 3月, 2015 4 次提交
  2. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  3. 12 3月, 2015 2 次提交
  4. 11 3月, 2015 12 次提交
    • P
      qemu: monitor: Kill qemuMonitorGetBlockStats(Info,ParamsNumber) · d3534a43
      Peter Krempa 提交于
      The functions and their QMP and HMP implementations are no longer needed
      since everything is now done via the *AllStats functions.
      d3534a43
    • P
      qemu: blockstats: Refactor qemuDomainBlockStatsFlags · e045587d
      Peter Krempa 提交于
      Now that qemuDomainBlocksStatsGather provides functions of both
      qemuMonitorGetBlockStatsParamsNumber and qemuMonitorGetBlockStatsInfo we
      can reuse it and kill a lot of code.
      
      Additionally as a bonus qemuDomainBlockStatsFlags will now support
      summary statistics so add a statement to the virsh man page about that.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1142636
      e045587d
    • P
      qemu: blockstats: Add support for totalled block statistics · cf093414
      Peter Krempa 提交于
      In the LXC driver, if the disk path is not provided the API returns
      total statistics for all disks of the domain. With the new text monitor
      implementation this can be now done in the qemu driver too.
      
      Add code that wil total the stats for all disks if the path is not
      provided.
      cf093414
    • P
      qemu: Split out working code qemuDomainBlockStats · 79966411
      Peter Krempa 提交于
      Extract the code to look up the disk alias and return the block stats
      struct so that it can be reused later in qemuDomainBlockStatsFlags.
      
      The function uses qemuMonitorGetAllBlockStatsInfo instead of
      qemuMonitorGetBlockStatsInfo.
      79966411
    • P
      qemu: monitor: Count block stats fields in qemuMonitorGetAllBlockStatsInfo · bdc05128
      Peter Krempa 提交于
      Our virDomainBlockStatsFlags API uses the old approach where, when it's
      called without the typed parameter array, returns the count of parameters
      supported by qemu.
      
      The supported parameter count is obtained via separate monitor calls
      which is a waste since we can calculate it when gathering the data.
      
      This patch adds code to the qemuMonitorGetAllBlockStatsInfo workers that
      allows to track the count of supported fields reported by qemu and will
      allow to remove the old duplicate code.
      bdc05128
    • P
      qemu: monitor: Convert common code to a macro · 4d8ebb7a
      Peter Krempa 提交于
      The function that is extracting block stats data from the QMP monitor
      reply contains a lot of repeated code. Since I'd be changing each of the
      copies in the next patch, lets convert it to a macro right away.
      4d8ebb7a
    • P
      qemu: monitor: Implement HMP version for listing all block device stats · f6563bc3
      Peter Krempa 提交于
      Add a different version of parser for "info blockstats" that basically
      parses the same information as the existing copy of the function.
      
      This will allow us to remove the single device version
      qemuMonitorGetBlockStatsInfo in the future.
      
      The new implementation uses few new helpers so it should be more
      understandable and provides a test case to verify that it works.
      f6563bc3
    • P
      qemu: blockstats: Switch to caller allocated hash table · 4f6b6788
      Peter Krempa 提交于
      Allocate the hash table in the monitor wrapper function instead of the
      worker itself so that the text monitor impl that will be added in the
      next patch doesn't have to duplicate it.
      4f6b6788
    • P
      qemu: monitor: Drop parsing of 'errs' from block info · 32288fc9
      Peter Krempa 提交于
      The error count statistic is not supported by qemu, so there's no need
      to pass the variables around if the result is ignored anyways.
      32288fc9
    • P
      qemu: Use macro to set block stats typed parameters · 7e9fb151
      Peter Krempa 提交于
      All the setters are the same code except for parameter name and
      variable, so they can be converted to a macro to save a ton of
      duplicated code.
      7e9fb151
    • L
      qemu: Remove unnecessary virReportError on networkGetNetworkAddress return · 64595431
      Luyao Huang 提交于
      Error messages are already set in all code paths returning -1 from
      networkGetNetworkAddress, so we don't want to overwrite them.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      64595431
    • M
      virQEMUCapsInitQMP: Don't dispose locked @vm · 954427c3
      Michal Privoznik 提交于
      When creating qemu capabilities, a dummy virDomainObj is created just
      because our monitor code expects that. However, the object is created
      locked already. Then, under cleanup label, we simply unref the object
      which results in whole domain object to be disposed. The object lock
      is destroyed subsequently, but hey - it's still locked:
      
      ==24845== Thread #14's call to pthread_mutex_destroy failed
      ==24845==    with error code 16 (EBUSY: Device or resource busy)
      ==24845==    at 0x4C3024E: pthread_mutex_destroy (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==24845==    by 0x531F72E: virMutexDestroy (virthread.c:83)
      ==24845==    by 0x5302977: virObjectLockableDispose (virobject.c:237)
      ==24845==    by 0x5302A89: virObjectUnref (virobject.c:265)
      ==24845==    by 0x1DD37866: virQEMUCapsInitQMP (qemu_capabilities.c:3397)
      ==24845==    by 0x1DD37CC6: virQEMUCapsNewForBinary (qemu_capabilities.c:3481)
      ==24845==    by 0x1DD381E2: virQEMUCapsCacheLookup (qemu_capabilities.c:3609)
      ==24845==    by 0x1DD30F8A: virQEMUCapsInitGuest (qemu_capabilities.c:744)
      ==24845==    by 0x1DD31889: virQEMUCapsInit (qemu_capabilities.c:1020)
      ==24845==    by 0x1DD7DD36: virQEMUDriverCreateCapabilities (qemu_conf.c:888)
      ==24845==    by 0x1DDC57C0: qemuStateInitialize (qemu_driver.c:803)
      ==24845==    by 0x53DC743: virStateInitialize (libvirt.c:777)
      ==24845==
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      954427c3
  5. 10 3月, 2015 1 次提交
    • L
      qemu: don't fill in nicindexes for session mode libvirtd · 705242f8
      Laine Stump 提交于
      Commit 4bbe1029 fixed a problem in commit f7afeddc by moving the call
      to virNetDevGetIndex() to a location common to all interface types (so
      that the nicindex array would be filled in for macvtap as well as tap
      interfaces), but the location was *too* common, as the original call
      to virNetDevGetIndex() had been in a section qualified by "if
      (cfg->privileged)". The result was that the "fixed" libvirtd would try
      to call virNetDevGetIndex() even for session mode libvirtd, and end up
      failing with the log message:
      
        Unable to open control socket: Operation not permitted
      
      To remedy that, this patch qualifies the call to virNetDevGetIndex()
      in its new location with cfg->privileged.
      
      This resolves https://bugzilla.redhat.com/show_bug.cgi?id=1198244
      705242f8
  6. 09 3月, 2015 4 次提交
  7. 06 3月, 2015 4 次提交
  8. 05 3月, 2015 1 次提交
  9. 04 3月, 2015 3 次提交
  10. 03 3月, 2015 6 次提交
    • M
      qemuProcessReconnect: Fill in pid file path · 63889e0c
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1197600
      
      So, libvirt uses pid file to track pid of started qemus. Whenever
      a domain is started, its pid is put into corresponding pid file.
      The pid file path is generated based on domain name and stored
      into domain object internals. However, it's not stored in the
      status XML and therefore lost on daemon restarts. Hence, later,
      when domain is being shut down, the daemon does not know which
      pid file to unlink, and the correct pid file is left behind. To
      avoid this, lets generate the pid file path again in
      qemuProcessReconnect().
      Reported-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      63889e0c
    • P
      qemu: check defaultMode for spice graphics independently · a16e5f0a
      Pavel Hrdina 提交于
      Instead of checking defaultMode for every channel that has no mode
      configured, test it only once outside of channel loop.  This fixes a bug
      that in case all possible channels are fore example set to insecure, but
      defaultMode is set to secure, we wouldn't auto-generate TLS port.  This
      results in failure while starting a guest.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1143832Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      a16e5f0a
    • P
      qemu: remove duplicated code for allocating spice ports · e4983952
      Pavel Hrdina 提交于
      We have two different places that needs to be updated while touching
      code for allocation spice ports.  Add a bool option to
      'qemuProcessSPICEAllocatePorts' function to switch between true and fake
      allocation so we can use this function also in qemu_driver to generate
      native domain definition.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      e4983952
    • M
      conf: De-duplicate scheduling policy enums · 2fd5880b
      Martin Kletzander 提交于
      Since adding the support for scheduler policy settings in commit
      8680ea97, there are two enums with the same information.  That was
      caused by rewriting the patch since first draft.
      
      Find out thanks to clang, but there was no impact whatsoever.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      2fd5880b
    • M
      qemu: Don't crash in qemuDomainOpenChannel() · b3ea0a8f
      Martin Kletzander 提交于
      The problem here was that when opening a channel, we were checking
      whether the channel given is alias (can't be NULL for running domain) or
      it's name, which can be NULL (for example with spicevmc).  In case of
      such domain qemuDomainOpenChannel() made the daemon crash.
      STREQ_NULLABLE() is safe to use since the code in question is wrapped in
      "if (name)" and is more readable, so use that instead of checking for
      non-NULL "vm->def->channels[i]->target.name".
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      b3ea0a8f
    • J
      disk: Disallow duplicated target 'dev' values · e0e29055
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1142631
      
      This patch resolves a situation where the same "<target dev='$name'...>"
      can be used for multiple disks in the domain.
      
      While the $name is "mostly" advisory regarding the expected order that
      the disk is added to the domain and not guaranteed to map to the device
      name in the guest OS, it still should be unique enough such that other
      domblk* type operations can be performed.
      
      Without the patch, the domblklist will list the same Target twice:
      
      $ virsh domblklist $dom
      Target     Source
      ------------------------------------------------
      sda        /var/lib/libvirt/images/file.qcow2
      sda        /var/lib/libvirt/images/file.img
      
      Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
      type calls will not be able to reference the second target.
      
      Fortunately, hotplug disallows adding a "third" sda value:
      
      $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
      error: Failed to attach disk
      error: operation failed: target sda already exists
      
      $
      
      BUT, it since 'sdb' doesn't exist one would get the following on the same
      hotplug attempt, but changing to use 'sdb' instead of 'sda'
      
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
      error: Failed to attach disk
      error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
      
      $
      
      Since we cannot fix this issue at parsing time, the best that can be done so
      as to not "lose" a domain is to make the check prior to starting the guest
      with the results as follows:
      
      $ virsh start $dom
      error: Failed to start domain $dom
      error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
      
      $
      
      Running 'make check' found a few more instances in the tests where this
      duplicated target dev value was being used. These also exhibited some
      duplicated 'id=' values (negating the uniqueness argument of aliases) in
      the corresponding .args file and of course the *xmlout version of a few
      input XML files.
      e0e29055
  11. 02 3月, 2015 2 次提交