]> Git Repo - qemu.git/log
qemu.git
12 years agotarget-s390x: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:56:52 +0000 (20:56 +0100)]
target-s390x: Clean includes

The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.

Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-ppc: Clean includes
Stefan Weil [Thu, 2 Feb 2012 20:40:37 +0000 (21:40 +0100)]
target-ppc: Clean includes

Remove some include statements which are not needed.

Acked-by: Alexander Graf <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-mips: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:56:03 +0000 (20:56 +0100)]
target-mips: Clean includes

Remove some include statements which are not needed.

Cc: Aurelien Jarno <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-microblaze: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:55:39 +0000 (20:55 +0100)]
target-microblaze: Clean includes

The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.

Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-m68k: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:55:18 +0000 (20:55 +0100)]
target-m68k: Clean includes

config.h was missing in cpu.h.

Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-lm32: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:54:57 +0000 (20:54 +0100)]
target-lm32: Clean includes

config.h was missing in cpu.h.

Acked-by: Michael Walle <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-i386: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:54:13 +0000 (20:54 +0100)]
target-i386: Clean includes

Remove some include statements which are not needed.

Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-cris: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:53:33 +0000 (20:53 +0100)]
target-cris: Clean includes

The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.

Cc: Edgar E. Iglesias <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-arm: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:53:02 +0000 (20:53 +0100)]
target-arm: Clean includes

Remove some include statements which are not needed.

Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agotarget-alpha: Clean includes
Stefan Weil [Wed, 1 Feb 2012 19:51:52 +0000 (20:51 +0100)]
target-alpha: Clean includes

The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.

Cc: Richard Henderson <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
12 years agoRemove macro HOST_LONG_SIZE
Stefan Weil [Wed, 1 Feb 2012 19:50:10 +0000 (20:50 +0100)]
Remove macro HOST_LONG_SIZE

HOST_LONG_SIZE is simply the size of a pointer value.
There is no need for this macro.

Signed-off-by: Stefan Weil <[email protected]>
12 years agoqxl: properly handle upright and non-shared surfaces
Gerd Hoffmann [Mon, 27 Feb 2012 10:05:09 +0000 (11:05 +0100)]
qxl: properly handle upright and non-shared surfaces

Although qxl creates a shared displaysurface when the qxl surface is
upright and doesn't need to be flipped there is no guarantee that the
surface doesn't become unshared for some reason.  Rename qxl_flip to
qxl_blit and fix it to handle both flip and non-flip cases.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoError out when tls-channel option is used without TLS
Christophe Fergeau [Fri, 24 Feb 2012 17:28:32 +0000 (18:28 +0100)]
Error out when tls-channel option is used without TLS

It's currently possible to setup spice channels using TLS when
no TLS port has been specified (ie TLS is disabled). This cannot
work, so better to error out in such a situation.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agospice: use error_report to report errors
Christophe Fergeau [Fri, 24 Feb 2012 17:13:12 +0000 (18:13 +0100)]
spice: use error_report to report errors

Error message reporting during spice startup wasn't consistent, it was done
with fprintf(stderr, "") but sometimes the message didn't have a trailing
\n. Using error_report make the intent of the message clearer and deal
with the final \n for us.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: add optinal 64bit vram bar
Gerd Hoffmann [Fri, 14 Oct 2011 16:05:48 +0000 (18:05 +0200)]
qxl: add optinal 64bit vram bar

This patch adds an 64bit pci bar for vram.  It is turned off by default.
It can be enabled by setting the size of the 64bit bar to be larger than
the 32bit bar.  Both 32bit and 64bit bar refer to the same memory.  Only
the first part of the memory is available via 32bit bar.

The intention is to allow large vram sizes for 64bit guests, by allowing
the vram bar being mapped above 4G, so we don't have to squeeze it into
the pci I/O window below 4G.

With vram_size_mb=16 and vram64_size_mb=256 it looks like this:

00:02.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 02) (prog-if 00 [VGA controller])
        Subsystem: Red Hat, Inc Device 1100
        Physical Slot: 2
        Flags: fast devsel, IRQ 10
        Memory at f8000000 (32-bit, non-prefetchable) [size=64M]
        Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
        Memory at fd020000 (32-bit, non-prefetchable) [size=8K]
        I/O ports at c5a0 [size=32]
        Memory at ffe0000000 (64-bit, prefetchable) [size=256M]
        Expansion ROM at fd000000 [disabled] [size=64K]

