* [PATCH] libxc: use xc_dom_panic when decompressor is not supported
@ 2015-03-06 11:33 Wei Liu
2015-03-06 12:43 ` Andrew Cooper
0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-03-06 11:33 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, svenvan.van, Wei Liu, Ian Campbell
State explicitly that specific decompressor is not supported by libxc.
Without this change, libxc error message only says the provided kernel
is invalid, which is misleading.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: svenvan.van@gmail.com
---
tools/libxc/xc_dom_bzimageloader.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 964ebdc..3bb17dd 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -185,8 +185,9 @@ static int xc_try_bzip2_decode(
static int xc_try_bzip2_decode(
struct xc_dom_image *dom, void **blob, size_t *size)
{
- DOMPRINTF("%s: BZIP2 decompress support unavailable",
- __FUNCTION__);
+ xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+ "%s: BZIP2 decompress support unavailable",
+ __FUNCTION__);
return -1;
}
@@ -367,16 +368,18 @@ static int xc_try_lzma_decode(
static int xc_try_xz_decode(
struct xc_dom_image *dom, void **blob, size_t *size)
{
- DOMPRINTF("%s: XZ decompress support unavailable",
- __FUNCTION__);
+ xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+ "%s: XZ decompress support unavailable",
+ __FUNCTION__);
return -1;
}
static int xc_try_lzma_decode(
struct xc_dom_image *dom, void **blob, size_t *size)
{
- DOMPRINTF("%s: LZMA decompress support unavailable",
- __FUNCTION__);
+ xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+ "%s: LZMA decompress support unavailable",
+ __FUNCTION__);
return -1;
}
@@ -577,8 +580,9 @@ static int xc_try_lzo1x_decode(
static int xc_try_lzo1x_decode(
struct xc_dom_image *dom, void **blob, size_t *size)
{
- DOMPRINTF("%s: LZO1x decompress support unavailable\n",
- __FUNCTION__);
+ xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+ "%s: LZO1x decompress support unavailable\n",
+ __FUNCTION__);
return -1;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libxc: use xc_dom_panic when decompressor is not supported
2015-03-06 11:33 [PATCH] libxc: use xc_dom_panic when decompressor is not supported Wei Liu
@ 2015-03-06 12:43 ` Andrew Cooper
2015-03-11 12:29 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2015-03-06 12:43 UTC (permalink / raw)
To: Wei Liu, xen-devel; +Cc: svenvan.van, Ian Jackson, Ian Campbell
On 06/03/2015 11:33, Wei Liu wrote:
> State explicitly that specific decompressor is not supported by libxc.
> Without this change, libxc error message only says the provided kernel
> is invalid, which is misleading.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: svenvan.van@gmail.com
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
I did the triage of this issue when reported on #xen. `xl -vvv
create...` does eventually reveal the issue, where `xl create` gives an
incorrect error message.
(although s/__FUNCTION__/__func__/ to be more C99 if you have cause to
resubmit)
> ---
> tools/libxc/xc_dom_bzimageloader.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
> index 964ebdc..3bb17dd 100644
> --- a/tools/libxc/xc_dom_bzimageloader.c
> +++ b/tools/libxc/xc_dom_bzimageloader.c
> @@ -185,8 +185,9 @@ static int xc_try_bzip2_decode(
> static int xc_try_bzip2_decode(
> struct xc_dom_image *dom, void **blob, size_t *size)
> {
> - DOMPRINTF("%s: BZIP2 decompress support unavailable",
> - __FUNCTION__);
> + xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
> + "%s: BZIP2 decompress support unavailable",
> + __FUNCTION__);
> return -1;
> }
>
> @@ -367,16 +368,18 @@ static int xc_try_lzma_decode(
> static int xc_try_xz_decode(
> struct xc_dom_image *dom, void **blob, size_t *size)
> {
> - DOMPRINTF("%s: XZ decompress support unavailable",
> - __FUNCTION__);
> + xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
> + "%s: XZ decompress support unavailable",
> + __FUNCTION__);
> return -1;
> }
>
> static int xc_try_lzma_decode(
> struct xc_dom_image *dom, void **blob, size_t *size)
> {
> - DOMPRINTF("%s: LZMA decompress support unavailable",
> - __FUNCTION__);
> + xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
> + "%s: LZMA decompress support unavailable",
> + __FUNCTION__);
> return -1;
> }
>
> @@ -577,8 +580,9 @@ static int xc_try_lzo1x_decode(
> static int xc_try_lzo1x_decode(
> struct xc_dom_image *dom, void **blob, size_t *size)
> {
> - DOMPRINTF("%s: LZO1x decompress support unavailable\n",
> - __FUNCTION__);
> + xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
> + "%s: LZO1x decompress support unavailable\n",
> + __FUNCTION__);
> return -1;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libxc: use xc_dom_panic when decompressor is not supported
2015-03-06 12:43 ` Andrew Cooper
@ 2015-03-11 12:29 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-03-11 12:29 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Ian Jackson, svenvan.van, Wei Liu, xen-devel
On Fri, 2015-03-06 at 12:43 +0000, Andrew Cooper wrote:
> On 06/03/2015 11:33, Wei Liu wrote:
> > State explicitly that specific decompressor is not supported by libxc.
> > Without this change, libxc error message only says the provided kernel
> > is invalid, which is misleading.
> >
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: svenvan.van@gmail.com
>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked + applied.
> I did the triage of this issue when reported on #xen. `xl -vvv
> create...` does eventually reveal the issue, where `xl create` gives an
> incorrect error message.
>
> (although s/__FUNCTION__/__func__/ to be more C99 if you have cause to
> resubmit)
FWIW this whole file uses __FUNCTION__, probably would be better to do
xc_dom_* in a big sweep instead of piecemeal. In any case I haven't
waited for a resubmit.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-11 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06 11:33 [PATCH] libxc: use xc_dom_panic when decompressor is not supported Wei Liu
2015-03-06 12:43 ` Andrew Cooper
2015-03-11 12:29 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.