sdk/emulator/qemu.git
12 years agohw/block-common: Factor out fall back to legacy -drive cyls=...
Markus Armbruster [Wed, 11 Jul 2012 13:08:39 +0000 (15:08 +0200)]
hw/block-common: Factor out fall back to legacy -drive cyls=...

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: Don't limit DriveInfo serial to 20 characters
Markus Armbruster [Wed, 11 Jul 2012 13:08:38 +0000 (15:08 +0200)]
blockdev: Don't limit DriveInfo serial to 20 characters

All current users (IDE, SCSI and virtio-blk) happen to share this 20
characters limit.  Still, it should be left to device models.  They
already enforce their limits.  They have to, as the DriveInfo limit
only affects legacy -drive serial=..., not the qdev properties.

usb-storage, which doesn't limit serial number length, also uses
DriveInfo for -usbdevice.  But that doesn't provide access to
DriveInfo serial.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohw/block-common: Factor out fall back to legacy -drive serial=...
Markus Armbruster [Wed, 11 Jul 2012 13:08:37 +0000 (15:08 +0200)]
hw/block-common: Factor out fall back to legacy -drive serial=...

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohw/block-common: Move BlockConf & friends from block.h
Markus Armbruster [Wed, 11 Jul 2012 13:08:36 +0000 (15:08 +0200)]
hw/block-common: Move BlockConf & friends from block.h

This stuff doesn't belong to block layer, and was put there only
because a better home didn't exist then.  Now it does.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoRelax IDE CHS limits from 16383,16,63 to 65535,16,255
Markus Armbruster [Tue, 10 Jul 2012 09:12:55 +0000 (11:12 +0200)]
Relax IDE CHS limits from 16383,16,63 to 65535,16,255

New limits straight from ATA4 6.2 Register delivered data transfer
command sector addressing.

I figure the old sector limit 63 was blindly copied from the BIOS
int 13 limit.  Doesn't apply to the hardware.  No idea where the old
cylinder limit comes from.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: Drop redundant CHS validation for if=ide
Markus Armbruster [Tue, 10 Jul 2012 09:12:54 +0000 (11:12 +0200)]
blockdev: Drop redundant CHS validation for if=ide

Leave it to ide_init_drive().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Compute BIOS CHS translation in one place
Markus Armbruster [Tue, 10 Jul 2012 09:12:53 +0000 (11:12 +0200)]
hd-geometry: Compute BIOS CHS translation in one place

Currently, it is split between hd_geometry_guess() and
pc_cmos_init_late().  Confusing.  info qtree shows the result of the
former.  Also confusing.

Fold the part done in pc_cmos_init_late() into hd_geometry_guess().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Test we don't put hard disk info into CMOS for a CD-ROM
Markus Armbruster [Tue, 10 Jul 2012 09:12:52 +0000 (11:12 +0200)]
qtest: Test we don't put hard disk info into CMOS for a CD-ROM

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide pc: Put hard disk info into CMOS only for hard disks
Markus Armbruster [Tue, 10 Jul 2012 09:12:51 +0000 (11:12 +0200)]
ide pc: Put hard disk info into CMOS only for hard disks

In particular, don't set disk type and geometry when a CD-ROM on bus
ide.0 has media during CMOS initialization.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Geometry and translation hints are now useless, purge them
Markus Armbruster [Tue, 10 Jul 2012 09:12:50 +0000 (11:12 +0200)]
block: Geometry and translation hints are now useless, purge them

There are two producers of these hints: drive_init() on behalf of
-drive, and hd_geometry_guess().

The only consumer of the hint is hd_geometry_guess().

The callers of hd_geometry_guess() call it only when drive_init()
didn't set the hints.  Therefore, drive_init()'s hints are never used.

Thus, hd_geometry_guess() only ever sees hints it produced itself in a
prior call.  Only the first call computes something, subsequent calls
just repeat the first call's results.  However, hd_geometry_guess() is
never called more than once: the device models don't, and the block
device is destroyed on unplug.  Thus, dropping the repeat feature
doesn't break anything now.

If a block device wasn't destroyed on unplug and could be reused with
a new device, then repeating old results would be wrong.  Thus,
dropping the repeat feature prevents future breakage.

This renders the hints unused.  Purge them from the block layer.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Cover qdev property for BIOS CHS translation
Markus Armbruster [Tue, 10 Jul 2012 09:12:49 +0000 (11:12 +0200)]
qtest: Cover qdev property for BIOS CHS translation

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: qdev property for BIOS CHS translation
Markus Armbruster [Tue, 10 Jul 2012 09:12:48 +0000 (11:12 +0200)]
ide: qdev property for BIOS CHS translation

This isn't quite orthodox.  CHS translation is firmware configuration,
communicated via the RTC's CMOS RAM, not a property of the disk.  But
it's best to treat it just like geometry anyway.

Maintain backward compatibility exactly like for geometry: fall back
to DriveInfo's translation, set with -drive trans=...

Bonus: info qtree now shows the translation.  Except when it shows
"auto": that's resolved by pc_cmos_init_late().  To be addressed
shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqdev: New property type chs-translation
Markus Armbruster [Tue, 10 Jul 2012 09:12:47 +0000 (11:12 +0200)]
qdev: New property type chs-translation

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqdev: Collect private helpers in one place
Markus Armbruster [Tue, 10 Jul 2012 09:12:46 +0000 (11:12 +0200)]
qdev: Collect private helpers in one place

