From 40ec4ff65859b245da3b116320e1be741d8eb131 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Fri, 13 Jan 2017 07:33:02 -0500 Subject: [PATCH] storage: Alter error message in probe/empty checks For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to avoid using the virsh like --overwrite syntax. Additionally provide a different error message when not writing the label to avoid confusion. --- src/storage/storage_backend.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 79482e6221..dc8f20c119 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -2808,10 +2808,17 @@ virStorageBackendBLKIDFindEmpty(const char *device, break; case VIR_STORAGE_BLKID_PROBE_DIFFERENT: - virReportError(VIR_ERR_STORAGE_POOL_BUILT, - _("Device '%s' formatted cannot overwrite using '%s', " - "requires build --overwrite"), - device, format); + if (writelabel) + virReportError(VIR_ERR_STORAGE_POOL_BUILT, + _("Format of device '%s' does not match the " + "expected format '%s', forced overwrite is " + "necessary"), + device, format); + else + virReportError(VIR_ERR_OPERATION_INVALID, + _("Format of device '%s' does not match the " + "expected format '%s'"), + device, format); break; } -- 2.47.2