All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen
@ 2015-01-22 17:21 Sander Eikelenboom
  2015-01-22 17:21 ` [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it Sander Eikelenboom
  2015-01-23  9:06 ` [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Fabio Fantoni
  0 siblings, 2 replies; 8+ messages in thread
From: Sander Eikelenboom @ 2015-01-22 17:21 UTC (permalink / raw)
  To: Fabio Fantoni, Ian Jackson, Ian Campbell, Stefano Stabellini
  Cc: Anthony PERARD, Sander Eikelenboom, xen-devel

Commit 2e5738ff "libxl: Add none to vga parameter" introduced the "none"
option for the Xen "vga=" config option but only appends the needed parameter
for the qemu-traditional case. This patch fixes the qemu-xen case by
appending the same "-vga none" qemu paramter.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
---
 tools/libxl/libxl_dm.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c2b0487..fc3f5a7 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -589,6 +589,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                 libxl__sizekb_to_mb(b_info->video_memkb)));
             break;
         case LIBXL_VGA_INTERFACE_TYPE_NONE:
+            flexarray_append_pair(dm_args, "-vga", "none");
             break;
         }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
  2015-01-22 17:21 [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Sander Eikelenboom
@ 2015-01-22 17:21 ` Sander Eikelenboom
  2015-01-26 12:12   ` Stefano Stabellini
  2015-01-23  9:06 ` [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Fabio Fantoni
  1 sibling, 1 reply; 8+ messages in thread
From: Sander Eikelenboom @ 2015-01-22 17:21 UTC (permalink / raw)
  To: Ian Jackson, Ian Campbell, Stefano Stabellini
  Cc: Sander Eikelenboom, xen-devel

While this fixes the race and error on shutdown of a HVM guest with pci-passthrough,
i don't know if this could give problems in other areas (migration ?),
hence posted as RFC.

--
Sander

8< -----------
At present on shutdown when using pci-passthrough with qemu-xen, qemu closes the QMP
socket before libxl is done with it causing these errors to be logged by libxl:

    Waiting for domain test (domid 1) to die [pid 11568]
    Domain 1 has shut down, reason code 0 0x0
    Action for shutdown reason code 0 is destroy
    Domain 1 needs to be cleaned up: destroying the domain
    libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
    libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
    libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
    libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
    Done. Exiting now

Prevent this by using the qemu '-no-shutdown' parameter which is described as doing:
    "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
     This allows for instance switching to monitor to commit changes to the disk image."

So Qemu will stop emulating, but keeps the QMP socket open and waits for libxl to
kill the qemu process when it is done, preventing the race and resulting in this
to be logged by libxl:

    Waiting for domain test (domid 1) to die [pid 10859]
    Domain 1 has shut down, reason code 0 0x0
    Action for shutdown reason code 0 is destroy
    Domain 1 needs to be cleaned up: destroying the domain
    Done. Exiting now

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
---
 tools/libxl/libxl_dm.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index fc3f5a7..3152c87 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -435,6 +435,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                     "path=%s/qmp-libxl-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
+    flexarray_append(dm_args, "-no-shutdown");
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen
  2015-01-22 17:21 [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Sander Eikelenboom
  2015-01-22 17:21 ` [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it Sander Eikelenboom
@ 2015-01-23  9:06 ` Fabio Fantoni
  2015-01-23 11:23   ` Sander Eikelenboom
  1 sibling, 1 reply; 8+ messages in thread
From: Fabio Fantoni @ 2015-01-23  9:06 UTC (permalink / raw)
  To: Sander Eikelenboom, Ian Jackson, Ian Campbell, Stefano Stabellini
  Cc: Anthony PERARD, xen-devel

Il 22/01/2015 18:21, Sander Eikelenboom ha scritto:
> Commit 2e5738ff "libxl: Add none to vga parameter" introduced the "none"
> option for the Xen "vga=" config option but only appends the needed parameter
> for the qemu-traditional case. This patch fixes the qemu-xen case by
> appending the same "-vga none" qemu paramter.

In upstream qemu -nodefaults is used, -vga none is old and deprecated 
way and not needed with -nodefaults used:
http://git.qemu.org/?p=qemu.git;a=blob;f=docs/qdev-device-use.txt;hb=HEAD
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl_dm.c;hb=HEAD 
(search -nodefaults)
What exactly is your problem?
Could you better detail?

Thanks for any reply.

>
> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
> ---
>   tools/libxl/libxl_dm.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index c2b0487..fc3f5a7 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -589,6 +589,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                   libxl__sizekb_to_mb(b_info->video_memkb)));
>               break;
>           case LIBXL_VGA_INTERFACE_TYPE_NONE:
> +            flexarray_append_pair(dm_args, "-vga", "none");
>               break;
>           }
>   

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen
  2015-01-23  9:06 ` [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Fabio Fantoni
@ 2015-01-23 11:23   ` Sander Eikelenboom
  0 siblings, 0 replies; 8+ messages in thread