[ mapping above 4G needs patched seabios:
  http://www.kraxel.org/cgit/seabios/commit/?h=pci64 ]

12 years agoMerge remote-tracking branch 'aneesh/for-upstream' into staging
Anthony Liguori [Mon, 27 Feb 2012 17:19:27 +0000 (11:19 -0600)]
Merge remote-tracking branch 'aneesh/for-upstream' into staging

* aneesh/for-upstream:
  hw/9pfs: Endian fixes for virtfs
  ./configure: add option for disabling VirtFS

12 years agousb: Resolve warnings about unassigned bus on usb device creation
Jan Kiszka [Mon, 27 Feb 2012 14:18:47 +0000 (15:18 +0100)]
usb: Resolve warnings about unassigned bus on usb device creation

When creating an USB device the old way, there is no way to specify the
target bus. Thus the warning issued by usb_create makes no sense and
rather confuses our users.

Resolve this by passing a bus reference to the usbdevice_init handler
and letting those handlers forward it to usb_create.

Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoslirp: Fix assertion failure on rejected DHCP requests
David Gibson [Fri, 24 Feb 2012 00:23:28 +0000 (01:23 +0100)]
slirp: Fix assertion failure on rejected DHCP requests

The guest network stack might DHCPREQUEST an address that the slirp built
in dhcp server can't let it have - for example if the guest has an old
leases file from another network configuration.  In this case the dhcp
server should and does reject the request and prepares to send a DHCPNAK
to the client.

However, in this case the daddr variable in bootp_reply() is set to
0.0.0.0.  Shortly afterwards, it unconditionally attempts to pre-insert the
new client address into the ARP table.  This causes an assertion failure in
arp_address_add() because of the 0.0.0.0 address.

According to RFC2131, DHCPNAK messages for clients on the same subnet
must be sent to the broadcast address (S3.2, subpoint 2).

Cc: Jan Kiszka <[email protected]>
Signed-off-by: David Gibson <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
12 years agoslirp: Refactor if_start
Jan Kiszka [Fri, 17 Feb 2012 15:35:36 +0000 (16:35 +0100)]
slirp: Refactor if_start

Replace gotos with a while loop, fix coding style.

CC: Zhi Yong Wu <[email protected]>
CC: Fabien Chouteau <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
12 years agoslirp: Fix requeuing of batchq packets in if_start
Jan Kiszka [Fri, 17 Feb 2012 15:26:38 +0000 (16:26 +0100)]
slirp: Fix requeuing of batchq packets in if_start

In case we requeued a packet that was the head of a longer session
queue, we failed to restore this ordering. Also, we did not properly
deal with changes to Slirp::next_m.

Instead of a cumbersome roll back, this fix simply avoids any changes
until we know if the packet was actually sent. Both fixes crashes due
to inconsistent queues and simplifies the logic.

Thanks to Zhi Yong Wu who found the reason for these crashes.

CC: Zhi Yong Wu <[email protected]>
CC: Fabien Chouteau <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
12 years agoslirp: Clean up ifs_init
Jan Kiszka [Fri, 17 Feb 2012 13:39:30 +0000 (14:39 +0100)]
slirp: Clean up ifs_init

Remove duplicate ifs_init macros, reimplement the logic as static inline
in mbuf.h.

CC: Zhi Yong Wu <[email protected]>
CC: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
12 years agousb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
Hans de Goede [Sun, 26 Feb 2012 15:14:47 +0000 (16:14 +0100)]
usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint

We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data
for an interrupt IN endpoint.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-redir: Limit return values returned by iso packets
Hans de Goede [Sun, 26 Feb 2012 15:14:46 +0000 (16:14 +0100)]
usb-redir: Limit return values returned by iso packets

The usbredir protocol uses a status of usb_redir_stall to indicate that
an iso data stream has stopped (ie because the urbs failed on resubmit),
but iso packets should never return a result of USB_RET_STALL, since iso
endpoints cannot stall. So instead simply always return USB_RET_NAK on
iso stream errors.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-redir: Let the usb-host know about our device filtering
Hans de Goede [Sun, 26 Feb 2012 15:14:45 +0000 (16:14 +0100)]
usb-redir: Let the usb-host know about our device filtering

libusbredirparser-0.3.4 adds 2 new packets which allows us to notify
the usb-host:
-about the usb device filter we have (if any), so that it knows not the even
 try to redirect certain devices
-when we reject a device based on filtering (in case it tries anyways)

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-redir: Always clear device state on filter reject
Hans de Goede [Sun, 26 Feb 2012 15:14:44 +0000 (16:14 +0100)]
usb-redir: Always clear device state on filter reject

Always call usbredir_device_disconnect() when usbredir_check_filter() fails
to clean up all the device state (ie received endpoint info).

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-redir: Fix printing of device version
Hans de Goede [Sun, 26 Feb 2012 15:14:43 +0000 (16:14 +0100)]
usb-redir: Fix printing of device version

The device version is in bcd format, which requires some special handling to
print.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoehci: drop old stuff
Gerd Hoffmann [Mon, 27 Feb 2012 12:08:25 +0000 (13:08 +0100)]
ehci: drop old stuff

Drop the "ehci under development" banner.
Drop unused & inactive (#if 0) code.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-ehci: Handle ISO packets failing with an error other then NAK
Hans de Goede [Sun, 26 Feb 2012 15:14:48 +0000 (16:14 +0100)]
usb-ehci: Handle ISO packets failing with an error other then NAK

Before this patch the ehci code was not checking for any other errors other
then USB_RET_NAK. This causes 2 problems:
1) Other errors are not reported to the guest.
2) When transactions with the ITD_XACT_IOC bit set completing with another
   error would not result in USBSTS_INT getting set.

