sdk/emulator/qemu.git
7 years agoMerge branch 'develop' into develop_qemu_2.7
SeokYeon Hwang [Wed, 9 Nov 2016 05:04:43 +0000 (14:04 +0900)]
Merge branch 'develop' into develop_qemu_2.7

Change-Id: If718c77de19a889746a25a2dd51881dce52ef4b4
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agohax: fix "hflags" synchronization problem
SeokYeon Hwang [Thu, 3 Nov 2016 13:07:55 +0000 (22:07 +0900)]
hax: fix "hflags" synchronization problem

CPUState synchronization should be done after MSR_EFER is updated.

Change-Id: I904564896d64ec9c31137cd5f2c47738ef2b79fd
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agopackage: update version (2.6.10)
Munkyu Im [Tue, 8 Nov 2016 02:31:06 +0000 (11:31 +0900)]
package: update version (2.6.10)

Change-Id: I507823d8044939815bfe443a1e2832da319d9363
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agokeyboard: change the function to use
Jinhyung Jo [Fri, 4 Nov 2016 02:46:47 +0000 (11:46 +0900)]
keyboard: change the function to use

QMap::take(const Key &key) is more efficient.
Short description for take():
  "Removes the item with the key from the map
   and returns the value associated with it."
For more information, see 'http://doc.qt.io/qt-5/qmap.html#take'.
And the value function is a constant function.

Change-Id: Ibdaf578c6eef49ebfa8beb3a00fc61785e4b74ed
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agoemulator: modify VM lock
Munkyu Im [Tue, 1 Nov 2016 07:09:12 +0000 (16:09 +0900)]
emulator: modify VM lock

check whether vm_launch.conf file exist.
skip making lock file if it's failed to create.

Change-Id: I2073d752e7fca9dfcce137b6ac0b6ecffcc0d05d
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agoyagl: sync with CPUState on HAX
SeokYeon Hwang [Thu, 3 Nov 2016 11:09:08 +0000 (20:09 +0900)]
yagl: sync with CPUState on HAX

CPUState should contain some special register and state not only KVM but
also HAX. Especially, "HF_LMA_MASK" on hflags is very important flag for
walking page table on 64bit environments.

Change-Id: I432804d684c009de0a7c79d560f5a869918bb1a5
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agohax: sync with recent updates
SeokYeon Hwang [Thu, 3 Nov 2016 11:08:11 +0000 (20:08 +0900)]
hax: sync with recent updates

Some CPU state synchronization has been missing on HAX. So, some logics
are updated. This updates are refered to recent KVM sources and
Intel's updated sources.

Change-Id: I181a3c98076ab114575875f0f566e12db457e267
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoecs: handle device capabilities
Jinhyung Choi [Mon, 24 Oct 2016 06:36:22 +0000 (15:36 +0900)]
ecs: handle device capabilities

* capability values are set by emulator daemon
|-------|          |-----|           |---------|
| emuld | -------> | ECS | --------> | clients |
|-------|   set    |-----|  result   |---------|

* ECS stores the value and send it when ECP requests.
|-----|            |-----|           |---------|
| ECP | -------->  | ECS | --------> | clients |
|-----|  request   |-----|  result   |---------|

check sensor & nfc device status additionally.

Change-Id: Icebefa564f0263afff0f0e1b139335c7c6f2ba3d
Signed-off-by: Jinhyung Choi <jinh0.choi@samsung.com>
7 years agoemulator: "--conf" should be first argument
SeokYeon Hwang [Tue, 1 Nov 2016 00:58:25 +0000 (09:58 +0900)]
emulator: "--conf" should be first argument

"--conf" should be first argument. Do not proceed if it is not.
Print more kind usage if arguments are not valid.

Change-Id: Ifb62075f3b130974b4a54d5900289c66c772dabd
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoui: reuse resource when it is reusable
SeokYeon Hwang [Tue, 25 Oct 2016 02:27:12 +0000 (11:27 +0900)]
ui: reuse resource when it is reusable

Some resources are unique and reusable. So we do not "free" and
"new" them repeatedly.

Change-Id: I2c1c0c15b9162a9f0eed49ed209e7073a102d821
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoui: move Qt5 clean-up codes inside main()
SeokYeon Hwang [Tue, 25 Oct 2016 02:21:23 +0000 (11:21 +0900)]
ui: move Qt5 clean-up codes inside main()

Qt5 resource clean-up in exit handler cause several unexpected
behaviors include segmentation fault. So it is moved inside
main() function, then clean-up is done before main function exit.

Change-Id: I4f53d531261f376de869e9c286bd700f9acbf726
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agopackage: update version (2.6.9)
Munkyu Im [Tue, 25 Oct 2016 09:32:22 +0000 (18:32 +0900)]
package: update version (2.6.9)

Change-Id: Icfae54729c6e7b68e65f3933c790c936af6eca35
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agonet: fix checking tap device
Munkyu Im [Tue, 25 Oct 2016 09:02:25 +0000 (18:02 +0900)]
net: fix checking tap device

nic[i]->peer value is null currently.

Change-Id: I4a4d4fcea1687ed1e924569b7321ef19f686c09f
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agoemulator: tighten validation for conf file
SeokYeon Hwang [Tue, 25 Oct 2016 04:53:16 +0000 (13:53 +0900)]
emulator: tighten validation for conf file

Change-Id: Iaae354e0815a568a7685d430959e60f8e5b424b9
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agopackage: update version(2.6.8)
Sooyoung Ha [Thu, 13 Oct 2016 13:09:18 +0000 (22:09 +0900)]
package: update version(2.6.8)

Change-Id: I53e6e26d189819c39611b321f1fe6d7448e7aa2c
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
7 years agoemulator: respawning when elevated
Munkyu Im [Thu, 13 Oct 2016 13:18:30 +0000 (22:18 +0900)]
emulator: respawning when elevated

In order to prevent potential elevation of privilege attack, lower
privilege processes can't interfere with higher privilege on Windows.
Emulator is usually launched by emulator manager that has high integrity
level, then drag-and-drop from Explorer (mostly medium integrity level)
does not work.

