Blocked revisions 4470,4505,4541 via svnmerge
commit26bb5c954a8f6df2335dd9000ebb3c72e66b9d93
authorAvi Kivity <avi@qumranet.com>
Tue, 20 Mar 2007 11:08:51 +0000 (20 11:08 +0000)
committerAvi Kivity <avi@qumranet.com>
Tue, 20 Mar 2007 11:08:51 +0000 (20 11:08 +0000)
treed6522436eb547887115fbd0c4dbaa283563f0406
parentb95c18c2ba2a06ee8d184131da0818fe7b13ea9c
Blocked revisions 4470,4505,4541 via svnmerge

................
  r4470 | avi | 2007-02-22 11:40:41 +0200 (Thu, 22 Feb 2007) | 39 lines

  kvm: userspace interface: merge from trunk

  ........
    r4462 | uri | 2007-02-21 13:40:37 +0200 (Wed, 21 Feb 2007) | 2 lines

    qemu migration: if connect() was interrupted by a signal, try again.
  ........
    r4464 | avi | 2007-02-21 18:08:00 +0200 (Wed, 21 Feb 2007) | 2 lines

    kvm: libkvm: add -Wall to compilation flags
  ........
    r4465 | avi | 2007-02-21 18:11:11 +0200 (Wed, 21 Feb 2007) | 2 lines

    kvm: libkvm: fix some warnings
  ........
    r4466 | avi | 2007-02-21 18:15:39 +0200 (Wed, 21 Feb 2007) | 2 lines

    kvm: libkvm: fix some more warnings
  ........
    r4467 | avi | 2007-02-21 18:20:36 +0200 (Wed, 21 Feb 2007) | 4 lines

    kvm: configure: better fix for --kerneldir

    From: Muli Ben-Yehuda <muli@il.ibm.com>
  ........
    r4468 | avi | 2007-02-21 19:53:02 +0200 (Wed, 21 Feb 2007) | 2 lines

    kvm: libkvm: merge kvm userspace interface changes
  ........
    r4469 | avi | 2007-02-21 20:50:23 +0200 (Wed, 21 Feb 2007) | 7 lines

    kvm: configure: fix bogus quoting

    config.mak is a Makefile, not a bash script, and thus won't strip
    the quotes.

    Thanks to Muli for noticing that I applied the wrong patch.
  ........