From: Sander Eikelenboom @ 2015-01-23 11:23 UTC (permalink / raw)
  To: Fabio Fantoni
  Cc: Anthony PERARD, xen-devel, Ian Jackson, Ian Campbell, Stefano Stabellini


Friday, January 23, 2015, 10:06:04 AM, you wrote:

> Il 22/01/2015 18:21, Sander Eikelenboom ha scritto:
>> Commit 2e5738ff "libxl: Add none to vga parameter" introduced the "none"
>> option for the Xen "vga=" config option but only appends the needed parameter
>> for the qemu-traditional case. This patch fixes the qemu-xen case by
>> appending the same "-vga none" qemu paramter.

> In upstream qemu -nodefaults is used, -vga none is old and deprecated 
> way and not needed with -nodefaults used:
> http://git.qemu.org/?p=qemu.git;a=blob;f=docs/qdev-device-use.txt;hb=HEAD
> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl_dm.c;hb=HEAD 
> (search -nodefaults)
> What exactly is your problem?
> Could you better detail?

> Thanks for any reply.

Ah you are right .. hmm it seems even this patch isn't helping ..

with vnc=0 && sdl=0 && vga=none i still end up with:
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
00:03.0 VGA compatible controller: Cirrus Logic GD 5446

A Cirrus logic controller ..

My assumption that sdl=0 disables sdl seems to be wrong .. i also needed the 
"nographic" option.

It seems you just have to be very persuasive to get rid of it :-)

So without this patch and with sdl=0 && vnc=0 && vga=none && nographic=1 .. 
i finely did get rid of the cirrus logic controller.



I'm not entirely sure the "-nodefaults" actually works .. since xen uses it's 
own machine type "xenfv" by default .. and the referenced doc says:

    292 The new way is -device.  The mapping from -vga argument to -device
    293 depends on the machine type.  For machine "pc", it's:
    <snip>
    315 Bug: the new way doesn't work for machine types "pc" and "isapc",
    316 because it violates obscure device initialization ordering
    317 constraints.

And further on the document says:

   395 === Default Devices ===
   396
   397 QEMU creates a number of devices by default, depending on the machine
   398 type.
   399
   400 -device DEVNAME... and global DEVNAME... suppress default devices for
   401 some DEVNAMEs:
   402
   403     default device      suppressing DEVNAMEs
   404     CD-ROM              ide-cd, ide-drive, scsi-cd
   405     isa-fdc's driveA    isa-fdc
   406     parallel            isa-parallel
   407     serial              isa-serial
   408     VGA                 VGA, cirrus-vga, vmware-svga
   409     virtioconsole       virtio-serial-pci, virtio-serial-s390, virtio-serial
   410
   411 The default NIC is connected to a default part created along with it.
   412 It is *not* suppressed by configuring a NIC with -device (you may call
   413 that a bug).  -net and -netdev suppress the default NIC.
   414
   415 -nodefaults suppresses all the default devices mentioned above, plus a
   416 few other things such as default SD-Card drive and default monitor.

It doesn't say any thing explicitly about sdl though, so it's either:

- the no-defaults also works for machine="xenfv", but qemu still defaults to sdl .. and therefore still enables the cirrus logic
  controller (or the referenced document is wrong)
or
- the no-defaults doesn't seem to work for machine="xenfv"

Will see if i can figure out which of the two it is ..

--
Sander







