[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 08/16] pci-assign: Fix error_report of pci-stub mes
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 08/16] pci-assign: Fix error_report of pci-stub message |
Date: |
Wed, 13 Nov 2013 17:01:12 +0400 |
From: Cole Robinson <address@hidden>
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 <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
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 011764f..aae4309 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;
--
1.7.10.4
- [Qemu-trivial] [PULL 07/16] qapi: Fix comment for create-type to match code., (continued)
- [Qemu-trivial] [PULL 07/16] qapi: Fix comment for create-type to match code., Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 13/16] trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies), Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 11/16] console: Remove unused debug code, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 15/16] gtk: Replace conditional debug messages by trace methods, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 06/16] vl: fix build when configured with no graphic support, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 09/16] .travis.yml: basic compile and check recipes, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 05/16] usb: drop unused USBNetState.inpkt field, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 16/16] qga: Fix shutdown command of guest agent to work with SysV, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 12/16] trace: Remove trace.h from console.h (less dependencies), Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 14/16] console: Replace conditional debug messages by trace methods, Michael Tokarev, 2013/11/13
- [Qemu-trivial] [PULL 08/16] pci-assign: Fix error_report of pci-stub message,
Michael Tokarev <=
- Re: [Qemu-trivial] [PULL 00/16] [for-1.7] Trivial patches for 2013-11-13, Stefan Weil, 2013/11/13