Re: [libvirt] [PATCH 8/9] qemu: Update domain status to paused while suspend event is emitted

2012-03-11 Thread Osier Yang
On 03/11/2012 10:37 PM, Paolo Bonzini wrote: Il 05/03/2012 11:25, Osier Yang ha scritto: This introduces a new paused reason VIR_DOMAIN_PAUSED_SUSPEND, and new suspend event type VIR_DOMAIN_EVENT_SUSPENDED_SUSPEND. While a SUSPEND event occurs, the running domain status will be transferred to "

Re: [libvirt] [PATCH 4/9] qemu: Do not start with source for removable disks if tray is open

2012-03-11 Thread Osier Yang
On 03/11/2012 10:44 PM, Paolo Bonzini wrote: Il 05/03/2012 11:25, Osier Yang ha scritto: This is similiar with physical world, one will be surprised if the box starts with medium exists while the tray is open. New tests are added, tests disk-{cdrom,floppy}-tray are for the qemu supports "-devic

[libvirt] [PATCH RFC 8/8] add qemu cache mutex

2012-03-11 Thread Lee Schermerhorn
Add a mutex for access to the qemu emulator cache. Not clear that this is actually needed -- driver should be locked across calls [?]. The patch can be dropped if not needed. --- src/qemu/qemu_capabilities.c | 18 +- src/qemu/qemu_capabilities.h |2 ++ src/qemu/qemu_driver.c

[libvirt] Restart2: [PATCH RFC 0/8] qemu: Cache results of parsing qemu help output

2012-03-11 Thread Lee Schermerhorn
Restart of send failed at patch 8. Not sure that one is needed, but try, try again. FYI: failure is: smtplib.SMTPSenderRefused: (452, '4.3.1 Insufficient system storage', ... -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH RFC 7/8] use qemuCapsFreeCPUModels in qemuBuildCpuArgString

2012-03-11 Thread Lee Schermerhorn
Use qemuCapsFreeCPUModels() in qemuBuildCpuArgStr(). Because it's there. --- src/qemu/qemu_command.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) Index: libvirt-0.9.10/src/qemu/qemu_command.c === --- libvirt-0.9.10

[libvirt] [PATCH RFC 6/8] qemu: hook up qemuCapsProbeCPUModels

2012-03-11 Thread Lee Schermerhorn
Hook up qemuCapsProbeCPUModels capabilities api to the emulator cache framework: - qemuCapsProbeCPUModels() looks up emulator in cache and returns the version and flags. - wrap the part of the original qemuCapsProbeCPUModels() with qemuCapsCacheCPUModels() to run the specified binary a

[libvirt] Restart: [PATCH RFC 0/8] qemu: Cache results of parsing qemu help output

2012-03-11 Thread Lee Schermerhorn
Send of series failed at patch 6. Attempting to restart here rather than resend entire series. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH RFC 5/8] qemu: hook up qemuCapsProbeMachineTypes

2012-03-11 Thread Lee Schermerhorn
Hook up qemuCapsProbeMachineTypes capabilities api to the emulator cache framework: - qemuCapsProbeMachineTypes() looks up emulator in cache and returns the version and flags. - wrap the part of the original qemuCapsProbeMachineTypes() with qemuCapsCacheMachineTypes() to run the specif

[libvirt] [PATCH RFC 3/8] qemu: add qemu emulator cache framework

2012-03-11 Thread Lee Schermerhorn
Define a qemu emulator cache structure and function to lookup, create, refresh emulator cache objects. The cache "tags" are the paths to the emulator binaries. E.g., "/usr/bin/qemu" Subsequent patches will "hook up" the various extract/probe info functions to consult the cache. Notes/questions:

[libvirt] [PATCH RFC 4/8] qemu: hook up qemuCapsExtractVersionInfo

2012-03-11 Thread Lee Schermerhorn
Hook up qemuCapsExtractVersionInfo capabilities api to the emulator cache framework by splitting into two parts: - qemuCapsExtractVersionInfo() looks up emulator in cache and returns the cached version and flags. Cache look up may fill or refresh the cache. - wrap the part of the orig

[libvirt] [PATCH RFC 2/8] qemu: add VirBitmapDup

2012-03-11 Thread Lee Schermerhorn
Add function to duplicate a virBitmap for returning cached qemuCaps[Flags] from qemuCapsExtractVersionInfo TODO: could factor the size calculation into a macro or inline function as it's used by both Dup and Alloc. --- src/libvirt_private.syms |1 + src/util/bitmap.c| 24 +

[libvirt] [PATCH RFC 0/8] qemu: Cache results of parsing qemu help output

