1. 09 12月, 2014 4 次提交
    • E
      getstats: add block.n.path stat · 7b499262
      Eric Blake 提交于
      I'm about to make block stats optionally more complex to cover
      backing chains, where block.count will no longer equal the number
      of <disks> for a domain.  For these reasons, it is nicer if the
      statistics output includes the source path (for local files).
      This patch doesn't add anything for network disks, although we
      may decide to add that later.
      
      With this patch, I now see the following for the same domain as
      in the previous patch (one qcow2 file, and an empty cdrom drive):
      $ virsh domstats --block foo
      Domain: 'foo'
        block.count=2
        block.0.name=hda
        block.0.path=/var/lib/libvirt/images/foo.qcow2
        block.1.name=hdc
      
      * src/libvirt-domain.c (virConnectGetAllDomainStats): Document
      new field.
      * tools/virsh.pod (domstats): Document new field.
      * src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Return the new
      stat for local files/block devices.
      (QEMU_ADD_NAME_PARAM): Add parameter.
      (qemuDomainGetStatsInterface): Update caller.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7b499262
    • E
      getstats: start giving offline block stats · 56b21dfe
      Eric Blake 提交于
      I noticed that for an offline domain, 'virsh domstats --block $dom'
      was producing just the domain name, with no stats.  But the older
      'virsh domblkinfo' works just fine on offline domains.  This patch
      starts to get us closer, by at least reporting the disk names for
      an offline domain.
      
      With this patch, I now see the following for an offline domain
      with one qcow2 disk and an empty cdrom drive:
      $ virsh domstats --block foo
      Domain: 'foo'
        block.count=2
        block.0.name=hda
        block.1.name=hdc
      
      * src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Don't short-circuit
      output of block name.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      56b21dfe
    • E
      getstats: improve documentation · f301fe77
      Eric Blake 提交于
      At least with 'virsh domstats --block' on an offline domain, we
      currently output no stats even though we recognize the stat
      category.  Although a later patch will improve this situation,
      it is better to document that this is expected behavior.
      
      Also, while the current implementation rejects filtering flags
      for virDomainListGetStats, this limitation may be lifted in the
      future and we do not enforce it at the API level.
      
      * src/libvirt-domain.c (virConnectGetAllDomainStats): Document
      that recognized stats might not be reported.
      (virDomainListGetStats): Likewise, and tweak filtering documentation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f301fe77
    • E
      getstats: avoid memory leak on OOM · 2f61602e
      Eric Blake 提交于
      qemuDomainGetStatsBlock() could leak a stats hash table if it
      encountered OOM while populating the virTypedParameters.
      Oddly, the fix doesn't even touch qemuDomainGetStatsBlock :)
      
      * src/qemu/qemu_driver.c (QEMU_ADD_COUNT_PARAM)
      (QEMU_ADD_NAME_PARAM): Don't return early.
      (qemuDomainGetStatsInterface): Adjust caller.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2f61602e
  2. 08 12月, 2014 4 次提交
  3. 06 12月, 2014 5 次提交
  4. 05 12月, 2014 5 次提交
  5. 04 12月, 2014 14 次提交
  6. 03 12月, 2014 8 次提交
    • S
      virsh: vol-upload disallow negative offset · cd53d947
      Shanzhi Yu 提交于
      Commit 570d0f63 describes disabling negative offset usage for
      vol-upload/download (e.g. cmdVolDownload and cmdVolUpload; however,
      the change was only made to cmdVolDownload. There was no change to
      cmdVolUpload.  This patch adds the same checks for vol-upload.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1087104Signed-off-by: NShanzhi Yu <shyu@redhat.com>
      cd53d947
    • P
      network: dnsmasq: Don't format lease file path · 42140680
      Peter Krempa 提交于
      Now that we don't use the leases file at all for leases just don't
      format it into the config and use the leaseshelper to do all the
      lifting.
      42140680
    • P
      leaseshelper: Refactor control flow · ca6dbdd0
      Peter Krempa 提交于
      Untangle a few conditions into a case statement and improve reporting of
      invaid commands.
      ca6dbdd0
    • N
      leaseshelper: improvements to support all events · 0f87054b
      Nehal J Wani 提交于
      This patch enables the helper program to detect event(s) triggered when
      there is a change in lease length or expiry and client-id. This
      transfers complete control of leases database to libvirt and obsoletes
      use of the lease database file (<network-name>.leases). That file will
      not be created, read, or written.  This is achieved by adding the option
      --leasefile-ro to dnsmasq and passing a custom env var to leaseshelper,
      which helps us map events related to leases with their corresponding
      network bridges, no matter what the event be.
      
      Also, this requires the addition of a new non-lease entry in our custom
      lease database: "server-duid". It is required to identify a DHCPv6
      server.
      
      Now that dnsmasq doesn't maintain its own leases database, it relies on
      our helper program to tell it about previous leases and server duid.
      Thus, this patch makes our leases program honor an extra action: "init",
      in which it sends the known info in a particular format to dnsmasq
      by printing it to stdout.
      
      The drawback of this change is that upgrade to this new approach does
      not transfer the existing leases for the network if the leaseshelper
      wasn't already used.
      0f87054b
    • D
      cpu-driver: Fix the cross driver function call · 86a15a25
      Daniel Hansel 提交于
      For Intel and PowerPC the implementation is calling a cpu driver
      function across driver layers (i.e. from qemu driver directly to cpu
      driver).
      The correct behavior is to use libvirt API functionality to perform such
      a inter-driver call.
      
      This patch introduces a new cpu driver API function getModels() to
      retrieve the cpu models. The currect implementation to process the
      cpu_map XML content is transferred to the INTEL and PowerPC cpu driver
      specific API functions.
      Additionally processing the cpu_map XML file is not safe due to the fact
      that the cpu map does not exist for all architectures. Therefore it is
      better to encapsulate the processing in the architecture specific cpu
      drivers.
      Signed-off-by: NDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      86a15a25
    • M
      qemu_migration: Precreate missing storage · cf54c606
      Michal Privoznik 提交于
      Based on previous commit, we can now precreate missing volumes. While
      digging out the functionality from storage driver would be nicer, if
      you've seen the code it's nearly impossible. So I'm going from the
      other end:
      
      1) For given disk target, disk path is looked up.
      2) For the disk path, storage pool is looked up, a volume XML is
      constructed and then passed to virStorageVolCreateXML() which has all
      the knowledge how to create raw images, (encrypted) qcow(2) images,
      etc.
      
      One of the advantages of this approach is, we don't have to care about
      image conversion - qemu does that for us. So for instance, users can
      transform qcow2 into raw on migration (if the correct XML is passed to
      the migration API).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cf54c606
    • M
      qemu_migration: Send disk sizes to the other side · e1466dc7
      Michal Privoznik 提交于
      Up 'til now, users need to precreate non-shared storage on migration
      themselves. This is not very friendly requirement and we should do
      something about it. In this patch, the migration cookie is extended,
      so that <nbd/> section does not only contain NBD port, but info on
      disks being migrated. This patch sends a list of pairs of:
      
          <disk target; disk size>
      
      to the destination. The actual storage allocation is left for next
      commit.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e1466dc7
    • M
      qemuMonitorJSONBlockStatsUpdateCapacity: Don't skip disks · a714533b
      Michal Privoznik 提交于
      The function queries the block devices visible to qemu
      ('query-block') and parses the qemu's output. The info is
      returned in a hash table which is expected to be pre-filled by
      qemuMonitorJSONGetAllBlockStatsInfo(). However, in the next patch
      we are not going to call the latter function at all, so we should
      make the former function add devices into the hash table if not
      found there.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a714533b