Check for presence of qemu -nodefconfig option before using it

We previously assumed that if the -device option existed in qemu, that
-nodefconfig would also exist. It turns out that isn't the case, as
demonstrated by qemu-kvm-0.12.3 in Fedora 13.

*/src/qemu/qemu_conf.[hc] - add a new QEMUD_CMD_FLAG, set it via the
                            help output, and check it before adding
                            -nodefconfig to the qemu commandline.
This commit is contained in:
Laine Stump 2010-06-24 14:49:51 -04:00
parent edfedfb414
commit 7d02393b1b
2 changed files with 5 additions and 1 deletions

View File

@ -1176,6 +1176,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_BALLOON;
if (strstr(help, "-device"))
flags |= QEMUD_CMD_FLAG_DEVICE;
if (strstr(help, "-nodefconfig"))
flags |= QEMUD_CMD_FLAG_NODEFCONFIG;
/* The trailing ' ' is important to avoid a bogus match */
if (strstr(help, "-rtc "))
flags |= QEMUD_CMD_FLAG_RTC;
@ -3780,7 +3782,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT("-nographic");
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
ADD_ARG_LIT("-nodefconfig"); /* Disabling global config files */
if (qemuCmdFlags & QEMUD_CMD_FLAG_NODEFCONFIG)
ADD_ARG_LIT("-nodefconfig"); /* Disabling global config files */
ADD_ARG_LIT("-nodefaults"); /* Disabling default guest devices */
}

View File

@ -90,6 +90,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_NO_KVM_PIT = (1LL << 34), /* -no-kvm-pit-reinjection supported */
QEMUD_CMD_FLAG_TDF = (1LL << 35), /* -tdf flag (user-mode pit catchup) */
QEMUD_CMD_FLAG_PCI_CONFIGFD = (1LL << 36), /* pci-assign.configfd */
QEMUD_CMD_FLAG_NODEFCONFIG = (1LL << 37), /* -nodefconfig */
};
/* Main driver state */