1. 24 6月, 2011 3 次提交
    • D
      Add infrastructure to automatically destroy guests when a connection closes · 558b7fd0
      Daniel P. Berrange 提交于
      Sometimes it is useful to be able to automatically destroy a guest when
      a connection is closed. For example, kill an incoming migration if
      the client managing the migration dies. This introduces a map between
      guest 'uuid' strings and virConnectPtr objects. When a connection is
      closed, any associated guests are killed off.
      
      * src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
        for performing autokill of guests associated with a connection
      * src/qemu/qemu_driver.c: Initialize autodestroy map
      558b7fd0
    • D
      Support reboots with the QEMU driver · 42f43592
      Daniel P. Berrange 提交于
      For controlled shutdown we issue a 'system_powerdown' command
      to the QEMU monitor. This triggers an ACPI event which (most)
      guest OS wire up to a controlled shutdown. There is no equiv
      ACPI event to trigger a controlled reboot. This patch attempts
      to fake a reboot.
      
       - In qemuDomainObjPrivatePtr we have a bool fakeReboot
         flag.
       - The virDomainReboot method sets this flag and then
         triggers a normal 'system_powerdown'.
       - The QEMU process is started with '-no-shutdown'
         so that the guest CPUs pause when it powers off the
         guest
       - When we receive the 'POWEROFF' event from QEMU JSON
         monitor if fakeReboot is not set we invoke the
         qemuProcessKill command and shutdown continues
         normally
       - If fakeReboot was set, we spawn a background thread
         which issues 'system_reset' to perform a warm reboot
         of the guest hardware. Then it issues 'cont' to
         start the CPUs again
      
      * src/qemu/qemu_command.c: Add -no-shutdown flag if
        we have JSON support
      * src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
        qemuDomainObjPrivate struct
      * src/qemu/qemu_driver.c: Fake reboot using the
        system_powerdown command if JSON support is available
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        binding for system_reset command
      * src/qemu/qemu_process.c: Reset the guest & start CPUs if
        fakeReboot is set
      42f43592
    • E
      build: avoid compiler failure · ab228c81
      Eric Blake 提交于
      GCC complained about a C99 for-loop declaration outside of C99 mode
      when compiling on RHEL 5.
      
      * src/qemu/qemu_driver.c (qemudDomainPinVcpuFlags): Avoid C99 for
      loop, since gcc 4.1.2 hates it.
      ab228c81
  2. 23 6月, 2011 2 次提交
  3. 22 6月, 2011 2 次提交
    • O
      qemu: Fix one memory leak · 20d5e9db
      Osier Yang 提交于
      * src/qemu/qemu_domain.c: (qemuDomainAppendLog)
      
        Free "message" in "cleanup".
      20d5e9db
    • M
      qemu: domain I/O asynchronous handling · 017abcbb
      Michal Privoznik 提交于
      For virtio disks and interfaces, qemu allows users to enable or disable
      ioeventfd feature. This means, qemu can execute domain code, while
      another thread waits for I/O event. Basically, in some cases it is win,
      in some loss. This feature is available via 'ioeventfd' attribute in disk
      and interface <driver> element. It accepts 'on' and 'off'. Leaving this
      attribute out defaults to hypervisor decision.
      017abcbb
  4. 21 6月, 2011 2 次提交
    • D
      set and restore MAC address of a NIC when using PASSTHROUGH mode · cbd8227e
      Dirk Herrendoerfer 提交于
      The following patch addresses the problem that when a PASSTHROUGH
      mode DIRECT NIC connection is made the MAC address of the NIC is
      not automatically set and reset to the configured VM MAC and
      back again.
      
      The attached patch fixes this problem by setting and resetting the MAC
      while remembering the previous setting while the VM is running.
      This also works if libvirtd is restarted while the VM is running.
      
      the patch passes make syntax-check
      cbd8227e
    • C
      Promote virEvent*Handle/Timeout to public API · 6094ad7b
      Cole Robinson 提交于
      Since we virEventRegisterDefaultImpl is now a public API, callers need
      a way to invoke the default registered Handle and Timeout functions. We
      already have general functions for these internally, so promote
      them to the public API.
      
      v2:
          Actually add APIs to libvirt.h
      6094ad7b
  5. 20 6月, 2011 4 次提交
  6. 17 6月, 2011 2 次提交
  7. 15 6月, 2011 6 次提交
    • J
      qemu: Translate boot config into bootindex if possible · c3068d4d
      Jiri Denemark 提交于
      Prefer bootindex=N option for -device over the old way -boot ORDER
      possibly accompanied with boot=on option for -drive. This gives us full
      control over which device will actually be used for booting guest OS.
      Moreover, if qemu doesn't support boot=on, this is the only way to boot
      of certain disks in some configurations (such as virtio disks when used
      together IDE disks) without transforming domain XML to use per device
      boot elements.
      c3068d4d
    • A
      Asynchronous event for BlockPull completion · 12cd77a0
      Adam Litke 提交于
      When an operation started by virDomainBlockPullAll completes (either with
      success or with failure), raise an event to indicate the final status.  This
      allows an API user to avoid polling on virDomainBlockPullInfo if they would
      prefer to use the event mechanism.
      
      * daemon/remote.c: Dispatch events to client
      * include/libvirt/libvirt.h.in: Define event ID and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle the new event
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block_stream completion and emit a libvirt block pull event
      * src/remote/remote_driver.c: Receive and dispatch events to application
      * src/remote/remote_protocol.x: Wire protocol definition for the event
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
        from QEMU monitor
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      12cd77a0
    • A
      Implement virDomainBlockPull for the qemu driver · 784ee08d
      Adam Litke 提交于
      The virDomainBlockPull* family of commands are enabled by the
      'block_stream' and 'info block_stream' qemu monitor commands.
      
      * src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement disk
        streaming by using the stream and info stream text monitor commands
      * src/qemu/qemu_monitor_json.[ch]: implement commands using the qmp monitor
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Acked-by: NDaniel P. Berrange <berrange@redhat.com>
      784ee08d
    • M
      spice: add <clipboard copypaste='yes|no'> option · 98bfdff1
      Marc-André Lureau 提交于
      From a security pov copy and paste between the guest and the client is not
      always desirable. So we need to be able to enable/disable this. The best place
      to do this from an administration pov is on the hypervisor, so the qemu cmdline
      is getting a spice disable-copy-paste option, see bug 693645. Example qemu
      invocation:
      qemu -spice port=5932,disable-ticketing,disable-copy-paste
      
      https://bugzilla.redhat.com/show_bug.cgi?id=693661
      98bfdff1
    • M
      virNodeGetMemoryStats: Implement linux support · af35cece
      Minoru Usui 提交于
      Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      af35cece
    • M
      virNodeGetCPUStats: Implement linux support · ce76e853
      Minoru Usui 提交于
      Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      ce76e853
  8. 14 6月, 2011 6 次提交
    • C
      qemu: Fix parsing 'info chardev' · c0980a3a
      Cole Robinson 提交于
      If qemu supports -chardev, our char frontend aliases are ex. 'charserial0'
      not just 'serial0'. Typically we don't use this code path because the
      pty's are scraped from stdout.
      c0980a3a
    • C
      qemu: Scrape stdout for virtio console pty · d0b1a9a0
      Cole Robinson 提交于
      Currently we forget to do this and have to fallback to info chardev (which
      also fails, see following patch)
      d0b1a9a0
    • O
      qemu: Parse current balloon value returned by query_balloon · 41514f7b
      Osier Yang 提交于
      Qemu once supported following memory stats which will returned by
      "query_balloon":
      
          stat_put(dict, "actual", actual);
          stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);
          stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);
          stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);
          stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);
          stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);
          stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);
      
      But it later disabled all the stats except "actual" by commit
      07b0403dfc2b2ac179ae5b48105096cc2d03375a.
      
      libvirt doesn't parse "actual", so user will always see a empty result
      with "virsh dommemstat $domain". Even qemu haven't disabled the stats,
      we should support parsing "actual".
      41514f7b
    • T
      vcpupin: Fix cpu affinity setting bug of qemu driver · d5f3320d
      Taku Izumi 提交于
      There is the case where cpu affinites for vcpu of qemu doesn't work
      correctly. For example, if only one vcpupin setting entry is provided
      and its setting is not for vcpu0, it doesn't work.
      
         # virsh dumpxml VM
         ...
         <vcpu>4</vcpu>
         <cputune>
           <vcpupin vcpu='3' cpuset='9-11'/>
         </cputune>
         ...
      
         # virsh start VM
         Domain VM started
      
         # virsh vcpuinfo VM
         VCPU:           0
         CPU:            31
         State:          running
         CPU time:       2.5s
         CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      
         VCPU:           1
         CPU:            12
         State:          running
         CPU time:       0.9s
         CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      
         VCPU:           2
         CPU:            30
         State:          running
         CPU time:       1.5s
         CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      
         VCPU:           3
         CPU:            13
         State:          running
         CPU time:       1.7s
         CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
      
      This patch fixes this problem.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      d5f3320d
    • H
      Deprecate several CURRENT/LIVE/CONFIG enums · fbd7820b
      Hu Tao 提交于
      This patch deprecates following enums:
      
      VIR_DOMAIN_MEM_CURRENT
      VIR_DOMAIN_MEM_LIVE
      VIR_DOMAIN_MEM_CONFIG
      
      VIR_DOMAIN_VCPU_LIVE
      VIR_DOMAIN_VCPU_CONFIG
      
      VIR_DOMAIN_DEVICE_MODIFY_CURRENT
      VIR_DOMAIN_DEVICE_MODIFY_LIVE
      VIR_DOMAIN_DEVICE_MODIFY_CONFIG
      
      And modify internal codes to use virDomainModificationImpact.
      fbd7820b
    • S
      qemu: Faster response time to qemu startup errors · f5358fdc
      Stefan Berger 提交于
      The below patch decreases the response time of libvirt to errors reported by Qemu upon startup by checking whether the qemu process is still alive while polling for the local socket to show up.
      
      This patch also introduces a special handling of signal for the Win32 part of virKillProcess.
      f5358fdc
  9. 13 6月, 2011 9 次提交
  10. 10 6月, 2011 1 次提交
  11. 08 6月, 2011 3 次提交
    • E
      build: break some long lines · d7814b21
      Eric Blake 提交于
      As long as I was already touching the function...
      
      * src/qemu/qemu_hotplug.c (qemuDomainChangeGraphics): Line wrap.
      d7814b21
    • E
      qemu: add missing break statement · ddc5b158
      Eric Blake 提交于
      Detected by Coverity.  Bug introduced in commit 9d73efdb (v0.8.8).
      
      * src/qemu/qemu_hotplug.c (qemuDomainChangeGraphics): Don't report
      error on success.
      ddc5b158
    • E
      qemu: reorder checks for safety · 4eb17d64
      Eric Blake 提交于
      Detected by Coverity.  All existing callers happen to be in
      range, so this isn't too serious.
      
      * src/qemu/qemu_cgroup.c (qemuCgroupControllerActive): Check
      bounds before dereference.
      4eb17d64