Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
launch: libvirt: Add force_tcg backend setting.
By using:

  export LIBGUESTFS_BACKEND_SETTINGS=force_tcg

you can force the libvirt backend to use TCG (software emulation)
instead of KVM (hardware accelerated virtualization).
  • Loading branch information
rwmjones committed Jan 18, 2014
1 parent 11ac9f7 commit 26f7fb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/guestfs.pod
Expand Up @@ -1494,8 +1494,8 @@ Currently the only backend setting is:

export LIBGUESTFS_BACKEND_SETTINGS=force_tcg

which will force the direct backend to use TCG (software emulation)
instead of KVM (hardware accelerated virtualization).
which will force the direct and libvirt backends to use TCG (software
emulation) instead of KVM (hardware accelerated virtualization).

=head2 ATTACHING TO RUNNING DAEMONS

Expand Down
9 changes: 8 additions & 1 deletion src/launch-libvirt.c
Expand Up @@ -597,6 +597,7 @@ parse_capabilities (guestfs_h *g, const char *capabilities_xml,
xmlNodeSetPtr nodes;
xmlAttrPtr attr;
size_t seen_qemu, seen_kvm;
bool force_tcg;

doc = xmlParseMemory (capabilities_xml, strlen (capabilities_xml));
if (doc == NULL) {
Expand Down Expand Up @@ -663,7 +664,13 @@ parse_capabilities (guestfs_h *g, const char *capabilities_xml,
return -1;
}

params->is_kvm = seen_kvm;
force_tcg = guestfs___get_backend_setting_bool (g, "force_tcg");

if (!force_tcg)
params->is_kvm = seen_kvm;
else
params->is_kvm = 0;

return 0;
}

Expand Down

0 comments on commit 26f7fb2

Please sign in to comment.