Received: from eggs.gnu.org ([2001:4830:134:3::10]:58760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgaNR-0000zl-UZ for qemu-devel@nongnu.org; Wed, 13 Nov 2013 08:21:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgaNL-0005Nw-OT for qemu-devel@nongnu.org; Wed, 13 Nov 2013 08:21:01 -0500 From: Michael Tokarev Date: Wed, 13 Nov 2013 17:01:12 +0400 Message-Id: <1384347680-15976-9-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1384347680-15976-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1384347680-15976-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PULL 08/16] pci-assign: Fix error_report of pci-stub message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-trivial@nongnu.org, Michael Tokarev , qemu-devel@nongnu.org, Cole Robinson From: Cole Robinson 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 Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- 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