So, when emulator process has elevated integrity level, we try to
respawn emulator with medium integrity level.

Change-Id: I17f29e411252758098304ba25b60219d07aa0d7c
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoutil: modify backtrace feature for Windows
Jinhyung Jo [Tue, 11 Oct 2016 11:06:06 +0000 (20:06 +0900)]
util: modify backtrace feature for Windows

integrate the 32-bit & 64-bit implementation

Change-Id: I7540eeec080ba7fb3f10dcbba663dc4d677b8db9
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
7 years agodisplay: remove Qt::AA_X11InitThreads attribute
Jinhyung Jo [Wed, 5 Oct 2016 08:12:21 +0000 (17:12 +0900)]
display: remove Qt::AA_X11InitThreads attribute

The Qt::AA_X11InitThreads attribute is obsolete and has no effect.

Change-Id: I6b0373b08e80b056f7f2a49700f4e07ade366a42
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agoscreenshot: fix abnormal exit issue
Jinhyung Jo [Wed, 5 Oct 2016 06:22:40 +0000 (15:22 +0900)]
screenshot: fix abnormal exit issue

If user close the emulator that have opened screenshot dialog,
the emulator becomes abnormal termination.

Change-Id: I0da1eac81ed575c8e1b13270246158a254ea4813
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agodisplay: change QMatrix to QTransform
Jinhyung Jo [Wed, 5 Oct 2016 06:15:30 +0000 (15:15 +0900)]
display: change QMatrix to QTransform

QMatrix class that we use for 2D transformation is obsolete.
QTransform is the recommended transformation class in Qt.

Change-Id: Ib4361575ac8fc519c4947ad927b3fa58b506a3a3
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agopackage: update version(2.6.7)
Jinhyung Jo [Wed, 5 Oct 2016 12:25:25 +0000 (21:25 +0900)]
package: update version(2.6.7)

Change-Id: I921963c6bc6feb7fd98a7d18bbbd4a5c9b76d2cc
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agoutil: improve backtrace feature
Jinhyung Jo [Mon, 19 Sep 2016 11:04:13 +0000 (20:04 +0900)]
util: improve backtrace feature

improve & clean up the code:
  - correct coding convention
  - add backtrace feature to Mac OS X
    : remove #ifdef CONFIG_DARWIN ... #endif
      The 'backtarce' family functions first appeared in Mac OS X 10.5
  - modify the Windows code using the APIs in DbgHelp
  - change debug channel: from debug_ch to new_debug_ch
  - remove some lines like redundant/unclear/unwanted/etc.
  - modify output form

Change-Id: I8b57d996fa9daabf990932fcfb82e45a5e453636
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agoRevert "display: move display functionality to Qt5 GUI"
Jinhyung Jo [Fri, 30 Sep 2016 12:14:32 +0000 (21:14 +0900)]
Revert "display: move display functionality to Qt5 GUI"

With AMD GPUs,
reverted commit makes a ciritical bug that GUI is invisible.

This reverts commit 99ffcba1997dade13316bd09023f93597db0f2df.

Conflicts:
    tizen/src/ui/displayglwidget.cpp
    tizen/src/ui/qt5_supplement.cpp

Change-Id: Ie5b4655bdf1beb228c788dd7dc874bb6f1cba63c
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agodisplay: fix display rotation failure
Jinhyung Jo [Fri, 30 Sep 2016 11:47:28 +0000 (20:47 +0900)]
display: fix display rotation failure

The degree 0(90) & degree 180(270) have same size of display.
For that reason,
the resize event does not occur when the rotate angle is changed.
So update the status of the rotate & scale before drawing.

Change-Id: I2092a45ad60e65d4ee14ed8bb66def210b28cc68
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agopackage: update version(2.6.6)
jihye [Wed, 28 Sep 2016 02:49:10 +0000 (11:49 +0900)]
package: update version(2.6.6)

Change-Id: Ided4434d646ffe0aaf21e7f451567cb06d512d41
Signed-off-by: jihye <jihye424.kim@samsung.com>
7 years agoMerge "osutil: adjust vm lock module" into develop
Jinhyung Choi [Wed, 28 Sep 2016 02:34:55 +0000 (11:34 +0900)]
Merge "osutil: adjust vm lock module" into develop

7 years agoabout dialog: remove ?(about) button
jihye [Tue, 27 Sep 2016 04:39:48 +0000 (13:39 +0900)]
about dialog: remove ?(about) button

Change-Id: I0041d77d293b7149a93321df2349697055a1dc7a
Signed-off-by: jihye <jihye424.kim@samsung.com>
7 years agoabout: change version from build version to platform version
jihye [Mon, 26 Sep 2016 09:19:00 +0000 (18:19 +0900)]
about: change version from build version to platform version

Change-Id: I4095209a97b751f51ce7c9696a98202399892493
Signed-off-by: jihye <jihye424.kim@samsung.com>
7 years agoosutil: adjust vm lock module
Munkyu Im [Mon, 26 Sep 2016 09:14:21 +0000 (18:14 +0900)]
osutil: adjust vm lock module

- move it to an earlier time.(early launching time)
- make the same lock file(vm.lock) on each host OS.

Change-Id: I80744500bf7c25c536061d2952f7f6552a0406f1
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agopackage: update version (2.6.5)
jihye424.kim [Thu, 22 Sep 2016 04:20:07 +0000 (13:20 +0900)]
package: update version (2.6.5)

Change-Id: I2e9b643c64e385b24f417d008a2440d491b46300
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agodetail dialog: temporarily remove shortcut info in mac
jihye424.kim [Wed, 21 Sep 2016 05:44:04 +0000 (14:44 +0900)]
detail dialog: temporarily remove shortcut info in mac

Change-Id: I5f2b6a8471699c963084e52e3ad0d499b37473c1
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agoui: add missing "break" statement
SeokYeon Hwang [Wed, 21 Sep 2016 04:40:04 +0000 (13:40 +0900)]
ui: add missing "break" statement

