* [Qemu-devel] [PATCH] blockjob: use qapi enum helpers
@ 2018-03-27 15:30 Marc-André Lureau
2018-03-27 16:42 ` [Qemu-devel] [Qemu-block] " John Snow
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marc-André Lureau @ 2018-03-27 15:30 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, mreitz, jcody, qemu-block, Marc-André Lureau
QAPI generator provide #define helpers for looking up enum string.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
blockjob.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/blockjob.c b/blockjob.c
index ef3ed69ff1..11c9ce124d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -75,10 +75,8 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
assert(s1 >= 0 && s1 <= BLOCK_JOB_STATUS__MAX);
trace_block_job_state_transition(job, job->ret, BlockJobSTT[s0][s1] ?
"allowed" : "disallowed",
- qapi_enum_lookup(&BlockJobStatus_lookup,
- s0),
- qapi_enum_lookup(&BlockJobStatus_lookup,
- s1));
+ BlockJobStatus_str(s0),
+ BlockJobStatus_str(s1));
assert(BlockJobSTT[s0][s1]);
job->status = s1;
}
@@ -86,17 +84,15 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
static int block_job_apply_verb(BlockJob *job, BlockJobVerb bv, Error **errp)
{
assert(bv >= 0 && bv <= BLOCK_JOB_VERB__MAX);
- trace_block_job_apply_verb(job, qapi_enum_lookup(&BlockJobStatus_lookup,
- job->status),
- qapi_enum_lookup(&BlockJobVerb_lookup, bv),
+ trace_block_job_apply_verb(job, BlockJobStatus_str(job->status),
+ BlockJobVerb_str(bv),
BlockJobVerbTable[bv][job->status] ?
"allowed" : "prohibited");
if (BlockJobVerbTable[bv][job->status]) {
return 0;
}
error_setg(errp, "Job '%s' in state '%s' cannot accept command verb '%s'",
- job->id, qapi_enum_lookup(&BlockJobStatus_lookup, job->status),
- qapi_enum_lookup(&BlockJobVerb_lookup, bv));
+ job->id, BlockJobStatus_str(job->status), BlockJobVerb_str(bv));
return -EPERM;
}
--
2.17.0.rc1.1.g4c4f2b46a3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH] blockjob: use qapi enum helpers
2018-03-27 15:30 [Qemu-devel] [PATCH] blockjob: use qapi enum helpers Marc-André Lureau
@ 2018-03-27 16:42 ` John Snow
2018-03-28 18:25 ` [Qemu-devel] " Jeff Cody
2018-03-31 7:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2018-03-27 16:42 UTC (permalink / raw)
To: Marc-André Lureau, qemu-devel; +Cc: kwolf, qemu-block, mreitz, jtc
On 03/27/2018 11:30 AM, Marc-André Lureau wrote:
> QAPI generator provide #define helpers for looking up enum string.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> blockjob.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/blockjob.c b/blockjob.c
> index ef3ed69ff1..11c9ce124d 100644
> --- a/blockjob.c
> +++ b/blockjob.c
> @@ -75,10 +75,8 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
> assert(s1 >= 0 && s1 <= BLOCK_JOB_STATUS__MAX);
> trace_block_job_state_transition(job, job->ret, BlockJobSTT[s0][s1] ?
> "allowed" : "disallowed",
> - qapi_enum_lookup(&BlockJobStatus_lookup,
> - s0),
> - qapi_enum_lookup(&BlockJobStatus_lookup,
> - s1));
> + BlockJobStatus_str(s0),
> + BlockJobStatus_str(s1));
> assert(BlockJobSTT[s0][s1]);
> job->status = s1;
> }
> @@ -86,17 +84,15 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
> static int block_job_apply_verb(BlockJob *job, BlockJobVerb bv, Error **errp)
> {
> assert(bv >= 0 && bv <= BLOCK_JOB_VERB__MAX);
> - trace_block_job_apply_verb(job, qapi_enum_lookup(&BlockJobStatus_lookup,
> - job->status),
> - qapi_enum_lookup(&BlockJobVerb_lookup, bv),
> + trace_block_job_apply_verb(job, BlockJobStatus_str(job->status),
> + BlockJobVerb_str(bv),
> BlockJobVerbTable[bv][job->status] ?
> "allowed" : "prohibited");
> if (BlockJobVerbTable[bv][job->status]) {
> return 0;
> }
> error_setg(errp, "Job '%s' in state '%s' cannot accept command verb '%s'",
> - job->id, qapi_enum_lookup(&BlockJobStatus_lookup, job->status),
> - qapi_enum_lookup(&BlockJobVerb_lookup, bv));
> + job->id, BlockJobStatus_str(job->status), BlockJobVerb_str(bv));
> return -EPERM;
> }
>
>
Oh, whoops. I knew you added functions, but I didn't realize we got
per-enum functions. Thanks.
Reviewed-by: John Snow <jsnow@redhat.com>
and forwarded to Jeff Cody.
--js
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] blockjob: use qapi enum helpers
2018-03-27 15:30 [Qemu-devel] [PATCH] blockjob: use qapi enum helpers Marc-André Lureau
2018-03-27 16:42 ` [Qemu-devel] [Qemu-block] " John Snow
@ 2018-03-28 18:25 ` Jeff Cody
2018-03-31 7:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Cody @ 2018-03-28 18:25 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel, kwolf, mreitz, qemu-block
On Tue, Mar 27, 2018 at 05:30:11PM +0200, Marc-André Lureau wrote:
> QAPI generator provide #define helpers for looking up enum string.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> blockjob.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/blockjob.c b/blockjob.c
> index ef3ed69ff1..11c9ce124d 100644
> --- a/blockjob.c
> +++ b/blockjob.c
> @@ -75,10 +75,8 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
> assert(s1 >= 0 && s1 <= BLOCK_JOB_STATUS__MAX);
> trace_block_job_state_transition(job, job->ret, BlockJobSTT[s0][s1] ?
> "allowed" : "disallowed",
> - qapi_enum_lookup(&BlockJobStatus_lookup,
> - s0),
> - qapi_enum_lookup(&BlockJobStatus_lookup,
> - s1));
> + BlockJobStatus_str(s0),
> + BlockJobStatus_str(s1));
> assert(BlockJobSTT[s0][s1]);
> job->status = s1;
> }
> @@ -86,17 +84,15 @@ static void block_job_state_transition(BlockJob *job, BlockJobStatus s1)
> static int block_job_apply_verb(BlockJob *job, BlockJobVerb bv, Error **errp)
> {
> assert(bv >= 0 && bv <= BLOCK_JOB_VERB__MAX);
> - trace_block_job_apply_verb(job, qapi_enum_lookup(&BlockJobStatus_lookup,
> - job->status),
> - qapi_enum_lookup(&BlockJobVerb_lookup, bv),
> + trace_block_job_apply_verb(job, BlockJobStatus_str(job->status),
> + BlockJobVerb_str(bv),
> BlockJobVerbTable[bv][job->status] ?
> "allowed" : "prohibited");
> if (BlockJobVerbTable[bv][job->status]) {
> return 0;
> }
> error_setg(errp, "Job '%s' in state '%s' cannot accept command verb '%s'",
> - job->id, qapi_enum_lookup(&BlockJobStatus_lookup, job->status),
> - qapi_enum_lookup(&BlockJobVerb_lookup, bv));
> + job->id, BlockJobStatus_str(job->status), BlockJobVerb_str(bv));
> return -EPERM;
> }
>
> --
> 2.17.0.rc1.1.g4c4f2b46a3
>
Thanks,
Looks like a bug fix to me.
Applied to my block branch:
git://github.com/codyprime/qemu-kvm-jtc block
-Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] blockjob: use qapi enum helpers
2018-03-27 15:30 [Qemu-devel] [PATCH] blockjob: use qapi enum helpers Marc-André Lureau
2018-03-27 16:42 ` [Qemu-devel] [Qemu-block] " John Snow
2018-03-28 18:25 ` [Qemu-devel] " Jeff Cody
@ 2018-03-31 7:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2018-03-31 7:18 UTC (permalink / raw)
To: marcandre.lureau; +Cc: famz, qemu-devel, kwolf, jcody, qemu-block, mreitz
Hi,
This series failed docker-build@min-glib build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
Type: series
Message-id: 20180327153011.29569-1-marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH] blockjob: use qapi enum helpers
=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-build@min-glib
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
0d7e11c24a blockjob: use qapi enum helpers
=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-jt_109c0/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
BUILD min-glib
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-jt_109c0/src'
GEN /var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272/qemu.tar.vroot'...
done.
Checking out files: 25% (1532/6066)
Checking out files: 26% (1578/6066)
Checking out files: 27% (1638/6066)
Checking out files: 28% (1699/6066)
Checking out files: 29% (1760/6066)
Checking out files: 30% (1820/6066)
Checking out files: 31% (1881/6066)
Checking out files: 32% (1942/6066)
Checking out files: 33% (2002/6066)
Checking out files: 34% (2063/6066)
Checking out files: 35% (2124/6066)
Checking out files: 36% (2184/6066)
Checking out files: 37% (2245/6066)
Checking out files: 38% (2306/6066)
Checking out files: 39% (2366/6066)
Checking out files: 40% (2427/6066)
Checking out files: 41% (2488/6066)
Checking out files: 42% (2548/6066)
Checking out files: 43% (2609/6066)
Checking out files: 44% (2670/6066)
Checking out files: 45% (2730/6066)
Checking out files: 46% (2791/6066)
Checking out files: 47% (2852/6066)
Checking out files: 48% (2912/6066)
Checking out files: 49% (2973/6066)
Checking out files: 50% (3033/6066)
Checking out files: 51% (3094/6066)
Checking out files: 52% (3155/6066)
Checking out files: 53% (3215/6066)
Checking out files: 54% (3276/6066)
Checking out files: 55% (3337/6066)
Checking out files: 56% (3397/6066)
Checking out files: 57% (3458/6066)
Checking out files: 58% (3519/6066)
Checking out files: 59% (3579/6066)
Checking out files: 60% (3640/6066)
Checking out files: 61% (3701/6066)
Checking out files: 62% (3761/6066)
Checking out files: 63% (3822/6066)
Checking out files: 64% (3883/6066)
Checking out files: 65% (3943/6066)
Checking out files: 66% (4004/6066)
Checking out files: 67% (4065/6066)
Checking out files: 68% (4125/6066)
Checking out files: 69% (4186/6066)
Checking out files: 70% (4247/6066)
Checking out files: 71% (4307/6066)
Checking out files: 72% (4368/6066)
Checking out files: 73% (4429/6066)
Checking out files: 74% (4489/6066)
Checking out files: 75% (4550/6066)
Checking out files: 75% (4601/6066)
Checking out files: 76% (4611/6066)
Checking out files: 77% (4671/6066)
Checking out files: 78% (4732/6066)
Checking out files: 79% (4793/6066)
Checking out files: 80% (4853/6066)
Checking out files: 81% (4914/6066)
Checking out files: 82% (4975/6066)
Checking out files: 83% (5035/6066)
Checking out files: 84% (5096/6066)
Checking out files: 85% (5157/6066)
Checking out files: 86% (5217/6066)
Checking out files: 87% (5278/6066)
Checking out files: 88% (5339/6066)
Checking out files: 88% (5342/6066)
Checking out files: 89% (5399/6066)
Checking out files: 90% (5460/6066)
Checking out files: 91% (5521/6066)
Checking out files: 92% (5581/6066)
Checking out files: 93% (5642/6066)
Checking out files: 94% (5703/6066)
Checking out files: 95% (5763/6066)
Checking out files: 96% (5824/6066)
Checking out files: 97% (5885/6066)
Checking out files: 98% (5945/6066)
Checking out files: 99% (6006/6066)
Checking out files: 100% (6066/6066)
Checking out files: 100% (6066/6066), done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272/qemu.tar.vroot/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272/qemu.tar.vroot/ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
tar: /var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272/qemu.tar: Wrote only 2048 of 10240 bytes
tar: Error is not recoverable: exiting now
failed to create tar file
COPY RUNNER
RUN test-build in qemu:min-glib
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
/var/tmp/qemu/run: line 32: prep_fail: command not found
Environment variables:
HOSTNAME=071087b09b30
MAKEFLAGS= -j8
J=8
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
TARGET_LIST=
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
FEATURES= dtc
DEBUG=
_=/usr/bin/env
Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install
ERROR: DTC (libfdt) version >= 1.4.2 not present.
Please install the DTC (libfdt) devel package
Traceback (most recent call last):
File "./tests/docker/docker.py", line 407, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 404, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 261, in run
return Docker().run(argv, args.keep, quiet=args.quiet)
File "./tests/docker/docker.py", line 229, in run
quiet=quiet)
File "./tests/docker/docker.py", line 147, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=a26a8cda34b311e8aff552540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-jt_109c0/src/docker-src.2018-03-31-03.17.32.6272:/var/tmp/qemu:z,ro', 'qemu:min-glib', '/var/tmp/qemu/run', 'test-build']' returned non-zero exit status 1
make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-jt_109c0/src'
make: *** [tests/docker/Makefile.include:163: docker-run-test-build@min-glib] Error 2
real 0m51.061s
user 0m8.876s
sys 0m6.729s
=== OUTPUT END ===
Test command exited with code: 2
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-31 7:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 15:30 [Qemu-devel] [PATCH] blockjob: use qapi enum helpers Marc-André Lureau
2018-03-27 16:42 ` [Qemu-devel] [Qemu-block] " John Snow
2018-03-28 18:25 ` [Qemu-devel] " Jeff Cody
2018-03-31 7:18 ` no-reply
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.