Just code motion, with one long line wrapped to keep checkpatch.pl
happy.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Cover qdev properties for disk geometry
Markus Armbruster [Tue, 10 Jul 2012 09:12:45 +0000 (11:12 +0200)]
qtest: Cover qdev properties for disk geometry

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: qdev properties for disk geometry
Markus Armbruster [Tue, 10 Jul 2012 09:12:44 +0000 (11:12 +0200)]
ide: qdev properties for disk geometry

Geometry needs to be qdev properties, because it belongs to the
disk's guest part.

Maintain backward compatibility exactly like for serial: fall back to
DriveInfo's geometry, set with -drive cyls=...

Do this only for ide-hd.  ide-drive is legacy.  ide-cd doesn't have a
geometry.

Bonus: info qtree now shows the geometry.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovirtio-blk: qdev properties for disk geometry
Markus Armbruster [Tue, 10 Jul 2012 09:12:43 +0000 (11:12 +0200)]
virtio-blk: qdev properties for disk geometry

Geometry needs to be qdev properties, because it belongs to the
disk's guest part.

Maintain backward compatibility exactly like for serial: fall back to
DriveInfo's geometry, set with -drive cyls=...

Bonus: info qtree now shows the geometry.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoscsi-hd: qdev properties for disk geometry
Markus Armbruster [Tue, 10 Jul 2012 09:12:42 +0000 (11:12 +0200)]
scsi-hd: qdev properties for disk geometry

Geometry needs to be qdev properties, because it belongs to the
disk's guest part.

Maintain backward compatibility exactly like for serial: fall back to
DriveInfo's geometry, set with -drive cyls=...

Do this only for scsi-hd.  scsi-disk is legacy.  scsi-cd doesn't have
a geometry.  scsi-block should get geometry from the host disk.

Bonus: info qtree now shows the geometry.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Switch to uint32_t to match BlockConf
Markus Armbruster [Tue, 10 Jul 2012 09:12:41 +0000 (11:12 +0200)]
hd-geometry: Switch to uint32_t to match BlockConf

Best to use the same type, to avoid unwanted truncation or sign
extension.

BlockConf can't use plain int for cyls, heads and secs, because
integer properties require an exact width.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqdev: Introduce block geometry properties
Markus Armbruster [Tue, 10 Jul 2012 09:12:40 +0000 (11:12 +0200)]
qdev: Introduce block geometry properties

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: Save geometry in DriveInfo
Markus Armbruster [Tue, 10 Jul 2012 09:12:39 +0000 (11:12 +0200)]
blockdev: Save geometry in DriveInfo

In preparation of purging it from the block layer, which will happen
later in this series.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide pc: Cut out the block layer geometry middleman
Markus Armbruster [Tue, 10 Jul 2012 09:12:38 +0000 (11:12 +0200)]
ide pc: Cut out the block layer geometry middleman

PC BIOS setup needs IDE geometry information.  Get it directly from
the device model rather than through the block layer.  In preparation
of purging geometry from the block layer, which will happen later in
this series.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Cut out block layer translation middleman
Markus Armbruster [Tue, 10 Jul 2012 09:12:37 +0000 (11:12 +0200)]
hd-geometry: Cut out block layer translation middleman

hd_geometry_guess() picks geometry and translation.  Callers can get
the geometry directly, via parameters, but for translation they need
to go through the block layer.

Add a parameter for translation, so it can optionally be gotten just
like geometry.  In preparation of purging translation from the block
layer, which will happen later in this series.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Clean up confusing use of prior translation hint
Markus Armbruster [Tue, 10 Jul 2012 09:12:36 +0000 (11:12 +0200)]
hd-geometry: Clean up confusing use of prior translation hint

When hd_geometry_guess() picks a geometry, it also picks the
appropriate translation, but only when the prior translation hint is
BIOS_ATA_TRANSLATION_AUTO.  Looks wrong, because such a prior
translation would be passed to the BIOS whether it's suitable for the
geometry or not.

Fortunately, that can't happen.  There are just two ways for the
translation hint to get set to something other than
BIOS_ATA_TRANSLATION_AUTO: drive_init() on behalf of -drive trans=...,
and hd_geometry_guess().  Both set it only when they also set a valid
geometry hint, i.e. one with a non-zero number of cylinders.

Since hd_geometry_guess() returns right away when it finds a valid
geometry hint, translation can only be BIOS_ATA_TRANSLATION_AUTO in
the remainder of the function.

Assert this, and simplify accordingly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Clean up gratuitous goto in hd_geometry_guess()
Markus Armbruster [Tue, 10 Jul 2012 09:12:35 +0000 (11:12 +0200)]
hd-geometry: Clean up gratuitous goto in hd_geometry_guess()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Factor out guess_chs_for_size()
Markus Armbruster [Tue, 10 Jul 2012 09:12:34 +0000 (11:12 +0200)]
hd-geometry: Factor out guess_chs_for_size()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Unnest conditional in hd_geometry_guess()
Markus Armbruster [Tue, 10 Jul 2012 09:12:33 +0000 (11:12 +0200)]
hd-geometry: Unnest conditional in hd_geometry_guess()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Add tracepoints
Markus Armbruster [Tue, 10 Jul 2012 09:12:32 +0000 (11:12 +0200)]
hd-geometry: Add tracepoints

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Move disk geometry guessing back from block.c
Markus Armbruster [Tue, 10 Jul 2012 09:12:31 +0000 (11:12 +0200)]
hd-geometry: Move disk geometry guessing back from block.c

