All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mitsyanko <i.mitsyanko@samsung.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Andreas Faerber <afaerber@suse.de>,
	Einar Lueck <elelueck@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCHv3] Support default block interfaces per QEMUMachine
Date: Wed, 21 Nov 2012 16:07:59 +0400	[thread overview]
Message-ID: <50ACC41F.8080403@samsung.com> (raw)
In-Reply-To: <1353421834-44687-1-git-send-email-borntraeger@de.ibm.com>

This version of patch doesn't change anything for majority of machines, 
its just that later we can
choose ourself which default block interface to use. So, nothing to 
review from Exynos point of view, but patch
is OK, except realview_pb_a8 part (see bellow):

Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com>


On 11/20/2012 06:30 PM, Christian Borntraeger wrote:

>   
> @@ -379,13 +379,14 @@ static QEMUMachine realview_pb_a8_machine = {
>       .name = "realview-pb-a8",
>       .desc = "ARM RealView Platform Baseboard for Cortex-A8",
>       .init = realview_pb_a8_init,
> +    .block_default_type = IF_SCSI,
>   };
>   


I think that's an unintentional change?


>   static QEMUMachine realview_pbx_a9_machine = {
>       .name = "realview-pbx-a9",
>       .desc = "ARM RealView Platform Baseboard Explore for Cortex-A9",
>       .init = realview_pbx_a9_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
> index 685cb54..64bb5a2 100644
> --- a/hw/s390-virtio.c
> +++ b/hw/s390-virtio.c
> @@ -315,21 +315,6 @@ static void s390_init(QEMUMachineInitArgs *args)
>           qdev_set_nic_properties(dev, nd);
>           qdev_init_nofail(dev);
>       }
> -
> -    /* Create VirtIO disk drives */
> -    for(i = 0; i < MAX_BLK_DEVS; i++) {
> -        DriveInfo *dinfo;
> -        DeviceState *dev;
> -
> -        dinfo = drive_get(IF_IDE, 0, i);
> -        if (!dinfo) {
> -            continue;
> -        }
> -
> -        dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390");
> -        qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
> -        qdev_init_nofail(dev);
> -    }
>   }
>   
>   static QEMUMachine s390_machine = {
> @@ -337,6 +322,7 @@ static QEMUMachine s390_machine = {
>       .alias = "s390",
>       .desc = "VirtIO based S390 machine",
>       .init = s390_init,
> +    .block_default_type = IF_VIRTIO,
>       .no_cdrom = 1,
>       .no_floppy = 1,
>       .no_serial = 1,
> @@ -353,3 +339,4 @@ static void s390_machine_init(void)
>   }
>   
>   machine_init(s390_machine_init);
> +
> diff --git a/hw/spapr.c b/hw/spapr.c
> index ad3f0ea..d955f02 100644
> --- a/hw/spapr.c
> +++ b/hw/spapr.c
> @@ -924,9 +924,9 @@ static QEMUMachine spapr_machine = {
>       .desc = "pSeries Logical Partition (PAPR compliant)",
>       .init = ppc_spapr_init,
>       .reset = ppc_spapr_reset,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = MAX_CPUS,
>       .no_parallel = 1,
> -    .use_scsi = 1,
>   };
>   
>   static void spapr_machine_init(void)
> diff --git a/hw/sun4m.c b/hw/sun4m.c
> index 1a78676..52cf82b 100644
> --- a/hw/sun4m.c
> +++ b/hw/sun4m.c
> @@ -1426,7 +1426,7 @@ static QEMUMachine ss5_machine = {
>       .name = "SS-5",
>       .desc = "Sun4m platform, SPARCstation 5",
>       .init = ss5_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .is_default = 1,
>   };
>   
> @@ -1434,7 +1434,7 @@ static QEMUMachine ss10_machine = {
>       .name = "SS-10",
>       .desc = "Sun4m platform, SPARCstation 10",
>       .init = ss10_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> @@ -1442,7 +1442,7 @@ static QEMUMachine ss600mp_machine = {
>       .name = "SS-600MP",
>       .desc = "Sun4m platform, SPARCserver 600MP",
>       .init = ss600mp_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> @@ -1450,7 +1450,7 @@ static QEMUMachine ss20_machine = {
>       .name = "SS-20",
>       .desc = "Sun4m platform, SPARCstation 20",
>       .init = ss20_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> @@ -1458,35 +1458,35 @@ static QEMUMachine voyager_machine = {
>       .name = "Voyager",
>       .desc = "Sun4m platform, SPARCstation Voyager",
>       .init = vger_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static QEMUMachine ss_lx_machine = {
>       .name = "LX",
>       .desc = "Sun4m platform, SPARCstation LX",
>       .init = ss_lx_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static QEMUMachine ss4_machine = {
>       .name = "SS-4",
>       .desc = "Sun4m platform, SPARCstation 4",
>       .init = ss4_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static QEMUMachine scls_machine = {
>       .name = "SPARCClassic",
>       .desc = "Sun4m platform, SPARCClassic",
>       .init = scls_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static QEMUMachine sbook_machine = {
>       .name = "SPARCbook",
>       .desc = "Sun4m platform, SPARCbook",
>       .init = sbook_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static const struct sun4d_hwdef sun4d_hwdefs[] = {
> @@ -1709,7 +1709,7 @@ static QEMUMachine ss1000_machine = {
>       .name = "SS-1000",
>       .desc = "Sun4d platform, SPARCserver 1000",
>       .init = ss1000_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 8,
>   };
>   
> @@ -1717,7 +1717,7 @@ static QEMUMachine ss2000_machine = {
>       .name = "SS-2000",
>       .desc = "Sun4d platform, SPARCcenter 2000",
>       .init = ss2000_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 20,
>   };
>   
> @@ -1896,7 +1896,7 @@ static QEMUMachine ss2_machine = {
>       .name = "SS-2",
>       .desc = "Sun4c platform, SPARCstation 2",
>       .init = ss2_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static void sun4m_register_types(void)
> diff --git a/hw/versatilepb.c b/hw/versatilepb.c
> index 25e652b..4892c1d 100644
> --- a/hw/versatilepb.c
> +++ b/hw/versatilepb.c
> @@ -358,14 +358,14 @@ static QEMUMachine versatilepb_machine = {
>       .name = "versatilepb",
>       .desc = "ARM Versatile/PB (ARM926EJ-S)",
>       .init = vpb_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static QEMUMachine versatileab_machine = {
>       .name = "versatileab",
>       .desc = "ARM Versatile/AB (ARM926EJ-S)",
>       .init = vab_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>   };
>   
>   static void versatile_machine_init(void)
> diff --git a/hw/vexpress.c b/hw/vexpress.c
> index d93f057..e89694c 100644
> --- a/hw/vexpress.c
> +++ b/hw/vexpress.c
> @@ -477,7 +477,7 @@ static QEMUMachine vexpress_a9_machine = {
>       .name = "vexpress-a9",
>       .desc = "ARM Versatile Express for Cortex-A9",
>       .init = vexpress_a9_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> @@ -485,7 +485,7 @@ static QEMUMachine vexpress_a15_machine = {
>       .name = "vexpress-a15",
>       .desc = "ARM Versatile Express for Cortex-A15",
>       .init = vexpress_a15_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 4,
>   };
>   
> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
> index 1f12a3d..a4a71c2 100644
> --- a/hw/xilinx_zynq.c
> +++ b/hw/xilinx_zynq.c
> @@ -200,7 +200,7 @@ static QEMUMachine zynq_machine = {
>       .name = "xilinx-zynq-a9",
>       .desc = "Xilinx Zynq Platform Baseboard for Cortex-A9",
>       .init = zynq_init,
> -    .use_scsi = 1,
> +    .block_default_type = IF_SCSI,
>       .max_cpus = 1,
>       .no_sdcard = 1
>   };
> diff --git a/vl.c b/vl.c
> index c8e9c78..86f0dd8 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -886,9 +886,9 @@ static int cleanup_add_fd(QemuOpts *opts, void *opaque)
>   
>   static int drive_init_func(QemuOpts *opts, void *opaque)
>   {
> -    int *use_scsi = opaque;
> +    BlockInterfaceType *block_default_type = opaque;
>   
> -    return drive_init(opts, *use_scsi) == NULL;
> +    return drive_init(opts, *block_default_type) == NULL;
>   }
>   
>   static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
> @@ -899,14 +899,15 @@ static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
>       return 0;
>   }
>   
> -static void default_drive(int enable, int snapshot, int use_scsi,
> +static void default_drive(int enable, int snapshot,
> +                          BlockInterfaceType block_default_type,
>                             BlockInterfaceType type, int index,
>                             const char *optstr)
>   {
>       QemuOpts *opts;
>   
>       if (type == IF_DEFAULT) {
> -        type = use_scsi ? IF_SCSI : IF_IDE;
> +        type = block_default_type;
>       }
>   
>       if (!enable || drive_get_by_index(type, index)) {
> @@ -917,7 +918,7 @@ static void default_drive(int enable, int snapshot, int use_scsi,
>       if (snapshot) {
>           drive_enable_snapshot(opts, NULL);
>       }
> -    if (!drive_init(opts, use_scsi)) {
> +    if (!drive_init(opts, type)) {
>           exit(1);
>       }
>   }
> @@ -3774,14 +3775,16 @@ int main(int argc, char **argv, char **envp)
>       /* open the virtual block devices */
>       if (snapshot)
>           qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot, NULL, 0);
> -    if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func, &machine->use_scsi, 1) != 0)
> +    if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func,
> +                          &machine->block_default_type, 1) != 0) {
>           exit(1);
> +    }
>   
> -    default_drive(default_cdrom, snapshot, machine->use_scsi,
> +    default_drive(default_cdrom, snapshot, machine->block_default_type,
>                     IF_DEFAULT, 2, CDROM_OPTS);
> -    default_drive(default_floppy, snapshot, machine->use_scsi,
> +    default_drive(default_floppy, snapshot, machine->block_default_type,
>                     IF_FLOPPY, 0, FD_OPTS);
> -    default_drive(default_sdcard, snapshot, machine->use_scsi,
> +    default_drive(default_sdcard, snapshot, machine->block_default_type,
>                     IF_SD, 0, SD_OPTS);
>   
>       register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);

-- 
Mitsyanko Igor
ASWG, Moscow R&D center, Samsung Electronics
email: i.mitsyanko@samsung.com

  parent reply	other threads:[~2012-11-21 12:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 14:30 [Qemu-devel] [PATCHv3] Support default block interfaces per QEMUMachine Christian Borntraeger
2012-11-20 14:49 ` Alexander Graf
2012-11-21 11:11   ` Christian Borntraeger
2012-11-21 12:07 ` Igor Mitsyanko [this message]
2012-11-21 12:35   ` Christian Borntraeger
2012-11-22 12:02 ` Markus Armbruster
2012-11-22 13:22   ` Christian Borntraeger
2012-11-22 14:05     ` Markus Armbruster
2012-11-22 20:02       ` [Qemu-devel] [PATCH 0/2] Followup patches regarding block default interface Christian Borntraeger
2012-11-22 20:02         ` [Qemu-devel] [PATCH 1/2] block: simply default_drive Christian Borntraeger
2012-11-22 20:02         ` [Qemu-devel] [PATCH 2/2] block: clarify comment about IF_IDE = 0 Christian Borntraeger
2012-11-23 14:19         ` [Qemu-devel] [PATCH 0/2] Followup patches regarding block default interface Stefan Hajnoczi
2012-11-23 15:10         ` Markus Armbruster
2012-11-23 16:23         ` Stefan Hajnoczi
2012-11-22 15:21     ` [Qemu-devel] [PATCHv3] Support default block interfaces per QEMUMachine Stefan Hajnoczi
2012-11-22 13:42   ` Markus Armbruster
2012-11-22 12:58 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50ACC41F.8080403@samsung.com \
    --to=i.mitsyanko@samsung.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=elelueck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.