Message ID | 1334746806-28733-1-git-send-email-alevy@redhat.com |
---|---|
State | New |
Headers | show |
On 04/18/12 13:00, Alon Levy wrote:
> initiate the implicit destroy ourselves.
What is the use case?
Allowing guests to do that without giving them a way to figure whenever
it will work or not doesn't look that useful to me.
cheers,
Gerd
On Tue, Apr 24, 2012 at 12:17:15PM +0200, Gerd Hoffmann wrote: > On 04/18/12 13:00, Alon Levy wrote: > > initiate the implicit destroy ourselves. > > What is the use case? Don't let guest crash the machine with bad driver. i.e. during testing I did this inadvertently. > > Allowing guests to do that without giving them a way to figure whenever > it will work or not doesn't look that useful to me. OK - so maybe just have this as a guest_bug instead of an assert? > > cheers, > Gerd >
>> Allowing guests to do that without giving them a way to figure whenever >> it will work or not doesn't look that useful to me. > > OK - so maybe just have this as a guest_bug instead of an assert? Yes, please. thanks, Gerd
diff --git a/hw/qxl.c b/hw/qxl.c index 6776a7f..1ab3348 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1163,7 +1163,15 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm, QXLDevSurfaceCreate surface; QXLSurfaceCreate *sc = &qxl->guest_primary.surface; - assert(qxl->mode != QXL_MODE_NATIVE); + if (qxl->mode == QXL_MODE_NATIVE) { + /* + * allow a create without a destroy. This could be used + * later for an atomic "change primary" but right now just + * destroy the primary for the guest. Note that this uses + * the ability to have multiple concurrent async commands. + */ + qxl_destroy_primary(qxl, async); + } qxl_exit_vga_mode(qxl); surface.format = le32_to_cpu(sc->format);
initiate the implicit destroy ourselves. Signed-off-by: Alon Levy <alevy@redhat.com> --- hw/qxl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)