Change-Id: Iff825869360222d3beaf3d158de5121c7537b1e9
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agopackage: update version(2.6.4)
jihye424.kim [Wed, 21 Sep 2016 02:09:40 +0000 (11:09 +0900)]
package: update version(2.6.4)

Change-Id: I05290052483fc021d074c4e0529fae937773e177
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agoecs: separate cli vm searching
Jinhyung Choi [Tue, 20 Sep 2016 04:23:05 +0000 (13:23 +0900)]
ecs: separate cli vm searching

cannot find vm between old and later version by ecp cli
- old version: 2.3, 2.3.1
- later version: 2.3.2, 2.4, 3.0

Change-Id: I6833c03063573cb1329c74fce77cdafab12a5e58
Signed-off-by: Jinhyung Choi <jinh0.choi@samsung.com>
7 years agoecp-launch: launch .app file in mac os x
Minkee Lee [Mon, 12 Sep 2016 10:57:09 +0000 (19:57 +0900)]
ecp-launch: launch .app file in mac os x

In mac os x, launch ecp using 'open' command like following

  # open emulator-control-panel.app --args [params ...]

Change-Id: I9dbf1246decd5ef01272cce18a8841b103e311b1
Signed-off-by: Minkee Lee <minkee.lee@samsung.com>
7 years agodisplay: fix transparency bug
Jinhyung Jo [Mon, 19 Sep 2016 11:22:20 +0000 (20:22 +0900)]
display: fix transparency bug

If the alpha value of the color less than 1.0,
there is a issue that the desktop background is blended
on the offscreen mode. So fixed it.

Change-Id: Ic5c80aa7274a8ce6e9b433dc87e2581b0761619c
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agodetail dialog: remove ?(about) button
jihye424.kim [Tue, 20 Sep 2016 07:19:09 +0000 (16:19 +0900)]
detail dialog: remove ?(about) button

Change-Id: I26c70ba1b868b1a769a37cf973231dc764e78da7
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agonet: use https_proxy as ecp parameter
Munkyu Im [Mon, 12 Sep 2016 02:27:53 +0000 (11:27 +0900)]
net: use https_proxy as ecp parameter

Search box on location tab uses https protocol to communicate with map server.
To access to map server, need https_proxy value.

Change-Id: Ice4847644abc9939d4e7a5c16e10a224d66c5acd
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agoMerge tag 'v2.7.0' into develop_qemu_2.7
SeokYeon Hwang [Mon, 12 Sep 2016 06:41:37 +0000 (15:41 +0900)]
Merge tag 'v2.7.0' into develop_qemu_2.7

v2.7.0 release

Change-Id: Id5feb5a9404ab064f9ea3d0aa0d95eef17020fa3
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoMerge branch 'features/newscreen' into develop
Jinhyung Jo [Mon, 12 Sep 2016 05:29:16 +0000 (14:29 +0900)]
Merge branch 'features/newscreen' into develop

Conflicts:
tizen/src/ui/qt5_supplement.cpp

Change-Id: Icd310f98594684aa96142b1a7c1af767d3cb16c5
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agodisplay: add initialization option
Jinhyung Jo [Tue, 26 Jul 2016 07:45:42 +0000 (16:45 +0900)]
display: add initialization option

Add code to run with OpenGL Legacy Profile in Mac OS X.

Change-Id: I23967ccdd33d87d96df858460ceaa688b129d41e
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agodisplay: move display functionality to Qt5 GUI
Jinhyung Jo [Wed, 22 Jun 2016 10:32:42 +0000 (19:32 +0900)]
display: move display functionality to Qt5 GUI

Qt5 GUI paints final display with all processing, not in VIGS.
The followings are in this commit.
 - VIGS: remove the code about display rendering
 - VIGS: modify the code about onscreen rendering server
 - VIGS: add functions to delivery the texture id to Qt5 UI
 - Qt5 UI: change the deprecated classes to the new classes
 - Qt5 UI: add OpenGL rendering functionality
 - Qt5 UI: fix the transparent issue with OpenGL
 - Qt5 UI: bug fix caused by image formats
 - etc. : minor modifications

Change-Id: I39471237b5d526751fac95e9fe88f05f6939142c
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agotablet: fix unexpected termination issue
Jinhyung Jo [Mon, 5 Sep 2016 09:52:34 +0000 (18:52 +0900)]
tablet: fix unexpected termination issue

'Null Pointer Dereference' occurs, the emulator dies unexpectedly.
It is caused by commit f998ca30b51b5c549898763d4bd5041380a60416.
The committer have made a mistake when applying the virtio API modification.
The virtio API has been changed as follows:
    previous: int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem)
    current: void *virtqueue_pop(VirtQueue *vq, size_t sz)

Change-Id: I2c5a20c2741633f855ab0128f7e4dd989404b2b2
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agomonitor: avoid clang shifting negative signed warning
Jinhyung Jo [Wed, 31 Aug 2016 08:30:50 +0000 (17:30 +0900)]
monitor: avoid clang shifting negative signed warning

clang 3.7.0 on x86_64 warns about the following:

  target-i386/monitor.c:38:22: warning: shifting a negative signed value is
undefined [-Wshift-negative-value]
        addr |= -1LL << 48;
                ~~~~ ^

Change-Id: I0885a0fbadc0273b09e58ef756fea34208ca7230
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
7 years agoRevert "yagl: fix the display broken issue"
Vasiliy Ulyanov [Wed, 24 Aug 2016 12:12:32 +0000 (15:12 +0300)]
Revert "yagl: fix the display broken issue"

This reverts commit fcc44797b6faa635424e142a10870370948ee57d.

Currently tizen 2.4 platform does not include the patches needed for 64
bit addresses support in yagl package. Until it is fixed, there is a
need to handle two host/target communication protocol versions at qemu
side. In order to avoid modification of autogenerated files, the
function yagl_transport_get_out_uintptr_t now takes care of different
pointer sizes.

In general, this patch does not completely fix the compatibility problem
with various platfrom versions. I.e. if more API calls are added, there
is a need to make sure they are appended at the end of the funcs array
and the existing calls preserve their ID numbers. Otherwise backward
compatibility will be broken.

