Revision 8c0d577e

b/kvm-all.c
33 33
//#define DEBUG_KVM
34 34

  
35 35
#ifdef DEBUG_KVM
36
#define dprintf(fmt, ...) \
36
#define DPRINTF(fmt, ...) \
37 37
    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
38 38
#else
39
#define dprintf(fmt, ...) \
39
#define DPRINTF(fmt, ...) \
40 40
    do { } while (0)
41 41
#endif
42 42

  
......
173 173
    long mmap_size;
174 174
    int ret;
175 175

  
176
    dprintf("kvm_init_vcpu\n");
176
    DPRINTF("kvm_init_vcpu\n");
177 177

  
178 178
    ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index);
179 179
    if (ret < 0) {
180
        dprintf("kvm_create_vcpu failed\n");
180
        DPRINTF("kvm_create_vcpu failed\n");
181 181
        goto err;
182 182
    }
183 183

  
......
186 186

  
187 187
    mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0);
188 188
    if (mmap_size < 0) {
189
        dprintf("KVM_GET_VCPU_MMAP_SIZE failed\n");
189
        DPRINTF("KVM_GET_VCPU_MMAP_SIZE failed\n");
190 190
        goto err;
191 191
    }
192 192

  
......
194 194
                        env->kvm_fd, 0);
195 195
    if (env->kvm_run == MAP_FAILED) {
196 196
        ret = -errno;
197
        dprintf("mmap'ing vcpu state failed\n");
197
        DPRINTF("mmap'ing vcpu state failed\n");
198 198
        goto err;
199 199
    }
200 200

  
......
325 325
        d.slot = mem->slot;
326 326

  
327 327
        if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) {
328
            dprintf("ioctl failed %d\n", errno);
328
            DPRINTF("ioctl failed %d\n", errno);
329 329
            ret = -1;
330 330
            break;
331 331
        }
......
768 768
    struct kvm_run *run = env->kvm_run;
769 769
    int ret;
770 770

  
771
    dprintf("kvm_cpu_exec()\n");
771
    DPRINTF("kvm_cpu_exec()\n");
772 772

  
773 773
    do {
774 774
#ifndef CONFIG_IOTHREAD
775 775
        if (env->exit_request) {
776
            dprintf("interrupt exit requested\n");
776
            DPRINTF("interrupt exit requested\n");
777 777
            ret = 0;
778 778
            break;
779 779
        }
......
792 792

  
793 793
        if (ret == -EINTR || ret == -EAGAIN) {
794 794
            cpu_exit(env);
795
            dprintf("io window exit\n");
795
            DPRINTF("io window exit\n");
796 796
            ret = 0;
797 797
            break;
798 798
        }
799 799

  
800 800
        if (ret < 0) {
801
            dprintf("kvm run failed %s\n", strerror(-ret));
801
            DPRINTF("kvm run failed %s\n", strerror(-ret));
802 802
            abort();
803 803
        }
804 804

  
......
807 807
        ret = 0; /* exit loop */
808 808
        switch (run->exit_reason) {
809 809
        case KVM_EXIT_IO:
810
            dprintf("handle_io\n");
810
            DPRINTF("handle_io\n");
811 811
            ret = kvm_handle_io(run->io.port,
812 812
                                (uint8_t *)run + run->io.data_offset,
813 813
                                run->io.direction,
......
815 815
                                run->io.count);
816 816
            break;
817 817
        case KVM_EXIT_MMIO:
818
            dprintf("handle_mmio\n");
818
            DPRINTF("handle_mmio\n");
819 819
            cpu_physical_memory_rw(run->mmio.phys_addr,
820 820
                                   run->mmio.data,
821 821
                                   run->mmio.len,
......
823 823
            ret = 1;
824 824
            break;
825 825
        case KVM_EXIT_IRQ_WINDOW_OPEN:
826
            dprintf("irq_window_open\n");
826
            DPRINTF("irq_window_open\n");
827 827
            break;
828 828
        case KVM_EXIT_SHUTDOWN:
829
            dprintf("shutdown\n");
829
            DPRINTF("shutdown\n");
830 830
            qemu_system_reset_request();
831 831
            ret = 1;
832 832
            break;
833 833
        case KVM_EXIT_UNKNOWN:
834
            dprintf("kvm_exit_unknown\n");
834
            DPRINTF("kvm_exit_unknown\n");
835 835
            break;
836 836
        case KVM_EXIT_FAIL_ENTRY:
837
            dprintf("kvm_exit_fail_entry\n");
837
            DPRINTF("kvm_exit_fail_entry\n");
838 838
            break;
839 839
        case KVM_EXIT_EXCEPTION:
840
            dprintf("kvm_exit_exception\n");
840
            DPRINTF("kvm_exit_exception\n");
841 841
            break;
842 842
        case KVM_EXIT_DEBUG:
843
            dprintf("kvm_exit_debug\n");
843
            DPRINTF("kvm_exit_debug\n");
844 844
#ifdef KVM_CAP_SET_GUEST_DEBUG
845 845
            if (kvm_arch_debug(&run->debug.arch)) {
846 846
                gdb_set_stop_cpu(env);
......
853 853
#endif /* KVM_CAP_SET_GUEST_DEBUG */
854 854
            break;
855 855
        default:
856
            dprintf("kvm_arch_handle_exit\n");
856
            DPRINTF("kvm_arch_handle_exit\n");
857 857
            ret = kvm_arch_handle_exit(env, run);
858 858
            break;
859 859
        }
b/target-i386/kvm.c
34 34
//#define DEBUG_KVM
35 35

  
36 36
#ifdef DEBUG_KVM
37
#define dprintf(fmt, ...) \
37
#define DPRINTF(fmt, ...) \
38 38
    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
39 39
#else
40
#define dprintf(fmt, ...) \
40
#define DPRINTF(fmt, ...) \
41 41
    do { } while (0)
42 42
#endif
43 43

  
......
957 957
            struct kvm_interrupt intr;
958 958
            intr.irq = irq;
959 959
            /* FIXME: errors */
960
            dprintf("injected interrupt %d\n", irq);
960
            DPRINTF("injected interrupt %d\n", irq);
961 961
            kvm_vcpu_ioctl(env, KVM_INTERRUPT, &intr);
962 962
        }
963 963
    }
......
971 971
    else
972 972
        run->request_interrupt_window = 0;
973 973

  
974
    dprintf("setting tpr\n");
974
    DPRINTF("setting tpr\n");
975 975
    run->cr8 = cpu_get_apic_tpr(env);
976 976

  
977 977
    return 0;
......
1009 1009

  
1010 1010
    switch (run->exit_reason) {
1011 1011
    case KVM_EXIT_HLT:
1012
        dprintf("handle_hlt\n");
1012
        DPRINTF("handle_hlt\n");
1013 1013
        ret = kvm_handle_halt(env);
1014 1014
        break;
1015 1015
    }

Also available in: Unified diff