Commit f3d54fc4 factored it out of hw/ide.c for reuse.  Sensible,
except it was put into block.c.  Device-specific functionality should
be kept in device code, not the block layer.  Move it to
hw/hd-geometry.c, and make stylistic changes required to keep
checkpatch.pl happy.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Add hard disk geometry test
Markus Armbruster [Tue, 10 Jul 2012 09:12:30 +0000 (11:12 +0200)]
qtest: Add hard disk geometry test

So far covers only IDE and tests only CMOS contents.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovvfat: Do not clobber the user's geometry
Markus Armbruster [Tue, 10 Jul 2012 09:12:29 +0000 (11:12 +0200)]
vvfat: Do not clobber the user's geometry

vvfat creates a virtual VFAT filesystem with a certain logical
geometry that depends on its options.  It sets the "geometry hint" to
this geometry.  It is the only block driver to do this.

The geometry hint is about about *physical* geometry, and used only by
certain hard disk device models.

vvfat's hint is normally invisible for device models, because
bdrv_open() puts a raw format on top of vvfat's fat protocol.  That
raw format is where drive_init() puts the user's geometry (if any),
and where the device model gets it from.

Nobody complained, because the default physical geometry is the same
as vvfat's logical geometry:

    opts        LCHS        def. PCHS
                1024,16,63  same
    :32:        1024,16,63  same
    :16:        1024,16,63  same
    :12:          64,16,63  same

Except when you specify :floppy:

    opts        LCHS        def. PCHS
       :floppy:   80, 2,36  5,16,63
    :32:floppy:   80, 2,36  5,16,63
    :16:floppy:   80, 2,36  5,16,63
    :12:floppy:   80, 2,18  2,16,63

Silly thing to do for use with a hard disk.

However, the "raw" format can be suppressed by adding an
redundant-looking "format=vvfat" to "file=fat:FOO".  Then, vvfat's
hint clobbers the user's geometry, i.e. -drive options cyls, heads,
secs get silently ignored.  Don't do that.

No change without format=vvfat.  With it, the user's hard disk
geometry (-drive options cyls, heads, secs) is now obeyed, and the
default hard disk geometry with :floppy: now matches the one without
format=vvfat.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovvfat: Fix partition table
Markus Armbruster [Tue, 10 Jul 2012 09:12:28 +0000 (11:12 +0200)]
vvfat: Fix partition table

Unless parameter ":floppy:" is given, vvfat creates a virtual image
with DOS MBR defining a single partition which holds the FAT file
system.  The size of the virtual image depends on the width of the
FAT: 32 MiB (CHS 64, 16, 63) for 12 bit FAT, 504 MiB (CHS 1024, 16,
63) for 16 and 32 bit FAT, leaving (64*16-1)*63 = 64449 and
(1024*16-1)*64 = 1032129 sectors for the partition.

However, it screws up the end of the partition in the MBR:

    FAT width param.  start CHS  end CHS     start LBA  size
        :32:          0,1,1      1023,14,63       63    1032065
        :16:          0,1,1      1023,14,55       63    1032057
        :12:          0,1,1        63,14,55       63      64377

The actual FAT file system nevertheless assumes the partition has
1032129 or 64449 sectors.  Oops.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: Move floppy geometry guessing back from block.c
Markus Armbruster [Tue, 10 Jul 2012 09:12:27 +0000 (11:12 +0200)]
fdc: Move floppy geometry guessing back from block.c

Commit 5bbdbb46 moved it to block.c because "other geometry guessing
functions already reside in block.c".  Device-specific functionality
should be kept in device code, not the block layer.  Move it back.

Disk geometry guessing is still in block.c.  To be moved out in a
later patch series.

Bonus: the floppy type used in pc_cmos_init() now obviously matches
the one in the FDrive.  Before, we relied on
bdrv_get_floppy_geometry_hint() picking the same type both in
fd_revalidate() and in pc_cmos_init().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosheepdog: do not blindly memset all read buffers
Christoph Hellwig [Tue, 10 Jul 2012 14:12:27 +0000 (16:12 +0200)]
sheepdog: do not blindly memset all read buffers

Only buffers that map to unallocated blocks need to be zeroed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosheepdog: always use coroutine-based network functions
MORITA Kazutaka [Wed, 4 Jul 2012 16:41:06 +0000 (01:41 +0900)]
sheepdog: always use coroutine-based network functions

This reduces some code duplication.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoaudio: Unbreak capturing in mixemu case
malc [Mon, 16 Jul 2012 14:08:36 +0000 (18:08 +0400)]
audio: Unbreak capturing in mixemu case

Signed-off-by: malc <av1474@comtv.ru>
12 years agoqemu-log: fix x86 and user logging
Blue Swirl [Sat, 7 Jul 2012 14:40:18 +0000 (14:40 +0000)]
qemu-log: fix x86 and user logging

5726c27fa913296aafab9f50b912cea5b3709271 broke
x86 specific options and user emulation specific stdio buffering.

Always enable all log items. They may not be useful for non-x86 targets,
but there's no harm either.

Fix user emulation buffering by passing around a flag.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'trivial-patches' of git://github.com/stefanha/qemu
Blue Swirl [Sat, 14 Jul 2012 10:58:22 +0000 (10:58 +0000)]
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

