* [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP
@ 2012-08-22 20:03 Daniel P. Berrange
2012-08-22 20:25 ` Anthony Liguori
2012-08-23 6:35 ` [Qemu-devel] unicore32 fails assertion without -kernel (was: How to reliably start a bare QEMU target to query capabilities via QMP) Markus Armbruster
0 siblings, 2 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2012-08-22 20:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori
I've been adapting libvirt to use to the various new QMP commands to
query QEMU's capabilities, instead of the hated -help parsing. Obviously
the critical part of this is being able to reliably start a bare QEMU
process with no actual guest OS configured (no disks, no kernel, etc)
and talk to its monitor. I hadn't anticipated problems since I only
tested with x86_64 / i386 most of the time, which work well in this
respect. Currently I am doing
# $QEMU_BINARY -S \
-no-user-config \
-nodefconfig \
-nodefaults \
-nographic \
-qmp stdio
This works for about 50% of the QEMU targets:
qemu-system-alpha
qemu-system-i386
qemu-system-lm32
qemu-system-ppc
qemu-system-ppc64
qemu-system-s390x
qemu-system-sparc
qemu-system-sparc64
qemu-system-x86_64
qemu-system-xtensa
qemu-system-xtensaeb
but fails for the other 50% of targets:
qemu-system-arm
qemu-system-cris
qemu-system-m68k
qemu-system-mips
qemu-system-mips64
qemu-system-mips64el
qemu-system-mipsel
qemu-system-or32
qemu-system-ppcemb
qemu-system-sh4
qemu-system-sh4eb
qemu-system-unicore32
With the failing targets i see the following kinds of errors:
$ qemu-system-arm -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Kernel image must be specified
$ qemu-system-cris -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Kernel image must be specified
$ qemu-system-m68k -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Kernel image must be specified
$ qemu-system-mips -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait qemu: Could not load MIPS bios 'mips_bios.bin', and no -kernel argument was specified
$ qemu-system-mipsel -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
qemu: Could not load MIPS bios 'mipsel_bios.bin', and no -kernel argument was specified
$ qemu-system-or32 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Can't create serial device, empty char device
$ qemu-system-ppcemb -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Unable to find PowerPC CPU definition
$ qemu-system-sh4 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Initializing CPU
Allocating ROM
Allocating SDRAM 1
Allocating SDRAM 2
shix_init: load BIOS 'shix_bios.bin'
ret=-1
qemu: could not load SHIX bios 'shix_bios.bin'
$ qemu-system-sh4eb -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
Initializing CPU
Allocating ROM
Allocating SDRAM 1
Allocating SDRAM 2
shix_init: load BIOS 'shix_bios.bin'
ret=-1
qemu: could not load SHIX bios 'shix_bios.bin'
$ qemu-system-unicore32 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
qemu-system-unicore32: /home/berrange/src/virt/qemu/hw/unicore32/../puv3.c:81: puv3_load_kernel: Assertion `kernel_filename != ((void *)0)' failed.
Aborted
Can we "fix" them in some way to not require the kernel ?
Do we have to go down the route of adding some sort of "-no-vm" flag to
explicitly say we don't care about any of the VM setup parts ? This would
be more like what my old patches did which mapped monitors commands
onto '-query-XXXXX' command line args, bypassing VM setup, but still
using normal QMP monitor interaction.
Any other suggestions on how to reliably get a QMP monitor to a target,
without any VM config. ?
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP
2012-08-22 20:03 [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP Daniel P. Berrange
@ 2012-08-22 20:25 ` Anthony Liguori
2012-08-23 8:56 ` Daniel P. Berrange
2012-08-23 6:35 ` [Qemu-devel] unicore32 fails assertion without -kernel (was: How to reliably start a bare QEMU target to query capabilities via QMP) Markus Armbruster
1 sibling, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2012-08-22 20:25 UTC (permalink / raw)
To: Daniel P. Berrange, qemu-devel; +Cc: Markus Armbruster
"Daniel P. Berrange" <berrange@redhat.com> writes:
> I've been adapting libvirt to use to the various new QMP commands to
> query QEMU's capabilities, instead of the hated -help parsing. Obviously
> the critical part of this is being able to reliably start a bare QEMU
> process with no actual guest OS configured (no disks, no kernel, etc)
> and talk to its monitor. I hadn't anticipated problems since I only
> tested with x86_64 / i386 most of the time, which work well in this
> respect. Currently I am doing
>
> # $QEMU_BINARY -S \
> -no-user-config \
> -nodefconfig \
> -nodefaults \
> -nographic \
> -qmp stdio
>
>
> This works for about 50% of the QEMU targets:
>
> qemu-system-alpha
> qemu-system-i386
> qemu-system-lm32
> qemu-system-ppc
> qemu-system-ppc64
> qemu-system-s390x
> qemu-system-sparc
> qemu-system-sparc64
> qemu-system-x86_64
> qemu-system-xtensa
> qemu-system-xtensaeb
>
> but fails for the other 50% of targets:
>
> qemu-system-arm
> qemu-system-cris
> qemu-system-m68k
> qemu-system-mips
> qemu-system-mips64
> qemu-system-mips64el
> qemu-system-mipsel
> qemu-system-or32
> qemu-system-ppcemb
> qemu-system-sh4
> qemu-system-sh4eb
> qemu-system-unicore32
>
>
> With the failing targets i see the following kinds of errors:
>
>
> $ qemu-system-arm -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Kernel image must be specified
>
> $ qemu-system-cris -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Kernel image must be specified
>
> $ qemu-system-m68k -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Kernel image must be specified
>
> $ qemu-system-mips -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait qemu: Could not load MIPS bios 'mips_bios.bin', and no -kernel argument was specified
>
> $ qemu-system-mipsel -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> qemu: Could not load MIPS bios 'mipsel_bios.bin', and no -kernel argument was specified
>
> $ qemu-system-or32 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Can't create serial device, empty char device
>
> $ qemu-system-ppcemb -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Unable to find PowerPC CPU definition
>
> $ qemu-system-sh4 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Initializing CPU
> Allocating ROM
> Allocating SDRAM 1
> Allocating SDRAM 2
> shix_init: load BIOS 'shix_bios.bin'
> ret=-1
> qemu: could not load SHIX bios 'shix_bios.bin'
>
> $ qemu-system-sh4eb -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Initializing CPU
> Allocating ROM
> Allocating SDRAM 1
> Allocating SDRAM 2
> shix_init: load BIOS 'shix_bios.bin'
> ret=-1
> qemu: could not load SHIX bios 'shix_bios.bin'
>
> $ qemu-system-unicore32 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> qemu-system-unicore32: /home/berrange/src/virt/qemu/hw/unicore32/../puv3.c:81: puv3_load_kernel: Assertion `kernel_filename != ((void *)0)' failed.
> Aborted
>
>
> Can we "fix" them in some way to not require the kernel ?
>
> Do we have to go down the route of adding some sort of "-no-vm" flag to
> explicitly say we don't care about any of the VM setup parts ? This would
> be more like what my old patches did which mapped monitors commands
> onto '-query-XXXXX' command line args, bypassing VM setup, but still
> using normal QMP monitor interaction.
>
> Any other suggestions on how to reliably get a QMP monitor to a target,
> without any VM config. ?
-M none. See the patch I just sent out. I think we can include this in
1.2 as it poses no real risk.
Regards,
Anthony Liguori
>
> Daniel
> --
> |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org -o- http://virt-manager.org :|
> |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] unicore32 fails assertion without -kernel (was: How to reliably start a bare QEMU target to query capabilities via QMP)
2012-08-22 20:03 [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP Daniel P. Berrange
2012-08-22 20:25 ` Anthony Liguori
@ 2012-08-23 6:35 ` Markus Armbruster
1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2012-08-23 6:35 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: Anthony Liguori, Guan Xuetao, qemu-devel
"Daniel P. Berrange" <berrange@redhat.com> writes:
> I've been adapting libvirt to use to the various new QMP commands to
> query QEMU's capabilities, instead of the hated -help parsing. Obviously
> the critical part of this is being able to reliably start a bare QEMU
> process with no actual guest OS configured (no disks, no kernel, etc)
> and talk to its monitor. I hadn't anticipated problems since I only
> tested with x86_64 / i386 most of the time, which work well in this
> respect. Currently I am doing
>
> # $QEMU_BINARY -S \
> -no-user-config \
> -nodefconfig \
> -nodefaults \
> -nographic \
> -qmp stdio
>
>
> This works for about 50% of the QEMU targets:
[...]
> but fails for the other 50% of targets:
[...]
> With the failing targets i see the following kinds of errors:
>
>
> $ qemu-system-arm -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> Kernel image must be specified
[...]
> $ qemu-system-unicore32 -S -nodefconfig -nodefaults -nographic -qmp unix:/tmp/foo,server,nowait
> qemu-system-unicore32: /home/berrange/src/virt/qemu/hw/unicore32/../puv3.c:81: puv3_load_kernel: Assertion `kernel_filename != ((void *)0)' failed.
> Aborted
Bug, cc'ing maintainer. It should fail cleanly, like the test case
above.
A similar bug was recently fixed for armv7m (commit 01fd41ab).
[...]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP
2012-08-22 20:25 ` Anthony Liguori
@ 2012-08-23 8:56 ` Daniel P. Berrange
0 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2012-08-23 8:56 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, Markus Armbruster
On Wed, Aug 22, 2012 at 03:25:38PM -0500, Anthony Liguori wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
>
> > I've been adapting libvirt to use to the various new QMP commands to
> > query QEMU's capabilities, instead of the hated -help parsing. Obviously
> > the critical part of this is being able to reliably start a bare QEMU
> > process with no actual guest OS configured (no disks, no kernel, etc)
> > and talk to its monitor. I hadn't anticipated problems since I only
> > tested with x86_64 / i386 most of the time, which work well in this
> > respect. Currently I am doing
> >
> > # $QEMU_BINARY -S \
> > -no-user-config \
> > -nodefconfig \
> > -nodefaults \
> > -nographic \
> > -qmp stdio
> >
> >
> > This works for about 50% of the QEMU targets:
> > Do we have to go down the route of adding some sort of "-no-vm" flag to
> > explicitly say we don't care about any of the VM setup parts ? This would
> > be more like what my old patches did which mapped monitors commands
> > onto '-query-XXXXX' command line args, bypassing VM setup, but still
> > using normal QMP monitor interaction.
> >
> > Any other suggestions on how to reliably get a QMP monitor to a target,
> > without any VM config. ?
>
> -M none. See the patch I just sent out. I think we can include this in
> 1.2 as it poses no real risk.
Great, that's an nice elegant solution to the problem :-)
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-23 8:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 20:03 [Qemu-devel] How to reliably start a bare QEMU target to query capabilities via QMP Daniel P. Berrange
2012-08-22 20:25 ` Anthony Liguori
2012-08-23 8:56 ` Daniel P. Berrange
2012-08-23 6:35 ` [Qemu-devel] unicore32 fails assertion without -kernel (was: How to reliably start a bare QEMU target to query capabilities via QMP) Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.