qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Providing a mechanism to reopen() file based chardevs
@ 2014-12-05 21:35 Tony Breeds
  2014-12-05 22:09 ` Paolo Bonzini
  2014-12-08  9:48 ` Daniel P. Berrange
  0 siblings, 2 replies; 5+ messages in thread
From: Tony Breeds @ 2014-12-05 21:35 UTC (permalink / raw)
  To: qemu-devel

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

Hi All,
    Openstcak (Nova) has had an issue for a longish time where a running
instance (qemu via libvirt) which has a file based console can fill the disk of
the hypervisor causing all guests to stall.

I'm looking at ways to fix this.  Clearly it can be done in openstack wothout
changing qemu but it seems to be that a better idea would be to teach qemu to
reopen() these files when it recieves a sighup and/or something in the monitor.

I like the idea of sighup as it allows systems administrators to use logrotate
thereby avoiding baking policy into qemu.

My initial thoughts are that I'd need to add a flag to the chardev (perhaps
allowreopen?) and upon reciept of the reopen request I'd I iterate over the
open chardevs and reopen them if they have this flag set.

The main target of this would be a console log.

So my main question is would that be something that would be considered for
2.3.0?  If so any high level design points I shoudl consider?

 - Is the chardev flag a good/bad idea?
 - Is it okay to change the action taken by sighup?

Yours Tony.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [Qemu-devel] Providing a mechanism to reopen() file based chardevs
  2014-12-05 21:35 [Qemu-devel] Providing a mechanism to reopen() file based chardevs Tony Breeds
@ 2014-12-05 22:09 ` Paolo Bonzini
  2014-12-06  4:32   ` Tony Breeds
  2014-12-08  9:48 ` Daniel P. Berrange
  1 sibling, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2014-12-05 22:09 UTC (permalink / raw)
  To: qemu-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 05/12/2014 22:35, Tony Breeds wrote:
> Hi All, Openstcak (Nova) has had an issue for a longish time where
> a running instance (qemu via libvirt) which has a file based
> console can fill the disk of the hypervisor causing all guests to
> stall.
> 
> I'm looking at ways to fix this.  Clearly it can be done in
> openstack wothout changing qemu but it seems to be that a better
> idea would be to teach qemu to reopen() these files when it
> recieves a sighup and/or something in the monitor.
> 
> I like the idea of sighup as it allows systems administrators to
> use logrotate thereby avoiding baking policy into qemu.
> 
> My initial thoughts are that I'd need to add a flag to the chardev
> (perhaps allowreopen?) and upon reciept of the reopen request I'd I
> iterate over the open chardevs and reopen them if they have this
> flag set.
> 
> The main target of this would be a console log.
> 
> So my main question is would that be something that would be
> considered for 2.3.0?  If so any high level design points I shoudl
> consider?
> 
> - Is the chardev flag a good/bad idea? - Is it okay to change the
> action taken by sighup?

I think so.  Should it reopen stdout/stderr too?

If you want to make it optional, you can add a suboption to -msg.

Paolo

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

* Re: [Qemu-devel] Providing a mechanism to reopen() file based chardevs
  2014-12-05 22:09 ` Paolo Bonzini
@ 2014-12-06  4:32   ` Tony Breeds
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Breeds @ 2014-12-06  4:32 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

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

On Fri, Dec 05, 2014 at 11:09:02PM +0100, Paolo Bonzini wrote:

> I think so.  Should it reopen stdout/stderr too?

Thanks for the feedback I'm gald it's something that isn't a clearly terrible idea.

I don't think that's required for my use case, but it's not all about me.  If
that's something people generally feel is desired I'm happy to try and make it
work.
 
> If you want to make it optional, you can add a suboption to -msg.

I'll look at that, based on 5mins of looking I don't think that'll work, but
you know the code much better than me so clearly I wont dismiss it.

Yours Tony.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [Qemu-devel] Providing a mechanism to reopen() file based chardevs
  2014-12-05 21:35 [Qemu-devel] Providing a mechanism to reopen() file based chardevs Tony Breeds
  2014-12-05 22:09 ` Paolo Bonzini
@ 2014-12-08  9:48 ` Daniel P. Berrange
  2014-12-09  1:30   ` Tony Breeds
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel P. Berrange @ 2014-12-08  9:48 UTC (permalink / raw)
  To: qemu-devel

On Sat, Dec 06, 2014 at 08:35:19AM +1100, Tony Breeds wrote:
> Hi All,
>     Openstcak (Nova) has had an issue for a longish time where a running
> instance (qemu via libvirt) which has a file based console can fill the disk of
> the hypervisor causing all guests to stall.
> 
> I'm looking at ways to fix this.  Clearly it can be done in openstack wothout
> changing qemu but it seems to be that a better idea would be to teach qemu to
> reopen() these files when it recieves a sighup and/or something in the monitor.

My long term desired approach to deal with this problem in OpenStack (and
other libvirt based mgmt apps) is to have a separate log daemon in libvirt
eg a virtlogd daemon. Take QEMU out of the business of writing to files
entirely and instead it would always just be a given a pipe FD which is
connected to the daemon. This avoidis the need to give QEMU permission to
open files at all, which is inline with our general security strategy for
host resources QEMU accesses.

Regards,
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] 5+ messages in thread

* Re: [Qemu-devel] Providing a mechanism to reopen() file based chardevs
  2014-12-08  9:48 ` Daniel P. Berrange
@ 2014-12-09  1:30   ` Tony Breeds
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Breeds @ 2014-12-09  1:30 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel

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

On Mon, Dec 08, 2014 at 09:48:12AM +0000, Daniel P. Berrange wrote:
 
> My long term desired approach to deal with this problem in OpenStack (and
> other libvirt based mgmt apps) is to have a separate log daemon in libvirt
> eg a virtlogd daemon. Take QEMU out of the business of writing to files
> entirely and instead it would always just be a given a pipe FD which is
> connected to the daemon. This avoidis the need to give QEMU permission to
> open files at all, which is inline with our general security strategy for
> host resources QEMU accesses.

Hi Daniel,
    that sounds like a good plan and would certainly address the openstack case
but I still feel like hving something in qemu is a good idea as that doesn't stop
an alternate fix in libvirt and it helps users that aren't using libvirt and qemu
together.

Having said that I'm willing to be directed by the qemu community.  If they feel that
a libvirt only fix is best then that's where I'll spend my effort.
 
Yours Tony.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-12-09  1:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05 21:35 [Qemu-devel] Providing a mechanism to reopen() file based chardevs Tony Breeds
2014-12-05 22:09 ` Paolo Bonzini
2014-12-06  4:32   ` Tony Breeds
2014-12-08  9:48 ` Daniel P. Berrange
2014-12-09  1:30   ` Tony Breeds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).