* 'trivial-patches' of git://github.com/stefanha/qemu:
  make: Remove 'build-all' rule
  qemu-keymaps: Finnish keyboard mapping broken
  vnc: add a more descriptive error message
  bitops: Fix documentation
  megasas: mark mfi_frame_desc as 'static'

12 years agovga: Implement blinking of text cursor
Jan Kiszka [Wed, 4 Jul 2012 17:49:54 +0000 (19:49 +0200)]
vga: Implement blinking of text cursor

Let the text cursor blink at 1.875 Hz, the original VGA cursor
frequency. No timer is used, instead we rely on the fact that the
display is updated periodically.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoconsole: Implementing blinking of cursor
Jan Kiszka [Tue, 10 Jul 2012 20:00:55 +0000 (22:00 +0200)]
console: Implementing blinking of cursor

Let the text console cursor blink at 2 HZ.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoconfigure: add -Werror to QEMU_CFLAGS early
Alexander Graf [Mon, 9 Jul 2012 12:38:08 +0000 (14:38 +0200)]
configure: add -Werror to QEMU_CFLAGS early

We want all configure tests pass with -Werror if it is enabled. So we
need to update QEMU_CFLAGS early on to make sure we also pass it in to
all the compile test jobs.

This fixes a warning-became-error bug in nss for me with the default
configuration:

In file included from /usr/include/nss3/pkcs11t.h:1780,
                 from /usr/include/nss3/keythi.h:41,
                 from /usr/include/nss3/keyt.h:41,
                 from /usr/include/nss3/pk11pub.h:43,
                 from libcacard/vcard_emul_nss.c:21:
/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomonitor: Use TARGET_PRI*PHYS to avoid TARGET_PHYS_ADDR_BITS ifdef
Peter Maydell [Mon, 25 Jun 2012 15:52:24 +0000 (16:52 +0100)]
monitor: Use TARGET_PRI*PHYS to avoid TARGET_PHYS_ADDR_BITS ifdef

Now we have TARGET_PRI*PHYS for printing target_phys_addr_t values,
we can use them in monitor.c rather than having duplicate code
in two arms of a TARGET_PHYS_ADDR_BITS ifdef.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr
Peter Maydell [Mon, 25 Jun 2012 15:52:23 +0000 (16:52 +0100)]
hw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr

Switch a format string from %x to TARGET_PRIxPHYS so that it will
continue to work even if target_phys_addr_t is changed
to 64 bits in the future.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohw/omap.h: Use TARGET_PRIxPHYS to define OMAP_FMT_plx
Peter Maydell [Mon, 25 Jun 2012 15:52:22 +0000 (16:52 +0100)]
hw/omap.h: Use TARGET_PRIxPHYS to define OMAP_FMT_plx

Use the new TARGET_PRIxPHYS macro to avoid the need to define an
OMAP_FMT_plx macro whose expansion depends directly on
TARGET_PHYS_ADDR_BITS.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotargphys.h: Define TARGET_PRI*PHYS format specifier macros
Peter Maydell [Mon, 25 Jun 2012 15:52:21 +0000 (16:52 +0100)]
targphys.h: Define TARGET_PRI*PHYS format specifier macros

Define a set of TARGET_PRI*PHYS format specifier macros for working
with target_phys_addr_t types. These follow the standard pattern
for such macros, and are more flexible than TARGET_FMT_plx, which
does not allow specification of field widths.

Suggested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agodisas: Fix printing of addresses in disassembly
Peter Maydell [Mon, 25 Jun 2012 04:55:55 +0000 (04:55 +0000)]
disas: Fix printing of addresses in disassembly

In our disassembly code, the bfd_vma type is always 64 bits,
even if the target's virtual address width is only 32 bits. This
means that when we print out addresses we need to truncate them
to 32 bits, to avoid odd output which has incorrectly sign-extended
a value to 64 bits, for instance this ARM example:
    0x80479a60:  e59f4088     ldr  r4, [pc, #136]  ; 0xffffffff80479a4f

(It would also be possible to truncate before passing the address
to info->print_address_func(), but truncating in the final print
function is the same approach that binutils takes to this problem.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: add AMD PCscsi emulation (PCI SCSI adapter)
Hervé Poussineau [Mon, 9 Jul 2012 10:02:31 +0000 (12:02 +0200)]
esp: add AMD PCscsi emulation (PCI SCSI adapter)

The PCI version is supported in lots of Operating Systems,
and has been successfully tested on:
- MS DOS 6.22 (using DC390 driver)
- MS Windows 3.11 (using DC390 driver)
- MS Windows 98 SE (using default driver)
- MS Windows NT 3.1 (using DC390 driver)
- MS Windows NT 4.0 (using default driver)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agopci: add some stubs
Hervé Poussineau [Mon, 9 Jul 2012 10:02:30 +0000 (12:02 +0200)]
pci: add some stubs

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: use trace framework instead of stderr output
Hervé Poussineau [Mon, 9 Jul 2012 10:02:29 +0000 (12:02 +0200)]
esp: use trace framework instead of stderr output

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: split esp code into generic chip emulation and sysbus layer
Hervé Poussineau [Mon, 9 Jul 2012 10:02:28 +0000 (12:02 +0200)]
esp: split esp code into generic chip emulation and sysbus layer

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: use hba_private field instead of a complex cast
Hervé Poussineau [Mon, 9 Jul 2012 10:02:27 +0000 (12:02 +0200)]
esp: use hba_private field instead of a complex cast

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: support future change of chip_id
Hervé Poussineau [Mon, 9 Jul 2012 10:02:26 +0000 (12:02 +0200)]
esp: support future change of chip_id

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: implement Reset ATN command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:25 +0000 (12:02 +0200)]
esp: implement Reset ATN command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: implement Disable selection command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:24 +0000 (12:02 +0200)]
esp: implement Disable selection command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: delay Transfer Information command if dma is not enabled
Hervé Poussineau [Mon, 9 Jul 2012 10:02:23 +0000 (12:02 +0200)]
esp: delay Transfer Information command if dma is not enabled