I hit this problem when unplugging devices while iso data was streaming from
the device to the guest. When this happens it takes a while for the guest to
process the unplugging and remove ISO transactions from the ehci schedule, in
the mean time these transactions would complete with a result of USB_RET_NODEV,
which was not handled. This lead to the Linux guest's usb subsystem "hanging",
that is it would no longer see new usb devices getting plugged in and running
for example lsusb would lead to a stuck (D state) lsusb process. This patch
fixes this.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agolibcacard: fix reported ATR length
Alon Levy [Sun, 26 Feb 2012 16:09:24 +0000 (17:09 +0100)]
libcacard: fix reported ATR length

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-ccid: advertise SELF_POWERED
Alon Levy [Sun, 26 Feb 2012 16:09:23 +0000 (17:09 +0100)]
usb-ccid: advertise SELF_POWERED

Before commit ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 each device
provided it's own response to USB_REQ_GET_STATUS, but after it that
response was based on bmAttributes, which was errounously set for
usb-ccid as 0xa0 and not 0xe0.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agolibcacard: link with glib for g_strndup
Alon Levy [Sun, 26 Feb 2012 16:09:22 +0000 (17:09 +0100)]
libcacard: link with glib for g_strndup

Without it the produced library for make libcacard.la has an unresolved
symbol.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-desc: fix user trigerrable segfaults (!config)
Alon Levy [Sun, 26 Feb 2012 16:09:21 +0000 (17:09 +0100)]
usb-desc: fix user trigerrable segfaults (!config)

Check for dev->config being NULL in two places:
 USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS.

The behavior of USB_REQ_GET_STATUS is unspecified in the Default state,
that corresponds to dev->config being NULL (it defaults to NULL and is
reset whenever a SET_CONFIGURATION with value 0, or attachment). I
implemented it to correspond with the state before
ed5a83ddd8c1d8ec7b1015315530cf29949e7c48, the commit moving SET_STATUS
to usb-desc; if dev->config is not set we return whatever is in the
first configuration.

The behavior of USB_REQ_GET_CONFIGURATION is also undefined before any
SET_CONFIGURATION, but here we just return 0 (same as specified for the
Address state).

A win7 guest failed to initialize the device before this patch,
segfaulting when GET_STATUS was called with dev->config == NULL. With
this patch the passthrough device still doesn't work but the failure is
unrelated.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-ehci: sanity-check iso xfers
Gerd Hoffmann [Mon, 27 Feb 2012 10:23:08 +0000 (11:23 +0100)]
usb-ehci: sanity-check iso xfers

This patch adds a sanity check to itd processing to make sure the
endpoint addressed by the guest is actually an iso endpoint.  Also
verify that usb drivers don't return USB_RET_ASYNC which is illegal for
iso xfers.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb: add tracepoint for usb packet state changes.
Gerd Hoffmann [Fri, 24 Feb 2012 10:03:27 +0000 (11:03 +0100)]
usb: add tracepoint for usb packet state changes.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-xhci: enable packet queuing
Gerd Hoffmann [Fri, 24 Feb 2012 09:44:05 +0000 (10:44 +0100)]
usb-xhci: enable packet queuing

qemu usb core has packet queues now, so flip lets the switch.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-uhci: implement packet queuing
Gerd Hoffmann [Fri, 27 Jan 2012 16:27:31 +0000 (17:27 +0100)]
usb-uhci: implement packet queuing

When a usb device is busy processing a packet (and returns
USB_RET_ASYNC), continue walking the transfer descriptor list
and process them to fill the request queue.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-uhci: process uhci_handle_td return code via switch.
Gerd Hoffmann [Fri, 27 Jan 2012 15:38:42 +0000 (16:38 +0100)]
usb-uhci: process uhci_handle_td return code via switch.

Restruct the uhci_handle_td return code processing to make the
control flow more clear and the code more readable.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-uhci: add UHCIQueue
Gerd Hoffmann [Fri, 27 Jan 2012 13:17:06 +0000 (14:17 +0100)]
usb-uhci: add UHCIQueue

UHCIAsync structs (in-flight requests) grouped in UHCIQueue now.
Each (active) usb endpoint gets its own UHCIQueue.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-uhci: cleanup UHCIAsync allocation & initialization.
Gerd Hoffmann [Fri, 27 Jan 2012 13:17:59 +0000 (14:17 +0100)]
usb-uhci: cleanup UHCIAsync allocation & initialization.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-ehci: fix reset
Gerd Hoffmann [Thu, 23 Feb 2012 13:24:00 +0000 (14:24 +0100)]
usb-ehci: fix reset

Two reset fixes:
  * pick up s->usbcmd value after ehci_reset call to make sure it
    keeps the reset value and doesn't get rubbish filled in when
    val is written back to the mmio register array later on.
  * make sure the frame timer is zapped on reset.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agousb-hid: fix tablet activation
Gerd Hoffmann [Thu, 23 Feb 2012 14:24:24 +0000 (15:24 +0100)]
usb-hid: fix tablet activation

Activate usb hid pointer devices (mouse+tablet) unconditionally
on polls, even if we NAK the poll due to lack of new events.

Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: make qxl_render_update async
Alon Levy [Fri, 24 Feb 2012 21:19:31 +0000 (23:19 +0200)]
qxl: make qxl_render_update async

RHBZ# 747011

Removes the last user of QXL_SYNC when using update drivers that use the
_ASYNC io ports.