Change-Id: I9bb3c118d44f46d72c87d90c08aa34b85d4ab008
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
7 years agoUpdate version for v2.7.0 release
Peter Maydell [Fri, 2 Sep 2016 12:44:11 +0000 (13:44 +0100)]
Update version for v2.7.0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agovirtio: rewrite with new virtio API
Sooyoung Ha [Tue, 16 Aug 2016 09:33:23 +0000 (18:33 +0900)]
virtio: rewrite with new virtio API

Change-Id: I935332a83e44f49ddb3fc5717b3da7a68b953e88
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
7 years agoUpdate version for v2.7.0-rc5 release
Peter Maydell [Tue, 30 Aug 2016 19:39:45 +0000 (20:39 +0100)]
Update version for v2.7.0-rc5 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years ago9pfs: handle walk of ".." in the root directory
Greg Kurz [Tue, 30 Aug 2016 15:02:27 +0000 (17:02 +0200)]
9pfs: handle walk of ".." in the root directory

The 9P spec at http://man.cat-v.org/plan_9/5/intro says:

All directories must support walks to the directory .. (dot-dot) meaning
parent directory, although by convention directories contain no explicit
entry for .. or . (dot).  The parent of the root directory of a server's
tree is itself.

This means that a client cannot walk further than the root directory
exported by the server. In other words, if the client wants to walk
"/.." or "/foo/../..", the server should answer like the request was
to walk "/".

This patch just does that:
- we cache the QID of the root directory at attach time
- during the walk we compare the QID of each path component with the root
  QID to detect if we're in a "/.." situation
- if so, we skip the current component and go to the next one

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years ago9pfs: forbid . and .. in file names
Greg Kurz [Tue, 30 Aug 2016 17:13:11 +0000 (19:13 +0200)]
9pfs: forbid . and .. in file names

According to the 9P spec http://man.cat-v.org/plan_9/5/open about the
create request:

The names . and .. are special; it is illegal to create files with these
names.

This patch causes the create and lcreate requests to fail with EINVAL if
the file name is either "." or "..".

Even if it isn't explicitly written in the spec, this patch extends the
checking to all requests that may cause a directory entry to be created:

    - mknod
    - rename
    - renameat
    - mkdir
    - link
    - symlink

The unlinkat request also gets patched for consistency (even if
rmdir("foo/..") is expected to fail according to POSIX.1-2001).

The various error values come from the linux manual pages.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years ago9pfs: forbid illegal path names
Greg Kurz [Tue, 30 Aug 2016 17:11:05 +0000 (19:11 +0200)]
9pfs: forbid illegal path names

Empty path components don't make sense for most commands and may cause
undefined behavior, depending on the backend.

Also, the walk request described in the 9P spec [1] clearly shows that
the client is supposed to send individual path components: the official
linux client never sends portions of path containing the / character for
example.

Moreover, the 9P spec [2] also states that a system can decide to restrict
the set of supported characters used in path components, with an explicit
mention "to remove slashes from name components".

This patch introduces a new name_is_illegal() helper that checks the
names sent by the client are not empty and don't contain unwanted chars.
Since 9pfs is only supported on linux hosts, only the / character is
checked at the moment. When support for other hosts (AKA. win32) is added,
other chars may need to be blacklisted as well.

If a client sends an illegal path component, the request will fail and
ENOENT is returned to the client.

[1] http://man.cat-v.org/plan_9/5/walk
[2] http://man.cat-v.org/plan_9/5/intro

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Tue, 30 Aug 2016 16:11:14 +0000 (17:11 +0100)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* pc-bios/optionrom/Makefile fix for -O0
* revert socket_connect change

# gpg: Signature made Tue 30 Aug 2016 15:36:59 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  optionrom: cope with multiple -O options
  Revert "Change net/socket.c to use socket_*() functions"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agooptionrom: cope with multiple -O options
Paolo Bonzini [Tue, 30 Aug 2016 12:30:11 +0000 (14:30 +0200)]
optionrom: cope with multiple -O options

Reproducer:

    CFLAGS="-g3 -O0" ./configure --target-list=aarch64-softmmu,arm-softmmu --enable-vhost-net --enable-virtfs

Here CFLAGS ends up with "-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ... -g3 -O0"
and pc-bios/optionrom/Makefile forgets to add the -O2 it needs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agoRevert "Change net/socket.c to use socket_*() functions"
Paolo Bonzini [Tue, 30 Aug 2016 12:04:12 +0000 (14:04 +0200)]
Revert "Change net/socket.c to use socket_*() functions"

Since commit 7e8449594c929, the socket connect code is blocking, because
calling socket_connect() without callback is blocking.  This reverts the
commit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agotranslate: early exit in tb_flush if there is no tcg
Christian Borntraeger [Thu, 25 Aug 2016 18:11:26 +0000 (20:11 +0200)]
translate: early exit in tb_flush if there is no tcg

tb_flush does all kind of things, which are very tcg specific. As it
is called from some places even for KVM (e.g. gdb server) it is better
to detect these cases and do an early exit.
This also fixes a crash in the gdb server that was triggered by
commit 909eaac9bbc2 ("tb hash: track translated blocks with qht").

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Richard Henderson <rth@twiddle.net>
Reported-by: Brent Baccala <cosine@freesoft.org>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1472148686-39841-1-git-send-email-borntraeger@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoui: fix refresh of VNC server surface
Daniel P. Berrange [Tue, 16 Aug 2016 16:30:32 +0000 (17:30 +0100)]
ui: fix refresh of VNC server surface

In previous commit

  commit c7628bff4138ce906a3620d12e0820c1cf6c140d
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   Fri Oct 30 12:10:09 2015 +0100

    vnc: only alloc server surface with clients connected

the VNC server was changed so that the 'vd->server' pixman
image was only allocated when a client is connected.

Since then if a client disconnects and then reconnects to
the VNC server all they will see is a black screen until
they do something that triggers a refresh. On a graphical
desktop this is not often noticed since there's many things
going on which cause a refresh. On a plain text console it
is really obvious since nothing refreshes frequently.

