Richard W.M. Jones
2018-Nov-06 10:09 UTC
Re: [Libguestfs] [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
On Mon, Nov 05, 2018 at 06:31:25PM +0100, Pino Toscano wrote:> +static void > +shutdown_clicked (GtkWidget *w, gpointer data) > +{ > + if (!is_iso_environment) > + return; > + > + sync (); > + sleep (2); > + ignore_value (system ("/sbin/shutdown")); > +} > +The shutdown button doesn't actually work[1]. I don't know why because /sbin/shutdown exists. Rich. [1] Using ‘make -C p2v run-virt-p2v-in-a-vm’ -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Richard W.M. Jones
2018-Nov-06 10:17 UTC
Re: [Libguestfs] [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
On Tue, Nov 06, 2018 at 10:09:19AM +0000, Richard W.M. Jones wrote:> On Mon, Nov 05, 2018 at 06:31:25PM +0100, Pino Toscano wrote: > > +static void > > +shutdown_clicked (GtkWidget *w, gpointer data) > > +{ > > + if (!is_iso_environment) > > + return; > > + > > + sync (); > > + sleep (2); > > + ignore_value (system ("/sbin/shutdown")); > > +} > > + > > The shutdown button doesn't actually work[1]. I don't > know why because /sbin/shutdown exists.Oh I see, it's because running just the shutdown command simply schedules a shutdown in future. You have to use ‘shutdown now’. BTW I don't believe it's necessary to use the full path (nor in the reboot command either). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard W.M. Jones
2018-Nov-06 11:37 UTC
Re: [Libguestfs] [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
On Tue, Nov 06, 2018 at 10:17:57AM +0000, Richard W.M. Jones wrote:> On Tue, Nov 06, 2018 at 10:09:19AM +0000, Richard W.M. Jones wrote: > > On Mon, Nov 05, 2018 at 06:31:25PM +0100, Pino Toscano wrote: > > > +static void > > > +shutdown_clicked (GtkWidget *w, gpointer data) > > > +{ > > > + if (!is_iso_environment) > > > + return; > > > + > > > + sync (); > > > + sleep (2); > > > + ignore_value (system ("/sbin/shutdown")); > > > +} > > > + > > > > The shutdown button doesn't actually work[1]. I don't > > know why because /sbin/shutdown exists. > > Oh I see, it's because running just the shutdown command simply > schedules a shutdown in future. You have to use ‘shutdown now’. BTW > I don't believe it's necessary to use the full path (nor in the reboot > command either).Actually the full path is there for RHEL 5 compatibility so it is required. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Possibly Parallel Threads
- [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
- [PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)
- Re: [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
- Re: [PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)
- Re: [PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)