qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Support diskless PC
@ 2009-02-06 22:13 Stefan Weil
  2009-02-06 23:41 ` [Qemu-devel] " Jan Kiszka
  2009-02-06 23:45 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Weil @ 2009-02-06 22:13 UTC (permalink / raw)
  To: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

Hello,

there is no reason why Qemu should not be able to emulate
a diskless PC. This patch allows this configuration
without tricks like dummy disks.

Regards
Stefan Weil



[-- Attachment #2: nodisk.patch --]
[-- Type: text/x-diff, Size: 697 bytes --]

There is no reason why Qemu should not be able to emulate
a diskless PC. So we support it.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>

Index: trunk/hw/pc.c
===================================================================
--- trunk.orig/hw/pc.c	2009-02-06 23:08:30.000000000 +0100
+++ trunk/hw/pc.c	2009-02-06 23:08:51.000000000 +0100
@@ -1147,6 +1147,7 @@
     .desc = "Standard PC",
     .init = pc_init_pci,
     .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
+    .nodisk_ok = 1,
     .max_cpus = 255,
 };
 
@@ -1155,5 +1156,6 @@
     .desc = "ISA-only PC",
     .init = pc_init_isa,
     .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
+    .nodisk_ok = 1,
     .max_cpus = 1,
 };

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

* [Qemu-devel] Re: [PATCH] Support diskless PC
  2009-02-06 22:13 [Qemu-devel] [PATCH] Support diskless PC Stefan Weil
@ 2009-02-06 23:41 ` Jan Kiszka
  2009-02-06 23:46   ` Anthony Liguori
  2009-02-06 23:45 ` [Qemu-devel] " Anthony Liguori
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2009-02-06 23:41 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Stefan Weil wrote:
> There is no reason why Qemu should not be able to emulate
> a diskless PC. So we support it.

Yeah, true!

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>

> 
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> 
> Index: trunk/hw/pc.c
> ===================================================================
> --- trunk.orig/hw/pc.c	2009-02-06 23:08:30.000000000 +0100
> +++ trunk/hw/pc.c	2009-02-06 23:08:51.000000000 +0100
> @@ -1147,6 +1147,7 @@
>      .desc = "Standard PC",
>      .init = pc_init_pci,
>      .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
> +    .nodisk_ok = 1,
>      .max_cpus = 255,
>  };
>  
> @@ -1155,5 +1156,6 @@
>      .desc = "ISA-only PC",
>      .init = pc_init_isa,
>      .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
> +    .nodisk_ok = 1,
>      .max_cpus = 1,
>  };



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

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

* Re: [Qemu-devel] [PATCH] Support diskless PC
  2009-02-06 22:13 [Qemu-devel] [PATCH] Support diskless PC Stefan Weil
  2009-02-06 23:41 ` [Qemu-devel] " Jan Kiszka
@ 2009-02-06 23:45 ` Anthony Liguori
  2009-02-07  0:17   ` [Qemu-devel] " Jan Kiszka
  2009-02-07  0:42   ` [Qemu-devel] [PATCH] Support diskless PC Carl-Daniel Hailfinger
  1 sibling, 2 replies; 8+ messages in thread
From: Anthony Liguori @ 2009-02-06 23:45 UTC (permalink / raw)
  To: qemu-devel

Stefan Weil wrote:
> Hello,
>
> there is no reason why Qemu should not be able to emulate
> a diskless PC. This patch allows this configuration
> without tricks like dummy disks.
>   

What circumstance would you run a VM with no disk, without -kernel, and 
without -boot n?

Regards,

Anthony Liguori

> Regards
> Stefan Weil
>
>
>   

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

* Re: [Qemu-devel] Re: [PATCH] Support diskless PC
  2009-02-06 23:41 ` [Qemu-devel] " Jan Kiszka
@ 2009-02-06 23:46   ` Anthony Liguori
  0 siblings, 0 replies; 8+ messages in thread
From: Anthony Liguori @ 2009-02-06 23:46 UTC (permalink / raw)
  To: qemu-devel

Jan Kiszka wrote:
> Stefan Weil wrote:
>   
>> There is no reason why Qemu should not be able to emulate
>> a diskless PC. So we support it.
>>     
>
> Yeah, true!
>
> Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
>   

