- Dec 18, 2015
-
-
Daniel P. Berrangé authored
The minimal first step conversion to use QIOChannelSocket classes instead of directly using POSIX sockets API. This will later be extended to also cover the TLS, SASL and websockets code. Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
- Dec 17, 2015
-
-
Eric Blake authored
When munging enum values, the fact that we were passing the entire prefix + value through camel_to_upper() meant that enum values spelled with CamelCase could be turned into CAMEL_CASE. However, this provides a potential collision (both OneTwo and One-Two would munge into ONE_TWO) for enum types, when the same two names are valid side-by-side as QAPI member names. By changing the generation of enum constants to always be prefix + '_' + c_name(value, False).upper(), and ensuring that there are no case collisions (in the next patches), we no longer have to worry about names that would be distinct as QAPI members but collide as variant tag names, without having to think about what munging the heuristics in camel_to_upper() will actually perform on an enum value. Making the change will affect enums that did not follow coding conventions, using 'CamelCase' rather than desired 'lower-case'. Thankfully, there are only two culprits: InputButton and ErrorClass. We already tweaked ErrorClass to make it an alias of QapiErrorClass, where only the alias needs changing rather than the whole tree. So the bulk of this change is modifying INPUT_BUTTON_WHEEL_UP to the new INPUT_BUTTON_WHEELUP (and likewise for WHEELDOWN). That part of this commit may later need reverting if we rename the enum constants from 'WheelUp' to 'wheel-up' as part of moving x-input-send-event to a stable interface; but at least we have documentation bread crumbs in place to remind us (commit 513e7cdb), and it matches the fact that SDL constants are also spelled SDL_BUTTON_WHEELUP. Suggested by: Markus Armbruster <armbru@redhat.com> Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-27-git-send-email-eblake@redhat.com> [Commit message tweaked] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Now that we guarantee the user doesn't have any enum values beginning with a single underscore, we can use that for our own purposes. Renaming ENUM_MAX to ENUM__MAX makes it obvious that the sentinel is generated. This patch was mostly generated by applying a temporary patch: |diff --git a/scripts/qapi.py b/scripts/qapi.py |index e6d014b..b862ec9 100644 |--- a/scripts/qapi.py |+++ b/scripts/qapi.py |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = { | max_index = c_enum_const(name, 'MAX', prefix) | ret += mcgen(''' | [%(max_index)s] = NULL, |+// %(max_index)s | }; | ''', | max_index=max_index) then running: $ cat qapi-{types,event}.c tests/test-qapi-types.c | sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list $ git grep -l _MAX | xargs sed -i -f list The only things not generated are the changes in scripts/qapi.py. Rejecting enum members named 'MAX' is now useless, and will be dropped in the next patch. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> [Rebased to current master, commit message tweaked] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Dec 03, 2015
-
-
Prasad J Pandit authored
While sending 'SetPixelFormat' messages to a VNC server, the client could set the 'red-max', 'green-max' and 'blue-max' values to be zero. This leads to a floating point exception in write_png_palette while doing frame buffer updates. Reported-by:
Lian Yihan <lianyihan@360.cn> Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Dec 01, 2015
-
-
Peter Maydell authored
When QEMU is brought to the foreground, the click event that activates QEMU should not go to the guest. Accidents happen when they do go to the guest without giving the user a chance to handle them. In particular, if the guest input device is not an absolute-position one then the location of the guest cursor (and thus the click) will likely not be the location of the host cursor when it is clicked, and could be completely obscured below another window. Don't send mouse clicks to QEMU unless the window either has focus or has grabbed mouse events. Reported-by:
John Arbuckle <programmingkidx@gmail.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
John Arbuckle <programmingkidx@gmail.com> Message-id: 1448551168-13196-1-git-send-email-peter.maydell@linaro.org
-
- Nov 26, 2015
-
-
Gerd Hoffmann authored
Commit "c7628bff vnc: only alloc server surface with clients connected" missed one rarely used codepath (cirrus with guest drivers using 2d accel) where we have to check for the server surface being present, to avoid qemu crashing with a NULL pointer dereference. Add the check. Reported-by:
Anthony PERARD <anthony.perard@citrix.com> Tested-by:
Anthony PERARD <anthony.perard@citrix.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 11, 2015
-
-
Hanna Reitz authored
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may find it useful to be able to therefore change the read-only status of a block device when changing the medium. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Nov 06, 2015
-
-
Markus Armbruster authored
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Same Coccinelle semantic patch as in commit b45c03f5. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Pavel Dovgaluk authored
This records user input (keyboard and mouse events) in record mode and replays these input events in replay mode. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20150917162524.8676.11696.stgit@PASHA-ISP.def.inno> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
- Nov 05, 2015
-
-
Gerd Hoffmann authored
Commit "4d77b1f2 vnc: fix bug: vnc server can't start when 'to' is specified" was rebased incorrectly, fix it. Reported-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Yang Hongyang <hongyang.yang@easystack.cn> Message-id: 1446714738-22400-1-git-send-email-kraxel@redhat.com
-
Peter Lieven authored
If the vs->output buffer is empty it will be dropped by the next qio_buffer_move_empty in vnc_jobs_consume_buffer anyway. So reuse the allocated buffer from this buffer in the worker thread where we otherwise would start with an empty (unallocated buffer). Signed-off-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-17-git-send-email-kraxel@redhat.com [ added a comment describing the non-obvious optimization ] Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-16-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-15-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-14-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-13-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-12-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-11-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-10-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-9-git-send-email-kraxel@redhat.com
-
Gerd Hoffmann authored
Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1446203414-4013-8-git-send-email-kraxel@redhat.com
-
- Nov 03, 2015
-
-
Yang Hongyang authored
commit e0d03b8c converted VNC startup to use SocketAddress, the interface socket_listen don't have a port_offset param, so we need to add the port offset (5900) to both 'port' and 'to' opts. currently only 'port' is added by offset. This patch add the port offset to 'to' opts. Signed-off-by:
Yang Hongyang <hongyang.yang@easystack.cn> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Message-id: 1445926252-14830-1-git-send-email-hongyang.yang@easystack.cn Cc: Daniel P. Berrange <berrange@redhat.com> Cc: Eric Blake <eblake@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Peter Lieven authored
I have observed that depending on the contents and the encoding it happens that sending data as RAW sometimes would take less space than the encoded data. This is especially the case for small updates or areas with high color images. If sending RAW encoded data is beneficial allow a fall back to RAW encoding for the framebuffer update. Signed-off-by:
Peter Lieven <pl@kamp.de> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
OGAWA Hirofumi authored
Current KEY_NPAGE/KEY_PPAGE handling is broken on -curses. Those uses "GREY", but "KEY_MASK" masked out "GREY". To fix, we have to use correct mask value - SCANCODE_KEYMASK. Then, this adds support of "shift + pageup/pagedown". With this, -curses mode can use scroll-up/down as usual like other display modes. Signed-off-by:
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
OGAWA Hirofumi authored
This converts vga code to curses code in console_write_bh(). With this changes, we can see line graphics (for example, dialog uses) correctly. Signed-off-by:
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
OGAWA Hirofumi authored
If TERM=xterm-256color, COLOR_PAIRS==256 and monitor passes chtype like 0x74xx. Then, the code uses uninitialized color pair. As result, monitor uses black for both of fg and bg color, i.e. terminal is filled by black. To fix, this initialize above than 64 with default color (fg=white,bg=black). FIXME: on 256 color, curses may be possible better vga color emulation. Signed-off-by:
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 02, 2015
-
-
Eric Blake authored
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This leads to spurious collisions if a tag value matches a non-variant member's name. Make the conversion to the new layout for input-related code. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-20-git-send-email-eblake@redhat.com> [Commit message tweaked slightly] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This leads to spurious collisions if a tag value matches a non-variant member's name. Make the conversion to the new layout for socket-related code. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-17-git-send-email-eblake@redhat.com> [Commit message tweaked slightly] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Rather than storing a base class as a pointer to a box, just store the fields of that base class in the same order, so that a child struct can be directly cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Compare to the earlier commit 1e6c1616 "qapi: Generate a nicer struct for flat unions" (although that patch had fewer places to change, as less of qemu was directly using qapi structs for flat unions). It also allows us to turn on automatic type-safe wrappers for upcasting to the base class of a struct. Changes to the generated code look like this in qapi-types.h: | struct SpiceChannel { |- SpiceBasicInfo *base; |+ /* Members inherited from SpiceBasicInfo: */ |+ char *host; |+ char *port; |+ NetworkAddressFamily family; |+ /* Own members: */ | int64_t connection_id; as well as additional upcast functions like qapi_SpiceChannel_base(). Meanwhile, changes to qapi-visit.c look like: | static void visit_type_SpiceChannel_fields(Visitor *v, SpiceChannel **obj, Error **errp) | { | Error *err = NULL; | |- visit_type_implicit_SpiceBasicInfo(v, &(*obj)->base, &err); |+ visit_type_SpiceBasicInfo_fields(v, (SpiceBasicInfo **)obj, &err); | if (err) { (the cast is necessary, since our upcast wrappers only deal with a single pointer, not pointer-to-pointer); plus the wholesale elimination of some now-unused visit_type_implicit_FOO() functions. Without boxing, the corner case of one empty struct having another empty struct as its base type now requires inserting a dummy member (previously, the 'Base *base' member sufficed). And now that we no longer consume a 'base' member in the generated C struct, we can delete the former negative struct-base-clash-base test. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-11-git-send-email-eblake@redhat.com> [Commit message tweaked slightly] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
A future qapi patch will rework generated structs with a base class to be unboxed. In preparation for that, change the code that allocates then populates an info struct to instead merely populate the fields of an info field passed in as a parameter (renaming vnc_basic_info_get* to vnc_init_basic_info*). Add rudimentary Error handling at the lowest levels for cases where the old code returned NULL; but rather than plumb Error all the way through the stack, the callers drop the error and return NULL as before. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-7-git-send-email-eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Oct 20, 2015
-
-
Daniel P. Berrangé authored
The Buffer code in the VNC server is useful for the IO channel code, so pull it out into a shared module, QIOBuffer. Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
Daniel P. Berrangé authored
The VNC code is currently using QemuOpts to configure the sockets connections / listeners it needs. Convert it to use SocketAddress to bring it in line with modern QAPI based code elsewhere in QEMU. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Daniel P. Berrange <berrange@redhat.com>
-
- Oct 19, 2015
-
-
Paolo Bonzini authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 16, 2015
-
-
John Arbuckle authored
The mouse cursor can become blinky when being moved a lot. This patch fixes that problem by issuing the redraw sooner. Signed-off-by:
John Arbuckle <programmingkidx@gmail.com> Message-id: AAA87DD7-EC20-4F4B-B71E-C38461D9FCBA@gmail.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
John Arbuckle authored
Eliminate this warning associated with the addRemovableDevicesMenuItems() function: ui/cocoa.m:1344:13: warning: function declaration isn't a prototype [-Wstrict-prototypes] static void addRemovableDevicesMenuItems() ^ ui/cocoa.m: In function 'addRemovableDevicesMenuItems': ui/cocoa.m:1344:13: warning: old-style function definition [-Wold-style-definition] Signed-off-by:
John Arbuckle <programmingkidx@gmail.com> Message-id: 7B365FC2-072B-4E8D-A1D9-922C2D691A83@gmail.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Oct 14, 2015
-
-
Paolo Bonzini authored
Having creation as a member of the CharDriver struct removes the need to export functions for qemu-char.c's usage. After the conversion, chardev backends implemented outside qemu-char.c will not need a stub creation function anymore. Ultimately all drivers will be converted. For now, support the case where cd->create == NULL. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 13, 2015
-
-
John Arbuckle authored
Eliminate this warning associated with the setting of the normalWindow's title: ui/cocoa.m: In function '-[QemuCocoaAppController init]': ui/cocoa.m:888:9: warning: format not a string literal and no format arguments [-Wformat-security] [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]]; Signed-off-by:
John Arbuckle <programmingkidx@gmail.com> Message-id: 57057D6E-C108-4AE1-8370-E7E6855B2F2C@gmail.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Oct 08, 2015
-
-
Gerd Hoffmann authored
This allows virtio-gpu to render in 3d mode. Uses native opengl support which is present in gtk versions 3.16 and newer. Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
Gerd Hoffmann authored
This allows virtio-gpu to render in 3d mode. Uses egl, for gtk versions 3.14 and older. Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
Gerd Hoffmann authored
Add helper functions to manage opengl contexts using egl. Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-