The last user is qxl_render_update, it is called both by qxl_hw_update
which is the vga_hw_update_ptr passed to graphic_console_init, and by
qxl_hw_screen_dump.

At the same time the QXLRect area being passed to the red_worker thread
is passed as a copy, as part of the QXLCookie.

The implementation uses interface_update_area_complete with a bh to make
sure dpy_update and qxl_flip are called from the io thread, otherwise
the vga->ds->surface.data can change under our feet.

With this patch sdl+spice works fine. But spice by itself doesn't
produce the expected screendumps unless repeated a few times, due to
ppm_save being called before update_area (rendering done in spice server
thread) having a chance to complete. Fixed by next patch, but see commit
message for problem introduced by it.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: introduce QXLCookie
Alon Levy [Fri, 24 Feb 2012 21:19:30 +0000 (23:19 +0200)]
qxl: introduce QXLCookie

Will be used in the next patch.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: remove flipped
Alon Levy [Fri, 24 Feb 2012 21:19:29 +0000 (23:19 +0200)]
qxl: remove flipped

Tested on linux and windows guests. For negative stride, qxl_flip copies
directly to vga->ds->surface->data, for positive it's reallocated to
share qxl->guest_primary.data

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: require spice >= 0.8.2
Alon Levy [Fri, 24 Feb 2012 21:19:28 +0000 (23:19 +0200)]
qxl: require spice >= 0.8.2

drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result,
any check for SPICE_SERVER_VERSION that is now always satisfied,
and SPICE_INTERFACE_CORE_MINOR >= 3 tests, because
0.8.2 has SPICE_INTERFACE_QXL_MINOR == 1 and
SPICE_INTERFACE_CORE_MINOR == 3.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: drop qxl_spice_update_area_async definition
Alon Levy [Fri, 24 Feb 2012 21:19:27 +0000 (23:19 +0200)]
qxl: drop qxl_spice_update_area_async definition

It was never used. Introduced in
5ff4e36c804157bd84af43c139f8cd3a59722db9
qxl: async io support using new spice api

But not used even then.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agosdl: remove NULL check, g_malloc0 can't fail
Alon Levy [Fri, 24 Feb 2012 21:19:26 +0000 (23:19 +0200)]
sdl: remove NULL check, g_malloc0 can't fail

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoqxl: fix spice+sdl no cursor regression
Alon Levy [Fri, 24 Feb 2012 21:19:25 +0000 (23:19 +0200)]
qxl: fix spice+sdl no cursor regression

regression introduced by 075360945860ad9bdd491921954b383bf762b0e5,

v2: lock around qemu_spice_cursor_refresh_unlocked

Reported-by: Fabiano Fidêncio <[email protected]>
Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
12 years agoaudio: Add some fall through comments
Stefan Weil [Sat, 25 Feb 2012 13:46:55 +0000 (14:46 +0100)]
audio: Add some fall through comments

Static code analysers expect these comments for case statements without
a break statement.

Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: malc <[email protected]>
12 years agoconfigure: Check whether makecontext() is a glibc stub function
Peter Maydell [Thu, 23 Feb 2012 16:20:05 +0000 (16:20 +0000)]
configure: Check whether makecontext() is a glibc stub function

On some systems (notably ARM Linux) glibc provides implementations
of makecontext(), getcontext() and friends which are stubs which
always return failure. Make the configure test for makecontext()
also check for the presence of the __stub_makecontext macro which
indicates the presence of these stubs, so we can avoid trying to use
them and fall back to a different coroutine implementation instead.

Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agovl.c: Avoid segfault when started with no arguments
Peter Maydell [Wed, 22 Feb 2012 22:40:00 +0000 (22:40 +0000)]
vl.c: Avoid segfault when started with no arguments

Fix a bug (introduced in commit a0abe47) where a command line which
specified no machine arguments (either explicitly or implicitly via
-kernel &co) would result in a segfault because of a NULL pointer
returned from qemu_opts_find(qemu_find_opts("machine"), 0).

Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agonic: zap obsolote romloading bits from ne2k + pcnet
Gerd Hoffmann [Wed, 8 Feb 2012 15:02:11 +0000 (16:02 +0100)]
nic: zap obsolote romloading bits from ne2k + pcnet

These days one just needs to specify the romfile in PCiDeviceInfo and
everything magically works.  It also allows to disable pxe rom loading
via "romfile=<emptystring>" like it is possible for all other nics.

[ v2: rebased & adapted to qom changes ]

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agobuild: allow turning off debuginfo
Gerd Hoffmann [Wed, 8 Feb 2012 12:54:13 +0000 (13:54 +0100)]
build: allow turning off debuginfo

This patch adds --{enable,disable}-debug-info switches to configure
which allows to include/exclude the '-g' switch on the gcc & ld
command lines.  Not building debug info reduces ressource usage
(especially disk) alot and is quite useful for test builds.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agooptimize screendump for the common non-switch case
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:45 +0000 (12:43 +0100)]
optimize screendump for the common non-switch case

switch console only if needed, also pass down whenever the console was
switched or not because a displaysurface redraw is only needed in case
the console was switched.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoRemove screendump dummy functions.
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:44 +0000 (12:43 +0100)]
Remove screendump dummy functions.