This doesn't fix the old -hda /dev/null hacks when using -kernel.  
That's unnecessary even without this patch.

Regards,

Anthony Liguori

>> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>>
>> Index: trunk/hw/pc.c
>> ===================================================================
>> --- trunk.orig/hw/pc.c	2009-02-06 23:08:30.000000000 +0100
>> +++ trunk/hw/pc.c	2009-02-06 23:08:51.000000000 +0100
>> @@ -1147,6 +1147,7 @@
>>      .desc = "Standard PC",
>>      .init = pc_init_pci,
>>      .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
>> +    .nodisk_ok = 1,
>>      .max_cpus = 255,
>>  };
>>  
>> @@ -1155,5 +1156,6 @@
>>      .desc = "ISA-only PC",
>>      .init = pc_init_isa,
>>      .ram_require = VGA_RAM_SIZE + PC_MAX_BIOS_SIZE,
>> +    .nodisk_ok = 1,
>>      .max_cpus = 1,
>>  };
>>     
>
>
>   

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

* [Qemu-devel] Re: [PATCH] Support diskless PC
  2009-02-06 23:45 ` [Qemu-devel] " Anthony Liguori
@ 2009-02-07  0:17   ` Jan Kiszka
  2009-02-07  1:29     ` Anthony Liguori
  2009-02-07  0:42   ` [Qemu-devel] [PATCH] Support diskless PC Carl-Daniel Hailfinger
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2009-02-07  0:17 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Anthony Liguori wrote:
> Stefan Weil wrote:
>> Hello,
>>
>> there is no reason why Qemu should not be able to emulate
>> a diskless PC. This patch allows this configuration
>> without tricks like dummy disks.
>>   
> 
> What circumstance would you run a VM with no disk, without -kernel, and
> without -boot n?

For custom BIOSes that are the boot image or retrieve it from somewhere.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

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

* Re: [Qemu-devel] [PATCH] Support diskless PC
  2009-02-06 23:45 ` [Qemu-devel] " Anthony Liguori
  2009-02-07  0:17   ` [Qemu-devel] " Jan Kiszka
@ 2009-02-07  0:42   ` Carl-Daniel Hailfinger
  1 sibling, 0 replies; 8+ messages in thread
From: Carl-Daniel Hailfinger @ 2009-02-07  0:42 UTC (permalink / raw)
  To: qemu-devel

On 07.02.2009 00:45, Anthony Liguori wrote:
> Stefan Weil wrote:
>> Hello,
>>
>> there is no reason why Qemu should not be able to emulate
>> a diskless PC. This patch allows this configuration
>> without tricks like dummy disks.
>>   
>
> What circumstance would you run a VM with no disk, without -kernel,
> and without -boot n?

BIOS/Firmware development. I've never used a disk inside qemu and I use
-kernel only twice a year if I change some OS handoff (or MTRR) code. I
have to admit I didn't know that -boot existed until you mentioned it in
this discussion.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/

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

* Re: [Qemu-devel] Re: [PATCH] Support diskless PC
  2009-02-07  0:17   ` [Qemu-devel] " Jan Kiszka
@ 2009-02-07  1:29     ` Anthony Liguori
  2009-02-07  2:27       ` [Qemu-devel] [PATCH] Remove nodisk_ok machine feature (was: [PATCH] Support diskless PC) Jan Kiszka
  0 siblings, 1 reply; 8+ messages in thread
From: Anthony Liguori @ 2009-02-07  1:29 UTC (permalink / raw)
  To: qemu-devel

Jan Kiszka wrote:
> Anthony Liguori wrote:
>   
>> Stefan Weil wrote:
>>     
>>> Hello,
>>>
>>> there is no reason why Qemu should not be able to emulate
>>> a diskless PC. This patch allows this configuration
>>> without tricks like dummy disks.
>>>   
>>>       
>> What circumstance would you run a VM with no disk, without -kernel, and
>> without -boot n?
>>     
>
> For custom BIOSes that are the boot image or retrieve it from somewhere.
>   

Well in that case, nodisk should just be completely removed.  There is 
no architecture that doesn't at least run a bios of some form.

Regards,

Anthony Liguori

> Jan
>
>   

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