The problem is that the VNC server didn't update the guest
dirty bitmap, so still believes its server image is in sync
with the guest contents.

To fix this we must explicitly mark the entire guest desktop
as dirty after re-creating the server surface. Move this
logic into vnc_update_server_surface() so it is guaranteed
to be call in all code paths that re-create the surface
instead of only in vnc_dpy_switch()

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Tested-by: Peter Lieven <pl@kamp.de>
Message-id: 1471365032-18096-1-git-send-email-berrange@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Wed, 24 Aug 2016 16:21:03 +0000 (17:21 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio: fixes

some bugfixes for virtio
balloon is still broken wrt migration

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Tue 23 Aug 2016 17:33:11 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  virtio: decrement vq->inuse in virtqueue_discard()
  virtio: recalculate vq->inuse after migration

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoFix bsd-user build after d915b7bb
Ed Maste [Mon, 22 Aug 2016 14:57:13 +0000 (10:57 -0400)]
Fix bsd-user build after d915b7bb

Must include "qemu-version.h" for the QEMU_PKGVERSION definition.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Message-id: 1471877833-52343-1-git-send-email-emaste@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agovirtio: decrement vq->inuse in virtqueue_discard()
Stefan Hajnoczi [Mon, 15 Aug 2016 12:54:16 +0000 (13:54 +0100)]
virtio: decrement vq->inuse in virtqueue_discard()

virtqueue_discard() moves vq->last_avail_idx back so the element can be
popped again.  It's necessary to decrement vq->inuse to avoid "leaking"
the element count.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agovirtio: recalculate vq->inuse after migration
Stefan Hajnoczi [Mon, 15 Aug 2016 12:54:15 +0000 (13:54 +0100)]
virtio: recalculate vq->inuse after migration

The vq->inuse field is not migrated.  Many devices don't hold
VirtQueueElements across migration so it doesn't matter that vq->inuse
starts at 0 on the destination QEMU.

At least virtio-serial, virtio-blk, and virtio-balloon migrate while
holding VirtQueueElements.  For these devices we need to recalculate
vq->inuse upon load so the value is correct.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agopackage: update version (2.6.3)
SeokYeon Hwang [Tue, 23 Aug 2016 06:42:16 +0000 (15:42 +0900)]
package: update version (2.6.3)

Change-Id: I69d103e682574fcb9b2b0198844d38834d3b3e5c
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoinput: fix null pointer dereference before device realizing
SeokYeon Hwang [Tue, 23 Aug 2016 06:38:51 +0000 (15:38 +0900)]
input: fix null pointer dereference before device realizing

Change-Id: Ic988464da57ab65509eb28ea53effd23c1e54d73
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agoUpdate version for v2.7.0-rc4 release
Peter Maydell [Mon, 22 Aug 2016 14:29:41 +0000 (15:29 +0100)]
Update version for v2.7.0-rc4 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Peter Maydell [Mon, 22 Aug 2016 09:02:28 +0000 (10:02 +0100)]
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Mon 22 Aug 2016 09:06:32 BST
# gpg:                using RSA key 0xEF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  e1000e: remove internal interrupt flag
  slirp: fix segv when init failed

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoe1000e: remove internal interrupt flag
Cao jin [Thu, 18 Aug 2016 14:15:54 +0000 (22:15 +0800)]
e1000e: remove internal interrupt flag

Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
is not necessary too, remove it now. And interrupt flag field intr_state also
can be removed now.

CC: Dmitry Fleytman <dmitry@daynix.com>
CC: Jason Wang <jasowang@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
CC: Marcel Apfelbaum <marcel@redhat.com>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Dmitry Fleytman <dmitry@daynix.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
7 years agoslirp: fix segv when init failed
Marc-André Lureau [Thu, 18 Aug 2016 13:44:05 +0000 (17:44 +0400)]
slirp: fix segv when init failed

Since commit f6c2e66ae8c8a, slirp uses an exit notifier to call
slirp_smb_cleanup. However, if init() failed, the notifier isn't added,
and removing it will fail:

==18447== Invalid write of size 8
==18447==    at 0x7EF2B5: notifier_remove (notify.c:32)
==18447==    by 0x48E80C: qemu_remove_exit_notifier (vl.c:2661)
==18447==    by 0x6A2187: net_slirp_cleanup (slirp.c:134)
==18447==    by 0x69419D: qemu_cleanup_net_client (net.c:338)
==18447==    by 0x69445B: qemu_del_net_client (net.c:401)
==18447==    by 0x6A2B81: net_slirp_init (slirp.c:366)
==18447==    by 0x6A4241: net_init_slirp (slirp.c:865)
==18447==    by 0x695C6D: net_client_init1 (net.c:1051)
==18447==    by 0x695F6E: net_client_init (net.c:1108)
==18447==    by 0x696DBA: net_init_netdev (net.c:1498)
==18447==    by 0x7F1F99: qemu_opts_foreach (qemu-option.c:1116)
==18447==    by 0x696E60: net_init_clients (net.c:1516)
==18447==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
7 years agopackage: update version (2.6.2)
SeokYeon Hwang [Mon, 22 Aug 2016 06:53:41 +0000 (15:53 +0900)]
package: update version (2.6.2)

Change-Id: I72e9e08a049f5a0059a662f2f171f1634e92526c
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
7 years agobuild: remove kvm module
Munkyu Im [Sat, 20 Aug 2016 08:07:32 +0000 (17:07 +0900)]
build: remove kvm module

It is moved to emulator-supplements package.

Change-Id: I6b4861e4ff9dd7117948fbe8d1f4be2ea4c0b2c7
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agolinuxboot: fix loading old kernels
Paolo Bonzini [Thu, 11 Dec 2014 01:17:03 +0000 (02:17 +0100)]
linuxboot: fix loading old kernels

Old kernels that used high memory only allowed the initrd to be in the
first 896MB of memory.  If you load the initrd above, they complain
that "initrd extends beyond end of memory".

In order to fix this, while not breaking machines with small amounts
of memory fixed by cdebec5 (linuxboot: compute initrd loading address,
2014-10-06), we need to distinguish two cases.  If pc.c placed the
initrd at end of memory, use the new algorithm based on the e801
memory map.  If instead pc.c placed the initrd at the maximum address
specified by the bzImage, leave it there.

The only interesting part is that the low-memory info block is now
loaded very early, in real mode, and thus the 32-bit address has
to be converted into a real mode segment.  The initrd address is
also patched in the info block before entering real mode, it is
simpler that way.

This fixes booting the RHEL4.8 32-bit installation image with 1GB
of RAM.

Cc: qemu-stable@nongnu.org
Cc: mst@redhat.com
Cc: jsnow@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 269e2358492b674c50160553d037702e916b9f1b)

