[PATCH] v2v: Fix RPM file owned test (RHBZ#1503958).
by Richard W.M. Jones
Linux.file_owner is not used by any other function, so remove it.
Linux.is_file_owned is only used when removing kmod-xenpv on old RHEL
releases, and so is only required to work for RPM.
The old file_owner/is_file_owned functions were completely broken.
This replaces them with a simpler, working implementation that only
covers the narrow use case of removing kmod-xenpv non-owned
directories.
Thanks: Ming Xie for finding and reporting the original bug.
---
v2v/linux.ml | 60 ++++++++++++++---------------------------------------------
v2v/linux.mli | 3 ---
2 files changed, 14 insertions(+), 49 deletions(-)
diff --git a/v2v/linux.ml b/v2v/linux.ml
index bc4af1ad2..d759bf7e6 100644
--- a/v2v/linux.ml
+++ b/v2v/linux.ml
@@ -99,58 +99,26 @@ let file_list_of_package (g : Guestfs.guestfs) inspect app =
error (f_"don’t know how to get list of files from package using %s")
format
-let rec file_owner (g : G.guestfs) { i_package_format = package_format } path =
+let is_file_owned (g : G.guestfs) { i_package_format = package_format } path =
match package_format with
- | "deb" ->
- (* With dpkg usually the directories are owned by all the packages
- * that install anything in them. Also with multiarch the same
- * package is allowed (although with different architectures).
- * This function returns only one package in all the cases.
- *)
- let cmd = [| "dpkg"; "-S"; path |] in
- debug "%s" (String.concat " " (Array.to_list cmd));
- let lines =
- try g#command_lines cmd
- with Guestfs.Error msg as exn ->
- if String.find msg "no path found matching pattern" >= 0 then
- raise Not_found
- else
- raise exn in
- if Array.length lines = 0 then
- error (f_"internal error: file_owner: dpkg command returned no output");
- let line = lines.(0) in
- let line =
- try String.sub line 0 (String.rindex line ':')
- with Invalid_argument _ ->
- error (f_"internal error: file_owner: invalid dpkg output: ‘%s’")
- line in
- fst (String.split "," line)
-
| "rpm" ->
- (* Although it is possible in RPM for multiple packages to own
- * a file, this deliberately only returns one package.
- *)
- let cmd = [| "rpm"; "-qf"; "--qf"; "%{NAME}\\n"; path |] in
- debug "%s" (String.concat " " (Array.to_list cmd));
- (try
- let pkgs = g#command_lines cmd in
- pkgs.(0)
- with Guestfs.Error msg as exn ->
- if String.find msg "is not owned" >= 0 then
- raise Not_found
- else
- raise exn
- | Invalid_argument _ (* pkgs.(0) raises index out of bounds *) ->
- error (f_"internal error: file_owner: rpm command returned no output")
- )
+ (* Run rpm -qf and print a magic string if the file is owned.
+ * If not owned, rpm will print "... is not owned by any package"
+ * and exit with an error. Unfortunately the string is sent to
+ * stdout, so here we ignore the exit status of rpm and just
+ * look for one of the two strings.
+ *)
+ let magic = "FILE_OWNED_TEST" in
+ let cmd = sprintf "rpm -qf --qf %s %s 2>&1 ||:"
+ (quote (magic ^ "\n")) (quote path) in
+ let r = g#sh cmd in
+ if String.find r magic >= 0 then true
+ else if String.find r "is not owned" >= 0 then false
+ else failwithf "RPM file owned test failed: %s" r
| format ->
error (f_"don’t know how to find file owner using %s") format
-and is_file_owned g inspect path =
- try ignore (file_owner g inspect path); true
- with Not_found -> false
-
let is_package_manager_save_file filename =
(* Recognized suffixes of package managers. *)
let suffixes = [ ".dpkg-old"; ".dpkg-new"; ".rpmsave"; ".rpmnew"; ] in
diff --git a/v2v/linux.mli b/v2v/linux.mli
index 705073644..08146a460 100644
--- a/v2v/linux.mli
+++ b/v2v/linux.mli
@@ -29,9 +29,6 @@ val remove : Guestfs.guestfs -> Types.inspect -> string list -> unit
val file_list_of_package : Guestfs.guestfs -> Types.inspect -> Guestfs.application2 -> string list
(** Return list of files owned by package. *)
-val file_owner : Guestfs.guestfs -> Types.inspect -> string -> string
-(** Return the name of the package that owns a file. *)
-
val is_file_owned : Guestfs.guestfs -> Types.inspect -> string -> bool
(** Returns true if the file is owned by an installed package. *)
--
2.13.2
7 years
Re: [Libguestfs] a question about multithreading with libguestfs
by Maxim Kozover
Hi Richard,
Can you tell, please, if the daemon at the appliance side is multithreaded
as well and is able to execute several simultaneous reads, for example? If
yes, how many threads it uses? Or every request starts its own thread?
Thanks much,
Maxim.
On Oct 18, 2017 2:17 AM, "Maxim Kozover" <maximkoz(a)gmail.com> wrote:
> Hi Richard!
> Finally it seems it works after removing ACQUIRE_LOCK_FOR_CURRENT_SCOPE
> in guestfs_mount_local_run and throwing away all directory cache code.
> Although I didn't try to mix fuse libguestfs client with other clients, I
> think guestfs_mount_local_run shouldn't take that specific lock as the
> function won't exit until umount and will sit in the loop. I think it does
> nothing libguestfs-related, only fuse loop activation.
> What I don't understand is how that lock in guestfs_mount_local_run didn't
> make problems with single threaded fuse_loop.
> I'll try to run it a bit more to see if any problems are seen.
> If everything is OK (hope not a false success as directory lists are
> slower and race condition maybe less likely), then it should be worth to
> see why directory cache made problems, maybe guard it with the same lock or
> different one?
> What do you think, Richard?
>
> Many thanks for your prompt help,
>
> Maxim.
>
> On Wed, Oct 18, 2017 at 1:39 AM, Richard W.M. Jones <rjones(a)redhat.com>
> wrote:
>
>> On Wed, Oct 18, 2017 at 01:33:49AM +0300, Maxim Kozover wrote:
>> > Hi Richard!
>> > Maybe the function guestfs_mount_local_run shouldn't
>> > ACQUIRE_LOCK_FOR_CURRENT_SCOPE as it doesn't talk with the daemon and
>> sits
>> > in the loop? What do you think?
>>
>> The lock is needed for any access to the guestfs_h structure, so I'm
>> pretty sure that is not safe.
>>
>> > If I remove it from guestfs_mount_local_run (in lib/action-1.c, don't
>> know
>> > how to properly remove it from ml generator), fuse_loop_mt works, but I
>> > still don't understand how it worked with fuse_loop (single threaded)
>> when
>> > guestfs_mount_local_run did ACQUIRE_LOCK_FOR_CURRENT_SCOPE.
>> > Unfortunately multiple ls -lR to the same directory tree lead to crash
>> > while it seems multiple ls -lR to different directory trees (if not
>> > repeated for a while) don't lead to crash, so I suspect directory cache
>> in
>> > fuse without guard.
>> > Is there a quick way to disable the directory cache in fuse so I can
>> see if
>> > it is directory cache that leads to crash or we have to look at other
>> parts?
>>
>> You could try removing the directory cache altogether from the FUSE
>> code (it may run much more slowly).
>>
>> 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
>>
>
>
7 years
Re: [Libguestfs] a question about multithreading with libguestfs
by Richard W.M. Jones
[Please keep replies on the mailing list so that others can benefit]
On Tue, Oct 17, 2017 at 10:07:31PM +0300, Maxim Kozover wrote:
> Hi Richard,
> Unfortunately I achieved a negative result, maybe you could help, please?
.
> I'm using libguestfs-1.36.4 as a base since I changed for myself a bit some
> detection stuff that you recently moved from C to OCaml and I can't rewrite
> it immediately.
>
> WIth vanilla 1.36.4 just changing fuse_loop to fuse_loop_mt gives almost
> immediate crash when the filesystem is accessed.
That's expected because plain 1.36 doesn't support multithreading, but ...
> I've put the most recent gnulib, changed a bit bootstrap etc, put the
> patches from https://www.redhat.com/archives/libguestfs/2017-June/
> msg00287.html and rebuilt.
... OK.
> The system seems to work (with single-threaded fuse).
> Changed fuse_loop to fuse_loop_mt, rebuilt and fuse is stuck on the first
> call to appropriate fuse "system call" like mount_local_getattr in case of
> ls.
> It is stuck at guestfs_lstatns possibly at ACQUIRE_LOCK_FOR_CURRENT_SCOPE,
> while being called from fuse.
Can you get a stack trace from gdb. Use the command ‘t a a bt’ to
show stacks from all threads at the same time.
> What do you think could be a problem? Some lock already taken?
> Also, maybe less concern for me as I use fuse read-only, is the directory
> cache guarded?
Possibly not, I've not really looked at the fuse code w.r.t
multithreading at all. Patches welcome as usual.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
7 years
[PATCH] daemon: simplify usage of Chroot.f
by Pino Toscano
Rely on currying, and avoid extra helper functions.
No behaviour changes.
---
daemon/inspect_fs_unix.ml | 20 ++++++++++----------
daemon/inspect_fs_windows.ml | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
index 59e26a05e..3ad119306 100644
--- a/daemon/inspect_fs_unix.ml
+++ b/daemon/inspect_fs_unix.ml
@@ -68,7 +68,7 @@ let arch_binaries =
*)
let rec parse_os_release release_file data =
let chroot = Chroot.create ~name:"parse_os_release" () in
- let lines = Chroot.f chroot (fun () -> read_small_file release_file) () in
+ let lines = Chroot.f chroot read_small_file release_file in
match lines with
| None -> false
@@ -182,7 +182,7 @@ and distro_of_os_release_id = function
*)
and parse_lsb_release release_file data =
let chroot = Chroot.create ~name:"parse_lsb_release" () in
- let lines = Chroot.f chroot (fun () -> read_small_file release_file) () in
+ let lines = Chroot.f chroot read_small_file release_file in
match lines with
| None -> false
@@ -229,7 +229,7 @@ and distro_of_lsb_release_distrib_id = function
and parse_suse_release release_file data =
let chroot = Chroot.create ~name:"parse_suse_release" () in
- let lines = Chroot.f chroot (fun () -> read_small_file release_file) () in
+ let lines = Chroot.f chroot read_small_file release_file in
match lines with
| None
@@ -297,14 +297,14 @@ and parse_generic ?rex distro release_file data =
let chroot = Chroot.create ~name:"parse_generic" () in
let product_name =
Chroot.f chroot (
- fun () ->
- if not (is_small_file release_file) then (
- eprintf "%s: not a regular file or too large\n" release_file;
+ fun file ->
+ if not (is_small_file file) then (
+ eprintf "%s: not a regular file or too large\n" file;
""
)
else
- read_first_line_from_file release_file
- ) () in
+ read_first_line_from_file file
+ ) release_file in
if product_name = "" then
false
else (
@@ -530,7 +530,7 @@ and check_hostname_from_file filename =
let name = sprintf "check_hostname_from_file: %s" filename in
Chroot.create ~name () in
- let hostname = Chroot.f chroot (fun () -> read_small_file filename) () in
+ let hostname = Chroot.f chroot read_small_file filename in
match hostname with
| None | Some [] | Some [""] -> None
| Some (hostname :: _) -> Some hostname
@@ -629,7 +629,7 @@ and check_hostname_freebsd () =
let filename = "/etc/rc.conf" in
try
- let lines = Chroot.f chroot (fun () -> read_small_file filename) () in
+ let lines = Chroot.f chroot read_small_file filename in
let lines =
match lines with None -> raise Not_found | Some lines -> lines in
let rec loop = function
diff --git a/daemon/inspect_fs_windows.ml b/daemon/inspect_fs_windows.ml
index 78af7f048..c7b766dd0 100644
--- a/daemon/inspect_fs_windows.ml
+++ b/daemon/inspect_fs_windows.ml
@@ -84,7 +84,7 @@ and get_windows_systemroot () =
and get_windows_systemroot_from_boot_ini boot_ini_path =
let chroot = Chroot.create ~name:"get_windows_systemroot_from_boot_ini" () in
- let lines = Chroot.f chroot (fun () -> read_small_file boot_ini_path) () in
+ let lines = Chroot.f chroot read_small_file boot_ini_path in
match lines with
| None -> None
| Some lines ->
--
2.13.6
7 years
[PATCH] v2v: -i libvirt: use precheck also for xen+ssh sources
by Pino Toscano
Updates commit f87f254b2bcda09713d908451f29512ec4286626.
---
v2v/input_libvirt_xen_ssh.ml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/v2v/input_libvirt_xen_ssh.ml b/v2v/input_libvirt_xen_ssh.ml
index a1b1dfa1e..545a8f5da 100644
--- a/v2v/input_libvirt_xen_ssh.ml
+++ b/v2v/input_libvirt_xen_ssh.ml
@@ -34,16 +34,16 @@ class input_libvirt_xen_ssh password libvirt_uri parsed_uri scheme server guest
object
inherit input_libvirt password libvirt_uri guest
+ method precheck () =
+ if backend_is_libvirt () then
+ error (f_"because of libvirt bug https://bugzilla.redhat.com/1140166 you must set this environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the virt-v2v command.");
+ error_if_libvirt_does_not_support_json_backingfile ();
+ error_if_no_ssh_agent ()
+
method source () =
debug "input_libvirt_xen_ssh: source: scheme %s server %s"
scheme server;
- if backend_is_libvirt () then (
- error (f_"because of libvirt bug https://bugzilla.redhat.com/1140166 you must set this environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the virt-v2v command.")
- );
- error_if_libvirt_does_not_support_json_backingfile ();
- error_if_no_ssh_agent ();
-
(* Get the libvirt XML. This also checks (as a side-effect)
* that the domain is not running. (RHBZ#1138586)
*)
--
2.13.6
7 years
Elias Hickman's libguestfs dump
by Elias Hickman
1. What am I trying to do?Deploy OpenStack using OOOQ (TripleO Quickstart)
2. What commands did I run?I ran:bash quickstart.sh $VIRTHOST
3. What was the exact output of these commands?
fatal: [127.0.0.2]: FAILED! => {"changed": true, "cmd": ["virt-customize", "-a", "/home/stack/undercloud.qcow2", "--upload", "/home/stack/instackenv.json:/home/stack/instackenv.json", "--run-command", "chown stack:stack /home/stack/instackenv.json"], "delta": "0:00:04.928642", "end": "2017-10-17 00:36:45.020645", "failed": true, "rc": 1, "start": "2017-10-17 00:36:40.092003", "stderr": "virt-customize: error: libguestfs error: guestfs_launch failed.\nThis usually means the libguestfs appliance failed to start or crashed.\nDo:\n export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1\nand run the command again. For further information, read:\n http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs\nYou can also run 'libguestfs-test-tool' and post the *complete* output\ninto a bug report or message to the libguestfs mailing list.\n\nIf reporting bugs, run virt-customize with debugging enabled and include \nthe complete output:\n\n virt-customize -v -x [...]", "stdout": "[ 0.0] Examining the guest ...", "stdout_lines": ["[ 0.0] Examining the guest ..."], "warnings": []}
4.
[stack@centos7 ~]$ libguestfs-test-tool
************************************************************
* IMPORTANT NOTICE
*
* When reporting bugs, include the COMPLETE, UNEDITED
* output below in your bug report.
*
************************************************************
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
LIBGUESTFS_DEBUG=1
LIBGUESTFS_TRACE=1
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
SELinux: Enforcing
libguestfs: trace: add_drive_scratch 104857600
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: disk_create "/tmp/libguestfsGvUr1O/scratch.1" "raw" 104857600
libguestfs: trace: disk_create = 0
libguestfs: trace: add_drive "/tmp/libguestfsGvUr1O/scratch.1" "format:raw" "cachemode:unsafe"
libguestfs: trace: add_drive = 0
libguestfs: trace: add_drive_scratch = 0
libguestfs: trace: get_append
libguestfs: trace: get_append = "NULL"
guestfs_get_append: (null)
libguestfs: trace: get_autosync
libguestfs: trace: get_autosync = 1
guestfs_get_autosync: 1
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "libvirt"
guestfs_get_backend: libvirt
libguestfs: trace: get_backend_settings
libguestfs: trace: get_backend_settings = []
guestfs_get_backend_settings: []
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
guestfs_get_cachedir: /var/tmp
libguestfs: trace: get_direct
libguestfs: trace: get_direct = 0
guestfs_get_direct: 0
libguestfs: trace: get_hv
libguestfs: trace: get_hv = "/usr/libexec/qemu-kvm"
guestfs_get_hv: /usr/libexec/qemu-kvm
libguestfs: trace: get_memsize
libguestfs: trace: get_memsize = 500
guestfs_get_memsize: 500
libguestfs: trace: get_network
libguestfs: trace: get_network = 0
guestfs_get_network: 0
libguestfs: trace: get_path
libguestfs: trace: get_path = "/usr/lib64/guestfs"
guestfs_get_path: /usr/lib64/guestfs
libguestfs: trace: get_pgroup
libguestfs: trace: get_pgroup = 0
guestfs_get_pgroup: 0
libguestfs: trace: get_program
libguestfs: trace: get_program = "libguestfs-test-tool"
guestfs_get_program: libguestfs-test-tool
libguestfs: trace: get_recovery_proc
libguestfs: trace: get_recovery_proc = 1
guestfs_get_recovery_proc: 1
libguestfs: trace: get_smp
libguestfs: trace: get_smp = 1
guestfs_get_smp: 1
libguestfs: trace: get_sockdir
libguestfs: trace: get_sockdir = "/tmp"
guestfs_get_sockdir: /tmp
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
guestfs_get_tmpdir: /tmp
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
guestfs_get_trace: 1
libguestfs: trace: get_verbose
libguestfs: trace: get_verbose = 1
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: trace: launch
libguestfs: trace: version
libguestfs: trace: version = <struct guestfs_version = major: 1, minor: 36, release: 3, extra: rhel=7,release=6.el7_4.3,libvirt, >
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "libvirt"
libguestfs: launch: program=libguestfs-test-tool
libguestfs: launch: version=1.36.3rhel=7,release=6.el7_4.3,libvirt
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=libvirt
libguestfs: launch: tmpdir=/tmp/libguestfsGvUr1O
libguestfs: launch: umask=0002
libguestfs: launch: euid=1001
libguestfs: libvirt version = 3002000 (3.2.0)
libguestfs: guest random name = guestfs-qaohyvwxssi570w7
libguestfs: connect to libvirt
libguestfs: opening libvirt handle: URI = qemu:///session, auth = default+wrapper, flags = 0
libguestfs: successfully opened libvirt handle: conn = 0x55e4685280c0
libguestfs: qemu version (reported by libvirt) = 1005003 (1.5.3)
libguestfs: get libvirt capabilities
libguestfs: parsing capabilities XML
libguestfs: trace: get_backend_setting "force_tcg"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_backend_setting "internal_libvirt_label"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_backend_setting "internal_libvirt_imagelabel"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_backend_setting "internal_libvirt_norelabel_disks"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: build appliance
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin5
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-1001/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-1001/appliance.d
supermin: version: 5.1.16
supermin: rpm: detected RPM version 4.11
supermin: package handler: fedora/rpm
supermin: acquiring lock on /var/tmp/.guestfs-1001/lock
supermin: if-newer: output does not need rebuilding
libguestfs: finished building supermin appliance
libguestfs: trace: disk_create "/tmp/libguestfsGvUr1O/overlay2" "qcow2" -1 "backingfile:/var/tmp/.guestfs-1001/appliance.d/root" "backingformat:raw"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o backing_file=/var/tmp/.guestfs-1001/appliance.d/root,backing_fmt=raw
libguestfs: command: run: \ /tmp/libguestfsGvUr1O/overlay2
Formatting '/tmp/libguestfsGvUr1O/overlay2', fmt=qcow2 size=4294967296 backing_file='/var/tmp/.guestfs-1001/appliance.d/root' backing_fmt='raw' encryption=off cluster_size=65536 lazy_refcounts=off
libguestfs: trace: disk_create = 0
libguestfs: trace: get_sockdir
libguestfs: trace: get_sockdir = "/tmp"
libguestfs: create libvirt XML
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: libvirt XML:\n<?xml version="1.0"?>\n<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">\n <name>guestfs-qaohyvwxssi570w7</name>\n <memory unit="MiB">500</memory>\n <currentMemory unit="MiB">500</currentMemory>\n <cpu mode="host-passthrough">\n <model fallback="allow"/>\n </cpu>\n <vcpu>1</vcpu>\n <clock offset="utc">\n <timer name="rtc" tickpolicy="catchup"/>\n <timer name="pit" tickpolicy="delay"/>\n <timer name="hpet" present="no"/>\n </clock>\n <os>\n sdftype>hvm</type>\n <kernel>/var/tmp/.guestfs-1001/appliance.d/kernel</kernel>\n <initrd>/var/tmp/.guestfs-1001/appliance.d/initrd</initrd>\n <cmdline>panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm</cmdline>\n <bios useserial="yes"/>\n </os>\n <on_reboot>destroy</on_reboot>\n <devices>\n <rng model="virtio">\n <backend model="random">/dev/urandom</backend>\n </rng>\n <controller type="scsi" index="0" model="virtio-scsi"/>\n <disk device="disk" type="file">\n <source file="/tmp/libguestfsGvUr1O/scratch.1"/>\n <target dev="sda" bus="scsi"/>\n <driver name="qemu" type="raw" cache="unsafe"/>\n <address type="drive" controller="0" bus="0" target="0" unit="0"/>\n </disk>\n <disk type="file" device="disk">\n <source file="/tmp/libguestfsGvUr1O/overlay2"/>\n <target dev="sdb" bus="scsi"/>\n <driver name="qemu" type="qcow2" cache="unsafe"/>\n <address type="drive" controller="0" bus="0" target="1" unit="0"/>\n <shareable/>\n </disk>\n <serial type="unix">\n <source mode="connect" path="/tmp/libguestfsYG0ndb/console.sock"/>\n <target port="0"/>\n </serial>\n <channel type="unix">\n <source mode="connect" path="/tmp/libguestfsYG0ndb/guestfsd.sock"/>\n <target type="virtio" name="org.libguestfs.channel.0"/>\n </channel>\n <controller type="usb" model="none"/>\n <memballoon model="none"/>\n </devices>\n <qemu:commandline>\n <qemu:env name="TMPDIR" value="/var/tmp"/>\n </qemu:commandline>\n</domain>\n
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: command: run: ls
libguestfs: command: run: \ -a
libguestfs: command: run: \ -l
libguestfs: command: run: \ -R
libguestfs: command: run: \ -Z /var/tmp/.guestfs-1001
libguestfs: /var/tmp/.guestfs-1001:
libguestfs: drwxr-xr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 .
libguestfs: drwxrwxrwt. root root system_u:object_r:tmp_t:s0 ..
libguestfs: drwxr-xr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 appliance.d
libguestfs: -rw-r--r--. stack stack unconfined_u:object_r:user_tmp_t:s0 lock
libguestfs: -rw-rw-r--. stack stack unconfined_u:object_r:user_tmp_t:s0 qemu.devices
libguestfs: -rw-rw-r--. stack stack unconfined_u:object_r:user_tmp_t:s0 qemu.help
libguestfs: -rw-rw-r--. stack stack unconfined_u:object_r:user_tmp_t:s0 qemu.stat
libguestfs:
libguestfs: /var/tmp/.guestfs-1001/appliance.d:
libguestfs: drwxr-xr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 .
libguestfs: drwxr-xr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 ..
libguestfs: -rw-r--r--. stack stack system_u:object_r:virt_content_t:s0 initrd
libguestfs: -rwxr-xr-x. stack stack system_u:object_r:virt_content_t:s0 kernel
libguestfs: -rw-r--r--. stack stack system_u:object_r:virt_content_t:s0 root
libguestfs: command: run: ls
libguestfs: command: run: \ -a
libguestfs: command: run: \ -l
libguestfs: command: run: \ -Z /tmp/libguestfsYG0ndb
libguestfs: drwx------. stack stack unconfined_u:object_r:user_tmp_t:s0 .
libguestfs: drwxrwxrwt. root root system_u:object_r:tmp_t:s0 ..
libguestfs: srwxrwxr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 console.sock
libguestfs: srwxrwxr-x. stack stack unconfined_u:object_r:user_tmp_t:s0 guestfsd.sock
libguestfs: launch libvirt guest
libguestfs: responding to serial console Device Status Report
\x1b[1;256r\x1b[256;256H\x1b[6n
Google, Inc.
Serial Graphics Adapter 06/09/14
SGABIOS $Id: sgabios.S 8 2010-04-22 00:03:40Z nlaredo $ (mockbuild@) Mon Jun 9 21:33:48 UTC 2014
Term: 80x24
4 0
SeaBIOS (version 1.10.2-3.el7_4.1)
Machine UUID 3b776b94-9173-4174-badb-323caa9893be
Booting from ROM...
\x1b[2J[ 0.000000] random: get_random_bytes called from start_kernel+0x42/0x4be with crng_init=0
[ 0.000000] Linux version 4.13.5-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)) #1 SMP Thu Oct 5 08:24:09 EDT 2017
[ 0.000000] Command line: panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009f7ff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009f800-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001f3fdfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000001f3fe000-0x000000001f3fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] random: fast init done
[ 0.000000] SMBIOS 2.4 present.
[ 0.000000] DMI: Red Hat KVM, BIOS 0.5.1 01/01/2011
[ 0.000000] Hypervisor detected: KVM
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] e820: last_pfn = 0x1f3fe max_arch_pfn = 0x400000000
[ 0.000000] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT
[ 0.000000] found SMP MP-table at [mem 0x000f7300-0x000f730f] mapped at [ffff8800000f7300]
[ 0.000000] Using GB pages for direct mapping
[ 0.000000] RAMDISK: [mem 0x1f0da000-0x1f3effff]
[ 0.000000] ACPI: Early table checksum verification disabled
[ 0.000000] ACPI BIOS Error (bug): A valid RSDP was not found (20170531/tbxfroot-244)
[ 0.000000] No NUMA configuration found
[ 0.000000] Faking a node at [mem 0x0000000000000000-0x000000001f3fdfff]
[ 0.000000] NODE_DATA(0) allocated [mem 0x1f0b8000-0x1f0d9fff]
[ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[ 0.000000] kvm-clock: cpu 0, msr 0:1f038001, primary cpu clock
[ 0.000000] kvm-clock: using sched offset of 354345410 cycles
[ 0.000000] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.000000] DMA32 [mem 0x0000000001000000-0x000000001f3fdfff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009efff]
[ 0.000000] node 0: [mem 0x0000000000100000-0x000000001f3fdfff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000001f3fdfff]
[ 0.000000] SFI: Simple Firmware Interface v0.81 http://simplefirmware.org
[ 0.000000] Intel MultiProcessor Specification v1.4
[ 0.000000] MPTABLE: OEM ID: BOCHSCPU
[ 0.000000] MPTABLE: Product ID: 0.1
[ 0.000000] MPTABLE: APIC at: 0xFEE00000
[ 0.000000] Processor #0 (Bootup-CPU)
[ 0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[ 0.000000] Processors: 1
[ 0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[ 0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
[ 0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[ 0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[ 0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.000000] e820: [mem 0x1f400000-0xfeffbfff] available for PCI devices
[ 0.000000] Booting paravirtualized kernel on KVM
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[ 0.000000] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:1 nr_cpu_ids:1 nr_node_ids:1
[ 0.000000] percpu: Embedded 39 pages/cpu @ffff88001ee00000 s119768 r8192 d31784 u2097152
[ 0.000000] KVM setup async PF for cpu 0
[ 0.000000] kvm-stealtime: cpu 0, msr 1ee0d940
[ 0.000000] PV qspinlock hash table entries: 256 (order: 0, 4096 bytes)
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 125879
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Memory: 479952K/511600K available (7981K kernel code, 2265K rwdata, 3484K rodata, 2232K init, 2456K bss, 31648K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] ftrace: allocating 33482 entries in 131 pages
[ 0.001000] Hierarchical RCU implementation.
[ 0.001000] \tRCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=1.
[ 0.001000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.001000] NR_IRQS: 524544, nr_irqs: 256, preallocated irqs: 16
[ 0.001000] \tOffload RCU callbacks from CPUs: .
[ 0.001000] Console: colour *CGA 80x25
[ 0.001000] console [ttyS0] enabled
[ 0.001007] tsc: Detected 3193.998 MHz processor
[ 0.001481] Calibrating delay loop (skipped) preset value.. 6387.99 BogoMIPS (lpj=3193998)
[ 0.002003] pid_max: default: 32768 minimum: 301
[ 0.002535] Security Framework initialized
[ 0.003003] SELinux: Disabled at boot.
[ 0.003468] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.004028] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.005008] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.005688] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.006272] Disabling memory control group subsystem
[ 0.007072] mce: CPU supports 10 MCE banks
[ 0.008002] Last level iTLB entries: 4KB 512, 2MB 255, 4MB 127
[ 0.008607] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[ 0.013142] Freeing SMP alternatives memory: 28K
[ 0.014578] smpboot: Max logical packages: 1
[ 0.015128] x2apic enabled
[ 0.015594] Switched APIC routing to physical x2apic.
[ 0.016807] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.017000] smpboot: CPU0: AMD Ryzen 5 1600 Six-Core Processor (family: 0x17, model: 0x1, stepping: 0x1)
[ 0.017011] Performance Events: AMD PMU driver.
[ 0.017487] ... version: 0
[ 0.017906] ... bit width: 48
[ 0.018003] ... generic registers: 4
[ 0.018421] ... value mask: 0000ffffffffffff
[ 0.018958] ... max period: 00007fffffffffff
[ 0.019003] ... fixed-purpose events: 0
[ 0.019414] ... event mask: 000000000000000f
[ 0.019983] Hierarchical SRCU implementation.
[ 0.020439] smp: Bringing up secondary CPUs ...
[ 0.020931] smp: Brought up 1 node, 1 CPU
[ 0.021003] smpboot: Total of 1 processors activated (6387.99 BogoMIPS)
[ 0.021927] devtmpfs: initialized
[ 0.022032] x86/mm: Memory block size: 128MB
[ 0.022610] evm: security.selinux
[ 0.022952] evm: security.ima
[ 0.023004] evm: security.capability
[ 0.023468] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.024006] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.024667] pinctrl core: initialized pinctrl subsystem
[ 0.025116] NET: Registered protocol family 16
[ 0.025693] cpuidle: using governor menu
[ 0.026664] PCI: Using configuration type 1 for base access
[ 0.027003] PCI: Using configuration type 1 for extended access
[ 0.028333] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.029003] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.029777] ACPI: Interpreter disabled.
[ 0.030033] vgaarb: loaded
[ 0.030357] SCSI subsystem initialized
[ 0.030788] usbcore: USB support disabled
[ 0.031032] EDAC MC: Ver: 3.0.0
[ 0.031401] PCI: Probing PCI hardware
[ 0.031808] PCI host bridge to bus 0000:00
[ 0.032004] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 0.032642] pci_bus 0000:00: root bus resource [mem 0x00000000-0xffffffffffff]
[ 0.033003] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.038257] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
[ 0.038976] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6]
[ 0.039005] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
[ 0.039729] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376]
[ 0.053242] pci 0000:00:01.0: PIIX/ICH IRQ router [8086:7000]
[ 0.053908] NetLabel: Initializing
[ 0.054002] NetLabel: domain hash size = 128
[ 0.054435] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 0.055013] NetLabel: unlabeled traffic allowed by default
[ 0.055695] clocksource: Switched to clocksource kvm-clock
[ 0.061245] VFS: Disk quotas dquot_6.6.0
[ 0.061684] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.062505] pnp: PnP ACPI: disabled
[ 0.063546] NET: Registered protocol family 2
[ 0.064140] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.064876] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.065743] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.066417] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.067045] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.067701] NET: Registered protocol family 1
[ 0.068206] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[ 0.068816] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[ 0.069457] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[ 0.070189] Unpacking initramfs...
[ 0.071715] Freeing initrd memory: 3160K
[ 0.072268] platform rtc_cmos: registered platform RTC device (no PNP device found)
[ 0.073177] alg: self-tests disabled
[ 0.073639] audit: initializing netlink subsys (disabled)
[ 0.074472] Initialise system trusted keyrings
[ 0.074950] audit: type=2000 audit(1508168835.114:1): state=initialized audit_enabled=0 res=1
[ 0.075865] workingset: timestamp_bits=36 max_order=17 bucket_order=0
[ 0.077220] zbud: loaded
[ 0.078379] NET: Registered protocol family 38
[ 0.078840] Key type asymmetric registered
[ 0.079288] Asymmetric key parser 'x509' registered
[ 0.079810] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[ 0.080591] io scheduler noop registered
[ 0.081010] io scheduler deadline registered (default)
[ 0.081558] io scheduler cfq registered
[ 0.081997] atomic64_test: passed for x86-64 platform with CX8 and with SSE
[ 0.082806] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 0.105317] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 0.106283] Non-volatile memory driver v1.3
[ 0.106738] Linux agpgart interface v0.103
[ 0.107276] rdac: device handler registered
[ 0.107732] hp_sw: device handler registered
[ 0.108181] emc: device handler registered
[ 0.108617] alua: device handler registered
[ 0.109085] libphy: Fixed MDIO Bus: probed
[ 0.109537] usbserial: usb_serial_init - usb_register failed
[ 0.110139] usbserial: usb_serial_init - returning with error -19
[ 0.110759] i8042: PNP: No PS/2 controller found.
[ 0.111270] i8042: Probing ports directly.
[ 0.112307] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 0.112816] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 0.113403] mousedev: PS/2 mouse device common for all mice
[ 0.114208] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[ 0.115654] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3
[ 0.116687] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input2
[ 0.117773] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[ 0.118501] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram
[ 0.119239] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.119873] hidraw: raw HID events driver (C) Jiri Kosina
[ 0.120507] drop_monitor: Initializing network drop monitor service
[ 0.121220] Initializing XFRM netlink socket
[ 0.121710] NET: Registered protocol family 10
[ 0.122316] Segment Routing with IPv6
[ 0.122707] NET: Registered protocol family 17
[ 0.123203] Bridge firewalling registered
[ 0.123715] sched_clock: Marking stable (123191261, 0)->(205902776, -82711515)
[ 0.124517] registered taskstats version 1
[ 0.124942] Loading compiled-in X.509 certificates
[ 0.125448] zswap: loaded using pool lzo/zbud
[ 0.126069] Key type big_key registered
[ 0.126520] Key type trusted registered
[ 0.126988] Key type encrypted registered
[ 0.127409] ima: No TPM chip found, activating TPM-bypass! (rc=-19)
[ 0.128073] evm: HMAC attrs: 0x1
[ 0.128577] rtc_cmos rtc_cmos: setting system clock to 2017-10-16 15:47:14 UTC (1508168834)
[ 0.131264] Freeing unused kernel memory: 2232K
[ 0.131733] Write protecting the kernel read-only data: 12288k
[ 0.132538] Freeing unused kernel memory: 200K
[ 0.134146] Freeing unused kernel memory: 612K
supermin: mounting /proc
supermin: ext2 mini initrd starting up: 5.1.16 glibc
supermin: cmdline: panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=/dev/sdb selinux=0 guestfs_verbose=1 TERM=xterm
supermin: uptime: 0.13 0.01
supermin: mounting /sys
supermin: internal insmod crc32-pclmul.ko
supermin: internal insmod crc32c-intel.ko
supermin: internal insmod crct10dif-pclmul.ko
supermin: internal insmod crc32_generic.ko
supermin: internal insmod nfit.ko
insmod: init_module: nfit.ko: No such device
supermin: internal insmod libata.ko
supermin: internal insmod ata_piix.ko
[ 0.143423] scsi host0: ata_piix
[ 0.143808] scsi host1: ata_piix
[ 0.144178] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc080 irq 14
[ 0.144875] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc088 irq 15
supermin: internal insmod virtio.ko
supermin: internal insmod virtio_ring.ko
supermin: internal insmod virtio_blk.ko
supermin: internal insmod virtio-rng.ko
supermin: internal insmod virtio_console.ko
supermin: internal insmod crypto_engine.ko
supermin: internal insmod virtio_crypto.ko
supermin: internal insmod virtio_net.ko
supermin: internal insmod nd_btt.ko
supermin: internal insmod dax.ko
supermin: internal insmod nd_pmem.ko
supermin: internal insmod sd_mod.ko
supermin: internal insmod virtio_scsi.ko
supermin: internal insmod virtio_balloon.ko
supermin: internal insmod virtio_input.ko
supermin: internal insmod virtio_pci.ko
[ 0.313057] virtio-pci 0000:00:03.0: PCI->APIC IRQ transform: INT A -> IRQ 11
[ 0.313816] virtio-pci 0000:00:03.0: virtio_pci: leaving for legacy driver
[ 0.316473] scsi host2: Virtio SCSI HBA
[ 0.318410] scsi 2:0:0:0: Direct-Access QEMU QEMU HARDDISK 1.5. PQ: 0 ANSI: 5
[ 0.319440] sd 2:0:0:0: [sda] 204800 512-byte logical blocks: (105 MB/100 MiB)
[ 0.320219] sd 2:0:0:0: [sda] Write Protect is off
[ 0.320751] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 0.321735] scsi 2:0:1:0: Direct-Access QEMU QEMU HARDDISK 1.5. PQ: 0 ANSI: 5
^H^H^H[ 0.323064] sd 2:0:1:0: [sdb] 8388608 512-byte logical blocks: (4.29 GB/4.00 GiB)
[ 0.323862] sd 2:0:1:0: [sdb] Write Protect is off
[ 0.324421] sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 0.325512] sd 2:0:0:0: [sda] Attached SCSI disk
[ 0.326398] sd 2:0:1:0: [sdb] Attached SCSI disk
[ 0.333394] virtio-pci 0000:00:04.0: PCI->APIC IRQ transform: INT A -> IRQ 11
[ 0.334180] virtio-pci 0000:00:04.0: virtio_pci: leaving for legacy driver
[ 0.378321] virtio-pci 0000:00:05.0: PCI->APIC IRQ transform: INT A -> IRQ 10
[ 0.379143] virtio-pci 0000:00:05.0: virtio_pci: leaving for legacy driver
supermin: internal insmod jbd2.ko
supermin: internal insmod mbcache.ko
supermin: internal insmod ext4.ko
[ 0.384209] random: crng init done
supermin: internal insmod crc-itu-t.ko
supermin: internal insmod crc4.ko
supermin: internal insmod crc7.ko
supermin: internal insmod crc8.ko
supermin: internal insmod libcrc32c.ko
supermin: picked /sys/block/sdb/dev as root device
supermin: creating /dev/root as block special 8:16
supermin: mounting new root on /root
[ 0.389280] EXT4-fs (sdb): mounting ext2 file system using the ext4 subsystem
[ 0.391899] EXT4-fs (sdb): mounted filesystem without journal. Opts:
supermin: deleting initramfs files
supermin: chroot
execl: /init: No such file or directory
supermin: debug: listing directory /
11 d lost+found 040700 16384 0:0
2 d . 040755 4096 0:0
417 d home 040755 4096 0:0
523 d tmp 041777 4096 0:0
521 d srv 040755 4096 0:0
7687 d var 040755 4096 0:0
509 d root 040550 4096 0:0
2 d .. 040755 4096 0:0
514 l sbin 120777 8 0:0 -> 7\x18
418 l lib 120777 7 0:0 -> \x18\x12
507 d opt 040755 4096 0:0
238 d dev 040755 4096 0:0
237 d boot 040555 4096 0:0
506 d mnt 040755 4096 0:0
12 d usr 040755 4096 1001:1001
221 l bin 120777 7 0:0 -> \x1f\b
219 - init 100755 5636 1001:1001
508 d proc 040555 4096 0:0
510 d run 040755 4096 0:0
30 d etc 040755 4096 1001:1001
522 d sys 040555 4096 0:0
430 l lib64 120777 9 0:0 -> $\x12
505 d media 040755 4096 0:0
supermin: debug: listing directory /bin
/bin: No such file or directory
supermin: debug: listing directory /lib
/lib: No such file or directory
supermin: debug: listing directory /lib64
/lib64: No such file or directory
[ 0.407521] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 0.407521]
[ 0.408453] CPU: 0 PID: 1 Comm: init Not tainted 4.13.5-1.el7.elrepo.x86_64 #1
[ 0.409211] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[ 0.409821] Call Trace:
[ 0.410085] dump_stack+0x63/0x85
[ 0.410430] panic+0xeb/0x245
[ 0.410741] ? sched_move_task+0xb6/0x120
[ 0.411156] do_exit+0xb3c/0xb40
[ 0.411491] do_group_exit+0x3f/0xb0
[ 0.411861] SyS_exit_group+0x14/0x20
[ 0.412244] entry_SYSCALL_64_fastpath+0x1a/0xa5
[ 0.412720] RIP: 0033:0x421529
[ 0.413039] RSP: 002b:00007ffd7dda6b38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[ 0.413811] RAX: ffffffffffffffda RBX: 0000000001b31023 RCX: 0000000000421529
[ 0.414541] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000001
[ 0.415263] RBP: 0000000001b30dc0 R08: 000000000000003c R09: 00000000000000e7
[ 0.415990] R10: ffffffffffffffc0 R11: 0000000000000246 R12: 0000000000000010
[ 0.416711] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000001b30dc0
[ 0.417455] Kernel Offset: disabled
[ 0.417820] Rebooting in 1 seconds..
libguestfs: error: appliance closed the connection unexpectedly, see earlier error messages
libguestfs: child_cleanup: 0x55e4685276d0: child process died
libguestfs: error: guestfs_launch failed, see earlier error messages
libguestfs: trace: launch = -1 (error)
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55e4685276d0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsGvUr1O
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsYG0ndb
[stack@centos7 ~]$
5. [stack@centos7 ~]$ rpm -qa | grep libguest
libguestfs-tools-c-1.36.3-6.el7_4.3.x86_64
libguestfs-tools-1.36.3-6.el7_4.3.noarch
libguestfs-1.36.3-6.el7_4.3.x86_64
[stack@centos7 ~]$ uname -a
Linux centos7.ryzen5 4.13.5-1.el7.elrepo.x86_64 #1 SMP Thu Oct 5 08:24:09 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
I believe libguestfs was installed with @Virtualization (yum groupinstall virtualization).
Thank you,Elias
7 years
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
by Pino Toscano
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use split_key_value_strings
daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++----------------------------
daemon/md.ml | 9 ++---
daemon/utils.ml | 16 ++++++++
daemon/utils.mli | 11 ++++++
4 files changed, 67 insertions(+), 62 deletions(-)
--
2.13.6
7 years
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
by Pino Toscano
Changes from v2 to v3:
- split_key_value_strings renamed to parse_key_value_strings
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use parse_key_value_strings
daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++----------------------------
daemon/md.ml | 9 ++---
daemon/utils.ml | 16 ++++++++
daemon/utils.mli | 11 ++++++
4 files changed, 67 insertions(+), 62 deletions(-)
--
2.13.6
7 years
[PATCH 1/3] daemon: add split_key_value_strings helper
by Pino Toscano
Add a simple helper to turn a list of strings into key/value pairs,
splitting by '='.
---
daemon/utils.ml | 15 +++++++++++++++
daemon/utils.mli | 6 ++++++
2 files changed, 21 insertions(+)
diff --git a/daemon/utils.ml b/daemon/utils.ml
index d87ad75db..fd1681a86 100644
--- a/daemon/utils.ml
+++ b/daemon/utils.ml
@@ -229,3 +229,18 @@ let unix_canonical_path path =
let path = String.nsplit "/" path in
let path = List.filter ((<>) "") path in
(if is_absolute then "/" else "") ^ String.concat "/" path
+
+let split_key_value_strings lines =
+ let lines = List.filter ((<>) "") lines in
+ let lines = List.filter (fun s -> s.[0] <> '#') lines in
+ List.map (
+ fun line ->
+ let key, value = String.split "=" line in
+ let value =
+ let n = String.length value in
+ if n >= 2 && value.[0] = '"' && value.[n-1] = '"' then
+ String.sub value 1 (n-2)
+ else
+ value in
+ (key, value)
+ ) lines
diff --git a/daemon/utils.mli b/daemon/utils.mli
index f312bde41..9730d06b5 100644
--- a/daemon/utils.mli
+++ b/daemon/utils.mli
@@ -97,5 +97,11 @@ val unix_canonical_path : string -> string
The path is modified in place because the result is always
the same length or shorter than the argument passed. *)
+val split_key_value_strings : string list -> (string * string) list
+(** Split the lines by the [=] separator, removing the double quotes
+ in the value if present. Empty lines, or that start with a comment
+ character [#], are ignored.
+*)
+
(**/**)
val get_verbose_flag : unit -> bool
--
2.13.6
7 years