Richard W.M. Jones
2016-Aug-23 16:23 UTC
Re: [Libguestfs] [PATCH 1/2] v2v:windows: factor out getting CurrentControlSet
On Wed, Aug 17, 2016 at 08:59:43PM +0300, Roman Kagan wrote:> It will be used in new code in a followup patch. > > Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> > --- > v2v/convert_windows.ml | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml > index 55bb3ef..751a6ab 100644 > --- a/v2v/convert_windows.ml > +++ b/v2v/convert_windows.ml > @@ -210,6 +210,13 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > (*----------------------------------------------------------------------*) > (* Perform the conversion of the Windows guest. *) > > + (* Find the 'Current' ControlSet. *) > + let get_current_cs root > + let select = g#hivex_node_get_child root "Select" in > + let valueh = g#hivex_node_get_value select "Current" in > + let value = int_of_le32 (g#hivex_value_value valueh) in > + sprintf "ControlSet%03Ld" value in > + > let rec configure_firstboot () > (match installer with > | None -> () > @@ -302,14 +309,8 @@ if errorlevel 3010 exit /b 0 > (* Update the SYSTEM hive. When this function is called the hive has > * already been opened as a hivex handle inside guestfs. > *) > - (* Find the 'Current' ControlSet. *) > - let current_cs > - let select = g#hivex_node_get_child root "Select" in > - let valueh = g#hivex_node_get_value select "Current" in > - let value = int_of_le32 (g#hivex_value_value valueh) in > - sprintf "ControlSet%03Ld" value in > - > - debug "current ControlSet is %s" current_cs; > + let current_cs = get_current_cs root in > + if verbose () then printf "current ControlSet is %s\n%!" current_cs;This changes (regresses) debug -> printf. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard W.M. Jones
2016-Aug-23 16:32 UTC
Re: [Libguestfs] [PATCH 1/2] v2v:windows: factor out getting CurrentControlSet
On Tue, Aug 23, 2016 at 05:23:58PM +0100, Richard W.M. Jones wrote:> On Wed, Aug 17, 2016 at 08:59:43PM +0300, Roman Kagan wrote: > > It will be used in new code in a followup patch. > > > > Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> > > --- > > v2v/convert_windows.ml | 17 +++++++++-------- > > 1 file changed, 9 insertions(+), 8 deletions(-) > > > > diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml > > index 55bb3ef..751a6ab 100644 > > --- a/v2v/convert_windows.ml > > +++ b/v2v/convert_windows.ml > > @@ -210,6 +210,13 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > > (*----------------------------------------------------------------------*) > > (* Perform the conversion of the Windows guest. *) > > > > + (* Find the 'Current' ControlSet. *) > > + let get_current_cs root > > + let select = g#hivex_node_get_child root "Select" in > > + let valueh = g#hivex_node_get_value select "Current" in > > + let value = int_of_le32 (g#hivex_value_value valueh) in > > + sprintf "ControlSet%03Ld" value in > > + > > let rec configure_firstboot () > > (match installer with > > | None -> () > > @@ -302,14 +309,8 @@ if errorlevel 3010 exit /b 0 > > (* Update the SYSTEM hive. When this function is called the hive has > > * already been opened as a hivex handle inside guestfs. > > *) > > - (* Find the 'Current' ControlSet. *) > > - let current_cs > > - let select = g#hivex_node_get_child root "Select" in > > - let valueh = g#hivex_node_get_value select "Current" in > > - let value = int_of_le32 (g#hivex_value_value valueh) in > > - sprintf "ControlSet%03Ld" value in > > - > > - debug "current ControlSet is %s" current_cs; > > + let current_cs = get_current_cs root in > > + if verbose () then printf "current ControlSet is %s\n%!" current_cs; > > This changes (regresses) debug -> printf.Adding: ACK if you fix this regression. 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/
Apparently Analagous Threads
- Re: [PATCH v2 1/2] v2v:windows: factor out getting CurrentControlSet
- [PATCH v2 0/2] v2v:windows: prevent conflicts with PnP on firstboot
- [PATCH] v2v:windows: prevent Parallels drivers from loading at boot
- Re: [PATCH 2/2] v2v:windows: prevent conflicts with PnP on firstboot
- [PATCH 3/7] customize: add support for pvvxsvc