summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyvectl
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-05-03 19:30:11 +0000
committerbapt <bapt@FreeBSD.org>2015-05-03 19:30:11 +0000
commitb5633ba2a5f5c5e3fddb07ef1f3c114268f7ea42 (patch)
tree43730ad7995cdbd70d25f4f9739ec3b2abd10b91 /usr.sbin/bhyvectl
parent249cdb0bbbb0d59f85a71e76323eeed99d6d3134 (diff)
parent4cd4238e928bc196c424f1549c026c4f4407fba6 (diff)
downloadFreeBSD-src-b5633ba2a5f5c5e3fddb07ef1f3c114268f7ea42.zip
FreeBSD-src-b5633ba2a5f5c5e3fddb07ef1f3c114268f7ea42.tar.gz
Merge from head
Diffstat (limited to 'usr.sbin/bhyvectl')
-rw-r--r--usr.sbin/bhyvectl/Makefile2
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/bhyvectl/Makefile b/usr.sbin/bhyvectl/Makefile
index c48ca6e..5c088a3 100644
--- a/usr.sbin/bhyvectl/Makefile
+++ b/usr.sbin/bhyvectl/Makefile
@@ -8,7 +8,7 @@ PACKAGE= bhyve
MAN=
-LIBADD= vmmapi util
+LIBADD= vmmapi
WARNS?= 3
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index e2b514d..223ee25 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -640,9 +640,9 @@ get_all_registers(struct vmctx *ctx, int vcpu)
uint64_t cr0, cr3, cr4, dr7, rsp, rip, rflags, efer;
uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp;
uint64_t r8, r9, r10, r11, r12, r13, r14, r15;
- int error;
+ int error = 0;
- if (get_efer || get_all) {
+ if (!error && (get_efer || get_all)) {
error = vm_get_register(ctx, vcpu, VM_REG_GUEST_EFER, &efer);
if (error == 0)
printf("efer[%d]\t\t0x%016lx\n", vcpu, efer);
@@ -787,10 +787,10 @@ get_all_registers(struct vmctx *ctx, int vcpu)
static int
get_all_segments(struct vmctx *ctx, int vcpu)
{
- int error;
uint64_t cs, ds, es, fs, gs, ss, tr, ldtr;
+ int error = 0;
- if (get_desc_ds || get_all) {
+ if (!error && (get_desc_ds || get_all)) {
error = vm_get_desc(ctx, vcpu, VM_REG_GUEST_DS,
&desc_base, &desc_limit, &desc_access);
if (error == 0) {
@@ -935,9 +935,9 @@ static int
get_misc_vmcs(struct vmctx *ctx, int vcpu)
{
uint64_t ctl, cr0, cr3, cr4, rsp, rip, pat, addr, u64;
- int error;
-
- if (get_cr0_mask || get_all) {
+ int error = 0;
+
+ if (!error && (get_cr0_mask || get_all)) {
uint64_t cr0mask;
error = vm_get_vmcs_field(ctx, vcpu, VMCS_CR0_MASK, &cr0mask);
if (error == 0)
@@ -1161,9 +1161,9 @@ static int
get_misc_vmcb(struct vmctx *ctx, int vcpu)
{
uint64_t ctl, addr;
- int error;
+ int error = 0;
- if (get_vmcb_intercept || get_all) {
+ if (!error && (get_vmcb_intercept || get_all)) {
error = vm_get_vmcb_field(ctx, vcpu, VMCB_OFF_CR_INTERCEPT, 4,
&ctl);
if (error == 0)
OpenPOWER on IntegriCloud