mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-24 04:12:20 +00:00
Fix initialization of virCommandPtr when creating QEMU argv
If the qemuBuildCommandLine method raised an error before the virCommandPtr instance was created, the local var would not be initialized, resulting in a possible SEGV in the error cleanup branch. Also add some debugging of the method params
This commit is contained in:
parent
a55a610b30
commit
731c911ceb
@ -4407,12 +4407,18 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
char *smp;
|
char *smp;
|
||||||
int last_good_net = -1;
|
int last_good_net = -1;
|
||||||
bool hasHwVirt = false;
|
bool hasHwVirt = false;
|
||||||
virCommandPtr cmd;
|
virCommandPtr cmd = NULL;
|
||||||
bool emitBootindex = false;
|
bool emitBootindex = false;
|
||||||
int usbcontroller = 0;
|
int usbcontroller = 0;
|
||||||
bool usblegacy = false;
|
bool usblegacy = false;
|
||||||
uname_normalize(&ut);
|
uname_normalize(&ut);
|
||||||
|
|
||||||
|
VIR_DEBUG("conn=%p driver=%p def=%p mon=%p json=%d "
|
||||||
|
"caps=%p migrateFrom=%s migrateFD=%d "
|
||||||
|
"snapshot=%p vmop=%d",
|
||||||
|
conn, driver, def, monitor_chr, monitor_json,
|
||||||
|
caps, migrateFrom, migrateFd, snapshot, vmop);
|
||||||
|
|
||||||
virUUIDFormat(def->uuid, uuid);
|
virUUIDFormat(def->uuid, uuid);
|
||||||
|
|
||||||
emulator = def->emulator;
|
emulator = def->emulator;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user