[Qemu-devel] [PATCH v4] bios: Add fast variant of SeaBIOS for use with -kernel on x86.

2016-04-01 Thread Richard W.M. Jones
he -kernel option to use this. You have to specify it by doing something like this: -kernel vmlinuz -bios bios-fast.bin Signed-off-by: Richard W.M. Jones --- Makefile | 3 ++- roms/Makefile| 4 +++- roms/config.seabios-fast | 27 +++

[Qemu-devel] [PATCH v4] bios: Add fast variant of SeaBIOS for use with -kernel on x86.

2016-04-01 Thread Richard W.M. Jones
The previous version was posted and discussed on this thread: https://lists.nongnu.org/archive/html/qemu-devel/2016-04/threads.html#00013 Since v3: - CONFIG_ROM_SIZE=0 (it chooses 64K automatically) - CONFIG_RELOCATE_INIT=n - CONFIG_BOOTORDER=n Knocks another 10ms off the boot time. Ric

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-01 Thread Richard W.M. Jones
On Fri, Apr 01, 2016 at 03:04:15PM -0400, Kevin O'Connor wrote: > On Fri, Apr 01, 2016 at 07:59:02PM +0100, Richard W.M. Jones wrote: > > On Fri, Apr 01, 2016 at 07:41:31PM +0100, Richard W.M. Jones wrote: > > > Below are some benchmarks of the other things you mentioned. T

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-01 Thread Richard W.M. Jones
On Fri, Apr 01, 2016 at 08:10:48PM +0100, Richard W.M. Jones wrote: > On Fri, Apr 01, 2016 at 03:04:15PM -0400, Kevin O'Connor wrote: > > Otherwise, it doesn't make > > sense that disabling CONFIG_BOOTORDER=n would change the boot time. > > Could it be explained by

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-01 Thread Richard W.M. Jones
On Fri, Apr 01, 2016 at 03:44:14PM -0400, Kevin O'Connor wrote: [...] I ran all the tests again, but this time I ran the test program 3 times (so 30 passes for each setting). As you can see from the results below the test is not very stable, so that could easily have accounted for the variation I

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-01 Thread Richard W.M. Jones
On Fri, Apr 01, 2016 at 04:05:46PM -0400, Kevin O'Connor wrote: > On Fri, Apr 01, 2016 at 07:41:31PM +0100, Richard W.M. Jones wrote: > > On Fri, Apr 01, 2016 at 11:35:40AM -0400, Kevin O'Connor wrote: > > > > +# general stuff > > > > +CONFIG_QEMU=y &g

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-02 Thread Richard W.M. Jones
On Fri, Apr 01, 2016 at 06:25:24PM -0400, Kevin O'Connor wrote: > I'm getting different results. When you have time we should probably > track down the discrepancy. Some of the difference is likely due to > different hardware (I'm using kvm on an old AMD machine) and some is > likely due to diffe

Re: [Qemu-devel] [PATCH v4.1] Add optionrom compatible with fw_cfg DMA version

2016-04-04 Thread Richard W.M. Jones
On Mon, Apr 04, 2016 at 04:02:04PM +0100, Stefan Hajnoczi wrote: > (1) initrd loading is broken, kernel complains it finds only gibberish: > > [0.934582] Unpacking initramfs... > [1.166983] Initramfs unpacking failed: junk in compressed archive > [1.168458] Freeing initrd memor

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-05 Thread Richard W.M. Jones
On Tue, Apr 05, 2016 at 06:38:36AM +0200, Kevin Wolf wrote: > Am 01.04.2016 um 13:20 hat Richard W.M. Jones geschrieben: > > > > My patch, plus the configuration and comments from your patch, > > combined. Plus I tested it with libguestfs boot-analysis and it works

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-04-05 Thread Richard W.M. Jones
> > OK so this reminds me of the second problem. How to detect what > > bioses are available, given a qemu binary. It would be nice if qemu > > had an option like: > > > > qemu -bios \? I didn't really think this one through. The extra time taken (in the link loader) to run the above query c

[Qemu-devel] [PATCH v2 REPOST 0/2] Add dynamic module loading for block drivers

2016-04-12 Thread Richard W.M. Jones
This is a repost of the support for dynamically loaded block drivers. It is identical to how it was posted last summer, except that I have rebased it and checked that it still works. It was last posted here: https://lists.gnu.org/archive/html/qemu-devel/2015-09/threads.html#01995 Last time this

[Qemu-devel] [PATCH v2 REPOST 2/2] Add dynamic generation of module_block.h

2016-04-12 Thread Richard W.M. Jones
From: Marc Marí To simplify the addition of new block modules, add a script that generates include/qemu/module_block.h automatically from the modules' source code. This script assumes that the QEMU coding style rules are followed. Signed-off-by: Marc Marí --- .gitignore |

[Qemu-devel] [PATCH v2 REPOST 1/2] Add dynamic module loading for block drivers

2016-04-12 Thread Richard W.M. Jones
From: Marc Marí Extend the current module interface to allow for block drivers to be loaded dynamically on request. The only block drivers that can be converted into modules are the drivers that don't perform any init operation except for registering themselves. This is why libiscsi has been dis

Re: [Qemu-devel] RFC: virtio-rng and /dev/urandom

2016-04-15 Thread Richard W.M. Jones
On Fri, Apr 15, 2016 at 06:41:34AM -0400, Cole Robinson wrote: > Libvirt currently rejects using host /dev/urandom as an input source for a > virtio-rng device. The only accepted sources are /dev/random and /dev/hwrng. > This is the result of discussions on qemu-devel around when the feature was >

Re: [Qemu-devel] [libvirt] RFC: virtio-rng and /dev/urandom

2016-04-15 Thread Richard W.M. Jones
On Fri, Apr 15, 2016 at 12:46:46PM +0100, Richard W.M. Jones wrote: > On Fri, Apr 15, 2016 at 06:41:34AM -0400, Cole Robinson wrote: > > Libvirt currently rejects using host /dev/urandom as an input source for a > > virtio-rng device. The only accepted sources are /dev/random

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-17 Thread Richard W.M. Jones
On Wed, Apr 13, 2016 at 05:09:49PM +0800, Fam Zheng wrote: > Underneath is the fcntl syscall that locks the local file, similar to what is > already used in libvirt virtlockd. Also because of that, we cannot directly > apply fcntl lock on the image file itself, instead we open and lock > "/var/tm

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-17 Thread Richard W.M. Jones
On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > the intervene. > +static int raw_lockf(BlockDriverState *bs, BdrvLockfCmd cmd) > +{ > + > +BDRVRawState *s = bs->opaque; > +int ret; > +struct flock fl = (st

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-18 Thread Richard W.M. Jones
On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > > > the intervene.

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 08:37:14PM +0800, Fam Zheng wrote: > On Mon, 04/18 09:04, Richard W.M. Jones wrote: > > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > > On Fri, Apr 15, 2016 at 11:

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 09:19:02PM +0800, Fam Zheng wrote: > On Tue, 04/19 14:07, Richard W.M. Jones wrote: > > We've done this successfully for years, for people monitoring their > > VMs using virt-df, pulling out files using guestfish and so on. We > > allow you to do

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 02:34:30PM +0100, Daniel P. Berrange wrote: > Have you ever considered integration with the QEMU NBD server. We > don't have APIs for enabling it explicitly in libvirt, but it strikes > me that it could be ideally suited for your needs. > > eg a hypothetical libvirt command

Re: [Qemu-devel] [PATCH v4.1] Add optionrom compatible with fw_cfg DMA version

2016-04-22 Thread Richard W.M. Jones
On Tue, Apr 05, 2016 at 09:29:28AM +0200, Gerd Hoffmann wrote: > On Mo, 2016-04-04 at 16:21 +0100, Richard W.M. Jones wrote: > > On Mon, Apr 04, 2016 at 04:02:04PM +0100, Stefan Hajnoczi wrote: > > > (1) initrd loading is broken, kernel complains it fi

[Qemu-devel] [PATCH v5] Add optionrom compatible with fw_cfg DMA version

2016-04-22 Thread Richard W.M. Jones
From: Marc Marí This optionrom is based on linuxboot.S. Signed-off-by: Marc Marí Signed-off-by: Richard W.M. Jones --- .gitignore| 4 + hw/i386/pc.c | 9 +- hw/nvram/fw_cfg.c | 2 +- include/hw/nvram/fw_cfg.h | 1

[Qemu-devel] [PATCH v5] Add optionrom compatible with fw_cfg DMA version

2016-04-22 Thread Richard W.M. Jones
v4 -> v5: * Fix the initrd loading problem by fixing the get_e801_addr function so it really reads the values from the BIOS. Previously the function always returned 16MB, and so it only happened to work for initrd sizes < ~15MB, and broke for anything larger. Now the function is fixed, I tes

[Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-04-25 Thread Richard W.M. Jones
v5 -> v6: - Changed the xen_load_linux assertion as suggested by Stefan. - I renamed the variables in get_e801_addr function, since the registers were really (16 bit 8086-style) AX, not EAX etc. Also I changed the GCC asm to make it a little bit more efficient. I verified by disassem

[Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-04-25 Thread Richard W.M. Jones
From: Marc Marí This optionrom is based on linuxboot.S. Signed-off-by: Marc Marí Signed-off-by: Richard W.M. Jones --- .gitignore| 4 + hw/i386/pc.c | 10 +- hw/nvram/fw_cfg.c | 2 +- include/hw/nvram/fw_cfg.h | 1

Re: [Qemu-devel] [PATCH v5] Add optionrom compatible with fw_cfg DMA version

2016-04-26 Thread Richard W.M. Jones
On Tue, Apr 26, 2016 at 09:43:09AM +0200, Gerd Hoffmann wrote: > On Fr, 2016-04-22 at 14:02 +0100, Richard W.M. Jones wrote: > > v4 -> v5: > > > > * Fix the initrd loading problem by fixing the get_e801_addr > >function so it really reads the values from the

Re: [Qemu-devel] [PATCH v3 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-04 Thread Richard W.M. Jones
On Thu, Apr 28, 2016 at 08:57:27PM +0800, Fam Zheng wrote: > They are wrappers of POSIX fcntl file locking, with the additional > interception of open/close (through qemu_open and qemu_close) to offer a > better semantics that preserves the locks across multiple life cycles of > different fds on th

Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-05-09 Thread Richard W.M. Jones
On Mon, May 09, 2016 at 04:31:26PM +0100, Stefan Hajnoczi wrote: > On Mon, May 9, 2016 at 2:24 PM, Stefan Hajnoczi wrote: > > On Mon, Apr 25, 2016 at 05:04:40PM +0100, Richard W.M. Jones wrote: > >> v5 -> v6: > >> > >> - Changed the xen_load_linux assertion

Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-05-09 Thread Richard W.M. Jones
Actually there's a rather more fundamental problem. In the current linuxboot_dma.c we use asm statements at the top and bottom of the file (outside any function). The asm statements define the header and what I assume is the footer of the file. At any rate, they encode the size of the file (the

Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-05-09 Thread Richard W.M. Jones
FWIW the response from the LLVM developers: https://llvm.org/bugs/show_bug.cgi?id=27688 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual

Re: [Qemu-devel] [PATCH v4 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 10:50:40AM +0800, Fam Zheng wrote: > +int qemu_lock_fd(int fd, int64_t start, int64_t len, bool readonly) I find this new API to be very unintuitive. When I was reading the other code in block/raw-posix.c I had to refer back to this file to find out what all the integers m

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 10:50:32AM +0800, Fam Zheng wrote: > v4: Don't lock RO image. [Rich] I applied this on top of HEAD and added some debugging messages to block/raw-posix.c so I can see when files are being opened and locked, and it does appear to do the right thing for read-only and write-ex

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 09:14:26AM +0100, Richard W.M. Jones wrote: > However I didn't test the write-shareable case (the libvirt > flag which should map to a shared lock -- is that right Dan?). To Dan (mainly): I think setting the flag in libvirt only sets cache=unsafe on the qem

Re: [Qemu-devel] [PATCH v4 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 09:57:48AM +0100, Daniel P. Berrange wrote: > On Tue, May 10, 2016 at 10:50:40AM +0800, Fam Zheng wrote: > > They are wrappers of POSIX fcntl file locking, with the additional > > interception of open/close (through qemu_open and qemu_close) to offer a > > better semantics t

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 11:14:22AM +0200, Kevin Wolf wrote: > Am 10.05.2016 um 10:50 hat Daniel P. Berrange geschrieben: > > On Tue, May 10, 2016 at 09:43:04AM +0100, Richard W.M. Jones wrote: > > > On Tue, May 10, 2016 at 09:14:26AM +0100, Richard W.M. Jones wrote: > > &

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 12:07:06PM +0200, Kevin Wolf wrote: > I'm surprised how low the standards seem to be when we're talking about > data integrity. If occasionally losing data is okay, the qemu block > layer could be quite a bit simpler. I welcome this patch because it fixes a real data integr

[Qemu-devel] Is 'hwclock -u -s' in a modern Linux guest necessary?

2016-03-19 Thread Richard W.M. Jones
I've been examining the time taken to launch the libguestfs appliance[1]. One of the commands we run in our custom init is: hwclock -u -s This takes 0.3 seconds, which is over 10% of the total launch time, and as far as I can tell it does nothing useful. It was added many years ago, and no on

[Qemu-devel] Why is SeaBIOS used with -kernel?

2016-03-19 Thread Richard W.M. Jones
I've been analyzing the libguestfs appliance[1] boot time. See attached file, especially the end of it. About 50% of the boot time is because of SeaBIOS. I'm using the qemu -kernel option. I understand that the kernel needs some BIOS features, eg. video stuff, E820. But kvmtool comes with a r

[Qemu-devel] [PATCH] docs: Update documentation for stderr (now log) tracing backend.

2016-03-20 Thread Richard W.M. Jones
This fixes commit ed7f5f1d8db06fc31352a5ef4f54985e630c575a. Signed-off-by: Richard W.M. Jones. Cc: Paolo Bonzini Cc: Stefan Hajnoczi --- docs/tracing.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tracing.txt b/docs/tracing.txt index 3182ee8..0bd6b9c 100644

Re: [Qemu-devel] Why is SeaBIOS used with -kernel?

2016-03-21 Thread Richard W.M. Jones
On Mon, Mar 21, 2016 at 08:58:27AM +0100, Gerd Hoffmann wrote: > On Sa, 2016-03-19 at 20:31 +0000, Richard W.M. Jones wrote: > > I've been analyzing the libguestfs appliance[1] boot time. See > > attached file, especially the end of it. > > > > About 50% of the

Re: [Qemu-devel] [PATCH v4] Add optionrom compatible with fw_cfg DMA version

2016-03-21 Thread Richard W.M. Jones
My notes on this patch: * It applies and compiles fine with current qemu on Linux/x86_64 host. However after building I had to do: cp pc-bios/optionrom/linuxboot_dma.bin pc-bios/ I wasn't sure if that was supposed to be done automatically. * It reduces libguestfs appliance boot time by ab

[Qemu-devel] [PATCH] exec: Rename and fix trace events for tracing I/O port access.

2016-03-29 Thread Richard W.M. Jones
Back in the day you used to be able to set DEBUG_IOPORT in ioport.c and get qemu to dump what (x86) I/O ports were being accessed by the guest. This was rather useful for finding out what closed source device drivers were up to. Now you're supposed to use cpu_in/cpu_out tracepoints instead. Howev

[Qemu-devel] [PATCH] exec: Rename and fix trace events for tracing I/O port access.

2016-03-29 Thread Richard W.M. Jones
re obvious what they do. Also: - they now work for 64 bit accesses - print the read/written value in hexadecimal Signed-off-by: Richard W.M. Jones --- exec.c | 10 +- ioport.c | 7 --- trace-events | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git

Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM

2016-05-26 Thread Richard W.M. Jones
On Thu, May 26, 2016 at 10:31:25AM -0400, Cole Robinson wrote: > If you try to gic-version=host with TCG on a KVM aarch64 host, > qemu segfaults, since host requires KVM APIs. > > Explicitly reject gic-version=host if KVM is not enabled > > https://bugzilla.redhat.com/show_bug.cgi?id=1339977 > Si

Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM

2016-05-26 Thread Richard W.M. Jones
On Thu, May 26, 2016 at 03:53:54PM +0100, Peter Maydell wrote: > On 26 May 2016 at 15:46, Richard W.M. Jones wrote: > > The problem with this is if I'm using TCG fallback mode, how > > can I specify the right gic-version? ie: > > > > -M virt,gic-version=host

Re: [Qemu-devel] [PULL 00/31] Misc changes for 2016-05-27

2016-05-27 Thread Richard W.M. Jones
On Fri, May 27, 2016 at 02:04:52PM +0100, Peter Maydell wrote: > With V=1: > > i686-w64-mingw32-ld -m i386pe -Ttext 0 -e _start -s -o > linuxboot_dma.img linuxboot_dma.o > linuxboot_dma.o:linuxboot_dma.c:(.text+0x57): undefined reference to > `load_kernel' > > Building an image for the target usi

Re: [Qemu-devel] [PULL 01/31] Add optionrom compatible with fw_cfg DMA version

2016-05-27 Thread Richard W.M. Jones
On Fri, May 27, 2016 at 04:09:32PM +0200, Paolo Bonzini wrote: > From: Marc Marí > > This optionrom is based on linuxboot.S. > > Signed-off-by: Marc Marí > Signed-off-by: Richard W.M. Jones > Message-Id: <1464027093-24073-2-git-send-email-rjo...@redhat.com> >

Re: [Qemu-devel] [PULL 00/31] Misc changes for 2016-05-27

2016-05-27 Thread Richard W.M. Jones
On Fri, May 27, 2016 at 04:06:07PM +0200, Paolo Bonzini wrote: > > > On 27/05/2016 15:38, Richard W.M. Jones wrote: > > One way to solve this (which works for me) is as below. There are > > some other approaches, eg. using -fno-leading-underscore, or using a > > cond

Re: [Qemu-devel] [PATCH v9] Add optionrom compatible with fw_cfg DMA version

2016-05-27 Thread Richard W.M. Jones
On Fri, May 27, 2016 at 04:50:14PM -0700, Stefan Hajnoczi wrote: > On Mon, May 23, 2016 at 07:11:32PM +0100, Richard W.M. Jones wrote: > > v8 -> v9: > > > > - Add a workaround for GCC < 4.9. > > > > - Add linuxbios_dma.bin to Makefile. > > >

Re: [Qemu-devel] [PULL 01/31] Add optionrom compatible with fw_cfg DMA version

2016-06-10 Thread Richard W.M. Jones
On Fri, May 27, 2016 at 04:09:32PM +0200, Paolo Bonzini wrote: > From: Marc Marí > > This optionrom is based on linuxboot.S. > > Signed-off-by: Marc Marí > Signed-off-by: Richard W.M. Jones > Message-Id: <1464027093-24073-2-git-send-email-rjo...@redhat.com> >

Re: [Qemu-devel] [PATCH v3] vl.c: Add '-L help' which lists data dirs.

2016-06-13 Thread Richard W.M. Jones
On Mon, Jun 13, 2016 at 01:55:59PM +0200, Paolo Bonzini wrote: > On 16/05/2016 18:34, Richard W.M. Jones wrote: > > QEMU compiles a list of data directories from various sources. When > > consuming a QEMU binary it's useful to be able to get this list of > > data direct

Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM

2016-06-17 Thread Richard W.M. Jones
On Fri, Jun 17, 2016 at 03:49:38PM +0100, Peter Maydell wrote: > On 26 May 2016 at 15:53, Peter Maydell wrote: > > On 26 May 2016 at 15:46, Richard W.M. Jones wrote: > >> The problem with this is if I'm using TCG fallback mode, how > >> can I specify the right

Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM

2016-06-17 Thread Richard W.M. Jones
On Fri, Jun 17, 2016 at 05:31:20PM +0100, Peter Maydell wrote: > On 17 June 2016 at 17:10, Richard W.M. Jones wrote: > > On Fri, Jun 17, 2016 at 03:49:38PM +0100, Peter Maydell wrote: > >> > I agree that we really need to do better here (thinking about > >> > t

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 01:08:49PM +0200, Kevin Wolf wrote: > Are you saying that libguestfs only allows operations like df on live > images, but not e.g. copying files out of the VM? [...] virt-copy-out will let you copy out files from a live VM. There's no difference between "safe" and "unsafe"

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Richard W.M. Jones
At no point did I say that it was safe to use libguestfs on live VMs or that you would always get consistent data out. But the fact that it can fail is understood, the chance of failure is really tiny (it has literally only happened twice that I've read corrupted data, in years of daily use), and

Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version

2016-05-10 Thread Richard W.M. Jones
On Tue, May 10, 2016 at 07:24:28PM +0200, Paolo Bonzini wrote: > > > On 09/05/2016 18:48, Richard W.M. Jones wrote: > > > > Of course we're well outside any standards here. Can we tell clang > > users to use the GCC/pre-compiled option ROMs :-? Any other ideas

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-11 Thread Richard W.M. Jones
On Wed, May 11, 2016 at 04:04:40PM +0800, Fam Zheng wrote: > On Tue, 05/10 13:22, Daniel P. Berrange wrote: > > On Tue, May 10, 2016 at 01:11:30PM +0100, Richard W.M. Jones wrote: > > > At no point did I say that it was safe to use libguestfs on live VMs > > > o

Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-11 Thread Richard W.M. Jones
While I remember there is another concern that doesn't seem to be addressed in this patch series. What happens when a guest is paused? I think exclusive locks should be converted to shared locks in that case, since (only while the guest is paused) it _is_ safe to fish around inside the guest's st

[Qemu-devel] [PATCH v7 2/2] Add optionrom compatible with fw_cfg DMA version

2016-05-11 Thread Richard W.M. Jones
From: Marc Marí This optionrom is based on linuxboot.S. Signed-off-by: Marc Marí Signed-off-by: Richard W.M. Jones --- .gitignore| 4 + hw/i386/pc.c | 10 +- hw/nvram/fw_cfg.c | 2 +- include/hw/nvram/fw_cfg.h | 1

[Qemu-devel] [PATCH v7 0/2] Add optionrom compatible with fw_cfg DMA version

2016-05-11 Thread Richard W.M. Jones
v6 -> v7: - This version compiles and works with both GCC (tested 6.1.1) and with Clang (tested 3.8.0). - Uses -m16 mode on both compilers to generate i8086 code. - The signrom.py script has been modified so it can (optionally) generate the size field in the header. - Tested with both

[Qemu-devel] [PATCH v7 1/2] scripts/signrom.py: Allow option ROM checksum script to write the size header.

2016-05-11 Thread Richard W.M. Jones
Modify the signrom.py script so that if the size byte in the header is 0 (ie. not set) then the script will set the size. If the size byte is non-zero then we do the same as before, so this doesn't require changes to any existing ROM sourcecode. Signed-off-by: Richard W.M. Jones --- sc

Re: [Qemu-devel] [PATCH v7 2/2] Add optionrom compatible with fw_cfg DMA version

2016-05-11 Thread Richard W.M. Jones
On Wed, May 11, 2016 at 10:07:27PM +0200, Paolo Bonzini wrote: > > > On 11/05/2016 19:42, Richard W.M. Jones wrote: > > + > > +#ifdef __clang__ > > +#define ADDR32 > > +#else > > +#define ADDR32 "addr32 " > > +#endif >

[Qemu-devel] [PATCH v8 0/3] Add optionrom compatible with fw_cfg DMA version

2016-05-11 Thread Richard W.M. Jones
v7 -> v8: - Add file magic check to signrom.py. - Some whitespace-only changes in linuxboot_dma.c. - Retested both clang & GCC with both small and large initrd. Rich.

[Qemu-devel] [PATCH v8 2/3] scripts/signrom.py: Check for magic in option ROMs.

2016-05-11 Thread Richard W.M. Jones
Because of the risk that compilers might not emit the asm() block at the beginning of the option ROM, check that the ROM contains the required magic signature. Signed-off-by: Richard W.M. Jones --- scripts/signrom.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PATCH v8 1/3] scripts/signrom.py: Allow option ROM checksum script to write the size header.

2016-05-11 Thread Richard W.M. Jones
Modify the signrom.py script so that if the size byte in the header is 0 (ie. not set) then the script will set the size. If the size byte is non-zero then we do the same as before, so this doesn't require changes to any existing ROM sourcecode. Signed-off-by: Richard W.M. Jones --- sc

[Qemu-devel] [PATCH v8 3/3] Add optionrom compatible with fw_cfg DMA version

2016-05-11 Thread Richard W.M. Jones
From: Marc Marí This optionrom is based on linuxboot.S. Signed-off-by: Marc Marí Signed-off-by: Richard W.M. Jones --- .gitignore| 4 + hw/i386/pc.c | 10 +- hw/nvram/fw_cfg.c | 2 +- include/hw/nvram/fw_cfg.h | 1

[Qemu-devel] tsc=reliable in Linux guests

2016-05-13 Thread Richard W.M. Jones
I was wondering why the Linux kernel was spending 21ms starting up each secondary CPU when we boot it virtualized with qemu -smp >= 2. It turns out the time was lost in check_tsc_sync_target(). This is easily avoided by using `tsc=reliable' on the command line, saving 63ms when starting a guest w

[Qemu-devel] [PATCH v4 REPOST] bios: Add fast variant of SeaBIOS for use with -kernel on x86.

2016-05-14 Thread Richard W.M. Jones
Previously posted here: https://lists.gnu.org/archive/html/qemu-devel/2016-04/threads.html#00205 There is no change. I just rebased it on top of current HEAD, and retested it. Rich.

[Qemu-devel] [PATCH v4 REPOST] bios: Add fast variant of SeaBIOS for use with -kernel on x86.

2016-05-14 Thread Richard W.M. Jones
he -kernel option to use this. You have to specify it by doing something like this: -kernel vmlinuz -bios bios-fast.bin Signed-off-by: Richard W.M. Jones Acked-by: Stefan Hajnoczi --- Makefile | 3 ++- roms/Makefile| 4 +++- roms/config.seabios-fast | 27 ++

[Qemu-devel] [PATCH] vl.c: Add -L ? (or -L help) which lists data dirs.

2016-05-16 Thread Richard W.M. Jones
are/qemu $ ./x86_64-softmmu/qemu-system-x86_64 -L /tmp -L \? /tmp /home/rjones/d/qemu/pc-bios /usr/local/share/qemu Signed-off-by: Richard W.M. Jones --- qemu-options.hx | 2 ++ vl.c| 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/q

[Qemu-devel] [PATCH v2] vl.c: Add '-L help' which lists data dirs.

2016-05-16 Thread Richard W.M. Jones
v1 -> v2: Avoid mentioning -L ? in the manual, commit messages etc. Because I'm using the is_help_option function, -L ? is still accepted. Rich.

[Qemu-devel] [PATCH v2] vl.c: Add '-L help' which lists data dirs.

2016-05-16 Thread Richard W.M. Jones
/x86_64-softmmu/qemu-system-x86_64 -L /tmp -L help /tmp /home/rjones/d/qemu/pc-bios /usr/local/share/qemu Signed-off-by: Richard W.M. Jones --- qemu-options.hx | 2 ++ vl.c| 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-opti

[Qemu-devel] Question about vNVDIMM file format

2016-05-16 Thread Richard W.M. Jones
I'm playing with ext4 and DAX. I'm using: -object memory-backend-file,id=mem1,share,mem-path=/var/tmp/pmem,size=4G \ -device nvdimm,memdev=mem1,id=nv1 where /var/tmp/pmem is a 4 GB ext4 filesystem image (no partition table). I can mount this in the guest using: mount -o dax /dev/pmem0 /m

[Qemu-devel] [PATCH v3] vl.c: Add '-L help' which lists data dirs.

2016-05-16 Thread Richard W.M. Jones
/x86_64-softmmu/qemu-system-x86_64 -L /tmp -L help /tmp /home/rjones/d/qemu/pc-bios /usr/local/share/qemu Signed-off-by: Richard W.M. Jones Reviewed-by: Eric Blake --- qemu-options.hx | 2 ++ vl.c| 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qe

[Qemu-devel] [PATCH v3] vl.c: Add '-L help' which lists data dirs.

2016-05-16 Thread Richard W.M. Jones
v2 -> v3: - Use constants true/false for list_data_dirs variable. Rich.

Re: [Qemu-devel] Question about vNVDIMM file format

2016-05-16 Thread Richard W.M. Jones
On Mon, May 16, 2016 at 09:53:36AM -0700, Stefan Hajnoczi wrote: > On Mon, May 16, 2016 at 04:04:01PM +0100, Richard W.M. Jones wrote: > > I'm playing with ext4 and DAX. > > > > I'm using: > > > > -object memory-backend-file,id=mem1,share,mem-path=/

Re: [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, Feb 16, 2016 at 05:34:41PM +0100, Paolo Bonzini wrote: > From: "Daniel P. Berrange" > > With the new style protocol, the NBD client will currenetly > send NBD_OPT_EXPORT_NAME as the first (and indeed only) > option it wants. The problem is that the NBD protocol spec > does not allow for r

Re: [Qemu-devel] [PATCH v8 0/3] Add optionrom compatible with fw_cfg DMA version

2016-05-17 Thread Richard W.M. Jones
On Wed, May 11, 2016 at 10:06:44PM +0100, Richard W.M. Jones wrote: > v7 -> v8: > > - Add file magic check to signrom.py. > > - Some whitespace-only changes in linuxboot_dma.c. > > - Retested both clang & GCC with both small and large initrd. Any comments? AF

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 04:22:06PM +0100, Alex Bligh wrote: > nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is > compulsory, even if you support it by returning a nameless export > (or default). Moreover support of export names is compulsory > (even if you have a single fixed one ca

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: > so it might be nicer to > make a change to the protocol document that instead permits current > nbdkit behavior and puts the burden on clients to interoperate when > NBD_OPT_LIST is not supported. The purpose of nbdkit is to be a server

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 10:05:50AM -0600, Eric Blake wrote: > On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: > > On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: > >> so it might be nicer to > >> make a change to the protocol document that instead permits c

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 09:59:02AM -0600, Eric Blake wrote: > On 05/17/2016 09:52 AM, Eric Blake wrote: > >>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the > >>> default name) as its only list entry? > >> > >> Or "default". > > > > As I read the protocol, I don't see "default

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
Just to close this thread out, I have implemented the exportname in qemu. NBD_OPT_LIST returns the exportname. nbdkit now interoperates with qemu 2.5 and 2.6. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: ht

Re: [Qemu-devel] Question about vNVDIMM file format

2016-05-18 Thread Richard W.M. Jones
On Wed, May 18, 2016 at 03:04:52PM +0800, Xiao Guangrong wrote: > On 05/17/2016 02:25 AM, Richard W.M. Jones wrote: > >(a) How necessary is the ACPI dependency? We disable ACPI because it > >is quite slow, adding something like 150-200ms to the boot process > >(every mill

Re: [Qemu-devel] Question about vNVDIMM file format

2016-05-18 Thread Richard W.M. Jones
I thought you might be interested in some performance results, "hot off the presses". With DAX enabled, I see the following messages in the guest kernel logs, which I assume means it is working: [0.469364] EXT4-fs (pmem0): DAX enabled. Warning: EXPERIMENTAL, use at your own risk [0.46993

Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-22 Thread Richard W.M. Jones
On Sat, May 21, 2016 at 11:53:12PM +0200, Wouter Verhelst wrote: > On Tue, May 17, 2016 at 10:50:01AM -0600, Eric Blake wrote: > > Option 2: An alternative solution would be to allow nbdkit to fail > > NBD_OPT_LIST with NBD_REP_ERR_UNSUP, at which point qemu client of 2.6 > > should just ignore the

Re: [Qemu-devel] [PATCH v8 3/3] Add optionrom compatible with fw_cfg DMA version

2016-05-23 Thread Richard W.M. Jones
On Mon, May 23, 2016 at 05:05:15PM +0200, Paolo Bonzini wrote: > > > On 11/05/2016 23:06, Richard W.M. Jones wrote: > > From: Marc Marí > > > > This optionrom is based on linuxboot.S. > > > > Signed-off-by: Marc Marí > > Signed-off-by: Richard W.

[Qemu-devel] [PATCH v9] Add optionrom compatible with fw_cfg DMA version

2016-05-23 Thread Richard W.M. Jones
v8 -> v9: - Add a workaround for GCC < 4.9. - Add linuxbios_dma.bin to Makefile. - Change Marc Mari's email address to new one. - Tested on RHEL 7.2 (gcc-4.8.5-4.el7.x86_64). Rich.

[Qemu-devel] [PATCH v9] Add optionrom compatible with fw_cfg DMA version

2016-05-23 Thread Richard W.M. Jones
From: Marc Marí This optionrom is based on linuxboot.S. Signed-off-by: Marc Marí Signed-off-by: Richard W.M. Jones --- .gitignore| 4 + Makefile | 2 +- configure | 20 +++ hw/i386/pc.c | 10

Re: [Qemu-devel] [PATCH v5 00/27] block: Lock images when opening

2016-05-24 Thread Richard W.M. Jones
On Tue, May 17, 2016 at 03:35:09PM +0800, Fam Zheng wrote: > v5: - Change "lock-image=on/off" to "lock-mode=exclusive/shared/off". > Default is "lock-mode=exclusive" to exclusively lock RW images and > shared > lock RO images; with lock-mode="shared", RW images are shared locked > too

Re: [Qemu-devel] [PATCH v5 00/27] block: Lock images when opening

2016-05-24 Thread Richard W.M. Jones
On Tue, May 24, 2016 at 02:46:15PM +0200, Kevin Wolf wrote: > Am 24.05.2016 um 13:48 hat Richard W.M. Jones geschrieben: > > On Tue, May 17, 2016 at 03:35:09PM +0800, Fam Zheng wrote: > > > v5: - Change "lock-image=on/off" to "lock-mode=exclusive/shared/off&qu

Re: [Qemu-devel] [PATCH v3] vl.c: Add '-L help' which lists data dirs.

2016-05-24 Thread Richard W.M. Jones
Any further objections to this one? It's a pretty useful patch for us. On Mon, May 16, 2016 at 05:34:35PM +0100, Richard W.M. Jones wrote: > QEMU compiles a list of data directories from various sources. When > consuming a QEMU binary it's useful to be able to get thi

Re: [Qemu-devel] [PATCH] vmdk: Fix overflow if l1_size is 0x20000000

2015-05-05 Thread Richard W.M. Jones
fl6.img': Could not open > '/tmp/afl6.img': Cannot allocate memory > > Values larger than 0x2000 will be refused by the validation in > vmdk_add_extent. > > Values smaller than 0x2000 will not overflow l1_size. > > Reported-by: Richard W.M. Jones

Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire

2015-05-08 Thread Richard W.M. Jones
On Fri, May 08, 2015 at 12:27:59PM +0200, Paolo Bonzini wrote: > And there are probably other NBD servers around. CCing Rich Jones so > that he can fix nbdkit. Thanks. FWIW currently nbdkit will send any arbitrary errno returned by a system call, and it doesn't do any platform-specific encoding.

Re: [Qemu-devel] [PATCH] wdt_i6300esb: register a reset function

2010-12-12 Thread Richard W.M. Jones
On Sat, Dec 11, 2010 at 06:39:03PM +, Blue Swirl wrote: > Thanks, applied. Wait! This patch is incomplete. I already posted a complete patch already some months ago (twice) but it was ignored both times: http://www.mail-archive.com/qemu-devel@nongnu.org/msg42716.html http://www.mail-archive

Re: [Qemu-devel] [PATCH] wdt_i6300esb: register a reset function

2010-12-12 Thread Richard W.M. Jones
On Sun, Dec 12, 2010 at 10:59:59AM +, Blue Swirl wrote: > On Sun, Dec 12, 2010 at 10:08 AM, Richard W.M. Jones > wrote: > > On Sat, Dec 11, 2010 at 06:39:03PM +, Blue Swirl wrote: > >> Thanks, applied. > > > > Wait!  This patch is incomplete. > >

[Qemu-devel] Re: [PATCH v3 2/7] wdt_ib700: Don't use SoftFloat int64 type

2010-12-18 Thread Richard W.M. Jones
On Sat, Dec 18, 2010 at 05:25:26PM +0100, Andreas Färber wrote: > softfloat.h's int64 type has least-width semantics, > but this doesn't seem intended here, so use plain int64_t. > > v3: > * Split off. > > Cc: Richard W.M. Jones > Signed-off-by: Andreas Färb

Re: [Qemu-devel] Re: [PATCH v3 2/7] wdt_ib700: Don't use SoftFloat int64 type

2010-12-19 Thread Richard W.M. Jones
On Sun, Dec 19, 2010 at 01:51:22PM +0100, Andreas Färber wrote: > Am 18.12.2010 um 17:47 schrieb Richard W.M. Jones: > > >On Sat, Dec 18, 2010 at 05:25:26PM +0100, Andreas Färber wrote: > >>softfloat.h's int64 type has least-width semantics, > >>but this doesn

[Qemu-devel] Re: [PATCH] qemu-kvm: Switch to upstream -enable-kvm semantics

2010-12-21 Thread Richard W.M. Jones
On Tue, Dec 21, 2010 at 04:41:03PM +0100, Markus Armbruster wrote: > Like this? > > upstream qemu | default |-enable-kvm > +---+--- > KVM available | disabled | enabled > KVM unavailable | disabled |fail > > qemu-kvm| default |-enable-kvm| -

<    1   2   3   4   5   6   7   8   9   10   >