The code in console.c verifies whenever a screen_dump function
pointer is present before calling it, so there is no need to supply an
dummy function.  Remove them.  Also report an error to notify the user
that he didn't got a screenshot.

Signed-off-by: Anthony Liguori <[email protected]>
12 years agovga: simplify screendump
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:43 +0000 (12:43 +0100)]
vga: simplify screendump

The displaychangelistener isn't needed at all, we can simply save the
image when vga_hw_update is done instead of hooking into the update
process.

Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: add qmp events
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:26 +0000 (13:45 +0100)]
suspend: add qmp events

Send qmp events on suspend and wakeup so libvirt
has a chance to track the vm state.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: make acpi timer wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:25 +0000 (13:45 +0100)]
suspend: make acpi timer wakeup the guest.

Make the acpi timer wake up the guest.
Guests can enable/disable this via acpi too.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: make rtc alarm wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:24 +0000 (13:45 +0100)]
suspend: make rtc alarm wakeup the guest.

Make the rtc wake up the guest when the alarm fires.
Add acpi windup to property support RTC_EN, so guests
can enable and disable this.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: make serial ports wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:23 +0000 (13:45 +0100)]
suspend: make serial ports wakeup the guest.

Add a 'wakeup' property to the serial port.  It is off by default.  When
enabled any incoming character on the serial line will wake up the
guest.  Useful for guests which have a serial console configured.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: make ps/2 devices wakeup the guest
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:22 +0000 (13:45 +0100)]
suspend: make ps/2 devices wakeup the guest

This patch adds wakeup support to ps/2 emulation.  Any key press on the
ps/2 keyboard will wakeup the guest.  Likewise any mouse button press
will wakeup the guest.  Mouse moves are ignored, so the guest will not
wakeup in case your mouse crosses the vnc window of a suspended guest by
accident.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: add system_wakeup monitor command
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:21 +0000 (13:45 +0100)]
suspend: add system_wakeup monitor command

This patch adds the system_wakeup monitor command which will simply
wake up suspended guests.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: switch acpi s3 to new infrastructure.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:20 +0000 (13:45 +0100)]
suspend: switch acpi s3 to new infrastructure.

This patch switches pc s3 suspend over to the new infrastructure.
The cmos_s3 qemu_irq is killed, the new notifier is used instead.
The xen hack goes away with that too, the hypercall can simply be
done in a notifier function now.

This patch also makes the guest actually stay suspended instead
of leaving suspend instantly, so it is useful for more than just
testing whenever the suspend/resume cycle actually works.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosuspend: add infrastructure
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:19 +0000 (13:45 +0100)]
suspend: add infrastructure

This patch adds some infrastructure to handle suspend and resume to
qemu.  First there are two functions to switch state and second there
is a suspend notifier:

 * qemu_system_suspend_request is supposed to be called when the
   guest asks for being be suspended, for example via ACPI.

 * qemu_system_wakeup_request is supposed to be called on events
   which should wake up the guest.

 * qemu_register_suspend_notifier can be used to register a notifier
   which will be called when the guest is suspended.  Machine types
   and device models can hook in there to modify state if needed.

 * qemu_register_wakeup_notifier can be used to register a notifier
   which will be called when the guest is woken up.  Machine types
   and device models can hook in there to modify state if needed.

 * qemu_system_wakeup_enable can be used to enable/disable wakeup
   events.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoacpi: add acpi_pm1_evt_write_en
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:18 +0000 (13:45 +0100)]
acpi: add acpi_pm1_evt_write_en

Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en
function, so the acpi code will see those updates.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoacpi: don't pass overflow_time to acpi_pm1_evt_get_sts
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:17 +0000 (13:45 +0100)]
acpi: don't pass overflow_time to acpi_pm1_evt_get_sts

Pretty pointless, can easily be reached via ACPIREGS now.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoacpi: add ACPIREGS
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:16 +0000 (13:45 +0100)]
acpi: add ACPIREGS

All those acpi structs are not independent from each other.
Various acpi functions expecting multiple acpi structs passed
in are a clean indicator for that ;)

So this patch bundles all acpi structs in the new ACPIREGS
struct, then use it everythere pass around acpi state.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoacpi: move around structs
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:15 +0000 (13:45 +0100)]
acpi: move around structs

Group all structs at the top of hw/acpi.h.
Just moving around lines, no code changes.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:51:24 +0000 (09:51 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  slirp/misc: fix gcc __warn_memset_zero_len warnings
  vl.c: Increase width of machine name column in "-M ?" output
  tcg: Remove unneeded include statements

12 years agoMerge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:50:37 +0000 (09:50 -0600)]
Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into staging

* mdroth/qga-win32-pull-2-23-12:
  qemu-ga: add win32 guest-shutdown command
  qemu-ga: add Windows service integration
  qemu-ga: add initial win32 support
  qemu-ga: fixes for win32 build of qemu-ga
  qemu-ga: rename guest-agent-commands.c -> commands-posix.c
  qemu-ga: separate out common commands from posix-specific ones
  qemu-ga: move channel/transport functionality into wrapper class
  qemu-ga: Add schema documentation for types