Change-Id: I0f461f04c0a7f97dc23dc7436f98a90ac3812a20
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
7 years agotest-logging: don't hard-code paths in /tmp
Sascha Silbe [Thu, 18 Aug 2016 18:46:03 +0000 (20:46 +0200)]
test-logging: don't hard-code paths in /tmp

Since f6880b7f [qemu-log: support simple pid substitution for logs],
test-logging creates files with hard-coded names in /tmp. In the best
case, this prevents multiple developers from running "make check" on
the same machine. In the worst case, it allows for symlink attacks,
enabling an attacker to overwrite files that are writable to the
developer running "make check".

Instead of hard-coding the paths, create a temporary directory using
g_dir_make_tmp() and clean it up afterwards.

Fixes: f6880b7f ("qemu-log: support simple pid substitution for logs")
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Message-id: 1471545963-11720-3-git-send-email-silbe@linux.vnet.ibm.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoglib: add compatibility implementation for g_dir_make_tmp()
Sascha Silbe [Thu, 18 Aug 2016 18:46:02 +0000 (20:46 +0200)]
glib: add compatibility implementation for g_dir_make_tmp()

We're going to make use of g_dir_make_tmp() in test-logging. Provide a
compatibility implementation of it for glib < 2.30.

May behave differently in some edge cases (e.g. pattern only at the
end of the template, the file name is not part of the error message),
but good enough in practice.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Message-id: 1471545963-11720-2-git-send-email-silbe@linux.vnet.ibm.com
[PMM: removed variable "template" which caused compilation failures
 when C++ files include glib-compat.h]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosyscall.c: Redefine IFLA_* enums
Michal Privoznik [Fri, 19 Aug 2016 08:06:40 +0000 (10:06 +0200)]
syscall.c: Redefine IFLA_* enums

In 9c37146782 I've tried to fix a broken build with older
linux-headers. However, I didn't do it properly. The solution
implemented here is to grab the enums that caused the problem
initially, and rename their values so that they are "QEMU_"
prefixed. In order to guarantee matching values with actual
enums from linux-headers, the enums are seeded with starting
values from the original enums.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 75c14d6e8a97c4ff3931d69c13eab7376968d8b4.1471593869.git.mprivozn@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoRevert "syscall.c: Fix build with older linux-headers"
Michal Privoznik [Fri, 19 Aug 2016 08:06:39 +0000 (10:06 +0200)]
Revert "syscall.c: Fix build with older linux-headers"

The fix I've made there was wrong. I mean, basically what I did
there was equivalent to:

  #if 0
  some code;
  #endif

This reverts commit 9c37146782e7850877d452da47dc451ba73aa62d.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 40d61349e445c1ad5fef795da704bf7ed6e19c86.1471593869.git.mprivozn@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agopackage: update version (2.6.1)
jihye424.kim [Fri, 19 Aug 2016 02:40:26 +0000 (11:40 +0900)]
package: update version (2.6.1)

Change-Id: I8f84bc367a2c27b1401edf0e308d0e3af6206b67
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agoicon: change emulator icon
jihye424.kim [Fri, 19 Aug 2016 01:24:31 +0000 (10:24 +0900)]
icon: change emulator icon

Change-Id: I6b7c64dac27eca54eb5664f68f31bc861c98ec6b
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
7 years agonet: modify sdb connection
Munkyu Im [Tue, 16 Aug 2016 10:37:49 +0000 (19:37 +0900)]
net: modify sdb connection

- change the sleeping time efficiently.
- disable stderr from log by using redirection.

