On Fri, Aug 08, 2008 at 02:30:15PM +0200, Jim Meyering wrote:
Guido Günther <agx(a)sigxcpu.org> wrote:
[..snip..]
> +static int qemudDomainAttachCdromDevice(virDomainPtr dom,
> + virDomainDeviceDefPtr dev)
> +{
> + struct qemud_driver *driver = (struct qemud_driver
*)dom->conn->privateData;
> + virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
> + virDomainDiskDefPtr disk;
> +
> + disk = vm->def->disks;
Check for vm == NULL before dereferencing it.
...
> +static int qemudDomainAttachHostDevice(virDomainPtr dom, virDomainDeviceDefPtr
dev)
> +{
> + struct qemud_driver *driver = (struct qemud_driver
*)dom->conn->privateData;
> + virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
...
> + if (qemudMonitorCommand(driver, vm, cmd, &reply) < 0) {
Likewise.
The same applies here: qemudDomainAttachDevice checked that already, but
again - better safe than sorry. Updated patches attached.
-- Guido