Skip to contentSkip to conversation

Trivial fixes and cleanups

PATCH In review Cleber Rosa 4 participants 14 messages Jul 27, 2017 – Jul 28, 2017

lore
Share & tools
lore
#0 lore raw

cover Trivial fixes and cleanups

This is a collection of trivial fixes and cleanups. The only expected behavior change is in the output on config.log, as per the first patch.

Cleber Rosa(5):
configure: remove duplicate single quotes on config.log
qemu-iotests: get rid of _full_imgproto_details()
qemu-iotests: remove commented out variables
qemu-iotests: remove comment about root privileges
docs: fix broken paths to docs/interop dir

 configure                           |  4 +---
 docs/devel/writing-qmp-commands.txt |  2 +-
 qapi-schema.json                    |  2 +-
 tests/qemu-iotests/check            | 13 +------------
 tests/qemu-iotests/common.rc        |  5 -----
 5 files changed, 4 insertions(+), 22 deletions(-)
#1 lore raw

PATCH 1/5 configure: remove duplicate single quotes on config.log header

The generation of the informational header on config.log contains two pairs of single quotes, which seems unintentional, and looks like this:

# QEMU configure log Thu Jul 26 08:17:15 EDT 2017
# Configured with: './configure' '--target-list=x86_64-softmmu'

With this change, the quotes comprehend the entire command line:

# QEMU configure log Mon Jul 26 08:17:35 EDT 2017
# Configured with: './configure --target-list=x86_64-softmmu'

---
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
configure +1 -3
index 987f59b..344d6d2 100755
@@ -35,9 +35,7 @@ rm -f config.log
 
 # Print a helpful header at the top of config.log
 echo "# QEMU configure log $(date)" >> config.log