>>
>> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
>> ---
>>   tools/libxl/libxl_dm.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index c2b0487..fc3f5a7 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -589,6 +589,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>                   libxl__sizekb_to_mb(b_info->video_memkb)));
>>               break;
>>           case LIBXL_VGA_INTERFACE_TYPE_NONE:
>> +            flexarray_append_pair(dm_args, "-vga", "none");
>>               break;
>>           }
>>   

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
  2015-01-22 17:21 ` [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it Sander Eikelenboom
@ 2015-01-26 12:12   ` Stefano Stabellini
  2015-01-27 13:21     ` Sander Eikelenboom
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Stabellini @ 2015-01-26 12:12 UTC (permalink / raw)
  To: Sander Eikelenboom
  Cc: xen-devel, Ian Jackson, Ian Campbell, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 2708 bytes --]

On Thu, 22 Jan 2015, Sander Eikelenboom wrote:
> While this fixes the race and error on shutdown of a HVM guest with pci-passthrough,
> i don't know if this could give problems in other areas (migration ?),
> hence posted as RFC.

I think the patch should be OK. Maybe you could test it with local
migration (migrating a guest to localhost) and tell us if everything is
OK?

If so, I think it should be committed.


> --
> Sander
> 
> 8< -----------
> At present on shutdown when using pci-passthrough with qemu-xen, qemu closes the QMP
> socket before libxl is done with it causing these errors to be logged by libxl:
> 
>     Waiting for domain test (domid 1) to die [pid 11568]
>     Domain 1 has shut down, reason code 0 0x0
>     Action for shutdown reason code 0 is destroy
>     Domain 1 needs to be cleaned up: destroying the domain
>     libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
>     libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
>     libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
>     libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
>     Done. Exiting now
> 
> Prevent this by using the qemu '-no-shutdown' parameter which is described as doing:
>     "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
>      This allows for instance switching to monitor to commit changes to the disk image."
> 
> So Qemu will stop emulating, but keeps the QMP socket open and waits for libxl to
> kill the qemu process when it is done, preventing the race and resulting in this
> to be logged by libxl:
> 
>     Waiting for domain test (domid 1) to die [pid 10859]
>     Domain 1 has shut down, reason code 0 0x0
>     Action for shutdown reason code 0 is destroy
>     Domain 1 needs to be cleaned up: destroying the domain
>     Done. Exiting now
> 
> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
> ---
>  tools/libxl/libxl_dm.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index fc3f5a7..3152c87 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -435,6 +435,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>                                      "path=%s/qmp-libxl-%d,server,nowait",
>                                      libxl__run_dir_path(), guest_domid));
>  
> +    flexarray_append(dm_args, "-no-shutdown");
>      flexarray_append(dm_args, "-mon");
>      flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>  
> -- 
> 1.7.10.4
> 

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
  2015-01-26 12:12   ` Stefano Stabellini
@ 2015-01-27 13:21     ` Sander Eikelenboom
  2015-01-27 13:41       ` Stefano Stabellini
  0 siblings, 1 reply; 8+ messages in thread
From: Sander Eikelenboom @ 2015-01-27 13:21 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, Ian Jackson, Ian Campbell


Monday, January 26, 2015, 1:12:16 PM, you wrote:

> On Thu, 22 Jan 2015, Sander Eikelenboom wrote:
>> While this fixes the race and error on shutdown of a HVM guest with pci-passthrough,
>> i don't know if this could give problems in other areas (migration ?),
>> hence posted as RFC.

> I think the patch should be OK. Maybe you could test it with local
> migration (migrating a guest to localhost) and tell us if everything is
> OK?

Hi stefano,

I'm not too experienced with migration, but a simple:
"xl -v migrate domid localhost" still seems to work with this patch.

--
Sander

> If so, I think it should be committed.