Change-Id: I542fe588ed468293f724acf8f1679c17f2c9f878
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Thu, 18 Aug 2016 13:42:51 +0000 (14:42 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Thu 18 Aug 2016 14:39:31 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  block: fix possible reorder of flush operations
  block: fix deadlock in bdrv_co_flush

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoblock: fix possible reorder of flush operations
Denis V. Lunev [Wed, 17 Aug 2016 18:06:54 +0000 (21:06 +0300)]
block: fix possible reorder of flush operations

This patch reduce CPU usage of flush operations a bit. When we have one
flush completed we should kick only next operation. We should not start
all pending operations in the hope that they will go back to wait on
wait_queue.

Also there is a technical possibility that requests will get reordered
with the previous approach. After wakeup all requests are removed from
the wait queue. They become active and they are processed one-by-one
adding to the wait queue in the same order. Though new flush can arrive
while all requests are not put into the queue.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Tested-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Signed-off-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Message-id: 1471457214-3994-3-git-send-email-den@openvz.org
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Fam Zheng <famz@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoblock: fix deadlock in bdrv_co_flush
Evgeny Yakovlev [Wed, 17 Aug 2016 18:06:53 +0000 (21:06 +0300)]
block: fix deadlock in bdrv_co_flush

The following commit
    commit 3ff2f67a7c24183fcbcfe1332e5223ac6f96438c
    Author: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
    Date:   Mon Jul 18 22:39:52 2016 +0300
    block: ignore flush requests when storage is clean
has introduced a regression.

There is a problem that it is still possible for 2 requests to execute
in non sequential fashion and sometimes this results in a deadlock
when bdrv_drain_one/all are called for BDS with such stalled requests.

1. Current flushed_gen and flush_started_gen is 1.
2. Request 1 enters bdrv_co_flush to with write_gen 1 (i.e. the same
   as flushed_gen). It gets past flushed_gen != flush_started_gen and
   sets flush_started_gen to 1 (again, the same it was before).
3. Request 1 yields somewhere before exiting bdrv_co_flush
4. Request 2 enters bdrv_co_flush with write_gen 2. It gets past
   flushed_gen != flush_started_gen and sets flush_started_gen to 2.
5. Request 2 runs to completion and sets flushed_gen to 2
6. Request 1 is resumed, runs to completion and sets flushed_gen to 1.
   However flush_started_gen is now 2.

From here on out flushed_gen is always != to flush_started_gen and all
further requests will wait on flush_queue. This change replaces
flush_started_gen with an explicitly tracked active flush request.

Signed-off-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Message-id: 1471457214-3994-2-git-send-email-den@openvz.org
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Fam Zheng <famz@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Peter Maydell [Thu, 18 Aug 2016 09:56:40 +0000 (10:56 +0100)]
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Thu 18 Aug 2016 06:36:16 BST
# gpg:                using RSA key 0xEF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net/net: properly handle multiple packets in net_fill_rstate()
  net: vmxnet: use g_new for pkt initialisation

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into staging
Peter Maydell [Thu, 18 Aug 2016 09:27:57 +0000 (10:27 +0100)]
Merge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into staging

Fix 'make docker-test-mingw@fedora'

Peter,

This is the single patch that stalls patchew's mingw testing. Since it
is small and trivial, let's have it in 2.7.

Fam

# gpg: Signature made Wed 17 Aug 2016 13:13:53 BST
# gpg:                using RSA key 0xCA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/docker-pull-request:
  curl: Cast fd to int for DPRINTF

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agonet/net: properly handle multiple packets in net_fill_rstate()
Zhang Chen [Thu, 18 Aug 2016 03:23:25 +0000 (11:23 +0800)]
net/net: properly handle multiple packets in net_fill_rstate()

When network is busy, we will receive multiple packets at one time. In
that situation, we should keep trying to do the receiving instead of
finalizing only the first packet.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
7 years agonet: vmxnet: use g_new for pkt initialisation
Li Qiang [Tue, 16 Aug 2016 11:28:01 +0000 (16:58 +0530)]
net: vmxnet: use g_new for pkt initialisation

When network transport abstraction layer initialises pkt, the maximum
fragmentation count is not checked. This could lead to an integer
overflow causing a NULL pointer dereference. Replace g_malloc() with
g_new() to catch the multiplication overflow.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Acked-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
7 years agocoreaudio: implement audio-in
Seokyeon Hwang [Wed, 17 Aug 2016 08:56:23 +0000 (17:56 +0900)]
coreaudio: implement audio-in

Change-Id: I7b7c91d24444b7e772846b0a0c64fcf677cad74d
Signed-off-by: Seokyeon Hwang <syeon.hwang@samsung.com>
7 years agocurl: Cast fd to int for DPRINTF
Fam Zheng [Mon, 1 Aug 2016 05:04:48 +0000 (13:04 +0800)]
curl: Cast fd to int for DPRINTF

Currently "make docker-test-mingw@fedora" has a warning like:

    /tmp/qemu-test/src/block/curl.c: In function 'curl_sock_cb':
    /tmp/qemu-test/src/block/curl.c:172:6: warning: format '%d' expects
    argument of type 'int', but argument 4 has type 'curl_socket_t {aka long
    long unsigned int}'
         DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd);
          ^
    cc1: all warnings being treated as errors

Cast to int to suppress it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1470027888-24381-1-git-send-email-famz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
7 years agoUpdate version for v2.7.0-rc3 release
Peter Maydell [Tue, 16 Aug 2016 16:34:30 +0000 (17:34 +0100)]
Update version for v2.7.0-rc3 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agolinux-user: Fix llseek with high bit of offset_low set
Peter Maydell [Thu, 11 Aug 2016 17:59:39 +0000 (18:59 +0100)]
linux-user: Fix llseek with high bit of offset_low set

The llseek syscall takes two 32-bit arguments, offset_high
and offset_low, which must be combined to form a single
64-bit offset. Unfortunately we were combining them with
   (uint64_t)arg2 << 32) | arg3
and arg3 is a signed type; this meant that when promoting
arg3 to a 64-bit type it would be sign-extended. The effect
was that if the offset happened to have bit 31 set then
this bit would get sign-extended into all of bits 63..32.
Explicitly cast arg3 to abi_ulong to avoid the erroneous
sign extension.

Reported-by: Chanho Park <parkch98@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Chanho Park <parkch98@gmail.com>
Message-id: 1470938379-1133-1-git-send-email-peter.maydell@linaro.org

7 years agosyscall.c: Fix build with older linux-headers
Michal Privoznik [Tue, 16 Aug 2016 09:47:43 +0000 (11:47 +0200)]
syscall.c: Fix build with older linux-headers

In c5dff280 we tried to make us understand netlink messages more.
So we've added a code that does some translation. However, the
code assumed linux-headers to be at least version 4.4 of it
because most of the symbols there (if not all of them) were added
in just that release. This, however, breaks build on systems with
older versions of the package.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Message-id: 23806aac6db3baf7e2cdab4c62d6e3468ce6b4dc.1471340849.git.mprivozn@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoqmp-commands.hx: remove outdated note
Marc-André Lureau [Thu, 11 Aug 2016 11:20:41 +0000 (15:20 +0400)]
qmp-commands.hx: remove outdated note

