[Qemu-devel] [PULL 0/3] Usb 20170929 patches

Gerd Hoffmann posted 3 patches 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170929110052.6111-1-kraxel@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
hw/usb/bus.c                | 4 +---
hw/usb/ccid-card-passthru.c | 2 +-
hw/usb/Makefile.objs        | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
[Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Gerd Hoffmann 6 years, 6 months ago
The following changes since commit ab161529261928ae7f3556e3220829c34b2686ec:

  Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170927a' into staging (2017-09-27 22:44:51 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/usb-20170929-pull-request

for you to fetch changes up to 13787d59cf86bac230c4d3eec3580110f53ac113:

  usb: Use angle brackets for cacard include directive (2017-09-29 12:28:26 +0200)

----------------------------------------------------------------
usb fixes.

----------------------------------------------------------------

Fam Zheng (1):
  usb: Use angle brackets for cacard include directive

Gerd Hoffmann (1):
  usb: fix libusb config variable name.

Thomas Huth (1):
  hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple()

 hw/usb/bus.c                | 4 +---
 hw/usb/ccid-card-passthru.c | 2 +-
 hw/usb/Makefile.objs        | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

-- 
2.9.3


Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Peter Maydell 6 years, 5 months ago
On 29 September 2017 at 12:00, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit ab161529261928ae7f3556e3220829c34b2686ec:
>
>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170927a' into staging (2017-09-27 22:44:51 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/usb-20170929-pull-request
>
> for you to fetch changes up to 13787d59cf86bac230c4d3eec3580110f53ac113:
>
>   usb: Use angle brackets for cacard include directive (2017-09-29 12:28:26 +0200)
>
> ----------------------------------------------------------------
> usb fixes.
>
> ----------------------------------------------------------------

This fails to build from clean (x86-64 Linux host):

make[1]: *** No rule to make target '../hw/usb/host-stub.o', needed by
'qemu-system-microblaze'. Stop.

(and similar for other targets).

thanks
-- PMM

Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Gerd Hoffmann 6 years, 5 months ago
  Hi,

> This fails to build from clean (x86-64 Linux host):
> 
> make[1]: *** No rule to make target '../hw/usb/host-stub.o', needed
> by
> 'qemu-system-microblaze'. Stop.
> 
> (and similar for other targets).

/me looks puzzled.

There is a "hw/usb/host-stub.c" file in the repo, so I fail so see why
make thinks it can't build the object file ...

Also it works fine in my testing, including a full build of all targets
(some with and some without usb support).

cheers,
  Gerd


Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Thomas Huth 6 years, 5 months ago
On 04.10.2017 10:43, Gerd Hoffmann wrote:
>   Hi,
> 
>> This fails to build from clean (x86-64 Linux host):
>>
>> make[1]: *** No rule to make target '../hw/usb/host-stub.o', needed
>> by
>> 'qemu-system-microblaze'. Stop.
>>
>> (and similar for other targets).
> 
> /me looks puzzled.
> 
> There is a "hw/usb/host-stub.c" file in the repo, so I fail so see why
> make thinks it can't build the object file ...
> 
> Also it works fine in my testing, including a full build of all targets
> (some with and some without usb support).

Ah, deja vu. I think you've now run into the problem that I had with my
patch, too - see:

 https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01875.html
 https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02082.html

I think this is a race condition when building with "make -j" in
parallel. Just add a line like this and you should be fine:

common-obj-$(CONFIG_ALL) += host-stub.o

 Thomas

Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Gerd Hoffmann 6 years, 5 months ago
  Hi,
> 
> Ah, deja vu. I think you've now run into the problem that I had with
> my
> patch, too - see:
> 
>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01875.html
>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02082.html
> 
> I think this is a race condition when building with "make -j" in
> parallel. Just add a line like this and you should be fine:
> 
> common-obj-$(CONFIG_ALL) += host-stub.o

I'd guess when compiling this unconditionally we better move it over to
stubs.

cheers,
  Gerd

diff --git a/hw/usb/host-stub.c b/stubs/usb-host.c
similarity index 100%
rename from hw/usb/host-stub.c
rename to stubs/usb-host.c
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 0e6d54b21f..c2f46ac540 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -44,8 +44,6 @@ redirect.o-libs = $(USB_REDIR_LIBS)
 # usb pass-through
 ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy)
 common-obj-y += host-libusb.o host-legacy.o
-else
-common-obj-y += host-stub.o
 endif
 
 host-libusb.o-cflags := $(LIBUSB_CFLAGS)
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index c7594796c3..edccdc5f1e 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -41,3 +41,4 @@ stub-obj-y += vmgenid.o
 stub-obj-y += xen-common.o
 stub-obj-y += xen-hvm.o
 stub-obj-y += pci-host-piix.o
+stub-obj-y += usb-host.o

Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Paolo Bonzini 6 years, 5 months ago
On 04/10/2017 11:50, Gerd Hoffmann wrote:
>   Hi,
>>
>> Ah, deja vu. I think you've now run into the problem that I had with
>> my
>> patch, too - see:
>>
>>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01875.html
>>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02082.html
>>
>> I think this is a race condition when building with "make -j" in
>> parallel. Just add a line like this and you should be fine:
>>
>> common-obj-$(CONFIG_ALL) += host-stub.o
> 
> I'd guess when compiling this unconditionally we better move it over to
> stubs.

No, just do what Thomas said.  See hw/pci/Makefile.objs for an example:

common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
common-obj-$(CONFIG_ALL) += pci-stub.o

So just add the line outside the "if".

Paolo

> cheers,
>   Gerd
> 
> diff --git a/hw/usb/host-stub.c b/stubs/usb-host.c
> similarity index 100%
> rename from hw/usb/host-stub.c
> rename to stubs/usb-host.c
> diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
> index 0e6d54b21f..c2f46ac540 100644
> --- a/hw/usb/Makefile.objs
> +++ b/hw/usb/Makefile.objs
> @@ -44,8 +44,6 @@ redirect.o-libs = $(USB_REDIR_LIBS)
>  # usb pass-through
>  ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy)
>  common-obj-y += host-libusb.o host-legacy.o
> -else
> -common-obj-y += host-stub.o
>  endif
>  
>  host-libusb.o-cflags := $(LIBUSB_CFLAGS)
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index c7594796c3..edccdc5f1e 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -41,3 +41,4 @@ stub-obj-y += vmgenid.o
>  stub-obj-y += xen-common.o
>  stub-obj-y += xen-hvm.o
>  stub-obj-y += pci-host-piix.o
> +stub-obj-y += usb-host.o
> 


Re: [Qemu-devel] [PULL 0/3] Usb 20170929 patches
Posted by Paolo Bonzini 6 years, 5 months ago
On 04/10/2017 11:37, Thomas Huth wrote:
> Ah, deja vu. I think you've now run into the problem that I had with my
> patch, too - see:
> 
>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01875.html
>  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02082.html
> 
> I think this is a race condition when building with "make -j" in
> parallel. Just add a line like this and you should be fine:
> 
> common-obj-$(CONFIG_ALL) += host-stub.o

That's correct!  Maybe it should be documented in build-system.txt.

It's basically an optimization, CONFIG_ALL is used when some stubs are
not used in all subtargets but you still want to build them once-only.

Then the toplevel Makefile will typically see the configuration symbol
as defined (because it operates on the union of all targets'
configuration symbols), and will skip builting the "stubs" file.  Using
CONFIG_ALL for the stubs file ensures that the object file is available
before recursing.

Paolo