12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:45:22 +0000 (09:45 -0600)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  qmp: add DEVICE_TRAY_MOVED event
  ide: drop ide_tray_state_post_load()
  block: Don't call bdrv_eject() if the tray state didn't change
  block: bdrv_eject(): Make eject_flag a real bool
  block: Rename bdrv_mon_event() & BlockMonEventAction

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:37:27 +0000 (09:37 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (46 commits)
  qemu-iotests: common.config: Allow use of arbitrary qemu* paths
  qemu-iotests: check: print relevant path information
  qemu-iotests: test loading internal snapshots
  qemu-iotests: Update filter for default cluster size
  qemu-iotests: add qed support to 025 image resize test
  qemu-iotests: Update rbd support
  qemu-iotests: common.config: Fix no $TEST_DIR directory
  qemu-iotests: only run 016 for file and sheepdog protocols
  qemu-iotests: Use zero-based offsets for IO patterns
  qemu-iotests: add support for rbd and sheepdog protocols
  qemu-iotests: filter IMGFMT correctly in 019
  qemu-iotests: README: Fix spelling
  qemu-iotests: add support for qed format
  qemu-iotests: filter TEST_DIR correctly in 019
  qemu-iotests: fix 019 golden output
  qemu-iotests: update expected results after qemu-img changes
  qemu-iotests: add read/write from smaller backing image test
  qemu-iotests: add sub-cluster allocating write test for sparse image formats
  qemu-iotests: improve test for qemu-img convert with backing file
  qemu-iotests: consider more cases in parsing qemu-io output
  ...

12 years agoMerge remote-tracking branch 'bonzini/virtio-scsi' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:33:03 +0000 (09:33 -0600)]
Merge remote-tracking branch 'bonzini/virtio-scsi' into staging

* bonzini/virtio-scsi:
  scsi-block: always use scsi_generic_ops for cache != none
  scsi: fix searching for an empty id
  scsi: fix wrong return for target INQUIRY
  virtio-scsi: add migration support
  virtio-scsi: process control queue requests
  virtio-scsi: add basic SCSI bus operation
  virtio-scsi: Add basic request processing infrastructure
  virtio-scsi: Add virtio-scsi stub device
  scsi-disk: add migration support
  scsi-generic: add migration support
  scsi: add SCSIDevice vmstate definitions
  scsi-disk: enable scatter/gather functionality
  scsi: add scatter/gather functionality
  scsi: pass residual amount to command_complete
  ahci: use new DMA helpers
  dma-helpers: add accounting wrappers
  dma-helpers: add dma_buf_read and dma_buf_write
  dma-helpers: make QEMUSGList target independent

