diff mbox

[3/3] block: drive_init(): Improve CHS setting error message

Message ID 1309458783-12661-4-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino June 30, 2011, 6:33 p.m. UTC
The current media doesn't clearly say the error cause.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 blockdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Markus Armbruster July 1, 2011, 7:21 a.m. UTC | #1
Luiz Capitulino <lcapitulino@redhat.com> writes:

> The current media doesn't clearly say the error cause.
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  blockdev.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 0a90ae8..2dbdd1b 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -311,7 +311,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
>  	        media = MEDIA_DISK;
>  	    } else if (!strcmp(buf, "cdrom")) {
>              if (cyls || secs || heads) {
> -                error_report("'%s' invalid physical CHS format", buf);
> +                error_report("CHS can't be set for CDROM media '%s'", buf);
>  	            return NULL;
>              }
>  	        media = MEDIA_CDROM;

It's an improvement.  I'd like "CHS can't be set with media=%s" even
better, because it's closer to the actual option string.  Matter of
taste.
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index 0a90ae8..2dbdd1b 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -311,7 +311,7 @@  DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
 	        media = MEDIA_DISK;
 	    } else if (!strcmp(buf, "cdrom")) {
             if (cyls || secs || heads) {
-                error_report("'%s' invalid physical CHS format", buf);
+                error_report("CHS can't be set for CDROM media '%s'", buf);
 	            return NULL;
             }
 	        media = MEDIA_CDROM;