The same mechanism is already in place for some select commands.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoesp: execute select commands immediately when it is a non-dma command
Hervé Poussineau [Mon, 9 Jul 2012 10:02:22 +0000 (12:02 +0200)]
esp: execute select commands immediately when it is a non-dma command

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
Blue Swirl [Sat, 14 Jul 2012 10:07:37 +0000 (10:07 +0000)]
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf

* 's390-for-upstream' of git://repo.or.cz/qemu/agraf:
  s390: autodetect map private

12 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 14 Jul 2012 10:07:34 +0000 (10:07 +0000)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  target-arm: Add support for long format translation table walks
  target-arm: Implement TTBCR changes for LPAE
  target-arm: Implement long-descriptor PAR format
  target-arm: Use target_phys_addr_t in get_phys_addr()
  target-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE
  target-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE
  target-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers
  target-arm: Extend feature flags to 64 bits
  target-arm: Implement privileged-execute-never (PXN)
  ARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits
  hw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits
  target-arm: Fix TCG temp handling in 64 bit cp writes
  target-arm: Fix some copy-and-paste errors in cp register names
  target-arm: Fix typo that meant TTBR1 accesses went to TTBR0
  target-arm: Fix CP15 based WFI

12 years agomake: Remove 'build-all' rule
Stefan Weil [Mon, 9 Jul 2012 18:36:36 +0000 (20:36 +0200)]
make: Remove 'build-all' rule

It is not needed, because the 'all' rule does the same.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-keymaps: Finnish keyboard mapping broken
Michael Tokarev [Thu, 12 Jul 2012 11:59:12 +0000 (12:59 +0100)]
qemu-keymaps: Finnish keyboard mapping broken

As mentioned in http://bugs.debian.org/660154 , finnish keyboard mapping
is kind of broken.  Fix it as Timo Sirainen suggests in #660154.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agovnc: add a more descriptive error message
Amos Kong [Sat, 30 Jun 2012 02:02:20 +0000 (10:02 +0800)]
vnc: add a more descriptive error message

Currently qemu outputs some low-level error in qemu-sockets.c
when failed to start vnc server.
eg. 'getaddrinfo(127.0.0.1,5902): Name or service not known'

Some libvirt users could not know what's happened with this
unclear error message. This patch added a more descriptive
error message.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agobitops: Fix documentation
Stefan Weil [Sun, 8 Jul 2012 20:31:21 +0000 (22:31 +0200)]
bitops: Fix documentation

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agomegasas: mark mfi_frame_desc as 'static'
Hannes Reinecke [Wed, 4 Jul 2012 10:02:07 +0000 (12:02 +0200)]
megasas: mark mfi_frame_desc as 'static'

Suggested by blue swirl. Patch is on top of Paolo's
scsi-next tree.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotarget-arm: Add support for long format translation table walks
Peter Maydell [Thu, 12 Jul 2012 10:59:12 +0000 (10:59 +0000)]
target-arm: Add support for long format translation table walks

Implement the actual table walk code for LPAE's long format
translation tables.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Implement TTBCR changes for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:11 +0000 (10:59 +0000)]
target-arm: Implement TTBCR changes for LPAE

Implement the changes to the TTBCR register required for LPAE:
 * many fewer bits should be RAZ/WI
 * since TTBCR changes can result in a change of ASID, we must
   flush the TLB on writes to it

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Implement long-descriptor PAR format
Peter Maydell [Thu, 12 Jul 2012 10:59:10 +0000 (10:59 +0000)]
target-arm: Implement long-descriptor PAR format

Implement the different format of the PAR when long descriptor
translation tables are in use. Note that we assume that
get_phys_addr() returns a long-descriptor format DFSR value on
failure if long descriptors are in use; this added subtlety tips
the balance and makes it worth adding a comment documenting the
API to get_phys_addr().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Use target_phys_addr_t in get_phys_addr()
Peter Maydell [Thu, 12 Jul 2012 10:59:09 +0000 (10:59 +0000)]
target-arm: Use target_phys_addr_t in get_phys_addr()

In the implementation of get_phys_addr(), consistently use
target_phys_addr_t to hold the physical address rather than
uint32_t.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:09 +0000 (10:59 +0000)]
target-arm: Add 64 bit PAR, TTBR0, TTBR1 for LPAE

Under LPAE, the cp15 registers PAR, TTBR0 and TTBR1 are extended
to 64 bits, with a 64 bit (MRRC/MCRR) access path to read the
full width of the register. Add the state fields for the top
half and the 64 bit access path. Actual use of the top half of
the register will come with the addition of the long-descriptor
translation table format support.