2012-03-11 Thread Lee Schermerhorn
Stracing libvirtd shows that the qemu driver is executing 2 different qemu binaries 3 times each to fetch the version, capabilities [supported devices], and cpu models each time VM state is queried. E.g., [lines wrapped]: 6471 17:15:26.561890 execve("/usr/bin/qemu", ["/usr/bin/qemu", "-c

[libvirt] [PATCH RFC 1/8] add virCapabilitiesDupMachines

2012-03-11 Thread Lee Schermerhorn
Add support to duplicate a virCapsGuestMachine object -- e.g., from cached emulator information. --- src/conf/capabilities.c | 34 ++ src/conf/capabilities.h |3 +++ src/libvirt_private.syms |1 + 3 files changed, 38 insertions(+) Index: libvirt-0.9.10

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sun, Mar 11, 2012 at 10:41:32AM -0500, Anthony Liguori wrote: > On 03/11/2012 10:12 AM, Gleb Natapov wrote: > >On Sun, Mar 11, 2012 at 09:16:49AM -0500, Anthony Liguori wrote: > >>>If libvirt assumes anything about what kvm actually supports it is > >>>working only by sheer luck. > >> > >>Well t

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sun, Mar 11, 2012 at 10:33:15AM -0500, Anthony Liguori wrote: > On 03/11/2012 09:56 AM, Gleb Natapov wrote: > >On Sun, Mar 11, 2012 at 09:12:58AM -0500, Anthony Liguori wrote: > >>-cpu best wouldn't solve this. You need a read/write configuration > >>file where QEMU probes the available CPU and

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Anthony Liguori
On 03/11/2012 10:12 AM, Gleb Natapov wrote: On Sun, Mar 11, 2012 at 09:16:49AM -0500, Anthony Liguori wrote: If libvirt assumes anything about what kvm actually supports it is working only by sheer luck. Well the simple answer for libvirt is don't use -nodefconfig and then it can reuse the CPU

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Anthony Liguori
On 03/11/2012 09:56 AM, Gleb Natapov wrote: On Sun, Mar 11, 2012 at 09:12:58AM -0500, Anthony Liguori wrote: -cpu best wouldn't solve this. You need a read/write configuration file where QEMU probes the available CPU and records it to be used for the lifetime of the VM. That what I thought too

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sun, Mar 11, 2012 at 09:16:49AM -0500, Anthony Liguori wrote: > >If libvirt assumes anything about what kvm actually supports it is > >working only by sheer luck. > > Well the simple answer for libvirt is don't use -nodefconfig and > then it can reuse the CPU definitions (including any that the

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sun, Mar 11, 2012 at 09:12:58AM -0500, Anthony Liguori wrote: > On 03/11/2012 08:27 AM, Gleb Natapov wrote: > >On Sat, Mar 10, 2012 at 12:24:47PM -0600, Anthony Liguori wrote: > >>Let's step back here. > >> > >>Why are you writing these patches? It's probably not because you > >>have a desire t

Re: [libvirt] [PATCH 4/9] qemu: Do not start with source for removable disks if tray is open

2012-03-11 Thread Paolo Bonzini
Il 05/03/2012 11:25, Osier Yang ha scritto: > This is similiar with physical world, one will be surprised if the > box starts with medium exists while the tray is open. > > New tests are added, tests disk-{cdrom,floppy}-tray are for the qemu > supports "-device" flag, and disk-{cdrom,floppy}-no-de

Re: [libvirt] [PATCH 8/9] qemu: Update domain status to paused while suspend event is emitted

2012-03-11 Thread Paolo Bonzini
Il 05/03/2012 11:25, Osier Yang ha scritto: > This introduces a new paused reason VIR_DOMAIN_PAUSED_SUSPEND, > and new suspend event type VIR_DOMAIN_EVENT_SUSPENDED_SUSPEND. > > While a SUSPEND event occurs, the running domain status will be > transferred to "paused" with reason "VIR_DOMAIN_PAUSED

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Anthony Liguori
On 03/11/2012 07:41 AM, Gleb Natapov wrote: On Sat, Mar 10, 2012 at 12:58:43PM -0300, Eduardo Habkost wrote: On Sat, Mar 10, 2012 at 12:42:46PM +, Daniel P. Berrange wrote: I could have sworn we had this discussion a year ago or so, and had decided that the default CPU models would be in s

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Anthony Liguori
On 03/11/2012 08:27 AM, Gleb Natapov wrote: On Sat, Mar 10, 2012 at 12:24:47PM -0600, Anthony Liguori wrote: Let's step back here. Why are you writing these patches? It's probably not because you have a desire to say -cpu Westmere when you run QEMU on your laptop. I'd wager to say that no huma

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sat, Mar 10, 2012 at 12:24:47PM -0600, Anthony Liguori wrote: > Let's step back here. > > Why are you writing these patches? It's probably not because you > have a desire to say -cpu Westmere when you run QEMU on your laptop. > I'd wager to say that no human has ever done that or that if they

Re: [libvirt] [Qemu-devel] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Sat, Mar 10, 2012 at 12:58:43PM -0300, Eduardo Habkost wrote: > On Sat, Mar 10, 2012 at 12:42:46PM +, Daniel P. Berrange wrote: > > > > > > I could have sworn we had this discussion a year ago or so, and had > > > decided > > > that the default CPU models would be in something like > > >

Re: [libvirt] Modern CPU models cannot be used with libvirt

2012-03-11 Thread Gleb Natapov
On Fri, Mar 09, 2012 at 03:15:26PM -0600, Anthony Liguori wrote: > On 03/09/2012 03:04 PM, Daniel P. Berrange wrote: > >On Fri, Mar 09, 2012 at 05:56:52PM -0300, Eduardo Habkost wrote: > >>Resurrecting an old thread: > >> > >>I didn't see any clear conclusion in this thread (this is why I am > >>re