12 years agotarget-i386: Introduce x86_cpuid_set_model_id()
Andreas Färber [Fri, 17 Feb 2012 16:46:04 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_set_model_id()

Move the logic to transform the 48-char model ID into the 12-word model
value into a helper.

Signed-off-by: Andreas Färber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agotarget-i386: Introduce x86_cpuid_version_set_stepping()
Andreas Färber [Fri, 17 Feb 2012 16:46:03 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_stepping()

Move the logic for setting the stepping field into a helper function.

To make the function self-contained and to prepare for future
unordered/multiple uses, mask out any previous stepping values first.

Signed-off-by: Andreas Färber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agotarget-i386: Introduce x86_cpuid_version_set_model()
Andreas Färber [Fri, 17 Feb 2012 16:46:02 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_model()

Move the logic for setting the model and extended model fields
into a helper function.

To make the function self-contained and to prepare for future
unordered/multiple uses, mask out any previous model values first.

Signed-off-by: Andreas Färber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agotarget-i386: Introduce x86_cpuid_version_set_family()
Andreas Färber [Fri, 17 Feb 2012 16:46:01 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_family()

Move the logic for setting the family and extended family into a
helper function.

To make the helper self-contained and in preparation of future
unordered/multiple uses, mask out any previous family values first.

Signed-off-by: Andreas Färber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoconsole: Eliminate text_consoles[]
Markus Armbruster [Tue, 7 Feb 2012 14:09:21 +0000 (15:09 +0100)]
console: Eliminate text_consoles[]

Simply use consoles[] instead.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosockets: Clean up inet_listen_opts()'s convoluted bind() loop
Markus Armbruster [Tue, 7 Feb 2012 14:09:15 +0000 (15:09 +0100)]
sockets: Clean up inet_listen_opts()'s convoluted bind() loop

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agosockets: Drop sockets_debug debug code
Markus Armbruster [Tue, 7 Feb 2012 14:09:14 +0000 (15:09 +0100)]
sockets: Drop sockets_debug debug code

I'm trying to improve this code's error reporting, and the debug code
is getting in my way: it clutters the code, it clobbers errno in
inconvenient places, and it uses the same fprintf() both for error
reporting and debug output in a few places.

Get rid of it.  Once decent error reporting is in place, adding back
whatever debug code we need shouldn't be hard.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agogdbstub: Error locations for -gdb
Markus Armbruster [Tue, 7 Feb 2012 14:09:13 +0000 (15:09 +0100)]
gdbstub: Error locations for -gdb

Stash away the option argument with add_device_config(), so we still
have its location when we get around to parsing it.

This doesn't improve any messages I can see just yet, but that'll
change shortly.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agovl.c: Error locations for options using add_device_config()
Markus Armbruster [Tue, 7 Feb 2012 14:09:12 +0000 (15:09 +0100)]
vl.c: Error locations for options using add_device_config()

These are -bt, -serial, -virtcon, -parallel, -debugcon, -usbdevice.
Improves messages emitted via proper error reporting interfaces.  For
instance:

    $ qemu-system-x86_64 -nodefaults -S -usb -usbdevice net:vlan=xxx
    qemu-system-x86_64: Parameter 'vlan' expects a number

becomes:

    qemu-system-x86_64: -usbdevice net:vlan=xxx: Parameter 'vlan' expects a number

Many more remain unimproved, because they're fprintf()ed.  The next
few commits will take care of that.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoqemu-char: qemu_chr_open_fd() can't fail, don't check
Markus Armbruster [Tue, 7 Feb 2012 14:09:11 +0000 (15:09 +0100)]
qemu-char: qemu_chr_open_fd() can't fail, don't check

Cleaned up silently in commit aad04cd0, but that just got reverted.
Re-apply this part.

Reviewed-by: Anthony Liguori <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoqemu-char: Re-apply style fixes from just reverted aad04cd0
Markus Armbruster [Tue, 7 Feb 2012 14:09:10 +0000 (15:09 +0100)]
qemu-char: Re-apply style fixes from just reverted aad04cd0

Reviewed-by: Anthony Liguori <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoqemu-char: Use qemu_open() to avoid leaking fds to children
Markus Armbruster [Tue, 7 Feb 2012 14:09:09 +0000 (15:09 +0100)]
qemu-char: Use qemu_open() to avoid leaking fds to children

Fixed silently in commit aad04cd0, but that just got reverted.
Re-apply the fixes, plus one missed instance: parport on Linux.

Reviewed-by: Anthony Liguori <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoRevert "qemu-char: Print strerror message on failure" and deps
Markus Armbruster [Tue, 7 Feb 2012 14:09:08 +0000 (15:09 +0100)]
Revert "qemu-char: Print strerror message on failure" and deps

The commit's purpose is laudable:

    The only way for chardev drivers to communicate an error was to
    return a NULL pointer, which resulted in an error message that
    said _that_ something went wrong, but not _why_.

It attempts to achieve it by changing the interface to return 0/-errno
and update qemu_chr_open_opts() to use strerror() to display a more
helpful error message.  Unfortunately, it has serious flaws:

1. Backends "socket" and "udp" return bogus error codes, because
qemu_chr_open_socket() and qemu_chr_open_udp() assume that
unix_listen_opts(), unix_connect_opts(), inet_listen_opts(),
inet_connect_opts() and inet_dgram_opts() fail with errno set
appropriately.  That assumption is wrong, and the commit turns
unspecific error messages into misleading error messages.  For
instance:

    $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx
    inet_connect: host and/or port not specified
    chardev: opening backend "socket" failed: No such file or directory

ENOENT is what happens to be in my errno when the backend returns
-errno.  Let's put ERANGE there just for giggles:

    $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx -drive if=none,iops=99999999999999999999
    inet_connect: host and/or port not specified
    chardev: opening backend "socket" failed: Numerical result out of range

Worse: when errno happens to be zero, return -errno erroneously
signals success, and qemu_chr_new_from_opts() dies dereferencing
uninitialized chr.  I observe this with "-serial unix:".

2. All qemu_chr_open_opts() knows about the error is an errno error
code.  That's simply not enough for a decent message.  For instance,
when inet_dgram() can't resolve the parameter host, which errno code
should it use?  What if it can't resolve parameter localaddr?

Clue: many backends already report errors in their open methods.
Let's revert the flawed commit along with its dependencies, and fix up
the silent error paths instead.

This reverts commit 6e1db57b2ac9025c2443c665a0d9e78748637b26.

Conflicts:

console.c
hw/baum.c
qemu-char.c

This reverts commit aad04cd024f0c59f0b96f032cde2e24eb3abba6d.

The parts of commit db418a0a "Add stdio char device on windows" that
depend on the reverted change fixed up.

Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
12 years agoscsi-block: always use scsi_generic_ops for cache != none
Paolo Bonzini [Wed, 15 Feb 2012 13:11:22 +0000 (14:11 +0100)]
scsi-block: always use scsi_generic_ops for cache != none

Signed-off-by: Paolo Bonzini <[email protected]>
12 years agoscsi: fix searching for an empty id
Paolo Bonzini [Wed, 15 Feb 2012 08:22:54 +0000 (09:22 +0100)]
scsi: fix searching for an empty id

The conditions for detecting no free target or LUN were wrong.

The LUN loop was followed by an "if" condition that is never
true, because the loop is exited as soon as lun becomes equal
to bus->info->max_lun, and never becomes greater than it.

The target loop had a wrong condition (<= instead of <).  Once
this is fixed, the loop would fail in the same way as the LUN
loop.

The fix is to see whether scsi_device_find returned the device with the
last (channel, target, LUN) pair, and fail if so.

Signed-off-by: Paolo Bonzini <[email protected]>
12 years agoscsi: fix wrong return for target INQUIRY
Paolo Bonzini [Wed, 15 Feb 2012 08:23:50 +0000 (09:23 +0100)]
scsi: fix wrong return for target INQUIRY

Signed-off-by: Paolo Bonzini <[email protected]>
12 years agovirtio-scsi: add migration support
Paolo Bonzini [Fri, 2 Dec 2011 14:23:15 +0000 (15:23 +0100)]
virtio-scsi: add migration support

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
12 years agovirtio-scsi: process control queue requests
Paolo Bonzini [Mon, 14 Nov 2011 16:44:09 +0000 (17:44 +0100)]
virtio-scsi: process control queue requests

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
12 years agoslirp/misc: fix gcc __warn_memset_zero_len warnings
Alon Levy [Fri, 24 Feb 2012 11:33:49 +0000 (13:33 +0200)]
slirp/misc: fix gcc __warn_memset_zero_len warnings

By removing memset altogether (Patch from Stefan Hajnoczi, tested
compile only by me).

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
12 years agohw/9pfs: Endian fixes for virtfs
Benjamin Herrenschmidt [Fri, 24 Feb 2012 00:23:30 +0000 (11:23 +1100)]
hw/9pfs: Endian fixes for virtfs

This patch fixes several endian bugs in virtfs.

Cc: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: David Gibson <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
12 years ago./configure: add option for disabling VirtFS
Meador Inge [Fri, 24 Feb 2012 08:30:42 +0000 (14:00 +0530)]
./configure: add option for disabling VirtFS

Signed-off-by: Meador Inge <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
12 years agoqemu-ga: add win32 guest-shutdown command
Michael Roth [Mon, 23 Jan 2012 02:24:37 +0000 (20:24 -0600)]
qemu-ga: add win32 guest-shutdown command

Implement guest-shutdown RPC for Windows. Functionally this should be
equivalent to the posix implementation.

Original patch by Gal Hammer <[email protected]>

12 years agoqemu-ga: add Windows service integration
Michael Roth [Sat, 21 Jan 2012 22:42:27 +0000 (16:42 -0600)]
qemu-ga: add Windows service integration

This allows qemu-ga to function as a Windows service:

 - to install the service (will auto-start on boot):
     qemu-ga --service install
 - to start the service:
     net start qemu-ga
 - to stop the service:
     net stop qemu-ga
 - to uninstall service:
     qemu-ga --service uninstall

Original patch by Gal Hammer <[email protected]>

12 years agoqemu-ga: add initial win32 support
Michael Roth [Sat, 21 Jan 2012 01:01:30 +0000 (19:01 -0600)]
qemu-ga: add initial win32 support

This adds a win32 channel implementation that makes qemu-ga functional
on Windows using virtio-serial (unix-listen/isa-serial not currently
implemented). Unlike with the posix implementation, we do not use
GIOChannel for the following reasons:

 - glib calls stat() on an fd to check whether S_IFCHR is set, which is
   the case for virtio-serial on win32. Because of that, a one-time
   check to determine whether the channel is readable is done by making
   a call to PeekConsoleInput(), which reports the underlying handle is
   not a valid console handle, and thus we can never read from the
   channel.

 - if one goes as far as to "trick" glib into thinking it is a normal
   file descripter, the buffering is done in such a way that data
   written to the output stream will subsequently result in that same
   data being read back as if it were input, causing an error loop.
   furthermore, a forced flush of the channel only moves the data into a
   secondary buffer managed by glib, so there's no way to prevent output
   from getting read back as input.

The implementation here ties into the glib main loop by implementing a
custom GSource that continually submits asynchronous/overlapped I/O to
fill an GAChannel-managed read buffer, and tells glib to poll the
corresponding event handle for a completion whenever there is no
data/RPC in the read buffer to notify the main application about.

12 years agoqemu-ga: fixes for win32 build of qemu-ga
Michael Roth [Fri, 20 Jan 2012 04:04:34 +0000 (22:04 -0600)]
qemu-ga: fixes for win32 build of qemu-ga

Various stubs and #ifdefs to compile for Windows using mingw
cross-build. Still has 1 linker error due to a dependency on the
forthcoming win32 versions of the GAChannel/transport class.

12 years agoqemu-ga: rename guest-agent-commands.c -> commands-posix.c
Michael Roth [Fri, 20 Jan 2012 04:28:18 +0000 (22:28 -0600)]
qemu-ga: rename guest-agent-commands.c -> commands-posix.c

12 years agoqemu-ga: separate out common commands from posix-specific ones
Michael Roth [Fri, 20 Jan 2012 04:19:27 +0000 (22:19 -0600)]
qemu-ga: separate out common commands from posix-specific ones

Many of the current RPC implementations are very much POSIX-specific
and require complete re-writes for Windows. There are however a small
set of core guest agent commands that are common to both, and other
commands such as guest-file-* which *may* be portable. So we introduce
commands.c for the latter, and will rename guest-agent-commands.c to
commands-posix.c in a future commit. Windows implementations will go in
commands-win32.c, eventually.

This page took 0.079884 seconds and 4 git commands to generate.