For the PAR we also need to correct the masking applied for
32 bit writes (there are no bits reserved if LPAE is implemented)
and clear the high half when doing a 32 bit result VA-to-PA
lookup.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE
Peter Maydell [Thu, 12 Jul 2012 10:59:08 +0000 (10:59 +0000)]
target-arm: Add 64 bit variants of DBGDRAR and DBGDSAR for LPAE

LPAE extends the DBGDRAR and DBGDSAR debug registers to 64 bits; we
only implement these as dummy RAZ versions; provide dummies for
the 64 bit accesses as well.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers
Peter Maydell [Thu, 12 Jul 2012 10:59:07 +0000 (10:59 +0000)]
target-arm: Add AMAIR0, AMAIR1 LPAE cp15 registers

Add implementations of the AMAIR0 and AMAIR1 LPAE
Auxiliary Memory Attribute Indirection Registers.
These are implementation defined and we choose to
implement them as RAZ/WI, matching the Cortex-A7
and Cortex-A15.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Extend feature flags to 64 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:06 +0000 (10:59 +0000)]
target-arm: Extend feature flags to 64 bits

Extend feature flags to 64 bits, as we've just run out of space
in the 32 bit integer we were using for them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Implement privileged-execute-never (PXN)
Peter Maydell [Thu, 12 Jul 2012 10:59:05 +0000 (10:59 +0000)]
target-arm: Implement privileged-execute-never (PXN)

Implement the privileged-execute-never (PXN) translation table bit.
It is implementation-defined whether this is implemented, so we give
it its own ARM_FEATURE_ flag. LPAE requires PXN, so add also an
LPAE feature flag and the implication logic, as a placeholder
for actually implementing LPAE at a later date.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:03 +0000 (10:59 +0000)]
ARM: Make target_phys_addr_t 64 bits and physaddrs 40 bits

Make target_phys_addr_t 64 bits for ARM targets, and set
TARGET_PHYS_ADDR_SPACE_BITS to 40.  This should have no effect for ARM
boards where physical addresses really are 32 bits (except perhaps a
slight performance hit on 32 bit hosts for system emulation) but allows
us to implement the Large Physical Address Extensions for Cortex-A15,
which mean 40 bit physical addresses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits
Peter Maydell [Thu, 12 Jul 2012 10:59:02 +0000 (10:59 +0000)]
hw/imx_avic.c: Avoid format error when target_phys_addr_t is 64 bits

Add a missing cast to avoid gcc complaining about format string
errors when printing an expression based on a target_phys_addr_t.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Chubb <peter.chubb@nicta.com.au>
12 years agotarget-arm: Fix TCG temp handling in 64 bit cp writes
Peter Maydell [Thu, 12 Jul 2012 10:59:04 +0000 (10:59 +0000)]
target-arm: Fix TCG temp handling in 64 bit cp writes

Fix errors in the TCG temp handling in the 64 bit coprocessor
write path: we were reusing a 32 bit temp after it had been
freed by store_reg(), and failing to free a 64 bit temp.

This bug has no visible effect at this point because there
aren't any non-NOP 64 bit registers yet; it needs to be fixed
as a prerequisite for the 64 bit registers in LPAE support.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Fix some copy-and-paste errors in cp register names
Peter Maydell [Thu, 12 Jul 2012 10:58:36 +0000 (10:58 +0000)]
target-arm: Fix some copy-and-paste errors in cp register names

Fix a couple of cases where cp register names were copy-and-pasted.
These are harmless since we don't use the name for anything (except
debugging convenience) but could be confusing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
12 years agotarget-arm: Fix typo that meant TTBR1 accesses went to TTBR0
Peter Maydell [Thu, 12 Jul 2012 10:58:36 +0000 (10:58 +0000)]
target-arm: Fix typo that meant TTBR1 accesses went to TTBR0

Fix a copy-and-paste error in the register description for TTBR1
that meant it was a duplicate of TTBR0 rather than affecting the
correct bit of CPU state.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Fix CP15 based WFI
Paul Brook [Thu, 12 Jul 2012 10:58:35 +0000 (10:58 +0000)]
target-arm: Fix CP15 based WFI

The coprocessor register rework broke cp15 based WFI instructions.
We incorrectly fall through the normal register write case, which
incorrectly adds a forced block termination.  We've already done
a special version of this (DISAS_WFI), so return immediately.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoiov: Fix do_send_recv() for MinGW (also fixes a build breakage)
Stefan Weil [Wed, 11 Jul 2012 05:09:05 +0000 (07:09 +0200)]
iov: Fix do_send_recv() for MinGW (also fixes a build breakage)

Commit 25e5e4c7 broke compilation for non POSIX hosts (e.g. MinGW)
because it partially replaced "ret" by "count".

It also changed the handling of EINTR in a wrong way.

The patch restores the old code for these two changes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu_find_file: check name as a straight path even if it has no '/'
Peter Maydell [Fri, 25 May 2012 12:07:01 +0000 (13:07 +0100)]
qemu_find_file: check name as a straight path even if it has no '/'

Make qemu_find_file() check for the passed in name as a straight
pathname even if it doesn't have any path separator character in it.
This means that "-bios foo", "-dtb foo" etc will find a file 'foo'
in the current directory.
This removes an inconsistency with -kernel and -initrd, which both
accept plain filenames as meaning files in the current directory.
It's also less confusing for the user than an undocumented restriction
that "this option accepts a filename, except for the special case
where the filename you pass happens not to have a '/' in it, in
which case we'll ignore it."

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agos390: autodetect map private
Christian Borntraeger [Fri, 15 Jun 2012 05:10:30 +0000 (05:10 +0000)]
s390: autodetect map private