>> --
>> Sander
>> 
>> 8< -----------
>> At present on shutdown when using pci-passthrough with qemu-xen, qemu closes the QMP
>> socket before libxl is done with it causing these errors to be logged by libxl:
>> 
>>     Waiting for domain test (domid 1) to die [pid 11568]
>>     Domain 1 has shut down, reason code 0 0x0
>>     Action for shutdown reason code 0 is destroy
>>     Domain 1 needs to be cleaned up: destroying the domain
>>     libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
>>     libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
>>     libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
>>     libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
>>     Done. Exiting now
>> 
>> Prevent this by using the qemu '-no-shutdown' parameter which is described as doing:
>>     "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
>>      This allows for instance switching to monitor to commit changes to the disk image."
>> 
>> So Qemu will stop emulating, but keeps the QMP socket open and waits for libxl to
>> kill the qemu process when it is done, preventing the race and resulting in this
>> to be logged by libxl:
>> 
>>     Waiting for domain test (domid 1) to die [pid 10859]
>>     Domain 1 has shut down, reason code 0 0x0
>>     Action for shutdown reason code 0 is destroy
>>     Domain 1 needs to be cleaned up: destroying the domain
>>     Done. Exiting now
>> 
>> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
>> ---
>>  tools/libxl/libxl_dm.c |    1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>> index fc3f5a7..3152c87 100644
>> --- a/tools/libxl/libxl_dm.c
>> +++ b/tools/libxl/libxl_dm.c
>> @@ -435,6 +435,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
>>                                      "path=%s/qmp-libxl-%d,server,nowait",
>>                                      libxl__run_dir_path(), guest_domid));
>>  
>> +    flexarray_append(dm_args, "-no-shutdown");
>>      flexarray_append(dm_args, "-mon");
>>      flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>>  
>> -- 
>> 1.7.10.4
>> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
  2015-01-27 13:21     ` Sander Eikelenboom
@ 2015-01-27 13:41       ` Stefano Stabellini
  2015-01-27 17:21         ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Stabellini @ 2015-01-27 13:41 UTC (permalink / raw)
  To: Sander Eikelenboom
  Cc: xen-devel, Ian Jackson, Ian Campbell, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 3286 bytes --]

On Tue, 27 Jan 2015, Sander Eikelenboom wrote:
> Monday, January 26, 2015, 1:12:16 PM, you wrote:
> 
> > On Thu, 22 Jan 2015, Sander Eikelenboom wrote:
> >> While this fixes the race and error on shutdown of a HVM guest with pci-passthrough,
> >> i don't know if this could give problems in other areas (migration ?),
> >> hence posted as RFC.
> 
> > I think the patch should be OK. Maybe you could test it with local
> > migration (migrating a guest to localhost) and tell us if everything is
> > OK?
> 
> Hi stefano,
> 
> I'm not too experienced with migration, but a simple:
> "xl -v migrate domid localhost" still seems to work with this patch.

Yep, that's the one.

In that case:

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


> --
> Sander
> 
> > If so, I think it should be committed.
> 
> 
> >> --
> >> Sander
> >> 
> >> 8< -----------
> >> At present on shutdown when using pci-passthrough with qemu-xen, qemu closes the QMP
> >> socket before libxl is done with it causing these errors to be logged by libxl:
> >> 
> >>     Waiting for domain test (domid 1) to die [pid 11568]
> >>     Domain 1 has shut down, reason code 0 0x0
> >>     Action for shutdown reason code 0 is destroy
> >>     Domain 1 needs to be cleaned up: destroying the domain
> >>     libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
> >>     libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
> >>     libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
> >>     libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
> >>     Done. Exiting now
> >> 
> >> Prevent this by using the qemu '-no-shutdown' parameter which is described as doing:
> >>     "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
> >>      This allows for instance switching to monitor to commit changes to the disk image."
> >> 
> >> So Qemu will stop emulating, but keeps the QMP socket open and waits for libxl to
> >> kill the qemu process when it is done, preventing the race and resulting in this
> >> to be logged by libxl:
> >> 
> >>     Waiting for domain test (domid 1) to die [pid 10859]
> >>     Domain 1 has shut down, reason code 0 0x0
> >>     Action for shutdown reason code 0 is destroy
> >>     Domain 1 needs to be cleaned up: destroying the domain
> >>     Done. Exiting now
> >> 
> >> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
> >> ---
> >>  tools/libxl/libxl_dm.c |    1 +
> >>  1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> >> index fc3f5a7..3152c87 100644
> >> --- a/tools/libxl/libxl_dm.c
> >> +++ b/tools/libxl/libxl_dm.c
> >> @@ -435,6 +435,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> >>                                      "path=%s/qmp-libxl-%d,server,nowait",
> >>                                      libxl__run_dir_path(), guest_domid));
> >>  
> >> +    flexarray_append(dm_args, "-no-shutdown");
> >>      flexarray_append(dm_args, "-mon");
> >>      flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
> >>  
> >> -- 
> >> 1.7.10.4
> >> 
> 

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it.
  2015-01-27 13:41       ` Stefano Stabellini
@ 2015-01-27 17:21         ` Ian Campbell
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-27 17:21 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: Sander Eikelenboom, Ian Jackson, xen-devel

