All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ui/cocoa: Do not alert even without block devices
@ 2022-02-13  2:14 Akihiko Odaki
  2022-02-14 12:31 ` Philippe Mathieu-Daudé via
  0 siblings, 1 reply; 4+ messages in thread
From: Akihiko Odaki @ 2022-02-13  2:14 UTC (permalink / raw)
  Cc: Peter Maydell, qemu-devel, Akihiko Odaki, Gerd Hoffmann

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 ui/cocoa.m | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index ac18e14ce01..271a2676026 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1715,11 +1715,6 @@ static void addRemovableDevicesMenuItems(void)
 
     currentDevice = qmp_query_block(NULL);
     pointerToFree = currentDevice;
-    if(currentDevice == NULL) {
-        NSBeep();
-        QEMU_Alert(@"Failed to query for block devices!");
-        return;
-    }
 
     menu = [[[NSApp mainMenu] itemWithTitle:@"Machine"] submenu];
 
-- 
2.32.0 (Apple Git-132)



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui/cocoa: Do not alert even without block devices
  2022-02-13  2:14 [PATCH] ui/cocoa: Do not alert even without block devices Akihiko Odaki
@ 2022-02-14 12:31 ` Philippe Mathieu-Daudé via
  2022-02-14 13:32   ` Markus Armbruster
  2022-02-14 13:40   ` Akihiko Odaki
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-02-14 12:31 UTC (permalink / raw)
  To: Akihiko Odaki, qemu-block, Markus Armbruster
  Cc: Peter Maydell, qemu-devel, Gerd Hoffmann

On 13/2/22 03:14, Akihiko Odaki wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> ---
>   ui/cocoa.m | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index ac18e14ce01..271a2676026 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -1715,11 +1715,6 @@ static void addRemovableDevicesMenuItems(void)
>   
>       currentDevice = qmp_query_block(NULL);
>       pointerToFree = currentDevice;
> -    if(currentDevice == NULL) {
> -        NSBeep();
> -        QEMU_Alert(@"Failed to query for block devices!");
> -        return;
> -    }
>   
>       menu = [[[NSApp mainMenu] itemWithTitle:@"Machine"] submenu];
>   

Cc'ing qemu-block@ and Markus (QMP).

I always wondered the point of this annoying warning but never
found out.

Is this menu updated when removable blkdev are hot-plugged from
the monitor or QMP?

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui/cocoa: Do not alert even without block devices
  2022-02-14 12:31 ` Philippe Mathieu-Daudé via
@ 2022-02-14 13:32   ` Markus Armbruster
  2022-02-14 13:40   ` Akihiko Odaki
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2022-02-14 13:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Gerd Hoffmann, qemu-block, Akihiko Odaki, qemu-devel

Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 13/2/22 03:14, Akihiko Odaki wrote:
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
>> ---
>>   ui/cocoa.m | 5 -----
>>   1 file changed, 5 deletions(-)
>> diff --git a/ui/cocoa.m b/ui/cocoa.m
>> index ac18e14ce01..271a2676026 100644
>> --- a/ui/cocoa.m
>> +++ b/ui/cocoa.m
>> @@ -1715,11 +1715,6 @@ static void addRemovableDevicesMenuItems(void)
>>         currentDevice = qmp_query_block(NULL);
>>       pointerToFree = currentDevice;
>> -    if(currentDevice == NULL) {
>> -        NSBeep();
>> -        QEMU_Alert(@"Failed to query for block devices!");
>> -        return;
>> -    }
>>         menu = [[[NSApp mainMenu] itemWithTitle:@"Machine"]
>> submenu];
>>   
>
> Cc'ing qemu-block@ and Markus (QMP).
>
> I always wondered the point of this annoying warning but never
> found out.

The condition conflates "query failed" (returns null with error and "no
block devices" (returns empty list, i.e. null, with no error set).
Quite suspicious.

Goes back to

    Author: John Arbuckle <programmingkidx@gmail.com>
    Date:   Fri Jun 19 10:53:27 2015 +0100

        ui/cocoa.m: Add machine menu items to change and eject removable drive media

        Adds all removable devices to the Machine menu as a Change and Eject menu
        item pair. ide-cd0 would have a "Change ide-cd0..." and "Eject ide-cd0"
        menu items.

        Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
        Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
        Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> Is this menu updated when removable blkdev are hot-plugged from
> the monitor or QMP?
>
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ui/cocoa: Do not alert even without block devices
  2022-02-14 12:31 ` Philippe Mathieu-Daudé via
  2022-02-14 13:32   ` Markus Armbruster
@ 2022-02-14 13:40   ` Akihiko Odaki
  1 sibling, 0 replies; 4+ messages in thread
From: Akihiko Odaki @ 2022-02-14 13:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Gerd Hoffmann, Markus Armbruster, qemu-block,
	qemu Developers

On Mon, Feb 14, 2022 at 9:31 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Is this menu updated when removable blkdev are hot-plugged from
> the monitor or QMP?

Actually no.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-14 14:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13  2:14 [PATCH] ui/cocoa: Do not alert even without block devices Akihiko Odaki
2022-02-14 12:31 ` Philippe Mathieu-Daudé via
2022-02-14 13:32   ` Markus Armbruster
2022-02-14 13:40   ` Akihiko Odaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.