By default qemu will use MAP_PRIVATE for guest pages. This will write
protect pages and thus break on s390 systems that dont support this feature.
Therefore qemu has a hack to always use MAP_SHARED for s390. But MAP_SHARED
has other problems (no dirty pages tracking, a lot more swap overhead etc.)
Newer systems allow the distinction via KVM_CAP_S390_COW. With this feature
qemu can use the standard qemu alloc if available, otherwise it will use
the old s390 hack.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agomegasas: disable due to build breakage
Anthony Liguori [Mon, 9 Jul 2012 23:16:16 +0000 (18:16 -0500)]
megasas: disable due to build breakage

The Buildbot has detected a new failure on builder default_i386_rhel61 while
building qemu.

Full details are available at:
 http://buildbot.b1-systems.de/qemu/builders/default_i386_rhel61/builds/304

The proper fix is non-trivial so let's disable the build by default until it's
fixed properly.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'mjt/mjt-iov2' into staging
Anthony Liguori [Mon, 9 Jul 2012 17:35:06 +0000 (12:35 -0500)]
Merge remote-tracking branch 'mjt/mjt-iov2' into staging

* mjt/mjt-iov2:
  rewrite iov_send_recv() and move it to iov.c
  cleanup qemu_co_sendv(), qemu_co_recvv() and friends
  export iov_send_recv() and use it in iov_send() and iov_recv()
  rename qemu_sendv to iov_send, change proto and move declarations to iov.h
  change qemu_iovec_to_buf() to match other to,from_buf functions
  consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
  allow qemu_iovec_from_buffer() to specify offset from which to start copying
  consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
  rewrite iov_* functions
  change iov_* function prototypes to be more appropriate
  virtio-serial-bus: use correct lengths in control_out() message

Conflicts:
tests/Makefile

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'quintela/migration-anthony-v2' into staging
Anthony Liguori [Mon, 9 Jul 2012 16:57:34 +0000 (11:57 -0500)]
Merge remote-tracking branch 'quintela/migration-anthony-v2' into staging

* quintela/migration-anthony-v2:
  Maintain the number of dirty pages
  dirty bitmap: abstract its use
  Exit loop if we have been there too long
  Only calculate expected_time for stage 2
  Only TCG needs TLB handling
  No need to iterate if we already are over the limit
  Add tracepoints for savevm section start/end
  Add spent time for migration
  Add migration_end function
  Add debugging infrastructure
  Add save_block_hdr function
  Add MigrationParams structure
  Add missing check for host_from_stream_offset return value for RAM_SAVE_FLAG_PAGE