On Tue, 2015-01-27 at 13:41 +0000, Stefano Stabellini wrote:
> On Tue, 27 Jan 2015, Sander Eikelenboom wrote:
> > Monday, January 26, 2015, 1:12:16 PM, you wrote:
> > 
> > > On Thu, 22 Jan 2015, Sander Eikelenboom wrote:
> > >> While this fixes the race and error on shutdown of a HVM guest with pci-passthrough,
> > >> i don't know if this could give problems in other areas (migration ?),
> > >> hence posted as RFC.
> > 
> > > I think the patch should be OK. Maybe you could test it with local
> > > migration (migrating a guest to localhost) and tell us if everything is
> > > OK?
> > 
> > Hi stefano,
> > 
> > I'm not too experienced with migration, but a simple:
> > "xl -v migrate domid localhost" still seems to work with this patch.
> 
> Yep, that's the one.
> 
> In that case:
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Applied.

Sander please wrap your commit logs (the bits which aren't log
quotations at least) to <80 (ideally <75) in the future.

> 
> > --
> > Sander
> > 
> > > If so, I think it should be committed.
> > 
> > 
> > >> --
> > >> Sander
> > >> 
> > >> 8< -----------
> > >> At present on shutdown when using pci-passthrough with qemu-xen, qemu closes the QMP
> > >> socket before libxl is done with it causing these errors to be logged by libxl:
> > >> 
> > >>     Waiting for domain test (domid 1) to die [pid 11568]
> > >>     Domain 1 has shut down, reason code 0 0x0
> > >>     Action for shutdown reason code 0 is destroy
> > >>     Domain 1 needs to be cleaned up: destroying the domain
> > >>     libxl: error: libxl_qmp.c:443:qmp_next: Socket read error: Connection reset by peer
> > >>     libxl: error: libxl_qmp.c:701:libxl__qmp_initialize: Failed to connect to QMP
> > >>     libxl: error: libxl_qmp.c:686:libxl__qmp_initialize: Connection error: Connection refused
> > >>     libxl: error: libxl_dm.c:1588:kill_device_model: Device Model already exited
> > >>     Done. Exiting now
> > >> 
> > >> Prevent this by using the qemu '-no-shutdown' parameter which is described as doing:
> > >>     "Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
> > >>      This allows for instance switching to monitor to commit changes to the disk image."
> > >> 
> > >> So Qemu will stop emulating, but keeps the QMP socket open and waits for libxl to
> > >> kill the qemu process when it is done, preventing the race and resulting in this
> > >> to be logged by libxl:
> > >> 
> > >>     Waiting for domain test (domid 1) to die [pid 10859]
> > >>     Domain 1 has shut down, reason code 0 0x0
> > >>     Action for shutdown reason code 0 is destroy
> > >>     Domain 1 needs to be cleaned up: destroying the domain
> > >>     Done. Exiting now
> > >> 
> > >> Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
> > >> ---
> > >>  tools/libxl/libxl_dm.c |    1 +
> > >>  1 file changed, 1 insertion(+)
> > >> 
> > >> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > >> index fc3f5a7..3152c87 100644
> > >> --- a/tools/libxl/libxl_dm.c
> > >> +++ b/tools/libxl/libxl_dm.c
> > >> @@ -435,6 +435,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> > >>                                      "path=%s/qmp-libxl-%d,server,nowait",
> > >>                                      libxl__run_dir_path(), guest_domid));
> > >>  
> > >> +    flexarray_append(dm_args, "-no-shutdown");
> > >>      flexarray_append(dm_args, "-mon");
> > >>      flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
> > >>  
> > >> -- 
> > >> 1.7.10.4
> > >> 
> > 



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-27 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 17:21 [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Sander Eikelenboom
2015-01-22 17:21 ` [RFC / PATCH] libxl: Prevent qemu closing QMP socket on shutdown before libxl is done with it Sander Eikelenboom
2015-01-26 12:12   ` Stefano Stabellini
2015-01-27 13:21     ` Sander Eikelenboom
2015-01-27 13:41       ` Stefano Stabellini
2015-01-27 17:21         ` Ian Campbell
2015-01-23  9:06 ` [PATCH] libxl: Actually append the "-vga none" parameter to qemu when using qemu-xen Fabio Fantoni
2015-01-23 11:23   ` Sander Eikelenboom

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.