* [PATCH] libxc: simplify error handling in meminit_hvm
@ 2016-03-03 16:09 Wei Liu
2016-03-07 16:02 ` Doug Goldstein
2016-03-07 16:12 ` Roger Pau Monné
0 siblings, 2 replies; 3+ messages in thread
From: Wei Liu @ 2016-03-03 16:09 UTC (permalink / raw)
To: Xen-devel; +Cc: Ian Jackson, Roger Pau Monne, Wei Liu, Stefano Stabellini
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@cardoe.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
---
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");
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libxc: simplify error handling in meminit_hvm
2016-03-03 16:09 [PATCH] libxc: simplify error handling in meminit_hvm Wei Liu
@ 2016-03-07 16:02 ` Doug Goldstein
2016-03-07 16:12 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Doug Goldstein @ 2016-03-07 16:02 UTC (permalink / raw)
To: Wei Liu, Xen-devel; +Cc: Stefano Stabellini, Ian Jackson, Roger Pau Monne
[-- Attachment #1.1.1: Type: text/plain, Size: 380 bytes --]
On 3/3/16 10:09 AM, Wei Liu wrote:
> 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@cardoe.com>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
--
Doug Goldstein
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 959 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libxc: simplify error handling in meminit_hvm
2016-03-03 16:09 [PATCH] libxc: simplify error handling in meminit_hvm Wei Liu
2016-03-07 16:02 ` Doug Goldstein
@ 2016-03-07 16:12 ` Roger Pau Monné
1 sibling, 0 replies; 3+ messages in thread
From: Roger Pau Monné @ 2016-03-07 16:12 UTC (permalink / raw)
To: Wei Liu; +Cc: Xen-devel, Roger Pau Monne, Ian Jackson, Stefano Stabellini
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
On Thu, 3 Mar 2016, Wei Liu wrote:
> 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@cardoe.com>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-07 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 16:09 [PATCH] libxc: simplify error handling in meminit_hvm Wei Liu
2016-03-07 16:02 ` Doug Goldstein
2016-03-07 16:12 ` Roger Pau Monné
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).