12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Mon, 9 Jul 2012 16:56:43 +0000 (11:56 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  slirp: Improve error reporting of inaccessible smb directories
  slirp: Ensure smbd and shared directory exist when enable smb
  slirp: add 'cmd:' target for guestfwd
  slirp: Enforce host-side user of smb share

12 years agoslirp: Improve error reporting of inaccessible smb directories
Jan Kiszka [Fri, 6 Jul 2012 06:40:48 +0000 (08:40 +0200)]
slirp: Improve error reporting of inaccessible smb directories

Instead of guessing, print the error code returned by access.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Ensure smbd and shared directory exist when enable smb
Dunrong Huang [Fri, 6 Jul 2012 06:04:43 +0000 (14:04 +0800)]
slirp: Ensure smbd and shared directory exist when enable smb

Users may pass the following parameters to qemu:
    $ qemu-kvm -net nic -net user,smb= ...
    $ qemu-kvm -net nic -net user,smb ...
    $ qemu-kvm -net nic -net user,smb=bad_directory ...

In these cases, qemu started successfully while samba server
failed to start. Users will confuse since samba server
failed silently without any indication of what it did wrong.

To avoid it, we check whether the shared directory exist and
if users have permission to access this directory when QEMU's
"built-in" SMB server is enabled.

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: add 'cmd:' target for guestfwd
Alexander Graf [Sun, 3 Jun 2012 07:45:01 +0000 (09:45 +0200)]
slirp: add 'cmd:' target for guestfwd

When using guestfwd=, Qemu only connects the virtual server's TCP port
to a single chardev. This is useless in most cases, as we usually want
to have more than a single connection from the guest to the outside world.

This patch adds a new cmd: target to guestfwd= that allows for execution
of a command on every TCP connection. This leverages the same code as
the -smb parameter, just that here the command is user defined.

Reported-by: Sascha Wilde <wilde@intevation.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Enforce host-side user of smb share
Jan Kiszka [Thu, 5 Jul 2012 17:35:57 +0000 (19:35 +0200)]
slirp: Enforce host-side user of smb share

Windows 7 (and possibly other versions) cannot connect to the samba
share if the exported host directory is not world-readable. This can be
resolved by forcing the username used for access checks to the one
under which QEMU and smbd are running.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 9 Jul 2012 15:29:40 +0000 (10:29 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (24 commits)
  block: Factor bdrv_read_unthrottled() out of guess_disk_lchs()
  qtest: Tidy up temporary files properly
  fdc: Drop broken code for user-defined floppy geometry
  fdc_test: introduce test_sense_interrupt
  fdc_test: update media_change test
  fdc: fix interrupt handling
  fdc: rewrite seek and DSKCHG bit handling
  block: introduce bdrv_swap, implement bdrv_append on top of it
  block: copy over job and dirty bitmap fields in bdrv_append
  raw: hook into blkdebug
  blkdebug: optionally tie errors to a specific sector
  blkdebug: store list of active rules
  blkdebug: pass getlength to underlying file
  blkdebug: tiny cleanup
  blkdebug: remove sync i/o events
  sheepdog: traverse pending_list from the first for each time
  sheepdog: split outstanding list into inflight and pending
  sheepdog: make sure we don't free aiocb before sending all requests
  sheepdog: use coroutine based socket functions in coroutine context
  sheepdog: restart I/O when socket becomes ready in do_co_req()
  ...

12 years agoblock: Factor bdrv_read_unthrottled() out of guess_disk_lchs()
Markus Armbruster [Fri, 29 Jun 2012 15:34:29 +0000 (17:34 +0200)]
block: Factor bdrv_read_unthrottled() out of guess_disk_lchs()

To prepare move of guess_disk_lchs() into hw/, where it poking
BlockDriverState member io_limits_enabled directly would be unclean.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Tidy up temporary files properly
Markus Armbruster [Fri, 29 Jun 2012 15:34:27 +0000 (17:34 +0200)]
qtest: Tidy up temporary files properly

Each test litters /tmp with several files: a pid file and two
sockets.  Tidy up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoMerge remote-tracking branch 'kraxel/usb.55' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:33 +0000 (09:51 -0500)]
Merge remote-tracking branch 'kraxel/usb.55' into staging

* kraxel/usb.55:
  usb-host: add trace events for iso xfers
  usb: fix interface initialization
  usb: split endpoint init and reset
  usb-redir: Correctly handle the usb_redir_babble usbredir status
  ehci: Kick async schedule on wakeup in the non companion case
  usb-ehci: Fix an assert whenever isoc transfers are used
  ehci: don't flush cache on doorbell rings.
  ehci: fix td writeback
  ehci: fix ehci_qh_do_overlay

12 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:19 +0000 (09:51 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

* bonzini/scsi-next:
  scsi: Fix transfer length for READ POSITION commands.
  scsi: Add basic support for SCSI media changer commands.
  scsi: Ensure command and transfer lengths are set for all SCSI devices
  scsi: Fix LOAD_UNLOAD
  scsi: Fix data length == SCSI_SENSE_BUF_SIZE
  virtio-scsi: do not crash on adding buffers to the event queue
  megasas: LSI Megaraid SAS HBA emulation
  megasas: Add header file
  ISCSI: force use of sg for SMC and SSC devices
  ISCSI: Add SCSI passthrough via scsi-generic to libiscsi
  scsi-disk: implement READ DISC INFORMATION
  atapi: implement READ DISC INFORMATION
  scsi: add a qdev property for the disk's WWN
  scsi: simplify handling of the VPD page length field

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 9 Jul 2012 14:51:06 +0000 (09:51 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  configure: Remove help for --disable-vnc-thread, --enable-vnc-thread
  cpu-common.h: Remove a pointless ifndef CONFIG_USER_ONLY
  cpu-common.h: Remove unnecessary guard on including targphys.h

12 years agofdc: Drop broken code for user-defined floppy geometry
Markus Armbruster [Fri, 29 Jun 2012 15:34:23 +0000 (17:34 +0200)]
fdc: Drop broken code for user-defined floppy geometry

bdrv_get_floppy_geometry_hint() fails to store through its parameter
drive when bs has a geometry hint.  Makes fd_revalidate() assign
random crap to drv->drive.

Has been broken that way for ages.  Harmless, because:

* The only way to set a geometry hint is -drive if=none,cyls=...
  Since commit c219331e, probably unintentional.

* The only use of drv->drive is as argument to another
  bdrv_get_floppy_geometry_hint().  Which doesn't use it, since the
  geometry hint is still there.

Drop the broken code, ignore -drive parameter cyls, heads and secs for
floppies even with if=none, just like before commit c219331e.  Matches
-help, which explains cyls, heads, secs as "hard disk physical
geometry".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc_test: introduce test_sense_interrupt
Pavel Hrdina [Wed, 4 Jul 2012 09:18:35 +0000 (11:18 +0200)]
fdc_test: introduce test_sense_interrupt

Calling sense interrupt status while there is no interrupt should
return invalid command (0x80).

Read command should always returns in st0 seek_end bit set to 1.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc_test: update media_change test
Pavel Hrdina [Wed, 4 Jul 2012 14:26:04 +0000 (16:26 +0200)]
fdc_test: update media_change test

After rewrite DSKCHG bit handling the test has to be updated. Now
is needed to seek to different track to clear DSKCHG bit.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: fix interrupt handling
Pavel Hrdina [Fri, 22 Jun 2012 10:33:55 +0000 (12:33 +0200)]
fdc: fix interrupt handling

If you call the SENSE INTERRUPT STATUS command while there is no interrupt
waiting you get as result unknown command.

Fixed status0 register handling for read/write/format commands.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: rewrite seek and DSKCHG bit handling
Pavel Hrdina [Fri, 22 Jun 2012 10:33:54 +0000 (12:33 +0200)]
fdc: rewrite seek and DSKCHG bit handling

This bit is cleared on every successful seek to a different track (cylinder).
The seek is also called on revalidate or on read/write/format commands which
also clear the DSKCHG bit.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>