1. 09 12月, 2014 3 次提交
    • 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: 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. 05 12月, 2014 1 次提交
  3. 04 12月, 2014 2 次提交
    • E
      qemu: Fix virsh freeze when blockcopy storage file is removed · fe3691f6
      Erik Skultety 提交于
      If someone removes blockcopy storage file when still in mirroring phase
      and then requesting blockjob abort using pivot, virsh cmd freezes. This
      is not an issue with older qemu versions which did not support
      asynchronous jobs (which we prefer by default).
      As we have reached the mirroring phase successfully, polling monitor for
      blockjob info always returns 1 and the loop never ends.
      This fix introduces a check for qemuDomainBlockPivot return code, possibly
      skipping the asynchronous waiting completely, if an error occurred and
      asynchronous waiting was the preferred method.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567
      fe3691f6
    • P
      qemu: driver: Reload snapshots and managedsaves prior to reconnecting · 48a05560
      Peter Krempa 提交于
      Reconnect to the VM is a possibly long-running job spawned in a separate
      thread. We should reload the snapshot defs and managedsave state prior
      to spawning the thread to avoid blocking of the daemon startup which
      would serialize on the VM lock.
      
      Also the reloading code would violate the domain job held while
      reconnecting as the loader functions don't create jobs.
      48a05560
  4. 03 12月, 2014 2 次提交
    • J
      Replace virDomainSnapshotFree with virObjectUnref · c8230c4d
      John Ferlan 提交于
      Since virDomainSnapshotFree will call virObjectUnref anyway, let's just use
      that directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      c8230c4d
    • J
      Replace virDomainFree with virObjectUnref · 8fb3aee2
      John Ferlan 提交于
      Since virDomainFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      8fb3aee2
  5. 02 12月, 2014 1 次提交
  6. 01 12月, 2014 2 次提交
  7. 28 11月, 2014 1 次提交
    • M
      qemu: Don't track quiesced state of FSs · 6085d917
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160084
      
      As of b6d4dad1 (1.2.5) we are trying to keep the status of FSFreeze
      in the guest. Even though I've tried to fixed couple of corner cases
      (6ea54769), it occurred to me just recently, that the approach is
      broken by design. Firstly, there are many other ways to talk to
      qemu-ga (even through libvirt) that filesystems can be thawed (e.g.
      qemu-agent-command) without libvirt noticing. Moreover, there are
      plenty of ways to thaw filesystems without even qemu-ga noticing (yes,
      qemu-ga keeps internal track of FSFreeze status). So, instead of
      keeping the track ourselves, or asking qemu-ga for stale state, it's
      the best to let qemu-ga deal with that (and possibly let guest kernel
      propagate an error).
      
      Moreover, there's one bug with the following approach, if fsfreeze
      command failed, we've executed fsthaw subsequently. So issuing
      domfsfreeze in virsh gave the following result:
      
      virsh # domfsfreeze gentoo
      Froze 1 filesystem(s)
      
      virsh # domfsfreeze gentoo
      error: Unable to freeze filesystems
      error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance
      
      virsh # domfsfreeze gentoo
      Froze 1 filesystem(s)
      
      virsh # domfsfreeze gentoo
      error: Unable to freeze filesystems
      error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6085d917
  8. 24 11月, 2014 2 次提交
  9. 21 11月, 2014 2 次提交
    • P
      qemu: Add handling for VSERPORT_CHANGE event · 15bbaaf0
      Peter Krempa 提交于
      New qemu added a new event that is emitted when a virtio serial channel
      is opened in the guest OS. This allows us to update the state of the
      port in the output-only XML element.
      
      This patch implements the monitor callbacks and necessary handlers to
      update the state in the definition.
      15bbaaf0
    • P
      storage: qemu: Fix security labelling of new image chain elements · 7e130e8b
      Peter Krempa 提交于
      When creating a disk image snapshot the libvirt code would blindly copy
      the parents label to the newly created image. This runs into problems
      when you start a VM from an image hosted on NFS (or other storage system
      that doesn't support selinux labels) and the snapshot destination is on
      a storage system that does support selinux labels. Libvirt's code in
      that case generates a different security label for the image hosted on
      NFS. This label is valid only for NFS images and doesn't allow access in
      case of a locally stored image.
      
      To fix this issue libvirt needs to refrain from copying security
      information in cases where the default domain seclabel is a better
      choice.
      
      This patch repurposes the now unused @force argument of
      virStorageSourceInitChainElement to denote whether a copy of the
      security labelling stuff should be attempted or not. This allows to
      fine-control the copy operation for cases where we need to keep the
      label of the old disk vs. the cases where we need to keep the label
      unset to use the default domain imagelabel.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1151718
      7e130e8b
  10. 19 11月, 2014 1 次提交
    • E
      maint: forbid 'int foo = true' · eb909376
      Eric Blake 提交于
      I noticed this while working on qemuDomainGetBlockInfo.  Assigning
      a bool value to an int variable compiles fine, but raises red flags
      on the maintenance front as it becomes too easy to assign -1 or 2
      or any other non-bool value to the same variable.
      
      * cfg.mk (sc_prohibit_int_assign_bool): New rule.
      * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
      offenders.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotCreateXML): Likewise.
      * src/test/test_driver.c (testDomainSnapshotAlignDisks):
      Likewise.
      * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
      * src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
      * src/util/virutil.c (virIsCapableVport): Likewise.
      * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
      * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
      (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
      (cmdDetachInterface): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eb909376
  11. 15 11月, 2014 3 次提交
  12. 13 11月, 2014 1 次提交
  13. 12 11月, 2014 1 次提交
  14. 11 11月, 2014 1 次提交
  15. 06 11月, 2014 3 次提交
  16. 03 11月, 2014 2 次提交
  17. 29 10月, 2014 3 次提交
  18. 28 10月, 2014 1 次提交
    • E
      qemu: forbid snapshot-delete --children-only on external snapshot · 2086a990
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=956506 documents that
      given a domain where an internal snapshot parent has an external
      snapshot child, we lacked a safety check when trying to use the
      --children-only option to snapshot-delete:
      
      $ virsh start dom
      $ virsh snapshot-create-as dom internal
      $ virsh snapshot-create-as dom external --disk-only
      $ virsh snapshot-delete dom external
      error: Failed to delete snapshot external
      error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
      $ virsh snapshot-delete dom internal --children
      error: Failed to delete snapshot internal
      error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
      $ virsh snapshot-delete dom internal --children-only
      Domain snapshot internal children deleted
      
      While I'd still like to see patches that actually do proper external
      snapshot deletion, we should at least fix the inconsistency in the
      meantime.  With this patch:
      
      $ virsh snapshot-delete dom internal --children-only
      error: Failed to delete snapshot internal
      error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDelete): Fix condition.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2086a990
  19. 23 10月, 2014 2 次提交
    • D
      Rename virDriver to virHypervisorDriver · 931dff99
      Daniel P. Berrange 提交于
      To prepare for introducing a single global driver, rename the
      virDriver struct to virHypervisorDriver and the registration
      API to virRegisterHypervisorDriver()
      931dff99
    • E
      qemu: Disallow NUMA/network tuning for session mode · 43b67f2e
      Erik Skultety 提交于
      Tuning NUMA or network interface parameters requires root
      privileges to manage cgroups. Thus an attempt to set some of these
      parameters in session mode on a running domain should be invalid
      followed by an error. An example might be memory tuning which raises
      an error in such case.
      
      The following behavior in session mode will be present after applying
      this patch:
      
        Tuning  |      SET      |   GET  |
      ----------|---------------|--------|
      NUMA      | shut off only | always |
      Memory    |     never     | never  |
      Interface |     never     | always |
      
      Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1126762
      43b67f2e
  20. 22 10月, 2014 1 次提交
  21. 21 10月, 2014 1 次提交
    • L
      qemu: x86_64 is good enough for i686 · afe8f420
      Lubomir Rintel 提交于
      virt-manager on Fedora sets up i686 hosts with "/usr/bin/qemu-kvm" emulator,
      which in turn unconditionally execs qemu-system-x86_64 querying capabilities
      then fails:
      
      Error launching details: invalid argument: architecture from emulator 'x86_64' doesn't match given architecture 'i686'
      
      Traceback (most recent call last):
        File "/usr/share/virt-manager/virtManager/engine.py", line 748, in _show_vm_helper
          details = self._get_details_dialog(uri, vm.get_connkey())
        File "/usr/share/virt-manager/virtManager/engine.py", line 726, in _get_details_dialog
          obj = vmmDetails(conn.get_vm(connkey))
        File "/usr/share/virt-manager/virtManager/details.py", line 399, in __init__
          self.init_details()
        File "/usr/share/virt-manager/virtManager/details.py", line 784, in init_details
          domcaps = self.vm.get_domain_capabilities()
        File "/usr/share/virt-manager/virtManager/domain.py", line 518, in get_domain_capabilities
          self.get_xmlobj().os.machine, self.get_xmlobj().type)
        File "/usr/lib/python2.7/site-packages/libvirt.py", line 3492, in getDomainCapabilities
          if ret is None: raise libvirtError ('virConnectGetDomainCapabilities() failed', conn=self)
      libvirtError: invalid argument: architecture from emulator 'x86_64' doesn't match given architecture 'i686'
      
      Journal:
      
      Oct 16 21:08:26 goatlord.localdomain libvirtd[1530]: invalid argument: architecture from emulator 'x86_64' doesn't match given architecture 'i686'
      afe8f420
  22. 15 10月, 2014 4 次提交