qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Consolidate the lockin


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Consolidate the locking error message
Date: Fri, 1 Jun 2018 07:32:49 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/01/2018 04:18 AM, Fam Zheng wrote:
When hot-plugging a block device fails due to image locking errors,
users won't see the helpful 'Is another process using the image?'
message in QMP because currently the error hint is not carried over
there.

Even though extending QMP to include hint is a conceivably easy task,
Libvirt will need some change to consume that data.

Before that is fully sorted out, let's just do the easy fix by joining
the two lines.

Signed-off-by: Fam Zheng <address@hidden>
---
  block/file-posix.c         | 10 ++--
  tests/qemu-iotests/153.out | 99 +++++++++++++-------------------------
  tests/qemu-iotests/182.out |  3 +-
  3 files changed, 38 insertions(+), 74 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 5a602cfe37..03776e13b1 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -699,11 +699,10 @@ static int raw_check_lock_bytes(BDRVRawState *s,
              if (ret) {
                  char *perm_name = bdrv_perm_names(p);
                  error_setg(errp,
-                           "Failed to get \"%s\" lock",
+                           "Failed to get \"%s\" lock. "
+                           "Is another process using the image?",

Except that this goes against the error message recommendations that Markus has tried to remind people of (in general, using a full-stop in error_setg() is frowned on). Markus, do you have any suggestions?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]