launch: direct: Make sure we pass lpj= parameter when using TCG.

I have verified that 'refined-jiffies' is the clock source when using
TCG (ie. not kvm-clock which seems only to be used for KVM).
This commit is contained in:
Richard W.M. Jones
2014-01-18 16:52:58 +00:00
parent 26f7fb237b
commit 012b01a0fb
2 changed files with 11 additions and 1 deletions

View File

@@ -276,6 +276,7 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline);
int daemon_accept_sock = -1, console_sock = -1;
int r;
int flags;
int sv[2];
char guestfsd_sock[256];
struct sockaddr_un addr;
@@ -635,7 +636,11 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
}
ADD_CMDLINE ("-append");
ADD_CMDLINE_STRING_NODUP (guestfs___appliance_command_line (g, appliance_dev, 0));
flags = 0;
if (!has_kvm || force_tcg)
flags |= APPLIANCE_COMMAND_LINE_IS_TCG;
ADD_CMDLINE_STRING_NODUP (guestfs___appliance_command_line (g, appliance_dev,
flags));
/* Note: custom command line parameters must come last so that
* qemu -set parameters can modify previously added options.

View File

@@ -40,10 +40,15 @@
* posted a patch asking for this to be added to /proc/cpuinfo too.
*
* Notes:
*
* - We only try to calculate lpj once.
*
* - Trying to calculate lpj must not fail. If the return value is
* <= 0, it is ignored by the caller.
*
* - KVM uses kvm-clock, but TCG uses some sort of jiffies source,
* which is why this is needed only for TCG appliances.
*
* (Suggested by Marcelo Tosatti)
*/