input-send-event is now stable since
6575ccddf4e7c2484bc14b10d5e89f57506c3953.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20160811112041.18616-1-marcandre.lureau@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging
Peter Maydell [Tue, 16 Aug 2016 12:03:15 +0000 (13:03 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging

target-i386: kernel_irqchip=off fix for KVM

# gpg: Signature made Tue 16 Aug 2016 12:55:42 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-pull-request:
  target-i386: kvm: Report kvm_pv_unhalt as unsupported w/o kernel_irqchip

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agotarget-i386: kvm: Report kvm_pv_unhalt as unsupported w/o kernel_irqchip
Eduardo Habkost [Fri, 12 Aug 2016 18:14:32 +0000 (15:14 -0300)]
target-i386: kvm: Report kvm_pv_unhalt as unsupported w/o kernel_irqchip

The kvm_pv_unhalt feature doesn't work if kernel_irqchip is
disabled, so we need to report it as unsupported.

Tested-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoslirp: Rename "struct arphdr" to "struct slirp_arphdr"
Thomas Huth [Mon, 15 Aug 2016 08:24:54 +0000 (10:24 +0200)]
slirp: Rename "struct arphdr" to "struct slirp_arphdr"

struct arphdr is already used by the system headers on OpenBSD
and thus QEMU does not compile here anymore. Fix it by renaming
our struct to slirp_arphdr instead.

Reported-by: Brad Smith
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 1471249494-17392-1-git-send-email-thuth@redhat.com
Buglink: https://bugs.launchpad.net/qemu/+bug/1613133
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agochar: fix waiting for TLS and telnet connection
Marc-André Lureau [Tue, 16 Aug 2016 08:33:32 +0000 (12:33 +0400)]
char: fix waiting for TLS and telnet connection

Since commit d7a04fd7d5008, tcp_chr_wait_connected() was introduced,
so vhost-user could wait until a backend started successfully. In
vhost-user case, the chr socket must be plain unix, and the chr+vhost
setup happens synchronously during qemu startup.

However, with TLS and telnet socket, initial socket setup happens
asynchronously, and s->connected is not set after the socket is
accepted. In order for tcp_chr_wait_connected() to not keep accepting
new connections and proceed with the last accepted socket, it can
check for s->ioc instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20160816083332.15088-1-marcandre.lureau@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agovirtio-gpu: fix missing log.h include file
Daniel P. Berrange [Mon, 8 Aug 2016 09:31:40 +0000 (10:31 +0100)]
virtio-gpu: fix missing log.h include file

The virtio-gpu.h file defines a macro VIRTIO_GPU_FILL_CMD
which includes a call to qemu_log_mask, but does not
include qemu/log.h. In a default configure, it is lucky
and gets qemu/log.h indirectly due to the 'log' trace
backend being enabled. If that trace backend is disabled
though, eg

 ./configure --enable-trace-backends=nop

Then the build will fail:

In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c: In function ‘virgl_cmd_create_resource_2d’:
/home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:13: error: implicit declaration of function ‘qemu_log_mask’ [-Werror=implicit-function-declaration]
             qemu_log_mask(LOG_GUEST_ERROR,                              \
             ^
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: note: in expansion of macro ‘VIRTIO_GPU_FILL_CMD’
     VIRTIO_GPU_FILL_CMD(c2d);
     ^~~~~~~~~~~~~~~~~~~
/home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:34:5: error: nested extern declaration of ‘qemu_log_mask’ [-Werror=nested-externs]
In file included from /home/berrange/src/virt/qemu/hw/display/virtio-gpu-3d.c:19:0:
/home/berrange/src/virt/qemu/include/hw/virtio/virtio-gpu.h:138:27: error: ‘LOG_GUEST_ERROR’ undeclared (first use in this function)
             qemu_log_mask(LOG_GUEST_ERROR,                              \

[snip many more errors]

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1470648700-3474-1-git-send-email-berrange@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20160816' into staging
Peter Maydell [Tue, 16 Aug 2016 09:45:00 +0000 (10:45 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160816' into staging

Build fix for the ccw bios (bios itself not rebuilt).

# gpg: Signature made Tue 16 Aug 2016 08:00:16 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20160816:
  pc-bios/s390-ccw.img: Fix build

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Tue, 16 Aug 2016 08:32:40 +0000 (09:32 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches for 2.7.0-rc3

# gpg: Signature made Mon 15 Aug 2016 14:55:46 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  iotests: Test case for wrong runtime option types
  block/nbd: Store runtime option values
  block/blkdebug: Store config filename
  block/nbd: Use QemuOpts for runtime options
  block/ssh: Use QemuOpts for runtime options

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agopc-bios/s390-ccw.img: Fix build
Christian Borntraeger [Mon, 15 Aug 2016 10:20:49 +0000 (12:20 +0200)]
pc-bios/s390-ccw.img: Fix build

Since
commit a9c87304b76d ("build-sys: fix building with make CFLAGS=.. argument")

pc-bios/s390-ccw.img build might fail with

--- snip ---
main.o: In function `virtio_setup':
qemu/pc-bios/s390-ccw/main.c:117: undefined reference to `__stack_chk_fail'
--- snip ---

Changing the CFLAGS to QEMU_CFLAGS does the trick. We also need to
add -fno-strict-aliasing as this was filtered out.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <1471258997-5811-1-git-send-email-borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160815' into staging
Peter Maydell [Mon, 15 Aug 2016 20:48:03 +0000 (21:48 +0100)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160815' into staging

ppc patch queue for 2016-08-15

Just a single patch here, I hope this is the last ppc / spapr fix to
squeeze into qemu-2.7.

# gpg: Signature made Mon 15 Aug 2016 07:46:36 BST
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.7-20160815:
  ppc: parse cpu features once

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/sstabellini/tags/xen-20160812-tag-2' into staging
Peter Maydell [Mon, 15 Aug 2016 18:04:51 +0000 (19:04 +0100)]
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160812-tag-2' into staging

Xen 2016/08/12, fixed commit message

# gpg: Signature made Sat 13 Aug 2016 00:39:09 BST
# gpg:                using RSA key 0x894F8F4870E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
# Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90

* remotes/sstabellini/tags/xen-20160812-tag-2:
  xen: handle inbound migration of VMs without ioreq server pages
  Xen: fix converity warning of xen_pt_config_init()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Peter Maydell [Mon, 15 Aug 2016 17:27:51 +0000 (18:27 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Fri 12 Aug 2016 11:48:03 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  trace-events: fix first line comment in trace-events

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>