|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxc: simplify error handling in meminit_hvm
commit ae3c165b8189cb45b437fe6d92da338f2fd3a19f
Author: Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Thu Mar 3 16:01:58 2016 +0000
Commit: Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Thu Mar 10 18:40:17 2016 +0000
libxc: simplify error handling in meminit_hvm
The hunk that prints out error message can only be reached from the loop
that allocates memory. Move that hunk into the loop to avoid confusing
gcc.
Reported-by: Doug Goldstein <cardoe@xxxxxxxxxx>
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Reviewed-by: Doug Goldstein <cardoe@xxxxxxxxxx>
Acked-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
---
tools/libxc/xc_dom_x86.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e13a4aa..bdec40a 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -1550,13 +1550,10 @@ static int meminit_hvm(struct xc_dom_image *dom)
}
if ( rc != 0 )
- break;
- }
-
- if ( rc != 0 )
- {
- DOMPRINTF("Could not allocate memory for HVM guest.");
- goto error_out;
+ {
+ DOMPRINTF("Could not allocate memory for HVM guest.");
+ goto error_out;
+ }
}
DPRINTF("PHYSICAL MEMORY ALLOCATION:\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |