1. 08 2月, 2016 3 次提交
    • P
      conf: Move and optimize disk target duplicity checking · e84ab793
      Peter Krempa 提交于
      Move the logic from virDomainDiskDefDstDuplicates into
      virDomainDiskDefCheckDuplicateInfo so that we don't have to loop
      multiple times through the array of disks. Since the original function
      was called in qemuBuildDriveDevStr, it was actually called for every
      single disk which was quite wasteful.
      
      Additionally the target uniqueness check needed to be duplicated in
      the disk hotplug case, since the disk was inserted into the domain
      definition after the device string was formatted and thus
      virDomainDiskDefDstDuplicates didn't do anything in that case.
      e84ab793
    • P
      qemu: snapshot: Avoid infinite loop if vCPUs can't be resumed · 986831a8
      Peter Krempa 提交于
      In b3d2a42e I've refactored the code and moved the 'cleanup' label.
      Unfortunately the code that was originally in the 'endjob' label and
      wanted to jump to cleanup is now in the cleanup label. Remove the jump
      and let the function finish.
      986831a8
    • P
      qemu: snapshot: Don't overwrite existing errors when thawing filesystems · a9839fe0
      Peter Krempa 提交于
      If we are attempting to thaw the filesystems on error, the code would
      overwrite the error code that caused the snapshot to fail with the error
      of thawing the filesystem. Since the thawing function allows control of
      error reporting behavior we can use this feature.
      a9839fe0
  2. 05 2月, 2016 2 次提交
  3. 04 2月, 2016 1 次提交
    • J
      conf: add caps to virDomainSaveConfig · cd57b7c7
      Joao Martins 提交于
      virDomainSaveConfig calls virDomainDefFormat which was setting the caps
      to NULL, thus keeping the old behaviour (i.e. not looking at
      netprefix). This patch adds the virCapsPtr to the function and allows
      the configuration to be saved and skipping interface names that were
      registered with virCapabilitiesSetNetPrefix().
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      cd57b7c7
  4. 03 2月, 2016 4 次提交
  5. 01 2月, 2016 1 次提交
  6. 28 1月, 2016 1 次提交
  7. 26 1月, 2016 2 次提交
    • D
      qemu: add reporting of vCPU wait time · 511e7c5b
      Daniel P. Berrange 提交于
      The VIR_DOMAIN_STATS_VCPU flag to virDomainListGetStats
      enables reporting of stats about vCPUs. Currently we
      only report the cumulative CPU running time and the
      execution state.
      
      This adds reporting of the wait time - time the vCPU
      wants to run, but the host scheduler has something else
      running ahead of it.
      
      The data is reported per-vCPU eg
      
      $ virsh domstats --vcpu demo
       Domain: 'demo'
         vcpu.current=4
         vcpu.maximum=4
         vcpu.0.state=1
         vcpu.0.time=1420000000
         vcpu.0.wait=18403928
         vcpu.1.state=1
         vcpu.1.time=130000000
         vcpu.1.wait=10612111
         vcpu.2.state=1
         vcpu.2.time=110000000
         vcpu.2.wait=12759501
         vcpu.3.state=1
         vcpu.3.time=90000000
         vcpu.3.wait=21825087
      
      In implementing this I notice our reporting of CPU execute
      time has very poor granularity, since we are getting it
      from /proc/$PID/stat. As a future enhancement we should
      prefer to get CPU execute time from /proc/$PID/schedstat
      or /proc/$PID/sched (if either exist on the running kernel)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      511e7c5b
    • P
      (qemu|lxc)DomainGetCPUStats: Clean up · 51f07d8f
      Peter Krempa 提交于
      Remove unnecessary condition and variable.
      51f07d8f
  8. 21 1月, 2016 1 次提交
    • D
      qemuDomainReboot: use fakeReboot=true only for acpi mode · e2b86f58
      Dmitry Andreev 提交于
      When acpi is used to reboot/shutdown qemu domain, qemu emits
      SHUTDOWN event. Libvirt uses fakeReboot variable in order to
      differentiate reboot or shutdown. fakeReboot value is reseted
      to false after domain restart/reset.
      
      When mode=agent is used to reboot qemu domain, qemu doesn't emit
      SHUTDOWN event and libvirt doesn't reset fakeReboot value to false.
      In this case next 'shutdown -h now' performs reboot. That's why
      we don't need to set fakeReboot=true for mode=agent.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      e2b86f58
  9. 12 1月, 2016 1 次提交
    • M
      qemu: Set virtio channel state sooner · 2f504455
      Michal Privoznik 提交于
      In qemu driver we listen to virtio channel events like an agent
      connected to or disconnected from the guest part of socket.
      However, with a little exception - when we find out that the
      socket in question is the guest agent one, we connect or
      disconnect guest agent which is done prior setting new state in
      internal structure. Due to a bug in our code it may happen that
      we got the event but failed to set it in internal structure
      representing the channel.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2f504455
  10. 09 1月, 2016 3 次提交
  11. 07 1月, 2016 1 次提交
  12. 05 1月, 2016 1 次提交
    • M
      qemu: Fix return value of qemuDomainGetBlockJobInfo · 783b2544
      Michal Privoznik 提交于
      While reviewing 1b43885d I've noticed a virReportError()
      followed by a goto endjob; without setting the correct return
      value. Problem is, if block job is so fast that it's bandwidth
      does not fit into ulong, an error is reported. However, by that
      time @ret is already set to 1 which means success. Since the
      scenario can be hardly considered successful, we should return a
      value meaning error.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      783b2544
  13. 04 1月, 2016 1 次提交
    • M
      qemu: do not copy out non-existent block job info · 1b43885d
      Michael Chapman 提交于
      Valgrind complained:
      
      ==23975== Conditional jump or move depends on uninitialised value(s)
      ==23975==    at 0x22255FA6: qemuDomainGetBlockJobInfo (qemu_driver.c:16538)
      ==23975==    by 0x538E97C: virDomainGetBlockJobInfo (libvirt-domain.c:9685)
      ==23975==    by 0x12F740: remoteDispatchDomainGetBlockJobInfoHelper (remote.c:2834)
      ==23975==    by 0x53FF287: virNetServerProgramDispatch (virnetserverprogram.c:437)
      ==23975==    by 0x540523D: virNetServerProcessMsg (virnetserver.c:135)
      ==23975==    by 0x54052C7: virNetServerHandleJob (virnetserver.c:156)
      ==23975==    by 0x52F515B: virThreadPoolWorker (virthreadpool.c:145)
      ==23975==    by 0x52F4668: virThreadHelper (virthread.c:206)
      ==23975==    by 0x6E08A50: start_thread (in /lib64/libpthread-2.12.so)
      ==23975==    by 0x82BE93C: clone (in /lib64/libc-2.12.so)
      ==23975==
      ==23975== Conditional jump or move depends on uninitialised value(s)
      ==23975==    at 0x22255FB4: qemuDomainGetBlockJobInfo (qemu_driver.c:16542)
      ==23975==    by 0x538E97C: virDomainGetBlockJobInfo (libvirt-domain.c:9685)
      ==23975==    by 0x12F740: remoteDispatchDomainGetBlockJobInfoHelper (remote.c:2834)
      ==23975==    by 0x53FF287: virNetServerProgramDispatch (virnetserverprogram.c:437)
      ==23975==    by 0x540523D: virNetServerProcessMsg (virnetserver.c:135)
      ==23975==    by 0x54052C7: virNetServerHandleJob (virnetserver.c:156)
      ==23975==    by 0x52F515B: virThreadPoolWorker (virthreadpool.c:145)
      ==23975==    by 0x52F4668: virThreadHelper (virthread.c:206)
      ==23975==    by 0x6E08A50: start_thread (in /lib64/libpthread-2.12.so)
      ==23975==    by 0x82BE93C: clone (in /lib64/libc-2.12.so)
      
      If no matching block job is found, qemuMonitorGetBlockJobInfo returns 0
      and we should not write anything to the caller-supplied
      virDomainBlockJobInfo pointer.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      1b43885d
  14. 21 12月, 2015 1 次提交
    • A
      pci: Introduce virPCIStubDriver enumeration · 6d9cdd2a
      Andrea Bolognani 提交于
      This replaces the virPCIKnownStubs string array that was used
      internally for stub driver validation.
      
      Advantages:
      
        * possible values are well-defined
        * typos in driver names will be detected at compile time
        * avoids having several copies of the same string around
        * no error checking required when setting / getting value
      
      The names used mirror those in the
      virDomainHostdevSubsysPCIBackendType enumeration.
      6d9cdd2a
  15. 17 12月, 2015 2 次提交
    • J
      qemu_hotplug: remove qemuDomainAttachDeviceControllerLive · aaa42d90
      Ján Tomko 提交于
      This function calls qemuDomainAttachControllerDevice for SCSI
      controllers and reports an error for all other controllers.
      
      Move the error inside qemuDomainAttachControllerDevice and delete this
      wrapper.
      aaa42d90
    • J
      qemu: Fix event generated for qemuDomainRevertToSnapshot (pause->run) · 5efcfb96
      John Ferlan 提交于
      A closer review of the code shows that for the transition from paused to
      running which was supposed to emit the VIR_DOMAIN_EVENT_RESUMED - no event
      would be generated. Rather the event is generated when going from running
      to running.
      
      Following the 'was_running' boolean shows it is set when the domain obj
      is active and the domain obj state is VIR_DOMAIN_RUNNING. So rather than
      using was_running to generate the RESUMED event, use !was_running
      5efcfb96
  16. 09 12月, 2015 15 次提交