`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-size: 10pt; font-family: Helvetica,Arial,sans-serif'>
<p>This will not cleanly shutdown your vm's at system halt though.</p>
<p>But if you can live with that, that will work fine :)</p>
<p> </p>
<div> </div>
<p>On 2014-09-29 11:59, Filip Marvan wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored --><!-- meta ignored --><!-- node type 8 --><!-- node type 8 -->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Hello Jorge,<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">thank you for reply. I found another quite simply solution. When I set sevice properties in manifest like this:<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><property_group name='startd' type='framework'><!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> <propval name='duration' type='astring' value='contract' /><!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> <propval name='ignore_error' type='astring' value='core,signal' /><!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"></property_group><!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">it does exactly what I need. Qemu process is still monitored by SMF, but when process stoped (because of shutdown from guest), SMF will not restart process again, but service is switched to maintanance mode.<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">So now when I list KVM services, I can see, which are running (are online) and which are not (are maintanance). <!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">Filip<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"><!-- o ignored --> </span></p>
<div>
<div style="border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0cm 0cm 0cm;">
<p class="MsoNormal"><strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';">From:</span></strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';"> Jorge Schrauwen [mailto:sjorge+ml@blackdot.be] <br /><strong>Sent:</strong> Friday, September 26, 2014 11:35 PM<br /><strong>To:</strong> Filip Marvan<br /><strong>Cc:</strong> omnios-discuss@lists.omniti.com<br /><strong>Subject:</strong> Re: [OmniOS-discuss] Managing KVM virtual machines<!-- o ignored --></span></p>
</div>
</div>
<p class="MsoNormal"><!-- o ignored --> </p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">You can make qemu dump a monitoring socket, you can then use netcat to send commands like acpi shutdown events but also query other info. If the socket is dead, the qemu process crashed.<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">So applying some wrapper magic it could be possible to make the svc more intelligent. I can't offor you a working manifest though :( I theorized about it but deemed it too much work for the one vm I run. I do use the qemu monitoring socket however.<!-- o ignored --></span></p>
<div>
<p class="MsoNormal"><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';"> <!-- o ignored --></span></p>
</div>
<p style="margin-bottom: 12.0pt;"><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">-chardev socket,id=monitor,path=/vms/hosts/${VMNAME}/run/monitor.sock,server,nowait \<br />-monitor chardev:monitor \<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">To add the monitor<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">Hope this is somewhat helpful!<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">Regards<!-- o ignored --></span></p>
<p><span style="font-size: 10.0pt; font-family: 'Helvetica','sans-serif';">Jorge<span style="color: #1f497d;"><!-- o ignored --></span></span></p>
</div>
</blockquote>
</body></html>
`