From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJeO-00039K-Mr for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:03:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUJeI-0006sv-NM for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:03:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJeI-0006sj-Ex for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:03:42 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9AH3f0c023581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 13:03:41 -0400 Message-ID: <1381424620.2796.1.camel@ul30vt.home> From: Alex Williamson Date: Thu, 10 Oct 2013 11:03:40 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci-assign: Fix error_report of pci-stub message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson Cc: qemu-devel@nongnu.org, mst@redhat.com On Thu, 2013-10-10 at 12:58 -0400, 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_report to preserve the intended > formatting. > > Signed-off-by: Cole Robinson > --- > hw/i386/kvm/pci-assign.c | 34 +++++++++++++++------------------- > 1 file changed, 15 insertions(+), 19 deletions(-) Acked-by: Alex Williamson > diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c > index 5618173..787b86e 100644 > --- a/hw/i386/kvm/pci-assign.c > +++ b/hw/i386/kvm/pci-assign.c > @@ -792,25 +792,21 @@ static void assign_failed_examine(AssignedDevice *dev) > } > > 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("***"); > + "%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; >