All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, alex.williamson@redhat.com,
	armbru@redhat.com, mst@redhat.com
Subject: Re: [Qemu-trivial] [PATCH v2] pci-assign: Fix error_report of pci-stub message
Date: Tue, 05 Nov 2013 18:47:27 -0500	[thread overview]
Message-ID: <5279838F.8060008@redhat.com> (raw)
In-Reply-To: <1d038bb1867cd9c72ba555ab40d4c891df71c5f5.1381506642.git.crobinso@redhat.com>

cc-ing qemu-trivial since this hasn't been picked up yet AFAICT.

- Cole

On 10/11/2013 11:52 AM, Cole Robinson wrote:
> Using multiple calls to error_report here means every line is
> prefaced with the (potentially long) pci-assign command line
> arguments.
> 
> Use a single error_printf to preserve the intended formatting.
> Since this code path is always preceded by an error_report call,
> we don't lose the command line reporting.
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
> 
> v2: Switch to error_printf
> 
>  hw/i386/kvm/pci-assign.c | 36 ++++++++++++++++--------------------
>  1 file changed, 16 insertions(+), 20 deletions(-)
> 
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 5618173..f013a1c 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -791,26 +791,22 @@ static void assign_failed_examine(AssignedDevice *dev)
>          goto fail;
>      }
>  
> -    error_report("*** The driver '%s' is occupying your device "
> -                 "%04x:%02x:%02x.%x.",
> -                 ns, dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function);
> -    error_report("***");
> -    error_report("*** You can try the following commands to free it:");
> -    error_report("***");
> -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/"
> -                 "new_id", vendor_id, device_id);
> -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> -                 "%s/unbind",
> -                 dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function, ns);
> -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> -                 "pci-stub/bind",
> -                 dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function);
> -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub"
> -                 "/remove_id", vendor_id, device_id);
> -    error_report("***");
> +    error_printf("*** The driver '%s' is occupying your device "
> +        "%04x:%02x:%02x.%x.\n"
> +        "***\n"
> +        "*** You can try the following commands to free it:\n"
> +        "***\n"
> +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/new_id\n"
> +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/%s/unbind\n"
> +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> +        "pci-stub/bind\n"
> +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/remove_id\n"
> +        "***",
> +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
> +        dev->host.function, vendor_id, device_id,
> +        dev->host.domain, dev->host.bus, dev->host.slot, dev->host.function,
> +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
> +        dev->host.function, vendor_id, device_id);
>  
>      return;
>  
> 



WARNING: multiple messages have this Message-ID (diff)
From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, alex.williamson@redhat.com,
	armbru@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] pci-assign: Fix error_report of pci-stub message
Date: Tue, 05 Nov 2013 18:47:27 -0500	[thread overview]
Message-ID: <5279838F.8060008@redhat.com> (raw)
In-Reply-To: <1d038bb1867cd9c72ba555ab40d4c891df71c5f5.1381506642.git.crobinso@redhat.com>

cc-ing qemu-trivial since this hasn't been picked up yet AFAICT.

- Cole

On 10/11/2013 11:52 AM, Cole Robinson wrote:
> Using multiple calls to error_report here means every line is
> prefaced with the (potentially long) pci-assign command line
> arguments.
> 
> Use a single error_printf to preserve the intended formatting.
> Since this code path is always preceded by an error_report call,
> we don't lose the command line reporting.
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
> 
> v2: Switch to error_printf
> 
>  hw/i386/kvm/pci-assign.c | 36 ++++++++++++++++--------------------
>  1 file changed, 16 insertions(+), 20 deletions(-)
> 
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 5618173..f013a1c 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -791,26 +791,22 @@ static void assign_failed_examine(AssignedDevice *dev)
>          goto fail;
>      }
>  
> -    error_report("*** The driver '%s' is occupying your device "
> -                 "%04x:%02x:%02x.%x.",
> -                 ns, dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function);
> -    error_report("***");
> -    error_report("*** You can try the following commands to free it:");
> -    error_report("***");
> -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/"
> -                 "new_id", vendor_id, device_id);
> -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> -                 "%s/unbind",
> -                 dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function, ns);
> -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> -                 "pci-stub/bind",
> -                 dev->host.domain, dev->host.bus, dev->host.slot,
> -                 dev->host.function);
> -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub"
> -                 "/remove_id", vendor_id, device_id);
> -    error_report("***");
> +    error_printf("*** The driver '%s' is occupying your device "
> +        "%04x:%02x:%02x.%x.\n"
> +        "***\n"
> +        "*** You can try the following commands to free it:\n"
> +        "***\n"
> +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/new_id\n"
> +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/%s/unbind\n"
> +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
> +        "pci-stub/bind\n"
> +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/remove_id\n"
> +        "***",
> +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
> +        dev->host.function, vendor_id, device_id,
> +        dev->host.domain, dev->host.bus, dev->host.slot, dev->host.function,
> +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
> +        dev->host.function, vendor_id, device_id);
>  
>      return;
>  
> 

  parent reply	other threads:[~2013-11-05 23:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 15:52 [Qemu-devel] [PATCH v2] pci-assign: Fix error_report of pci-stub message Cole Robinson
2013-10-14  6:47 ` Markus Armbruster
2013-11-05 23:47 ` Cole Robinson [this message]
2013-11-05 23:47   ` Cole Robinson
2013-11-06  8:44   ` [Qemu-trivial] " Michael Tokarev
2013-11-06  8:44     ` [Qemu-devel] " Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5279838F.8060008@redhat.com \
    --to=crobinso@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.