Support different log levels.
This will let us add more verbose logs for debugging but have them
compiled out most of the time.
Change-Id: Iaae468e41025a165b5e67fa6fec5422f004c6a44
diff --git a/src/api.c b/src/api.c
index 825cb42..aa6c7c1 100644
--- a/src/api.c
+++ b/src/api.c
@@ -207,7 +207,8 @@
{
struct spci_value ret = spci_error(SPCI_ABORTED);
- dlog("Aborting VM %u vCPU %u\n", current->vm->id, vcpu_index(current));
+ dlog_notice("Aborting VM %u vCPU %u\n", current->vm->id,
+ vcpu_index(current));
if (current->vm->id == HF_PRIMARY_VM_ID) {
/* TODO: what to do when the primary aborts? */
@@ -384,8 +385,8 @@
.arg4 = receiver->mailbox.recv_size};
default:
/* This should never be reached, but return an error in case. */
- dlog("Tried to return an invalid message function %#x\n",
- receiver->mailbox.recv_func);
+ dlog_error("Tried to return an invalid message function %#x\n",
+ receiver->mailbox.recv_func);
return spci_error(SPCI_DENIED);
}
}
@@ -444,8 +445,8 @@
if (atomic_load_explicit(&vcpu->vm->aborting, memory_order_relaxed)) {
if (vcpu->state != VCPU_STATE_ABORTED) {
- dlog("Aborting VM %u vCPU %u\n", vcpu->vm->id,
- vcpu_index(vcpu));
+ dlog_notice("Aborting VM %u vCPU %u\n", vcpu->vm->id,
+ vcpu_index(vcpu));
vcpu->state = VCPU_STATE_ABORTED;
}
ret = false;
@@ -1365,8 +1366,9 @@
target_vcpu = vm_get_vcpu(target_vm, target_vcpu_idx);
- dlog("Injecting IRQ %d for VM %d vCPU %d from VM %d vCPU %d\n", intid,
- target_vm_id, target_vcpu_idx, current->vm->id, current->cpu->id);
+ dlog_info("Injecting IRQ %d for VM %d vCPU %d from VM %d vCPU %d\n",
+ intid, target_vm_id, target_vcpu_idx, current->vm->id,
+ current->cpu->id);
return internal_interrupt_inject(target_vcpu, intid, current, next);
}