* [Qemu-devel] [PATCH] Remove nodisk_ok machine feature (was: [PATCH] Support diskless PC)
  2009-02-07  1:29     ` Anthony Liguori
@ 2009-02-07  2:27       ` Jan Kiszka
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2009-02-07  2:27 UTC (permalink / raw)
  To: qemu-devel

Anthony Liguori wrote:
> Jan Kiszka wrote:
>> Anthony Liguori wrote:
>>  
>>> Stefan Weil wrote:
>>>    
>>>> Hello,
>>>>
>>>> there is no reason why Qemu should not be able to emulate
>>>> a diskless PC. This patch allows this configuration
>>>> without tricks like dummy disks.
>>>>         
>>> What circumstance would you run a VM with no disk, without -kernel, and
>>> without -boot n?
>>>     
>>
>> For custom BIOSes that are the boot image or retrieve it from somewhere.
>>   
> 
> Well in that case, nodisk should just be completely removed.  There is
> no architecture that doesn't at least run a bios of some form.

I was wondering this already, but I was not sure about the motivation
for nodisk beyond x86 (if there is any).

------->

All archs have some kind of firmware to load and can be fine with it
already. So there is not much use in enforcing the presence of a disk.
If the system setup requires one, the user will notice it anyway once
the firmware/bios fails to boot from it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 hw/boards.h       |    1 -
 hw/mips_jazz.c    |    2 --
 hw/mips_malta.c   |    1 -
 hw/mips_mipssim.c |    1 -
 hw/mips_r4k.c     |    1 -
 hw/sun4m.c        |   12 ------------
 hw/sun4u.c        |    3 ---
 vl.c              |    4 ----
 8 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/hw/boards.h b/hw/boards.h
