Ravenports generated: 27 May 2020 18:48
[ravenports.git] / bucket_A9 / qemu
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               qemu
4 VERSION=                5.0.0
5 REVISION=               1
6 KEYWORDS=               emulators
7 VARIANTS=               standard
8 SDESC[standard]=        Fast CPU emulator and virtualizer for x86 platform
9 HOMEPAGE=               https://www.qemu.org/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            https://download.qemu.org/
14 DISTFILE[1]=            qemu-5.0.0.tar.xz:main
15 DF_INDEX=               1
16 SPKGS[standard]=        complete
17                         primary
18                         docs
19                         nls
20
21 OPTIONS_AVAILABLE=      none
22 OPTIONS_STANDARD=       none
23
24 BUILD_DEPENDS=          texi2html:primary:standard
25                         python-Sphinx:single:python_default
26 BUILDRUN_DEPENDS=       nettle:primary:standard
27                         fontconfig:primary:standard
28                         freetype:primary:standard
29                         gnutls:primary:standard
30                         cyrus-sasl:primary:standard
31                         curl:primary:standard
32                         vde2:single:standard
33                         libepoxy:single:standard
34
35 USES=                   cpe gmake pkgconfig bison perl:build python:build
36                         jpeg png mesa gettext-runtime gettext-tools ncurses
37                         makeinfo
38 GNOME_COMPONENTS=       gdkpixbuf gtk2 vte
39 SDL_COMPONENTS=         sdl2
40 XORG_COMPONENTS=        x11 xext
41
42 LICENSE=                GPLv2:primary
43 LICENSE_TERMS=          primary:{{WRKSRC}}/LICENSE
44 LICENSE_FILE=           GPLv2:{{WRKSRC}}/COPYING
45 LICENSE_SCHEME=         solo
46
47 FPC_EQUIVALENT=         emulators/qemu
48
49 MUST_CONFIGURE=         yes
50 CONFIGURE_ARGS=         --disable-usb-redir
51                         --disable-stack-protector
52                         --disable-kvm
53                         --disable-xen
54                         --disable-vde
55                         --enable-pcap
56                         --enable-docs
57                         --enable-debug
58                         --enable-debug-info
59                         --prefix={{PREFIX}}
60                         --cc={{CC}}
61                         --python={{PYTHON_CMD}}
62                         --localstatedir=/var
63                         --extra-cflags="-I{{WRKSRC}} -I{{LOCALBASE}}/include -DPREFIX=\\\"\"{{PREFIX}}\\\"\""
64                         --extra-ldflags="-L/usr/lib -L{{LOCALBASE}}/lib"
65
66 MAKE_ENV=               BSD_MAKE="{{MAKE}}"
67                         V=1
68
69 INSTALL_REQ_TOOLCHAIN=  yes
70 PLIST_SUB=              JQUERY=3.5.1
71
72 VAR_OPSYS[freebsd]=     CONFIGURE_ARGS=--enable-netmap
73                         CONFIGURE_ARGS=--disable-linux-user
74                         CONFIGURE_ARGS=--disable-linux-aio
75 VAR_OPSYS[linux]=       CONFIGURE_ARGS=--disable-netmap
76 VAR_OPSYS[dragonfly]=   CONFIGURE_ARGS=--disable-netmap
77                         CONFIGURE_ARGS=--disable-linux-user
78                         CONFIGURE_ARGS=--disable-linux-aio
79
80 post-patch:
81         ${REINPLACE_CMD} -e '/LIBS/s|-lprocstat|-lprocstat -lelf|' \
82                  -e '/libusb/s/ --atleast-version=1\.0\.[0-9]*//' \
83                 ${WRKSRC}/configure
84         ${REINPLACE_CMD} -E \
85                 -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \
86                 -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
87                 ${WRKSRC}/Makefile.target
88         ${REINPLACE_CMD} -E \
89                 -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \
90                 -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
91                 ${WRKSRC}/Makefile
92         ${REINPLACE_CMD} -E \
93                 -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \
94                 ${WRKSRC}/scripts/texi2pod.pl
95         # GNS3 (promiscuous multicast)
96         ${REINPLACE_CMD} -e 's|(buf\[0\] & 1) && (rctl & E1000_RCTL_MPE)|buf[0] \& 1|' \
97                 ${WRKSRC}/hw/net/e1000.c
98         # broken build for optionrom
99         ${REINPLACE_CMD} -e '/roms="optionrom"/d' ${WRKSRC}/configure
100         # silence some include warnings
101         ${MKDIR} ${WRKSRC}/bsd-user/dragonfly
102
103 pre-install:
104         # for some reason file is considered out-of-date
105         ${TOUCH} ${WRKSRC}/config-host.mak
106
107 post-patch-dragonfly:
108         ${REINPLACE_CMD} -e '/libs_qga=..glib_libs/ s|glib_libs|glib_libs -lintl|' \
109                 ${WRKSRC}/configure
110
111 post-install:
112         ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample \
113                 ${STAGEDIR}${PREFIX}/etc
114         ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample \
115                 ${STAGEDIR}${PREFIX}/etc
116         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
117         (cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${STD_DOCDIR}/)
118         # remove empty directories
119         ${RM} -r ${STAGEDIR}/var
120
121 post-patch-freebsd:
122         ${REINPLACE_CMD} -e '/libs_qga=..glib_libs/ s|glib_libs|glib_libs -lintl|' \
123                 ${WRKSRC}/configure
124
125 [FILE:782:descriptions/desc.primary]
126 QEMU is a fast processor emulator using dynamic translation to achieve
127 good emulation speed.  QEMU has two operating modes:
128
129  * Full system emulation. In this mode, QEMU emulates a full system (for
130    example a PC), including a processor and various peripherials.  It can
131    be used to launch different Operating Systems without rebooting the PC
132    or to debug system code.
133  * User mode emulation (Linux host only). In this mode, QEMU can launch
134    Linux processes compiled for one CPU on another CPU. It can be used to
135    launch the Wine Windows API emulator or to ease cross-compilation and
136    cross-debugging.
137
138 As QEMU requires no host kernel patches to run, it is safe and easy to use.
139
140 See also the preconfigured system images on http://oszoo.org/
141 Many live cd isos also work.
142
143
144 [FILE:96:distinfo]
145 2f13a92a0fa5c8b69ff0796b59b86b080bbb92ebad5d301a7724dd06b5e78cb6     62426192 qemu-5.0.0.tar.xz
146
147
148 [FILE:3493:manifests/plist.primary]
149 @sample etc/qemu-ifdown.sample
150 @sample etc/qemu-ifup.sample
151 %%ONLY-LINUX%%bin/
152  ivshmem-client
153  ivshmem-server
154  qemu-aarch64
155  qemu-aarch64_be
156  qemu-alpha
157  qemu-arm
158  qemu-armeb
159  qemu-cris
160  qemu-hppa
161  qemu-m68k
162  qemu-microblaze
163  qemu-microblazeel
164  qemu-mips
165  qemu-mips64
166  qemu-mips64el
167  qemu-mipsel
168  qemu-mipsn32
169  qemu-mipsn32el
170  qemu-nios2
171  qemu-or1k
172  qemu-ppc
173  qemu-ppc64
174  qemu-ppc64abi32
175  qemu-ppc64le
176  qemu-pr-helper
177  qemu-riscv32
178  qemu-riscv64
179  qemu-s390x
180  qemu-sh4
181  qemu-sh4eb
182  qemu-sparc32plus
183  qemu-tilegx
184  qemu-xtensa
185  qemu-xtensaeb
186 %%ONLY-LINUX%%libexec/qemu-bridge-helper
187 bin/
188  elf2dmp
189  qemu-edid
190  qemu-ga
191  qemu-i386
192  qemu-img
193  qemu-io
194  qemu-nbd
195  qemu-sparc
196  qemu-sparc64
197  qemu-storage-daemon
198  qemu-system-aarch64
199  qemu-system-alpha
200  qemu-system-arm
201  qemu-system-cris
202  qemu-system-hppa
203  qemu-system-i386
204  qemu-system-lm32
205  qemu-system-m68k
206  qemu-system-microblaze
207  qemu-system-microblazeel
208  qemu-system-mips
209  qemu-system-mips64
210  qemu-system-mips64el
211  qemu-system-mipsel
212  qemu-system-moxie
213  qemu-system-nios2
214  qemu-system-or1k
215  qemu-system-ppc
216  qemu-system-ppc64
217  qemu-system-riscv32
218  qemu-system-riscv64
219  qemu-system-rx
220  qemu-system-s390x
221  qemu-system-sh4
222  qemu-system-sh4eb
223  qemu-system-sparc
224  qemu-system-sparc64
225  qemu-system-tricore
226  qemu-system-unicore32
227  qemu-system-x86_64
228  qemu-system-xtensa
229  qemu-system-xtensaeb
230  qemu-x86_64
231 share/applications/qemu.desktop
232 share/icons/hicolor/128x128/apps/qemu.png
233 share/icons/hicolor/16x16/apps/qemu.png
234 share/icons/hicolor/24x24/apps/qemu.png
235 share/icons/hicolor/256x256/apps/qemu.png
236 share/icons/hicolor/32x32/apps/
237  qemu.bmp
238  qemu.png
239 share/icons/hicolor/48x48/apps/qemu.png
240 share/icons/hicolor/512x512/apps/qemu.png
241 share/icons/hicolor/64x64/apps/qemu.png
242 share/icons/hicolor/scalable/apps/qemu.svg
243 share/man/man1/
244  qemu-img.1.gz
245  qemu.1.gz
246 share/man/man7/
247  qemu-block-drivers.7.gz
248  qemu-cpu-models.7.gz
249  qemu-ga-ref.7.gz
250  qemu-qmp-ref.7.gz
251 share/man/man8/
252  qemu-ga.8.gz
253  qemu-nbd.8.gz
254 share/qemu/
255  QEMU,cgthree.bin
256  QEMU,tcx.bin
257  bamboo.dtb
258  bios-256k.bin
259  bios-microvm.bin
260  bios.bin
261  canyonlands.dtb
262  edk2-aarch64-code.fd
263  edk2-arm-code.fd
264  edk2-arm-vars.fd
265  edk2-i386-code.fd
266  edk2-i386-secure-code.fd
267  edk2-i386-vars.fd
268  edk2-licenses.txt
269  edk2-x86_64-code.fd
270  edk2-x86_64-secure-code.fd
271  efi-e1000.rom
272  efi-e1000e.rom
273  efi-eepro100.rom
274  efi-ne2k_pci.rom
275  efi-pcnet.rom
276  efi-rtl8139.rom
277  efi-virtio.rom
278  efi-vmxnet3.rom
279  hppa-firmware.img
280  kvmvapic.bin
281  linuxboot.bin
282  linuxboot_dma.bin
283  multiboot.bin
284  openbios-ppc
285  openbios-sparc32
286  openbios-sparc64
287  opensbi-riscv32-sifive_u-fw_jump.bin
288  opensbi-riscv32-virt-fw_jump.bin
289  opensbi-riscv64-sifive_u-fw_jump.bin
290  opensbi-riscv64-virt-fw_jump.bin
291  palcode-clipper
292  petalogix-ml605.dtb
293  petalogix-s3adsp1800.dtb
294  pvh.bin
295  pxe-e1000.rom
296  pxe-eepro100.rom
297  pxe-ne2k_pci.rom
298  pxe-pcnet.rom
299  pxe-rtl8139.rom
300  pxe-virtio.rom
301  qemu-nsis.bmp
302  qemu_vga.ndrv
303  s390-ccw.img
304  s390-netboot.img
305  sgabios.bin
306  skiboot.lid
307  slof.bin
308  trace-events-all
309  u-boot-sam460-20100605.bin
310  u-boot.e500
311  vgabios-ati.bin
312  vgabios-bochs-display.bin
313  vgabios-cirrus.bin
314  vgabios-qxl.bin
315  vgabios-ramfb.bin
316  vgabios-stdvga.bin
317  vgabios-virtio.bin
318  vgabios-vmware.bin
319  vgabios.bin
320 share/qemu/firmware/
321  50-edk2-i386-secure.json
322  50-edk2-x86_64-secure.json
323  60-edk2-aarch64.json
324  60-edk2-arm.json
325  60-edk2-i386.json
326  60-edk2-x86_64.json
327 share/qemu/keymaps/
328  ar
329  bepo
330  cz
331  da
332  de
333  de-ch
334  en-gb
335  en-us
336  es
337  et
338  fi
339  fo
340  fr
341  fr-be
342  fr-ca
343  fr-ch
344  hr
345  hu
346  is
347  it
348  ja
349  lt
350  lv
351  mk
352  nl
353  no
354  pl
355  pt
356  pt-br
357  ru
358  sl
359  sv
360  th
361  tr
362
363
364 [FILE:10655:manifests/plist.docs]
365 share/doc/qemu/
366  index.html
367  qemu-ga-ref.html
368  qemu-ga-ref.txt
369  qemu-qmp-ref.html
370  qemu-qmp-ref.txt
371 share/doc/qemu/docs/
372  COLO-FT.txt
373  amd-memory-encryption.txt
374  barrier.txt
375  block-replication.txt
376  bootindex.txt
377  can.txt
378  ccid.txt
379  colo-proxy.txt
380  conf.py
381  cpu-hotplug.rst
382  defs.rst.inc
383  generic-loader.txt
384  hyperv.txt
385  igd-assign.txt
386  image-fuzzer.txt
387  index.html.in
388  index.rst
389  memory-hotplug.txt
390  microvm.rst
391  multi-thread-compression.txt
392  multiseat.txt
393  nvdimm.txt
394  pci_expander_bridge.txt
395  pcie.txt
396  pcie_pci_bridge.txt
397  pr-manager.rst
398  pvrdma.txt
399  qcow2-cache.txt
400  qdev-device-use.txt
401  qemu-option-trace.rst.inc
402  qemu_logo.pdf
403  qemupciserial.inf
404  rdma.txt
405  replay.txt
406  spice-port-fqdn.txt
407  throttle.txt
408  usb-storage.txt
409  usb2.txt
410  version.texi
411  virtio-balloon-stats.txt
412  virtio-net-failover.rst
413  virtio-pmem.rst
414  xbzrle.txt
415  xen-save-devices-state.txt
416 share/doc/qemu/docs/built/index.html
417 share/doc/qemu/docs/built/devel/
418  .buildinfo
419  atomics.html
420  bitops.html
421  decodetree.html
422  genindex.html
423  index.html
424  kconfig.html
425  loads-stores.html
426  memory.html
427  migration.html
428  objects.inv
429  reset.html
430  s390-dasd-ipl.html
431  search.html
432  searchindex.js
433  secure-coding-practices.html
434  stable-process.html
435  tcg-plugins.html
436  tcg.html
437  testing.html
438 share/doc/qemu/docs/built/devel/_static/
439  alabaster.css
440  basic.css
441  custom.css
442  doctools.js
443  documentation_options.js
444  file.png
445  jquery-%%JQUERY%%.js
446  jquery.js
447  language_data.js
448  minus.png
449  plus.png
450  pygments.css
451  searchtools.js
452  underscore-1.3.1.js
453  underscore.js
454 share/doc/qemu/docs/built/interop/
455  .buildinfo
456  bitmaps.html
457  dbus-vmstate.html
458  dbus.html
459  genindex.html
460  index.html
461  live-block-operations.html
462  objects.inv
463  pr-helper.html
464  qemu-ga.8
465  qemu-ga.html
466  search.html
467  searchindex.js
468  vhost-user-gpu.html
469  vhost-user.html
470 share/doc/qemu/docs/built/interop/_static/
471  alabaster.css
472  basic.css
473  custom.css
474  doctools.js
475  documentation_options.js
476  file.png
477  jquery-%%JQUERY%%.js
478  jquery.js
479  language_data.js
480  minus.png
481  plus.png
482  pygments.css
483  searchtools.js
484  underscore-1.3.1.js
485  underscore.js
486 share/doc/qemu/docs/built/specs/
487  .buildinfo
488  acpi_hw_reduced_hotplug.html
489  genindex.html
490  index.html
491  objects.inv
492  ppc-spapr-xive.html
493  ppc-xive.html
494  search.html
495  searchindex.js
496  tpm.html
497 share/doc/qemu/docs/built/specs/_static/
498  alabaster.css
499  basic.css
500  custom.css
501  doctools.js
502  documentation_options.js
503  file.png
504  jquery-%%JQUERY%%.js
505  jquery.js
506  language_data.js
507  minus.png
508  plus.png
509  pygments.css
510  searchtools.js
511  underscore-1.3.1.js
512  underscore.js
513 share/doc/qemu/docs/built/system/
514  .buildinfo
515  build-platforms.html
516  deprecated.html
517  gdb.html
518  genindex.html
519  images.html
520  index.html
521  invocation.html
522  ivshmem.html
523  keys.html
524  license.html
525  linuxboot.html
526  managed-startup.html
527  monitor.html
528  mux-chardev.html
529  net.html
530  objects.inv
531  qemu-block-drivers.7
532  qemu-block-drivers.html
533  qemu-cpu-models.7
534  qemu-cpu-models.html
535  qemu-manpage.html
536  qemu.1
537  quickstart.html
538  search.html
539  searchindex.js
540  security.html
541  target-arm.html
542  target-i386.html
543  target-m68k.html
544  target-mips.html
545  target-ppc.html
546  target-s390x.html
547  target-sparc.html
548  target-sparc64.html
549  target-xtensa.html
550  targets.html
551  tls.html
552  usb.html
553  vnc-security.html
554 share/doc/qemu/docs/built/system/_static/
555  alabaster.css
556  basic.css
557  custom.css
558  doctools.js
559  documentation_options.js
560  file.png
561  jquery-%%JQUERY%%.js
562  jquery.js
563  language_data.js
564  minus.png
565  plus.png
566  pygments.css
567  searchtools.js
568  underscore-1.3.1.js
569  underscore.js
570 share/doc/qemu/docs/built/system/arm/
571  cpu-features.html
572  integratorcp.html
573  musicpal.html
574  nseries.html
575  orangepi.html
576  palm.html
577  realview.html
578  stellaris.html
579  sx1.html
580  versatile.html
581  xscale.html
582 share/doc/qemu/docs/built/system/s390x/vfio-ap.html
583 share/doc/qemu/docs/built/tools/
584  .buildinfo
585  genindex.html
586  index.html
587  objects.inv
588  qemu-img.1
589  qemu-img.html
590  qemu-nbd.8
591  qemu-nbd.html
592  qemu-trace-stap.1
593  qemu-trace-stap.html
594  search.html
595  searchindex.js
596  virtfs-proxy-helper.1
597  virtfs-proxy-helper.html
598  virtiofsd.1
599  virtiofsd.html
600 share/doc/qemu/docs/built/tools/_static/
601  alabaster.css
602  basic.css
603  custom.css
604  doctools.js
605  documentation_options.js
606  file.png
607  jquery-%%JQUERY%%.js
608  jquery.js
609  language_data.js
610  minus.png
611  plus.png
612  pygments.css
613  searchtools.js
614  underscore-1.3.1.js
615  underscore.js
616 share/doc/qemu/docs/built/user/
617  .buildinfo
618  genindex.html
619  index.html
620  main.html
621  objects.inv
622  search.html
623  searchindex.js
624 share/doc/qemu/docs/built/user/_static/
625  alabaster.css
626  basic.css
627  custom.css
628  doctools.js
629  documentation_options.js
630  file.png
631  jquery-%%JQUERY%%.js
632  jquery.js
633  language_data.js
634  minus.png
635  plus.png
636  pygments.css
637  searchtools.js
638  underscore-1.3.1.js
639  underscore.js
640 share/doc/qemu/docs/config/
641  ich9-ehci-uhci.cfg
642  mach-virt-graphical.cfg
643  mach-virt-serial.cfg
644  q35-emulated.cfg
645  q35-virtio-graphical.cfg
646  q35-virtio-serial.cfg
647 share/doc/qemu/docs/devel/
648  atomics.rst
649  bitops.rst
650  blkdebug.txt
651  blkverify.txt
652  build-system.txt
653  conf.py
654  decodetree.rst
655  fuzzing.txt
656  index.rst
657  kconfig.rst
658  loads-stores.rst
659  lockcnt.txt
660  memory.rst
661  migration.rst
662  multi-thread-tcg.txt
663  multiple-iothreads.txt
664  qapi-code-gen.txt
665  rcu.txt
666  replay.txt
667  reset.rst
668  s390-dasd-ipl.rst
669  secure-coding-practices.rst
670  stable-process.rst
671  tcg-plugins.rst
672  tcg.rst
673  testing.rst
674  tracing.txt
675  virtio-migration.txt
676  writing-qmp-commands.txt
677 share/doc/qemu/docs/interop/
678  bitmaps.rst
679  conf.py
680  dbus-vmstate.rst
681  dbus.rst
682  firmware.json
683  index.rst
684  live-block-operations.rst
685  nbd.txt
686  parallels.txt
687  pr-helper.rst
688  prl-xml.txt
689  qcow2.txt
690  qed_spec.txt
691  qemu-ga-qapi.texi
692  qemu-ga-ref.7
693  qemu-ga-ref.7.pod
694  qemu-ga-ref.html
695  qemu-ga-ref.texi
696  qemu-ga-ref.txt
697  qemu-ga.rst
698  qemu-qmp-qapi.texi
699  qemu-qmp-ref.7
700  qemu-qmp-ref.7.pod
701  qemu-qmp-ref.html
702  qemu-qmp-ref.texi
703  qemu-qmp-ref.txt
704  qmp-intro.txt
705  qmp-spec.txt
706  vhost-user-gpu.rst
707  vhost-user.json
708  vhost-user.rst
709  vnc-ledstate-Pseudo-encoding.txt
710 share/doc/qemu/docs/specs/
711  acpi_cpu_hotplug.txt
712  acpi_hw_reduced_hotplug.rst
713  acpi_mem_hotplug.txt
714  acpi_nvdimm.txt
715  acpi_pci_hotplug.txt
716  conf.py
717  edu.txt
718  fw_cfg.txt
719  index.rst
720  ivshmem-spec.txt
721  pci-ids.txt
722  pci-serial.txt
723  pci-testdev.txt
724  ppc-spapr-hcalls.txt
725  ppc-spapr-hotplug.txt
726  ppc-spapr-uv-hcalls.txt
727  ppc-spapr-xive.rst
728  ppc-xive.rst
729  pvpanic.txt
730  rocker.txt
731  standard-vga.txt
732  tpm.rst
733  vmcoreinfo.txt
734  vmgenid.txt
735  vmw_pvscsi-spec.txt
736 share/doc/qemu/docs/sphinx/
737  hxtool.py
738  kerneldoc.py
739  kernellog.py
740  qmp_lexer.py
741 share/doc/qemu/docs/sphinx/__pycache__/
742  hxtool.cpython-38.pyc
743  kerneldoc.cpython-38.pyc
744  kernellog.cpython-38.pyc
745  qmp_lexer.cpython-%%PYTHON_SUFFIX%%.pyc
746 share/doc/qemu/docs/spin/
747  aio_notify.promela
748  aio_notify_accept.promela
749  aio_notify_bug.promela
750  tcg-exclusive.promela
751  win32-qemu-event.promela
752 share/doc/qemu/docs/system/
753  build-platforms.rst
754  conf.py
755  cpu-models-mips.rst.inc
756  cpu-models-x86.rst.inc
757  deprecated.rst
758  device-url-syntax.rst.inc
759  gdb.rst
760  images.rst
761  index.rst
762  invocation.rst
763  ivshmem.rst
764  keys.rst
765  keys.rst.inc
766  license.rst
767  linuxboot.rst
768  managed-startup.rst
769  monitor.rst
770  mux-chardev.rst
771  mux-chardev.rst.inc
772  net.rst
773  qemu-block-drivers.rst
774  qemu-block-drivers.rst.inc
775  qemu-cpu-models.rst
776  qemu-manpage.rst
777  quickstart.rst
778  security.rst
779  target-arm.rst
780  target-i386-desc.rst.inc
781  target-i386.rst
782  target-m68k.rst
783  target-mips.rst
784  target-ppc.rst
785  target-s390x.rst
786  target-sparc.rst
787  target-sparc64.rst
788  target-xtensa.rst
789  targets.rst
790  tls.rst
791  usb.rst
792  vnc-security.rst
793 share/doc/qemu/docs/system/arm/
794  cpu-features.rst
795  integratorcp.rst
796  musicpal.rst
797  nseries.rst
798  orangepi.rst
799  palm.rst
800  realview.rst
801  stellaris.rst
802  sx1.rst
803  versatile.rst
804  xscale.rst
805 share/doc/qemu/docs/system/s390x/vfio-ap.rst
806 share/doc/qemu/docs/tools/
807  conf.py
808  index.rst
809  qemu-img.rst
810  qemu-nbd.rst
811  qemu-trace-stap.rst
812  virtfs-proxy-helper.rst
813  virtiofsd.rst
814 share/doc/qemu/docs/user/
815  conf.py
816  index.rst
817  main.rst
818 share/doc/qemu/interop/
819  .buildinfo
820  bitmaps.html
821  dbus-vmstate.html
822  dbus.html
823  genindex.html
824  index.html
825  live-block-operations.html
826  objects.inv
827  pr-helper.html
828  qemu-ga.html
829  search.html
830  searchindex.js
831  vhost-user-gpu.html
832  vhost-user.html
833 share/doc/qemu/interop/_static/
834  alabaster.css
835  basic.css
836  custom.css
837  doctools.js
838  documentation_options.js
839  file.png
840  jquery-%%JQUERY%%.js
841  jquery.js
842  language_data.js
843  minus.png
844  plus.png
845  pygments.css
846  searchtools.js
847  underscore-1.3.1.js
848  underscore.js
849 share/doc/qemu/specs/
850  .buildinfo
851  acpi_hw_reduced_hotplug.html
852  genindex.html
853  index.html
854  objects.inv
855  ppc-spapr-xive.html
856  ppc-xive.html
857  search.html
858  searchindex.js
859  tpm.html
860 share/doc/qemu/specs/_static/
861  alabaster.css
862  basic.css
863  custom.css
864  doctools.js
865  documentation_options.js
866  file.png
867  jquery-%%JQUERY%%.js
868  jquery.js
869  language_data.js
870  minus.png
871  plus.png
872  pygments.css
873  searchtools.js
874  underscore-1.3.1.js
875  underscore.js
876 share/doc/qemu/system/
877  .buildinfo
878  build-platforms.html
879  deprecated.html
880  gdb.html
881  genindex.html
882  images.html
883  index.html
884  invocation.html
885  ivshmem.html
886  keys.html
887  license.html
888  linuxboot.html
889  managed-startup.html
890  monitor.html
891  mux-chardev.html
892  net.html
893  objects.inv
894  qemu-block-drivers.html
895  qemu-cpu-models.html
896  qemu-manpage.html
897  quickstart.html
898  search.html
899  searchindex.js
900  security.html
901  target-arm.html
902  target-i386.html
903  target-m68k.html
904  target-mips.html
905  target-ppc.html
906  target-s390x.html
907  target-sparc.html
908  target-sparc64.html
909  target-xtensa.html
910  targets.html
911  tls.html
912  usb.html
913  vnc-security.html
914 share/doc/qemu/system/_static/
915  alabaster.css
916  basic.css
917  custom.css
918  doctools.js
919  documentation_options.js
920  file.png
921  jquery-%%JQUERY%%.js
922  jquery.js
923  language_data.js
924  minus.png
925  plus.png
926  pygments.css
927  searchtools.js
928  underscore-1.3.1.js
929  underscore.js
930 share/doc/qemu/system/arm/
931  cpu-features.html
932  integratorcp.html
933  musicpal.html
934  nseries.html
935  orangepi.html
936  palm.html
937  realview.html
938  stellaris.html
939  sx1.html
940  versatile.html
941  xscale.html
942 share/doc/qemu/system/s390x/vfio-ap.html
943 share/doc/qemu/tools/
944  .buildinfo
945  genindex.html
946  index.html
947  objects.inv
948  qemu-img.html
949  qemu-nbd.html
950  qemu-trace-stap.html
951  search.html
952  searchindex.js
953  virtfs-proxy-helper.html
954  virtiofsd.html
955 share/doc/qemu/tools/_static/
956  alabaster.css
957  basic.css
958  custom.css
959  doctools.js
960  documentation_options.js
961  file.png
962  jquery-%%JQUERY%%.js
963  jquery.js
964  language_data.js
965  minus.png
966  plus.png
967  pygments.css
968  searchtools.js
969  underscore-1.3.1.js
970  underscore.js
971 share/doc/qemu/user/
972  .buildinfo
973  genindex.html
974  index.html
975  main.html
976  objects.inv
977  search.html
978  searchindex.js
979 share/doc/qemu/user/_static/
980  alabaster.css
981  basic.css
982  custom.css
983  doctools.js
984  documentation_options.js
985  file.png
986  jquery-%%JQUERY%%.js
987  jquery.js
988  language_data.js
989  minus.png
990  plus.png
991  pygments.css
992  searchtools.js
993  underscore-1.3.1.js
994  underscore.js
995
996
997 [FILE:261:manifests/plist.nls]
998 share/locale/bg/LC_MESSAGES/qemu.mo
999 share/locale/de_DE/LC_MESSAGES/qemu.mo
1000 share/locale/fr_FR/LC_MESSAGES/qemu.mo
1001 share/locale/hu/LC_MESSAGES/qemu.mo
1002 share/locale/it/LC_MESSAGES/qemu.mo
1003 share/locale/tr/LC_MESSAGES/qemu.mo
1004 share/locale/zh_CN/LC_MESSAGES/qemu.mo
1005
1006
1007 [FILE:3416:patches/patch-configure]
1008 --- configure.orig      2020-04-28 16:49:25 UTC
1009 +++ configure
1010 @@ -493,6 +493,9 @@ numa=""
1011  tcmalloc="no"
1012  jemalloc="no"
1013  replication="yes"
1014 +pcap="no"
1015 +pcap_create="no"
1016 +bpf="no"
1017  vxhs=""
1018  bochs="yes"
1019  cloop="yes"
1020 @@ -1168,6 +1171,10 @@ for opt do
1021    ;;
1022    --enable-vnc-png) vnc_png="yes"
1023    ;;
1024 +  --enable-pcap) pcap="yes"
1025 +  ;;
1026 +  --disable-pcap) pcap="no"
1027 +  ;;
1028    --disable-slirp) slirp="no"
1029    ;;
1030    --enable-slirp=git) slirp="git"
1031 @@ -3137,6 +3144,14 @@ if ! check_include "ifaddrs.h" ; then
1032  fi
1033  
1034  ##########################################
1035 +# getifaddrs (for tests/test-io-channel-socket )
1036 +
1037 +have_ifaddrs_h=yes
1038 +if ! check_include "ifaddrs.h" ; then
1039 +  have_ifaddrs_h=no
1040 +fi
1041 +
1042 +##########################################
1043  # VTE probe
1044  
1045  if test "$vte" != "no"; then
1046 @@ -5098,7 +5113,7 @@ fi
1047  
1048  # check for libusb
1049  if test "$libusb" != "no" ; then
1050 -    if $pkg_config --atleast-version=1.0.13 libusb-1.0; then
1051 +    if $pkg_config libusb-1.0; then
1052          libusb="yes"
1053          libusb_cflags=$($pkg_config --cflags libusb-1.0)
1054          libusb_libs=$($pkg_config --libs libusb-1.0)
1055 @@ -5501,6 +5516,50 @@ if test "$debug_stack_usage" = "yes"; th
1056    fi
1057  fi
1058  
1059 +##########################################
1060 +# pcap probe
1061 +
1062 +if test "$pcap" = "yes" -a "$pcap" != "no"; then
1063 +  cat > $TMPC << EOF
1064 +#include <pcap.h>
1065 +int main(void) { return (pcap_lib_version() == (char *)0 ? 1 : 0); }
1066 +EOF
1067 +  if test "$mingw32" = "no" ; then
1068 +    libpcap=-lpcap
1069 +  else
1070 +    libpcap=-lwpcap
1071 +  fi
1072 +  if compile_prog "" "$libpcap" ; then
1073 +    :
1074 +  else
1075 +    echo
1076 +    echo "Error: Could not find pcap"
1077 +    echo "Make sure to have the pcap libs and headers installed."
1078 +    echo
1079 +    exit 1
1080 +  fi
1081 +  cat > $TMPC << EOF
1082 +#include <pcap.h>
1083 +int main(void)
1084 +{
1085 +  char errbuf[PCAP_ERRBUF_SIZE];
1086 +  return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0);
1087 +}
1088 +EOF
1089 +  if compile_prog "" "$libpcap" ; then
1090 +    pcap_create="yes"
1091 +  fi
1092 +  cat > $TMPC << EOF
1093 +#define PCAP_DONT_INCLUDE_PCAP_BPF_H
1094 +#include <pcap.h>
1095 +#include <net/bpf.h>
1096 +int main(void) { return (BPF_MAJOR_VERSION); }
1097 +EOF
1098 +  if compile_prog ; then
1099 +    bpf="yes"
1100 +  fi
1101 +  libs_softmmu="$libpcap $libs_softmmu"
1102 +fi # test "$pcap"
1103  
1104  ##########################################
1105  # check if we have open_by_handle_at
1106 @@ -6627,6 +6686,7 @@ echo "Audio drivers     $audio_drv_list"
1107  echo "Block whitelist (rw) $block_drv_rw_whitelist"
1108  echo "Block whitelist (ro) $block_drv_ro_whitelist"
1109  echo "VirtFS support    $virtfs"
1110 +echo "pcap support      $pcap"
1111  echo "Multipath support $mpath"
1112  echo "VNC support       $vnc"
1113  if test "$vnc" = "yes" ; then
1114 @@ -6864,6 +6924,15 @@ fi
1115  if test "$want_tools" = "yes" ; then
1116    echo "CONFIG_TOOLS=y" >> $config_host_mak
1117  fi
1118 +if test "$pcap" = "yes" ; then
1119 +  echo "CONFIG_PCAP=y" >> $config_host_mak
1120 +  if test "$pcap_create" = "yes" ; then
1121 +    echo "CONFIG_PCAP_CREATE=y" >> $config_host_mak
1122 +  fi
1123 +  if test "$bpf" = "yes" ; then
1124 +    echo "CONFIG_BPF=y" >> $config_host_mak
1125 +  fi
1126 +fi
1127  if test "$slirp" != "no"; then
1128    echo "CONFIG_SLIRP=y" >> $config_host_mak
1129    echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
1130 @@ -7121,6 +7190,9 @@ fi
1131  if test "$have_fsxattr" = "yes" ; then
1132      echo "HAVE_FSXATTR=y" >> $config_host_mak
1133  fi
1134 +if test "$have_ifaddrs_h" = "yes" ; then
1135 +    echo "HAVE_IFADDRS_H=y" >> $config_host_mak
1136 +fi
1137  if test "$have_copy_file_range" = "yes" ; then
1138      echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak
1139  fi
1140
1141
1142 [FILE:365:patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc]
1143 --- disas/libvixl/vixl/a64/disasm-a64.cc.orig   2020-04-28 16:49:24 UTC
1144 +++ disas/libvixl/vixl/a64/disasm-a64.cc
1145 @@ -2693,7 +2693,7 @@ void Disassembler::AppendPCRelativeOffse
1146    if (offset < 0) {
1147      abs_offset = -abs_offset;
1148    }
1149 -  AppendToOutput("#%c0x%" PRIx64, sign, abs_offset);
1150 +  AppendToOutput("#%c0x%" PRIx64, sign, offset < 0 ? -offset : offset);
1151  }
1152  
1153  
1154
1155
1156 [FILE:582:patches/patch-include_net_net.h]
1157 --- include/net/net.h.orig      2020-04-28 16:49:24 UTC
1158 +++ include/net/net.h
1159 @@ -208,8 +208,8 @@ void netdev_add(QemuOpts *opts, Error **
1160  int net_hub_id_for_client(NetClientState *nc, int *id);
1161  NetClientState *net_hub_port_find(int hub_id);
1162  
1163 -#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
1164 -#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
1165 +#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup"
1166 +#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown"
1167  #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
1168  #define DEFAULT_BRIDGE_INTERFACE "br0"
1169  
1170
1171
1172 [FILE:436:patches/patch-net_clients.h]
1173 --- net/clients.h.orig  2020-04-28 16:49:25 UTC
1174 +++ net/clients.h
1175 @@ -61,4 +61,10 @@ int net_init_netmap(const Netdev *netdev
1176  int net_init_vhost_user(const Netdev *netdev, const char *name,
1177                          NetClientState *peer, Error **errp);
1178  
1179 +#ifdef CONFIG_PCAP
1180 +int net_init_pcap(const Netdev *netdev, const char *name,
1181 +                    NetClientState *peer, Error **errp);
1182 +#endif
1183 +
1184 +
1185  #endif /* QEMU_NET_CLIENTS_H */
1186
1187
1188 [FILE:6930:patches/patch-net_net.c]
1189 --- net/net.c.orig      2020-04-28 16:49:25 UTC
1190 +++ net/net.c
1191 @@ -55,6 +55,11 @@
1192  #include "net/filter.h"
1193  #include "qapi/string-output-visitor.h"
1194  
1195 +#include <sys/ioctl.h>
1196 +#if defined(__FreeBSD__) || defined(__DragonFly__)
1197 +#include <net/if.h>
1198 +#endif
1199 +
1200  /* Net bridge is currently not supported for W32. */
1201  #if !defined(_WIN32)
1202  # define CONFIG_NET_BRIDGE
1203 @@ -935,7 +940,225 @@ static int net_init_nic(const Netdev *ne
1204      return idx;
1205  }
1206  
1207 +#if defined(CONFIG_PCAP)
1208 +#if defined(CONFIG_BPF)
1209 +#define PCAP_DONT_INCLUDE_PCAP_BPF_H
1210 +#include <net/bpf.h>
1211 +#endif
1212 +#include <pcap.h>
1213 +
1214 +struct PCAPState {
1215 +    NetClientState     nc;
1216 +    pcap_t            *handle;
1217 +    int                max_eth_frame_size;
1218 +};
1219 +
1220 +static ssize_t pcap_receive(NetClientState *nc, const uint8_t *buf, size_t size)
1221 +{
1222 +    struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc);
1223 +
1224 +    return pcap_inject(s->handle, (u_char*)buf, size);
1225 +}
1226 +
1227 +static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata
1228 +               )
1229 +{
1230 +    NetClientState *nc = (NetClientState *)user;
1231 +
1232 +    int len = phdr->len;
1233 +#if defined(__FreeBSD__) || defined(__DragonFly__)
1234 +    struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc);
1235 +    int max_eth_frame_size = s->max_eth_frame_size;
1236 +
1237 +    if (len > max_eth_frame_size) {
1238 +        fprintf(stderr,
1239 +            "pcap_send: packet size > %d (%d), truncating\n",
1240 +            max_eth_frame_size, len);
1241 +        len = max_eth_frame_size;
1242 +    }
1243 +#endif
1244 +    qemu_send_packet(nc, pdata, len);
1245 +}
1246 +
1247 +static void pcap_send(void *opaque)
1248 +{
1249 +    struct PCAPState *s = (struct PCAPState *)opaque;
1250 +
1251 +    for (;;) {
1252 +        if (pcap_dispatch(s->handle, 0, (pcap_handler)&pcap_callback, (u_char *)&s->nc) >= 0)
1253 +            break;
1254 +    }
1255 +}
1256 +
1257 +static void pcap_cleanup(NetClientState *nc)
1258 +{
1259 +    struct PCAPState *s = DO_UPCAST(struct PCAPState, nc, nc);
1260 +
1261 +    qemu_purge_queued_packets(nc);
1262 +    pcap_close(s->handle);
1263 +}
1264 +
1265 +static NetClientInfo net_pcap_info = {
1266 +    .type = NET_CLIENT_DRIVER_PCAP,
1267 +    .size = sizeof(struct PCAPState),
1268 +    .receive = pcap_receive,
1269 +//    .receive_raw = pcap_receive_raw,
1270 +//    .receive_iov = pcap_receive_iov,
1271 +//    .poll = pcap_poll,
1272 +    .cleanup = pcap_cleanup,
1273 +};
1274 +/*
1275 + * ... -net pcap,ifname="..."
1276 + */
1277 +
1278 +int net_init_pcap(const Netdev *netdev,
1279 +    const char *name, NetClientState *peer, Error **errp)
1280 +{
1281 +    const NetdevPcapOptions *pcap_opts;
1282 +    NetClientState *nc;
1283 +    struct PCAPState *s;
1284 +    const char *ifname;
1285 +    char errbuf[PCAP_ERRBUF_SIZE];
1286 +#if defined(_WIN32)
1287 +    HANDLE h;
1288 +#endif
1289 +    int i;
1290 +
1291 +    assert(netdev->type == NET_CLIENT_DRIVER_PCAP);
1292 +    pcap_opts = &netdev->u.pcap;
1293 +    if (!pcap_opts->has_ifname)
1294 +        return -1;
1295 +
1296 +    ifname = pcap_opts->ifname;
1297 +
1298 +    /* create the object */
1299 +    nc = qemu_new_net_client(&net_pcap_info, peer, "pcap", ifname);
1300 +    s = DO_UPCAST(struct PCAPState, nc, nc);
1301 +
1302 +    if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) {
1303 +        fprintf(stderr, "qemu: pcap_create: %s\n", errbuf);
1304 +        goto fail;
1305 +    }
1306
1307 +#if defined(__FreeBSD__) || defined(__DragonFly__)
1308 +    /*
1309 +     * We want to avoid passing oversize packets to the guest, which
1310 +     * at least on FreeBSD can happen if the host interface uses tso
1311 +     * (seen with an em(4) in this case) - so find out the host
1312 +    * interface's mtu and assume the guest is configured the same.
1313 +     */
1314 +    s->max_eth_frame_size = 1514;
1315 +    i = socket(AF_INET, SOCK_DGRAM, 0);
1316 +    if (i >= 0) {
1317 +        struct ifreq ifr;
1318 +
1319 +        (void) memset(&ifr, 0, sizeof(ifr));
1320 +        strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1321 +        if (ioctl(i, SIOCGIFMTU, &ifr) != -1)
1322 +            s->max_eth_frame_size = ifr.ifr_mtu + 14;
1323 +        close(i);
1324 +    }
1325 +#endif
1326 +
1327 +#if defined(CONFIG_PCAP_CREATE) || defined(_WIN32)
1328 +    /*
1329 +     * Create pcap handle for the device, set promiscuous mode and activate.
1330 +     */
1331 +    s->handle = (void *)pcap_create(ifname, errbuf);
1332 +    if (!s->handle) {
1333 +        fprintf(stderr, "qemu: pcap_create: %s\n", errbuf);
1334 +        goto fail;
1335 +    }
1336 +    if (pcap_set_promisc(s->handle, 1) != 0) {
1337 +        pcap_perror(s->handle, (char *)"qemu: pcap_set_promisc:");
1338 +        goto fail;
1339 +    }
1340 +   if (pcap_activate(s->handle) != 0) {
1341 +        pcap_perror(s->handle, (char *)"qemu: pcap_activate:");
1342 +        goto fail;
1343 +    }
1344 +#else
1345 +    /* Attempt to connect device. */
1346 +    s->handle = (void *)pcap_open_live(ifname, 65535, 1, 0, errbuf);
1347 +    if (!s->handle) {
1348 +        fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf);
1349 +        goto fail;
1350 +    }
1351 +#endif
1352 +
1353 +    /* Set non-blocking mode. */
1354 +    if (pcap_setnonblock(s->handle, 1, errbuf) < 0) {
1355 +        fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf);
1356 +        goto fail;
1357 +    }
1358 +
1359 +#if defined(_WIN32)
1360 +    /*
1361 +     * Tell the kernel that the packet has to be seen immediately.
1362 +     */
1363 +    if (pcap_setmintocopy(s->handle, 0) < 0) {
1364 +        fprintf(stderr, "qemu: pcap failed to set immediate mode\n");
1365 +        goto fail;
1366 +    }
1367 +#else /* !_WIN32 */
1368 +#if defined(CONFIG_BPF)
1369 +#if defined(BIOCIMMEDIATE)
1370 +    /*
1371 +     * Tell the kernel that the packet has to be seen immediately.
1372 +     */
1373 +    {
1374 +        unsigned int one = 1;
1375 +        if (ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one) < 0) {
1376 +            fprintf(stderr, "qemu: pcap failed to set immediate mode\n");
1377 +            goto fail;
1378 +        }
1379 +    }
1380 +#endif /* BIOCIMMEDIATE */
1381 +#if defined(BIOCFEEDBACK)
1382 +    /*
1383 +     * Tell the kernel that the sent packet has to be fed back.
1384 +     * This is necessary to connect host and guest.
1385 +     */
1386 +    {
1387 +        unsigned int one = 1;
1388 +        if (ioctl(pcap_fileno(s->handle), BIOCFEEDBACK, &one) < 0) {
1389 +            fprintf(stderr, "qemu: pcap failed to set feedback mode\n");
1390 +            goto fail;
1391 +        }
1392 +    }
1393 +#endif /* BIOCFEEDBACK */
1394 +#endif /* CONFIG_BPF */
1395 +#endif /* _WIN32 */
1396 +
1397 +    snprintf(s->nc.info_str, sizeof(s->nc.info_str), "pcap redirector");
1398 +
1399 +#if defined(_WIN32)
1400 +    if ((h = pcap_getevent(s->handle)) == NULL) {
1401 +        fprintf(stderr, "qemu: pcap_getevent failed\n");
1402 +        goto fail;
1403 +    }
1404 +    qemu_add_wait_object(h, pcap_send, s);
1405 +#else /* !_WIN32 */
1406 +    if ((i = pcap_get_selectable_fd(s->handle)) < 0) {
1407 +        fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n");
1408 +        goto fail;
1409 +    }
1410 +    qemu_set_fd_handler(i, pcap_send, NULL, s);
1411 +#endif /* _WIN32 */
1412 +
1413 +    return 0;
1414 +
1415 +fail:
1416 +    if (s) {
1417 +        if (s->handle)
1418 +            pcap_close(s->handle);
1419 +    }
1420 +
1421 +    return -1;
1422 +}
1423  
1424 +#endif
1425
1426  static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])(
1427      const Netdev *netdev,
1428      const char *name,
1429 @@ -962,6 +1185,9 @@ static int (* const net_client_init_fun[
1430  #ifdef CONFIG_L2TPV3
1431          [NET_CLIENT_DRIVER_L2TPV3]    = net_init_l2tpv3,
1432  #endif
1433 +#ifdef CONFIG_PCAP
1434 +       [NET_CLIENT_DRIVER_PCAP]      = net_init_pcap,
1435 +#endif
1436  };
1437  
1438  
1439
1440
1441 [FILE:423:patches/patch-net_tap-bsd.c]
1442 --- net/tap-bsd.c.orig  2020-04-28 16:49:25 UTC
1443 +++ net/tap-bsd.c
1444 @@ -31,9 +31,16 @@
1445  
1446  #if defined(__NetBSD__) || defined(__FreeBSD__)
1447  #include <sys/ioctl.h>
1448 +#include <sys/socket.h>
1449  #include <net/if.h>
1450  #include <net/if_tap.h>
1451  #endif
1452 +#if defined(__DragonFly)
1453 +#include <sys/ioctl.h>
1454 +#include <sys/socket.h>
1455 +#include <net/if.h>
1456 +#include <net/tap/if_tap.h>
1457 +#endif
1458  
1459  #if defined(__OpenBSD__)
1460  #include <sys/param.h>
1461
1462
1463 [FILE:1550:patches/patch-qapi_net.json]
1464 --- qapi/net.json.orig  2020-04-28 16:49:25 UTC
1465 +++ qapi/net.json
1466 @@ -373,6 +373,19 @@
1467      '*helper': 'str' } }
1468  
1469  ##
1470 +# @NetdevPcapOptions:
1471 +#
1472 +# Use ifname as a source to capture
1473 +#
1474 +# @ifname: #required to determine which interface to capture
1475 +#
1476 +# Since: 1.2
1477 +##
1478 +{ 'struct': 'NetdevPcapOptions',
1479 +  'data': {
1480 +    '*ifname':     'str' } }
1481 +
1482 +##
1483  # @NetdevHubPortOptions:
1484  #
1485  # Connect two or more net clients through a software hub.
1486 @@ -437,7 +450,7 @@
1487  ##
1488  { 'enum': 'NetClientDriver',
1489    'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
1490 -            'bridge', 'hubport', 'netmap', 'vhost-user' ] }
1491 +            'bridge', 'hubport', 'netmap', 'vhost-user', 'pcap' ] }
1492  
1493  ##
1494  # @Netdev:
1495 @@ -460,6 +473,7 @@
1496      'user':     'NetdevUserOptions',
1497      'tap':      'NetdevTapOptions',
1498      'l2tpv3':   'NetdevL2TPv3Options',
1499 +    'pcap':     'NetdevPcapOptions',
1500      'socket':   'NetdevSocketOptions',
1501      'vde':      'NetdevVdeOptions',
1502      'bridge':   'NetdevBridgeOptions',
1503 @@ -493,7 +507,7 @@
1504  ##
1505  { 'enum': 'NetLegacyOptionsType',
1506    'data': ['none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
1507 -           'bridge', 'netmap', 'vhost-user'] }
1508 +           'bridge', 'netmap', 'vhost-user', 'pcap'] }
1509  
1510  ##
1511  # @NetLegacyOptions:
1512 @@ -510,6 +524,7 @@
1513      'user':     'NetdevUserOptions',
1514      'tap':      'NetdevTapOptions',
1515      'l2tpv3':   'NetdevL2TPv3Options',
1516 +    'pcap':     'NetdevPcapOptions',
1517      'socket':   'NetdevSocketOptions',
1518      'vde':      'NetdevVdeOptions',
1519      'bridge':   'NetdevBridgeOptions',
1520
1521
1522 [FILE:7685:files/pkg-message-single]
1523 FreeBSD host notes
1524 ==================
1525
1526 - Needs to set net.link.tap.user_open sysctl in order to use /dev/tap*
1527   networking as non-root.  Don't forget to adjust device node permissions in
1528   /etc/devfs.rules.
1529
1530 - slirp (usermode networking) is fixed now in cvs, on FreeSBIE 1.0 guests you
1531   still have to manually do: echo nameserver 10.0.2.3 >/etc/resolv.conf but
1532   i've been told that that's normal.  (fixed on FreeSBIE 1.1.) And you have
1533   to wait a bit for dhclient to do its thing; traffic to address 10.0.2.2 is
1534   routed to 127.1 on the host.
1535
1536 - Expect timer problems when guest kernel HZ is > hosts, for example time
1537   sleep 1 takes 49 seconds and booting sleeps for minutes at the acd0 probe
1538   with a FreeSBIE 1.0 guest, thats because its kernel is built with HZ=5000,
1539   and FreeBSD's default is 100...  (no longer a problem with FreeSBIE 1.1.)
1540   The linux 2.6 kernel uses 1000 by default btw.  (changed to 250 later, and
1541   recent linux kernels now no longer have a fixed HZ, aka `tickless
1542   kernel'...)  Enabling /dev/rtc doesn't seem to help either (not included
1543   since it needs a patch to emulators/rtc.)
1544
1545 - Update: the above problem has gotten worse with FreeBSD guests
1546   somewhere before 8.0, mainly since the kernel now usually wants
1547   double or even quadruple number of timer irqs compared to HZ if
1548   it detects an apic (and at least early versions of FreeBSD 8 had
1549   a bug that essentially halved qemu's clock rate too); the only
1550   reason you usually don't see symptoms of this with FreeBSD 8
1551   guests is they automatically reduce their HZ to 100 when running
1552   in a VM while the default for the host kernel is still HZ=1000.
1553   Workaround: you can disable the apic clock in the guest by setting
1554
1555     hint.apic.0.clock="0"
1556
1557   in loader.conf(5) (or manually at the loader prompt), if that
1558   doesn't work the only things you can do is either reduce the
1559   guest's HZ to, say, 100 by setting e.g.
1560
1561     kern.hz="100"
1562
1563   from the loader as above (which usually is a good idea in a VM
1564   anyway and FreeBSD 8 now does by itself as mentioned), or otherwise
1565   increase the host's HZ to 2000 or even 4000 from the loader in
1566   the same way.
1567
1568 - The -smb option (smb-export local dir to guest using the default
1569   slirp networking) needs the samba port/package installed
1570   in addition to qemu. (SAMBA knob.)
1571
1572 - If you want to use usb devices connected to the host in the guest
1573   yot need either recent 10-current (not tested yet much) or you can
1574   use usbredir over the network (see below); also unless you are
1575   running qemu as root you then need to fix permissions for /dev/ugen*
1576   device nodes: if you are on 5.x or later (devfs) put a rule in
1577   /etc/devfs.rules, activate it in /etc/rc.conf and run /etc/rc.d/devfs
1578   restart.  Example devfs.rules:
1579
1580     [ugen_ruleset=20]
1581     add path 'ugen*' mode 660 group operator
1582
1583   corresponding rc.conf line:
1584
1585     devfs_system_ruleset="ugen_ruleset"
1586
1587 - If you want to test the new (in 0.15.0) usb network redirection (USBREDIR
1588   option) see this thread by Hans de Goede <hdegoede <at> redhat.com>:
1589
1590     http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183
1591
1592   Quote:
1593
1594   Example usage:
1595
1596   1) Start usbredirserver for a usb device:
1597   sudo usbredirserver 045e:0772
1598   2) Start qemu with usb2 support + a chardev talking to usbredirserver +
1599      a usb-redir device using this chardev:
1600   qemu -usb \
1601     -readconfig docs/ich9-ehci-uhci.cfg \
1602     -chardev socket,id=usbredirchardev,host=localhost,port=4000 \
1603     -device usb-redir,chardev=usbredirchardev,id=usbredirdev ...
1604
1605   [you would replace docs/ich9-ehci-uhci.cfg with e.g.
1606   /raven/share/doc/qemu/docs/ich9-ehci-uhci.cfg, but turns out
1607   ehci was broken for me here with FreeBSD guests and the previous
1608   qemu version at least, I got:
1609
1610     FETCHENTRY: entry at 22C5484 is of type 2 which is not supported yet processing error - resetting ehci HC
1611     Assertion failed: (0), function ehci_advance_state, file /data/ports/emulators/qemu-devel/work/qemu-0.15.0/hw/usb-ehci.c, line 2045.
1612
1613   The new qemu version works better tho.]
1614
1615 - Still usb: since the hub is no longer attached to the uchi controller and
1616   the wakeup mechanism, resume interrupt is not implemented yet linux guests
1617   will suspend the bus, i.e. they wont see devices usb_add'ed after its
1618   (linux') uhci module got loaded.  Workaround: either add devices before
1619   linux loads the module or rmmod and modprobe it afterwards.  [Not sure
1620   if this still applies to the new libusb host code used on recent
1621   10-current.]
1622
1623 - If you build qemu wihout SDL and then get crashes running it try passing it
1624   -nographic.  This should probably be default in that case...
1625
1626 - qemu's network boot roms (-boot n) have a bug when bootfiles sizes are a
1627   multiple of blksize, if this affects you (like with FreeBSD's /boot/pxeboot)
1628   you can do like
1629
1630     cp /boot/pxeboot pxeboot-qemu && chmod +w pxeboot-qemu && echo >>pxeboot-qemu
1631
1632   and then use pxeboot-qemu.  Actually you need recent btx code
1633   (from after 7.0 was released) because of the real mode boot
1634   problem, so use at least pxeboot from there.  And I just did that
1635   for the pxeboot extracted out of
1636
1637     ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200805/7.0-STABLE-200805-i386-bootonly.iso
1638
1639   and placed it here:
1640
1641     http://people.freebsd.org/~nox/qemu/pxeboot-qemu
1642
1643 - If you use slirp (usernet, the default) and want to mount nfs into the guest
1644   and you are not running qemu as root, then mountd(8) on the exporting box
1645   needs to be run with -n in order to accept requests from ports >= 1024.
1646
1647 - (not FreeBSD-specific:) There have been reports of qcow2 corruption with (at
1648   least) win2k guests on recent kvm (which uses similar qcow2 code than qemu
1649   now, see this thread:
1650
1651     http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00713.html -
1652
1653   the consensus on that thread seems to be that qcow(2) code has always been
1654   experimental and you should use raw images if you want reliability; raw is
1655   also usually faster.)  You should be able to migrate existing images to raw
1656   using qemu-img(1)'s convert function; raw doesn't support advanced features
1657   like snapshots tho.  [a few important qcow2 bugfixed have been committed in
1658   the meantime so this _might_ be less of an issue now; and meanwhile there
1659   also is the new qed format - I don't know how stable that one is.]
1660
1661 - (also not FreeBSD-specific:)  It is recommended to pass raw images using the
1662   new -drive syntax, specifying format=raw explicitly in order to avoid
1663   malicious guests being able to exploit the format autodetection thats
1664   otherwise getting used.  (Not that you should run malicious guests anyway,
1665   but this eleminates at least a known attack vector.)
1666
1667 - qemu now has improved physical cdrom support, but still there is at
1668   least one known problem: you need to have the guest eject the disc if you
1669   want to change it/take it out, or otherwise the guest may continue using
1670   state (like size) of the old disc.  (You can also do like `change ide1-cd0
1671   /dev/acd0' in the monitor after taking out the disc if a guest cannot eject
1672   it itself.)
1673
1674 - The default configuration location (qemu-ifup script etc.) has been changed
1675   from /etc to PREFIX/etc (usually /raven/etc).  Move your files accordingly.
1676
1677 - The pcap code (-net nic... -net pcap,ifname=...) should work properly now,
1678   with only one exception:  Advanced features like TSO used on the host
1679   interface can cause oversize packets which now do get truncated to avoid
1680   confusing/panicing guests but of course still will cause retransmissions.
1681   So if you see slow throughput and `pcap_send: packet size > ..., truncating'
1682   messages on qemu's tty try disabling TSO etc on the host interface at least
1683   while using pcap.
1684
1685
1686 [FILE:20:files/qemu-ifdown.sample]
1687 #!/bin/sh
1688 exec true
1689
1690
1691 [FILE:20:files/qemu-ifup.sample]
1692 #!/bin/sh
1693 exec true
1694
1695
1696 [FILE:66:files/special.mk]
1697 .if "${ARCH_STANDARD}" == "x86_64"
1698 MAKE_ARGS+=     ARCH=x86_64
1699 .endif
1700
1701
1702 [FILE:436:dragonfly/patch-disas_libvixl_vixl_utils.h]
1703 --- disas/libvixl/vixl/utils.h.orig     2020-04-28 16:49:24 UTC
1704 +++ disas/libvixl/vixl/utils.h
1705 @@ -42,6 +42,13 @@ namespace vixl {
1706  #define PRINTF_CHECK(format_index, varargs_index)
1707  #endif
1708  
1709 +#ifndef INT64_C
1710 +#define INT32_C(c) c
1711 +#define INT64_C(c) (c ## LL)
1712 +#define UINT32_C(c) (c ## U)
1713 +#define UINT64_C(c) (c ## ULL)
1714 +#endif
1715 +
1716  // Check number width.
1717  inline bool is_intn(unsigned n, int64_t x) {
1718    VIXL_ASSERT((0 < n) && (n < 64));
1719
1720
1721 [FILE:323:dragonfly/patch-hw-ppc_newworld.c]
1722 --- hw/ppc/mac_newworld.c.orig  2020-04-28 16:49:24 UTC
1723 +++ hw/ppc/mac_newworld.c
1724 @@ -74,6 +74,11 @@
1725  #include "hw/sysbus.h"
1726  #include "trace.h"
1727  
1728 +/* FreeBSD headers define this */
1729 +#ifdef round_page
1730 +#undef round_page
1731 +#endif
1732 +
1733  #define MAX_IDE_BUS 2
1734  #define CFG_ADDR 0xf0000510
1735  #define TBFREQ (100UL * 1000UL * 1000UL)
1736
1737
1738 [FILE:334:dragonfly/patch-hw_ppc_mac__oldworld.c]
1739 --- hw/ppc/mac_oldworld.c.orig  2020-04-28 16:49:24 UTC
1740 +++ hw/ppc/mac_oldworld.c
1741 @@ -60,6 +60,11 @@
1742  
1743  #define GRACKLE_BASE 0xfec00000
1744  
1745 +/* FreeBSD headers define this */
1746 +#ifdef round_page
1747 +#undef round_page
1748 +#endif
1749 +
1750  static void fw_cfg_boot_set(void *opaque, const char *boot_device,
1751                              Error **errp)
1752  {
1753
1754
1755 [FILE:843:dragonfly/patch-util_coroutine-ucontext.c]
1756 --- util/coroutine-ucontext.c.orig      2020-04-28 16:49:25 UTC
1757 +++ util/coroutine-ucontext.c
1758 @@ -158,7 +158,15 @@ Coroutine *qemu_coroutine_new(void)
1759                  2, arg.i[0], arg.i[1]);
1760  
1761      /* swapcontext() in, siglongjmp() back out */
1762 -    if (!sigsetjmp(old_env, 0)) {
1763 +    /* Save signal mask in this sigsetjmp, because makecontext on DragonFly
1764 +     * leaves all signals blocked when entering the new context with
1765 +     * swapcontext.
1766 +     * Workaround this, by just having the signal mask restored by the
1767 +     * siglongjmp that brings us back from qemu_coroutine_new().
1768 +     * XXX Remove this workaround when the makecontext behaviour is fixed
1769 +     *     on DragonFly.
1770 +     */
1771 +    if (!sigsetjmp(old_env, 1)) {
1772          start_switch_fiber(&fake_stack_save, co->stack, co->stack_size);
1773          swapcontext(&old_uc, &uc);
1774      }
1775