................
  r4505 | avi | 2007-03-06 13:47:06 +0200 (Tue, 06 Mar 2007) | 184 lines

  kvm: userspace interface: merge from trunk

  ........
    r4472 | avi | 2007-02-22 14:01:31 +0200 (Thu, 22 Feb 2007) | 4 lines

    kvm: external module: hack source not to use f_path

    only present in newer kernels.
  ........
    r4473 | uri | 2007-02-22 16:28:31 +0200 (Thu, 22 Feb 2007) | 4 lines

    kvm: external module: replace f_mnt with f_vfsmnt (for 'struct file')

    ‘struct file’ has no member named ‘f_mnt’.
  ........
    r4474 | uri | 2007-02-22 19:05:41 +0200 (Thu, 22 Feb 2007) | 18 lines

    user: add dirty-pages-logging enable/reset support existing memory regions

    The memory regions' parameters are kept in kvm_context.
    Enable (all regions):
        When the user request to enable dirty-pages-logging, a request is sent to
            for all memory regions for which dirty-page-logging is disabled.
        The enable request is sent to the kvm module (KVM_SET_MEMORY_REGION ioctl)
            with the region's original (at create time) parameters and with
            KVM_MEM_LOG_DIRTY_PAGES on.
    Reset:
        Reset dirty-pages-logging of all regions to their original settings (at
            create time).
        The disable request is sent to the kvm module (KVM_SET_MEMORY_REGION ioctl)
            with the region's original (at create time) parameters, for all memory
            regions for which an enable-request was sent during Enable above (
            all the memory regions which at create time had dirty-page-logging
            disabled).
  ........
    r4476 | uri | 2007-02-22 20:13:42 +0200 (Thu, 22 Feb 2007) | 6 lines

    qemu-kvm: add functions to enable/disable/get kvm's dirty pages logging

    enable/disable are done using kvm_physical_memory_set_dirty_tracking
    get is done using kvm_update_dirty_pages_log which gets kvm's dirty pages
            bitmap and updates qemu dirty pages bytemap.
  ........
    r4477 | uri | 2007-02-22 20:15:07 +0200 (Thu, 22 Feb 2007) | 2 lines

    qemu: dirty page logging enable/disable: add support for kvm
  ........
    r4478 | uri | 2007-02-22 20:29:29 +0200 (Thu, 22 Feb 2007) | 5 lines

    qemu migration: initialize uninitialized variable

    Used uninitialized if an error occurred.
    Mainly to avoid compiler warning, since there was an error anyways.
  ........
    r4479 | uri | 2007-02-22 20:53:38 +0200 (Thu, 22 Feb 2007) | 9 lines

    kvm migration: add support for kvm live migration.

    cpu_physical_memory_set_dirty_tracking() now enables/disables kvm's
            dirty-pages-logging
    Using kvm_update_dirty_pages_log() all dirty pages are logged in qemu's
            dirty pages bytemap, and all those pages are retransmitted.

    Also added 'return 0' to start_migration if everything is OK.
  ........
    r4480 | dor | 2007-02-23 02:01:49 +0200 (Fri, 23 Feb 2007) | 3 lines

    Add bonding support for the bridging script.
    Now it automatically detect bonding driver existance and use it instead of the physical interface.
  ........
    r4482 | avi | 2007-02-25 14:38:58 +0200 (Sun, 25 Feb 2007) | 6 lines

    kvm: rpm: build rpm through srpm instead of relying on precompiled binaries

    since the rpm --prefix -s /usr/kvm and the default --prefix is /usr/local, we
    can't reuse the result of a compilation to generate an rpm.  so build and srpm
    and compile that.
  ........
    r4483 | avi | 2007-02-26 11:08:05 +0200 (Mon, 26 Feb 2007) | 2 lines

    kvm: don't sync *.mod.c files from kernel repo
  ........
    r4484 | uri | 2007-02-26 16:05:24 +0200 (Mon, 26 Feb 2007) | 10 lines

    qemu migration: comparing guest memory on src/dst hosts (ifdef MIGRATION_VERIFY)
    Guest memory compare is done by calculating a simple checksum for each page of
        the guest by both hosts, sending it from src to dst and comparing it on the
        dst.
    Migration status does not depend on memory compare results, it's for debugging
        purpose only.

    An alternative to ifdef is to add a verify-option (e.g. -v) to qemu migrate
        command.
  ........
    r4485 | avi | 2007-02-26 16:09:01 +0200 (Mon, 26 Feb 2007) | 4 lines

    kvm: external module: adapt to 2.6.16's get_sb() callback

    based on patch from Gerd Hoffman <kraxel@suse.de>
  ........
    r4486 | uri | 2007-02-26 19:47:30 +0200 (Mon, 26 Feb 2007) | 16 lines

    qemu migration: save/load usb-uhci (re-commit of 4259)

    Re-Commit of 4259, with adaptation to pci save/load functions of qemu 0.9.0

    Below is a copy of the snv-log of 4259:
    qemu savevm: save/load usb-uhci (#154)

    This includes "usbdevice tablet".

    from Lonnie Mendez on the qemu-devel mailing list (adjusted to qemu 0.8.2):
    http://lists.gnu.org/archive/html/qemu-devel/2006-11/msg00239.html
    It is mentioned that "The code will only work well if you remove all usb
    devices attached to the guest prior to saving the vm state."
    It was working for me even without removing, but need more testing.
  ........
    r4490 | dor | 2007-03-01 11:19:40 +0200 (Thu, 01 Mar 2007) | 2 lines

    Now that all of qemu's addons (bios, keymaps,..) are inside the kvm rpm there is no need to be depended on qemu)
  ........
    r4491 | avi | 2007-03-01 14:07:57 +0200 (Thu, 01 Mar 2007) | 2 lines

    kvm: external module: adapt to KVMFS_SUPER_MAGIC now living in magic.h
  ........
    r4493 | avi | 2007-03-04 13:30:33 +0200 (Sun, 04 Mar 2007) | 2 lines

    kvm: external module: workaround for KVM_MINOR not present in older kernels
  ........
    r4496 | uri | 2007-03-04 21:44:38 +0200 (Sun, 04 Mar 2007) | 4 lines

    qemu: adding a command line option -no-rtc to not use rtc for (host) timer alarm (#259)

    Using gettimeofday() instead.
  ........
    r4497 | uri | 2007-03-05 11:54:47 +0200 (Mon, 05 Mar 2007) | 2 lines

    kvm kernel (svn): make sync: copy include/linux/magic.h
  ........
    r4498 | uri | 2007-03-05 12:47:50 +0200 (Mon, 05 Mar 2007) | 2 lines

    qemu: fix condition for -no-rtc command line option (fixes rev 4496) (#259)
  ........
    r4499 | itaish | 2007-03-05 13:10:18 +0200 (Mon, 05 Mar 2007) | 1 line

    Support for –balloon command line.
  ........
    r4500 | uri | 2007-03-05 15:08:57 +0200 (Mon, 05 Mar 2007) | 5 lines

    kvm kernel (svn): make sync: revert rev 4497

    To be replaced with a conditional inclusion of magic.h in
        external-module-compat.h
  ........
    r4501 | uri | 2007-03-05 15:41:55 +0200 (Mon, 05 Mar 2007) | 8 lines

    kvm: adding include/linux/magic.h

    This file is currently a copy of linux-tree/include/linux/magic.h
    By adding magic.h to our svn repository we make sure it is always "includable".

    This is a better solution than the one described in the log of rev 4500,
        since kvm_main.c also includes linux/magic.h.
  ........
    r4503 | avi | 2007-03-06 12:10:42 +0200 (Tue, 06 Mar 2007) | 11 lines

    kvm: qemu: report the host's cpu vendor to the guest

    x86_64 Linux uses the vendor ID as a means to select between sysenter and
    syscall as the vdso kernel entry instruction for comaptibility mode (32-bit
    userspace).  Because syscall is not supported in Intel's implementation of
    compatibility mode, and sysenter is not supported in AMD's implementation of
    compatibility mode, we can't have a least-common-denominator setting.

    This is bad news for inter-vendor migration, at least for 32-on-64 setups.
    Maybe we can trap the #UD and emulate the offending instruction.  Yuck.
  ........
    r4504 | avi | 2007-03-06 13:41:52 +0200 (Tue, 06 Mar 2007) | 4 lines

    kvm: qemu: re-apply r4257 (register sync for monitor commands)

    fell victim to the qemu 0.9.0 merge.
  ........
................
  r4541 | avi | 2007-03-18 15:15:32 +0200 (Sun, 18 Mar 2007) | 222 lines

  kvm: userspace interface: merge from trunk

  ................
    r4510 | uri | 2007-03-06 19:01:06 +0200 (Tue, 06 Mar 2007) | 4 lines

    qemu live migration: send announce-self-packets only on tap interfaces.

    The guest does not need to receive those packets.
  ................
    r4511 | avi | 2007-03-07 09:10:04 +0200 (Wed, 07 Mar 2007) | 2 lines

    kvm: qemu: workaround bogus __user in Linux usb header on some distros
  ................
    r4513 | uri | 2007-03-07 15:54:09 +0200 (Wed, 07 Mar 2007) | 10 lines

    qemu migration: homogeneous pages optimization

    If all the bytes of a page are the same (homogeneous page) there is no need to
        send the whole page, a single byte is enough.
    Using 32-bit ints instead of bytes to optimize even more (faster and require
        all-ints-are-the-same which is a superset of all-bytes-are-the-same).

    Discovering that a page is not homogeneous is done "quickly" (with high
        probability).
  ................
    r4514 | uri | 2007-03-07 19:12:45 +0200 (Wed, 07 Mar 2007) | 25 lines

    qemu migration: tcp migration: changing end-of-migration protocol

    The migration protocol is as follows (let the guest migrate from A to B):
      1. A sends VM-state to B and waits for ACK
      2. B receive VM-state and sends ACK and waits for GO
      3. A receive ACK and sends GO (A does not continue running the guest)
      4. B receive GO and continue running the guest (success).

    If anything goes wrong on steps 1 or 2 (migration failure) A continue running
        the guest and B exists.

    The GO message is an addition to the previous protocol.
    In the previous protocol B would continue after step 2 (after sending ACK).
    But A would consider the migration to fail unless it received ACK
    Theoretically, both sides may continue to run the guest if the ACK message
        was lost (altough practically it's very rare).
    By adding the GO message we ensure such situation can not happen.
    It may happen that both sides would not continue to run the guest which would
        stay in a stopped mode. In that case the user (or a management software)
        would decide where to continue running the guest.
    Also the GO message vulnerability time frame is shorter than that of the
        ACK message.

    TODO: timeout if an ACK/GO message does not arrive
  ................
    r4516 | uri | 2007-03-08 16:28:32 +0200 (Thu, 08 Mar 2007) | 4 lines

    kvm savevm/loadvm: if kvm_allowed do not access unmapped memory (0xa0000-0xc0000)

    Related to r4435.
  ................
    r4517 | uri | 2007-03-08 17:30:31 +0200 (Thu, 08 Mar 2007) | 10 lines

    qemu migration: tcp migration: timeout if migration-end messages do not arrive on time

    If A (src) does not receive ACK on time, migration failed. It is safe since
        B (dst) is waiting for GO, which A does not send.
        A continues to run the guest, and B eventually exits.
    If B does not receive GO on time, migration failed (for B), and it exits.
        A thinks the migration was successful (it successfully sent GO).
        In this scenario (which is very unlikely), A does not continue to run
        the guest, and user intervention is required.
  ................
    r4518 | dor | 2007-03-11 12:30:18 +0200 (Sun, 11 Mar 2007) | 2 lines

    Use full path for binaries so sudo command will work even without the rigth environment variables
  ................
    r4519 | avi | 2007-03-11 13:12:05 +0200 (Sun, 11 Mar 2007) | 4 lines

    kvm: qemu: re-add files dropped during qemu 0.9.0 merge

    noticed by Anthony Liguori some years ago.
  ................
    r4520 | uri | 2007-03-11 13:59:07 +0200 (Sun, 11 Mar 2007) | 2 lines

    qemu migration: convergence-condition: limit the number of live iterations.
  ................
    r4521 | uri | 2007-03-11 14:10:24 +0200 (Sun, 11 Mar 2007) | 7 lines

    qemu migration: convergence-condition: limit the number of rapid-writes iterations.

    When the rate of pages getting dirty is faster than the rate of pages getting
        transferred, the process will never converge.
    We limit the number of such iterations (AKA rapid-writes iteration), and force
        the end of the live part of the migration process when that limit reached.
  ................
    r4522 | uri | 2007-03-12 16:24:06 +0200 (Mon, 12 Mar 2007) | 2 lines

    qemu migration: added last migration status to "info migration"
  ................
    r4524 | uri | 2007-03-12 19:00:45 +0200 (Mon, 12 Mar 2007) | 13 lines

    qemu migration: replacing error code numbers with error code names (enum).

    src error codes range is 1   - 100
    kvm error codes range is 101 - 200 (migration related errors)
    dst error codes range is 201 - 300 (actually 200+src_error_codes)

    No backwards compatibility (nobody used the old values anyways).

    Also made some minor changes to remove code which overwrites previous
        more-specific error code, and added a few error messages.

    Next: print a message according to the error code for 'info migration'
  ................
    r4525 | avi | 2007-03-13 14:42:50 +0200 (Tue, 13 Mar 2007) | 4 lines

    kvm: qemu: revert r4423, returning to the standard qemu bios

    Windows boots, acpi still broken.
  ................
    r4531 | avi | 2007-03-14 16:33:58 +0200 (Wed, 14 Mar 2007) | 3 lines

    Initialized merge tracking via "svnmerge" with revisions "1-4525" from
    svn://cleopatra.q/svn/kvm/kvm/branches/acpi
  ................
    r4532 | avi | 2007-03-14 16:35:28 +0200 (Wed, 14 Mar 2007) | 37 lines

    kvm: merge acpi branch

    acpi is supported again, for Linux and Windows.

    ........
      r4526 | avi | 2007-03-13 17:51:25 +0200 (Tue, 13 Mar 2007) | 2 lines

      kvm: branch for acpi hackery
    ........
      r4527 | avi | 2007-03-13 17:52:59 +0200 (Tue, 13 Mar 2007) | 5 lines

      kvm: libkvm: temporaryly map gpa a8000-affff

      this allows some smm initialization stuff to work.  should be replaced with
      something better.
    ........
      r4528 | avi | 2007-03-13 17:55:47 +0200 (Tue, 13 Mar 2007) | 5 lines

      kvm: qemu: implement smm acpi in qemu

      the qemu bios smm handler acts on commands written to port 0xb2.  since we
      don't emulate smm, move that functionality into qemu.
    ........
      r4529 | avi | 2007-03-13 18:39:38 +0200 (Tue, 13 Mar 2007) | 4 lines

      kvm: qemu: switch to plain qemu bios

      still doesn't boot Windows.
    ........
      r4530 | avi | 2007-03-14 11:55:41 +0200 (Wed, 14 Mar 2007) | 5 lines

      kvm: qemu: disable tpr updates by cr8

      this loses the 4 low bits of the tpr and breaks the Windows ACPI HAL.  Will
      have to be fixed for 64-bit Windows.
    ........
  ................
    r4533 | uri | 2007-03-14 16:45:30 +0200 (Wed, 14 Mar 2007) | 2 lines

    use KVM_GET_MEM_MAP ioctl to get memory map of phys_ram
  ................
    r4534 | avi | 2007-03-14 16:49:47 +0200 (Wed, 14 Mar 2007) | 4 lines

    kvm: launch script: disable tablet

    consumes ~60% cpu on Windows with the ACPI HAL, mostly banging on the apic.
  ................
    r4535 | uri | 2007-03-14 16:50:32 +0200 (Wed, 14 Mar 2007) | 2 lines

    qemu: added function to get memory map of phys_ram (via kvmctl (KVM_GET_MEM_MAP))
  ................
    r4536 | avi | 2007-03-14 19:40:36 +0200 (Wed, 14 Mar 2007) | 4 lines

    kvm: qemu: emulate the qemu bios instead of bochs trunk

    this allows kvm to boot with the stock qemu-0.9.0 bios.
  ................
    r4537 | uri | 2007-03-14 20:08:08 +0200 (Wed, 14 Mar 2007) | 16 lines

    qemu migration: handle holes in guest's physical memory

    "Holes in the physical memory" you ask.
    Yes indeed. Just wait till you see KVM's ballooning mechanism.

    The src query kvm and gets a memory map (of pages which exist in memory).
    The src "keep notes" that these pages should not be sent (using dirty bitmap)
    The src sends the memory map to the guest (immediately after ram_phys_size)
    The dst receive the map.
    The dst should free the memory pages which the src freed, but now it just
            prints the bitmap values that tell which pages are to be freed.

    Also added some error values to be used by above changes and helper functions.

    Uses r4533 and r4535.
  ................
    r4538 | itaish | 2007-03-14 23:49:03 +0200 (Wed, 14 Mar 2007) | 1 line

    Set the pcihypercall device to start in a non interruptable state. Without this fix, the vdsmd can cause an interrupt (simply by calling the vmchannel) before the device driver had a chance to setup an ISR.
  ................
    r4539 | uri | 2007-03-15 16:57:16 +0200 (Thu, 15 Mar 2007) | 8 lines

    user: if KVM_GET_MEM_MAP is not defined, fake kvm_get_mem_map()

    The fake is to set the bits of all pages of the slot (no holes in the memory).
    This overcomes compilation problems caused by KVM_GET_MEM_MAP definition
        (and ioctl implementation) not making it to the master git tree, yet.

    see also r4533
  ................
    r4540 | dor | 2007-03-18 11:10:03 +0200 (Sun, 18 Mar 2007) | 5 lines

    Remove depmod command.

    First the kernel version is not passed to the rpmbuild.
    Second the kvm-kmod calls depmod in the post part.
  ................
................