index 0577f06..b870957 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -16,7 +16,6 @@ typedef struct QEMUMachine {
     QEMUMachineInitFunc *init;
 #define RAMSIZE_FIXED	(1 << 0)
     ram_addr_t ram_require;
-    int nodisk_ok;
     int use_scsi;
     int max_cpus;
     struct QEMUMachine *next;
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index 9bdb903..7475517 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -294,7 +294,6 @@ QEMUMachine mips_magnum_machine = {
     .desc = "MIPS Magnum",
     .init = mips_magnum_init,
     .ram_require = MAGNUM_BIOS_SIZE + VGA_RAM_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -303,6 +302,5 @@ QEMUMachine mips_pica61_machine = {
     .desc = "Acer Pica 61",
     .init = mips_pica61_init,
     .ram_require = MAGNUM_BIOS_SIZE + VGA_RAM_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index b7afb2d..e2e5e41 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -950,5 +950,4 @@ QEMUMachine mips_malta_machine = {
     .desc = "MIPS Malta Core LV",
     .init = mips_malta_init,
     .ram_require = VGA_RAM_SIZE + BIOS_SIZE,
-    .nodisk_ok = 1,
 };
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index 3f54900..5fb58e4 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -185,5 +185,4 @@ QEMUMachine mips_mipssim_machine = {
     .desc = "MIPS MIPSsim platform",
     .init = mips_mipssim_init,
     .ram_require = BIOS_SIZE + VGA_RAM_SIZE /* unused */,
-    .nodisk_ok = 1,
 };
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index ab0c110..e6697e9 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -282,5 +282,4 @@ QEMUMachine mips_machine = {
     .desc = "mips r4k platform",
     .init = mips_r4k_init,
     .ram_require = VGA_RAM_SIZE + BIOS_SIZE,
-    .nodisk_ok = 1,
 };
diff --git a/hw/sun4m.c b/hw/sun4m.c
index bae8803..6c358fc 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -1072,7 +1072,6 @@ QEMUMachine ss5_machine = {
     .desc = "Sun4m platform, SPARCstation 5",
     .init = ss5_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1081,7 +1080,6 @@ QEMUMachine ss10_machine = {
     .desc = "Sun4m platform, SPARCstation 10",
     .init = ss10_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
     .max_cpus = 4,
 };
@@ -1091,7 +1089,6 @@ QEMUMachine ss600mp_machine = {
     .desc = "Sun4m platform, SPARCserver 600MP",
     .init = ss600mp_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
     .max_cpus = 4,
 };
@@ -1101,7 +1098,6 @@ QEMUMachine ss20_machine = {
     .desc = "Sun4m platform, SPARCstation 20",
     .init = ss20_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
     .max_cpus = 4,
 };
@@ -1111,7 +1107,6 @@ QEMUMachine voyager_machine = {
     .desc = "Sun4m platform, SPARCstation Voyager",
     .init = vger_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1120,7 +1115,6 @@ QEMUMachine ss_lx_machine = {
     .desc = "Sun4m platform, SPARCstation LX",
     .init = ss_lx_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1129,7 +1123,6 @@ QEMUMachine ss4_machine = {
     .desc = "Sun4m platform, SPARCstation 4",
     .init = ss4_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1138,7 +1131,6 @@ QEMUMachine scls_machine = {
     .desc = "Sun4m platform, SPARCClassic",
     .init = scls_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1147,7 +1139,6 @@ QEMUMachine sbook_machine = {
     .desc = "Sun4m platform, SPARCbook",
     .init = sbook_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
 
@@ -1389,7 +1380,6 @@ QEMUMachine ss1000_machine = {
     .desc = "Sun4d platform, SPARCserver 1000",
     .init = ss1000_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
     .max_cpus = 8,
 };
@@ -1399,7 +1389,6 @@ QEMUMachine ss2000_machine = {
     .desc = "Sun4d platform, SPARCcenter 2000",
     .init = ss2000_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
     .max_cpus = 20,
 };
@@ -1597,6 +1586,5 @@ QEMUMachine ss2_machine = {
     .desc = "Sun4c platform, SPARCstation 2",
     .init = ss2_init,
     .ram_require = PROM_SIZE_MAX + TCX_SIZE,
-    .nodisk_ok = 1,
     .use_scsi = 1,
 };
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 234df7a..230d694 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -642,7 +642,6 @@ QEMUMachine sun4u_machine = {
     .desc = "Sun4u platform",
     .init = sun4u_init,
     .ram_require = PROM_SIZE_MAX + VGA_RAM_SIZE,
-    .nodisk_ok = 1,
     .max_cpus = 1, // XXX for now
 };
 
@@ -651,7 +650,6 @@ QEMUMachine sun4v_machine = {
     .desc = "Sun4v platform",
     .init = sun4v_init,
     .ram_require = PROM_SIZE_MAX + VGA_RAM_SIZE,
-    .nodisk_ok = 1,
     .max_cpus = 1, // XXX for now
 };
 
@@ -660,6 +658,5 @@ QEMUMachine niagara_machine = {
     .desc = "Sun4v platform, Niagara",
     .init = niagara_init,
     .ram_require = PROM_SIZE_MAX + VGA_RAM_SIZE,
-    .nodisk_ok = 1,
     .max_cpus = 1, // XXX for now
 };
diff --git a/vl.c b/vl.c
index aff2b2c..eb4ca35 100644
--- a/vl.c
+++ b/vl.c
@@ -5311,10 +5311,6 @@ int main(int argc, char **argv, char **envp)
     linux_boot = (kernel_filename != NULL);
     net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF;
 
-    if (!linux_boot && net_boot == 0 &&
-        !machine->nodisk_ok && nb_drives_opt == 0)
-        help(1);
-
     if (!linux_boot && *kernel_cmdline != '\0') {
         fprintf(stderr, "-append only allowed with -kernel option\n");
         exit(1);

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

end of thread, other threads:[~2009-02-07  2:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06 22:13 [Qemu-devel] [PATCH] Support diskless PC Stefan Weil
2009-02-06 23:41 ` [Qemu-devel] " Jan Kiszka
2009-02-06 23:46   ` Anthony Liguori
2009-02-06 23:45 ` [Qemu-devel] " Anthony Liguori
2009-02-07  0:17   ` [Qemu-devel] " Jan Kiszka
2009-02-07  1:29     ` Anthony Liguori
2009-02-07  2:27       ` [Qemu-devel] [PATCH] Remove nodisk_ok machine feature (was: [PATCH] Support diskless PC) Jan Kiszka
2009-02-07  0:42   ` [Qemu-devel] [PATCH] Support diskless PC Carl-Daniel Hailfinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).