qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Add Mount image file menu item


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Add Mount image file menu item
Date: Thu, 10 Sep 2015 09:21:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Programmingkid <address@hidden> writes:

> Does this look about right?
>
>     QDict *qdict;
>     Error *errp;
>     QObject **ret_data;
>     static int counter;
>     char *idString, *fileName;
>
>       // The file variable is objective-c, left that code out
>
>         fileName = g_strdup_printf("%s",
>                             [file cStringUsingEncoding: 
> NSASCIIStringEncoding]);
>         
>         /* Create an unique id */
>         idString = g_strdup_printf("USB%d", counter++);
>
>         /* Create the QDICT object */
>         qdict = qdict_new();
>         qdict_put_obj(qdict, "id", qstring_from_str(idString));
>         qdict_put_obj(qdict, "device", qstring_from_str(idString));
>         qdict_put_obj(qdict, "if", qstring_from_str("none"));
>         qdict_put_obj(qdict, "file", qstring_from_str(fileName));
>         qdict_put_obj(qdict, "driver", qstring_from_str("usb-storage"));
>         drive_add(IF_DEFAULT, 0, fileName, "none");
>         qmp_device_add(qdict, ret_data, &errp);
>         handleAnyDeviceErrors(errp);
>         g_free(fileName);
>         g_free(idString);
>
> This is a sample of what I am working on. For some reason, it crashes QEMU. 
> Any clues why? I think it might be because of qdict_put_obj(). 

My crystal ball is down for maintenance today, so you'll have to gives
us the clues yourself: a stack backtrace, for starters :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]