-printf "# Configured with:" >> config.log
-printf " '%s'" "$0" "$@" >> config.log
-echo >> config.log
+echo "# Configured with: '$0 $@'" >> config.log
 echo "#" >> config.log
 
 print_error() {
Signature · 1 line
2.9.4
#2 lore raw

Re: [Qemu-devel] [PATCH 1/5] configure: remove duplicate single quotes on config.log header

Quoted 6 lines · Cleber Rosa

The generation of the informational header on config.log contains two pairs of single quotes, which seems unintentional, and looks like this:

# QEMU configure log Thu Jul 26 08:17:15 EDT 2017
# Configured with: './configure' '--target-list=x86_64-softmmu'

I think this is deliberate. The idea is that the string is a validly shell-quoted string that you can cut and paste into a shell prompt if you want to. (This is less important than it used to be now we have config.status.)

If your configure command has more than one line you get something like this:

# Configured with: '../../configure' '--target-list=arm-softmmu,aarch64-softmmu,arm-linux-user,aarch64-linux-user' '--enable-debug' '--cc=ccache gcc' '--audio-drv-list=pa'

...and note in particular how the '--cc=ccache gcc' argument is printed. Your change would give

# Configured with: '../../configure --target-list=arm-softmmu,aarch64-softmmu,arm-linux-user,aarch64-linux-user --enable-debug --cc=ccache gcc --audio-drv-list=pa'

which can't be cut and pasted, and is ambiguous.

thanks
-- PMM

#3 lore raw

Re: [Qemu-devel] [PATCH 1/5] configure: remove duplicate single quotes on config.log header

Quoted 11 lines · Peter Maydell
Quoted 6 lines · Cleber Rosa

The generation of the informational header on config.log contains two pairs of single quotes, which seems unintentional, and looks like this:

# QEMU configure log Thu Jul 26 08:17:15 EDT 2017
# Configured with: './configure' '--target-list=x86_64-softmmu'

I think this is deliberate. The idea is that the string is a validly shell-quoted string that you can cut and paste into a shell prompt if you want to.

It IS deliberate. If you want, you could improve the code to only emit '' around arguments that require it rather than all arguments, but that requires more shell code (it's easier to quote everywhere, even when it looks strange because the quotes weren't necessary).

Quoted 2 lines

...and note in particular how the '--cc=ccache gcc' argument is printed.

Yes, that's a case where the quotes are necessary.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#4 lore raw

Re: [Qemu-devel] [PATCH 1/5] configure: remove duplicate single quotes on config.log header

Quoted 18 lines · Eric Blake
Quoted 11 lines · Peter Maydell
Quoted 6 lines · Cleber Rosa

The generation of the informational header on config.log contains two pairs of single quotes, which seems unintentional, and looks like this:

# QEMU configure log Thu Jul 26 08:17:15 EDT 2017
# Configured with: './configure' '--target-list=x86_64-softmmu'

I think this is deliberate. The idea is that the string is a validly shell-quoted string that you can cut and paste into a shell prompt if you want to.

It IS deliberate. If you want, you could improve the code to only emit '' around arguments that require it rather than all arguments, but that requires more shell code (it's easier to quote everywhere, even when it looks strange because the quotes weren't necessary).

Quoted 5 lines
Quoted 2 lines

...and note in particular how the '--cc=ccache gcc' argument is printed.

Yes, that's a case where the quotes are necessary.

Right, now I can see why. Thanks for the review!

Signature · 4 lines
Cleber Rosa
[ Sr Software Engineer - Virtualization Team - Red Hat ]
[ Avocado Test Framework - avocado-framework.github.io ]
[  7ABB 96EB 8B46 B94D 5E0F  E9BB 657E 8D33 A5F2 09F3  ]
#5 lore raw

PATCH 2/5 qemu-iotests: get rid of _full_imgproto_details()

In reply to Cleber Rosa

Although this function is used, its implementation does nothing besides echoing a variable name. There's no need to wrap this functionality in a function, and based on the one usage it has, it's not even required to adhere to a convention or code style.

---
 tests/qemu-iotests/check     | 3 +--
 tests/qemu-iotests/common.rc | 5 -----
 2 files changed, 1 insertion(+), 7 deletions(-)
tests/qemu-iotests/check +1 -2
index 2a55ec9..7a2e0d0 100755
@@ -228,7 +228,6 @@ rm -f check.full
 [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE
 
 FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
-FULL_IMGPROTO_DETAILS=`_full_imgproto_details`
 FULL_HOST_DETAILS=`_full_platform_details`
 #FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
 #FULL_MOUNT_OPTIONS=`_scratch_mount_options`
@@ -239,7 +238,7 @@ QEMU_IMG      -- "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS
 QEMU_IO       -- "$QEMU_IO_PROG" $QEMU_IO_OPTIONS
 QEMU_NBD      -- "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS
 IMGFMT        -- $FULL_IMGFMT_DETAILS
-IMGPROTO      -- $FULL_IMGPROTO_DETAILS
+IMGPROTO      -- $IMGPROTO
 PLATFORM      -- $FULL_HOST_DETAILS
 TEST_DIR      -- $TEST_DIR
 SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER
tests/qemu-iotests/common.rc +0 -5
index 2548e58..e4d30ad 100644
@@ -479,11 +479,6 @@ _full_imgfmt_details()
     fi
 }
 
-_full_imgproto_details()
-{
-    echo "$IMGPROTO"
-}
-
 _full_platform_details()
 {
     os=`uname -s`
Signature · 1 line
2.9.4
#6 lore raw

PATCH 3/5 qemu-iotests: remove commented out variables

In reply to Cleber Rosa

The variables FULL_MKFS_OPTIONS and FULL_MOUNT_OPTIONS are commented out, never used, and even refer to functions that do exist. The last time these were touched was around 8 years ago, so I guess it's safe to assume outputting such information on test execution is still on the radar.

---
 tests/qemu-iotests/check | 4 ----
 1 file changed, 4 deletions(-)
tests/qemu-iotests/check +0 -4
index 7a2e0d0..437ef65 100755
@@ -229,8 +229,6 @@ rm -f check.full
 
 FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
 FULL_HOST_DETAILS=`_full_platform_details`
-#FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
-#FULL_MOUNT_OPTIONS=`_scratch_mount_options`
 
 cat <<EOF
 QEMU          -- "$QEMU_PROG" $QEMU_OPTIONS
@@ -244,8 +242,6 @@ TEST_DIR      -- $TEST_DIR
 SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER
 
 EOF
-#MKFS_OPTIONS  -- $FULL_MKFS_OPTIONS
-#MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS
 
 seq="check"
 
Signature · 1 line
2.9.4
Reviewed-by on v1 3/5
#7 lore raw

Re: [Qemu-devel] [PATCH 3/5] qemu-iotests: remove commented out variables

Quoted 10 lines · Cleber Rosa

The variables FULL_MKFS_OPTIONS and FULL_MOUNT_OPTIONS are commented out, never used, and even refer to functions that do exist. The last time these were touched was around 8 years ago, so I guess it's safe to assume outputting such information on test execution is still on the radar.

---
 tests/qemu-iotests/check | 4 ----
 1 file changed, 4 deletions(-)
#8 lore raw

PATCH 4/5 qemu-iotests: remove comment about root privileges requirement

In reply to Cleber Rosa

The check script contains a commented out root user requirement, probably because of its xfstests heritage. This requirement doesn't apply to qemu-iotests, so it better be gone.

---
 tests/qemu-iotests/check | 6 ------
 1 file changed, 6 deletions(-)
tests/qemu-iotests/check +0 -6
index 437ef65..d504b6e 100755
@@ -123,12 +123,6 @@ fi
 # we need common
 . "$source_iotests/common"
 
-#if [ `id -u` -ne 0 ]
-#then
-#    echo "check: QA must be run as root"
-#    exit 1
-#fi
-
 TIMESTAMP_FILE=check.time-$IMGPROTO-$IMGFMT
 
 tmp="${TEST_DIR}"/$$
Signature · 1 line
2.9.4
Reviewed-by on v1 4/5
#9 lore raw

Re: [Qemu-devel] [PATCH 4/5] qemu-iotests: remove comment about root privileges requirement

Quoted 8 lines · Cleber Rosa

The check script contains a commented out root user requirement, probably because of its xfstests heritage. This requirement doesn't apply to qemu-iotests, so it better be gone.

---
 tests/qemu-iotests/check | 6 ------
 1 file changed, 6 deletions(-)
#10 lore raw

PATCH 5/5 docs: fix broken paths to docs/interop dir

In reply to Cleber Rosa

With the move of some docs to docs/interop on d59157e, a couple of references where not updated.

---
 docs/devel/writing-qmp-commands.txt | 2 +-
 qapi-schema.json                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
docs/devel/writing-qmp-commands.txt +1 -1
index 1e63754..69793e3 100644
@@ -8,7 +8,7 @@ into the QAPI framework implementation.
 
 For an in-depth introduction to the QAPI framework, please refer to
 docs/qapi-code-gen.txt. For documentation about the QMP protocol,
-start with docs/qmp-intro.txt.
+start with docs/interop/qmp-intro.txt.
 
 == Overview ==
 
qapi-schema.json +1 -1
index 9c6c3e1..37f1e6e 100644
@@ -23,7 +23,7 @@
 # | -> data issued by the Client
 # | <- Server data response
 #
-# Please, refer to the QMP specification (docs/qmp-spec.txt) for
+# Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
 # detailed information on the Server command and response formats.
 #
 # = Stability Considerations
Signature · 1 line
2.9.4
Reviewed-by on v1 5/5
#11 lore raw

Re: [Qemu-devel] [PATCH 5/5] docs: fix broken paths to docs/interop dir

Quoted 8 lines · Cleber Rosa

With the move of some docs to docs/interop on d59157e, a couple of references where not updated.

---
 docs/devel/writing-qmp-commands.txt | 2 +-
 qapi-schema.json                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Safe for 2.10, but also okay if it slips to 2.11

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 5/5
#12 lore raw

Re: [Qemu-devel] [PATCH 5/5] docs: fix broken paths to docs/interop dir

In reply to Cleber Rosa
Quoted 8 lines · Cleber Rosa

With the move of some docs to docs/interop on d59157e, a couple of references where not updated.

---
 docs/devel/writing-qmp-commands.txt | 2 +-
 qapi-schema.json                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
#13 lore raw
In reply to Cleber Rosa
Quoted 11 lines · Cleber Rosa

This is a collection of trivial fixes and cleanups. The only expected behavior change is in the output on config.log, as per the first patch.

Cleber Rosa(5):
configure: remove duplicate single quotes on config.log
qemu-iotests: get rid of _full_imgproto_details()
qemu-iotests: remove commented out variables
qemu-iotests: remove comment about root privileges
docs: fix broken paths to docs/interop dir

Quoted 6 lines
 configure                           |  4 +---
 docs/devel/writing-qmp-commands.txt |  2 +-
 qapi-schema.json                    |  2 +-
 tests/qemu-iotests/check            | 13 +------------
 tests/qemu-iotests/common.rc        |  5 -----
 5 files changed, 4 insertions(+), 22 deletions(-)

CCing Kevin Wolf for qemu-iotests changes.